中文 Latex

How to build Texstudio

如何建立中文Latex 文件,安裝與使用

(1) Download TeXstudio. website

(2) 執行 texstudio-2.12.22-win-qt5.exe

(3) change setting: 起始畫面 pdfLatex 改成 XeLaTex

Options->Configure TeXstudio -> Build -> Default compiler --> XeLaTex

(4) Prepare document.tex and compile this 中文 tex file.

(5) 如果沒有修改compiler,會出現錯誤

(6) 恢復第4步,修正compiler, 再compile乙次,view乙次,document.pdf 產生,中文 pdf 編譯完成。

Latex 語法設定

\documentclass[12pt,a4paper]{article}

%\documentclass[prb,preprint]{revtex4-1}

\usepackage{amsmath}

\usepackage{amsfonts}

\usepackage{amssymb}

\usepackage{amsthm} %要有這個才能寫proof

\usepackage{amssymb,amsthm,amsmath,amsfonts,subfigure, mathrsfs}

%\usepackage{ctex}

\usepackage{xeCJK}

\usepackage{fontspec} %加這個就可以設定字體

\setCJKmainfont{標楷體}

\XeTeXlinebreaklocale "zh"

\XeTeXlinebreakskip = 0pt plus 1pt

\usepackage[a4paper,margin=1in]{geometry}

\title{compress sensing}

\usepackage{graphicx}

\usepackage{multirow}

\usepackage{authblk}

%add additional author names and affiliations

\usepackage{hyperref}

\usepackage[dvipsnames]{xcolor} %一般LaTeX不是Beamer 彩色用套件


\newtheorem*{example}{Example}

\newtheorem*{question}{Question}

\newtheorem*{remark}{Remark}

\newtheorem{corollary}{Corollary}

\theoremstyle{definition}

\newtheorem{definition}{Definition}[section]

\newtheorem{lemma}{Lemma}[section]

\newtheorem{thm}{Theorem}[section]

\newtheorem{prop}{Proposition}[section]

%\newtheorem{thm}{Theorem}

%意思是我們要先建一個新的定理環境, 叫做thm, 顯示時標示為“Theorem”。比方說:

%\begin{thm}

% 定理的內容

%\end{thm}


\theoremstyle{remark}

%\newtheorem*{remark}{Remark}

\newtheorem*{exercise}{Exercise}

%\newtheorem{corollary}{Corollary}

%\newtheorem{definition}{Definition}

%\newtheorem{lemma}{Lemma}

\newtheorem{theorem}{Theorem}

%\newtheorem{example}{Example}

%\newtheorem{環境名稱}{定理名稱}[章節層次]

%符號定義區

%\newcommand{\abs}[1]{\left|#1\right|}

\renewcommand{\(}{\left(}

\renewcommand{\)}{\right)}

%\renewcommand{\[}{\left[}

%\renewcommand{\]}{\right]}


%\newtheorem{example}{Example}

\newcommand{\iid}{i.i.d.}

\newcommand\pN{\mathcal{N}}

\newcommand{\R}{\mathbb{R}}

%\newcommand{\u}{\mathbf{u}}

\newcommand{\x}{\mathbf{x}}

\newcommand{\y}{\mathbf{y}}

\newcommand{\ds}{\displaystyle}

\newcommand{\h}{\mathbf{h}}

\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}

\newcommand\bigZero{\mbox{\huge$0$}}

\newcommand\bigSigma{\mbox{\huge$\Sigma$}}

\renewcommand{\qedsymbol}{$\blacksquare$}


%{\textcolor{White}{白色}}

%{\color{green}{綠色的文字}}

%{\textcolor{ForestGreen}{森林綠}}

%{\textcolor{Plum}{深紫色}}

%{\textcolor{purple!70}{淡紫色}}

%{\textcolor{PineGreen}{松樹綠}}

%{\textcolor{SpringGreen}{春天綠}}

%{\color{Cyan}{青色}}

%{\color{BrickRed}{磚紅色}}

%{\color{red}{紅色}}

%{\color{green}{綠色的文字}}

%{\textcolor{ForestGreen}{森林綠}}

%{\textcolor{Plum}{深紫色}}

%{\textcolor{purple!70}{淡紫色}}

%{\textcolor{PineGreen}{松樹綠}}

%{\textcolor{SpringGreen}{春天綠}}

%{\color{Cyan}{青色}}

%{\color{BrickRed}{磚紅色}}

\begin{document}

\author{李柏翰}

%\author[1]{ }

%\author[2]{Yau Yuan Shih}

%\affil[1,2]{Parallel and Scientific Computing Laboratory }

%\affil[2]{Department of Biology, University Y}

%\institute{ National Chiao Tung University}

\date{\today}

%\affil[1,2]{ National Chiao Tung University}

\affil{ 國立台北科技大學光電工程學系}

\title{ 微分方程初步 }

\maketitle

%\tableofcontents

........

\begin{center}

{\Large 謝謝大家收看!}

\end{center}

\end{document}

Equation LaTex 語法對照