(2) 執行 texstudio-2.12.22-win-qt5.exe
(3) change setting: 起始畫面 pdfLatex 改成 XeLaTex
Options->Configure TeXstudio -> Build -> Default compiler --> XeLaTex
(6) 恢復第4步,修正compiler, 再compile乙次,view乙次,document.pdf 產生,中文 pdf 編譯完成。
\documentclass[12pt,a4paper]{article}
%\documentclass[prb,preprint]{revtex4-1}
\usepackage{amsthm} %要有這個才能寫proof
\usepackage{amssymb,amsthm,amsmath,amsfonts,subfigure, mathrsfs}
\usepackage{fontspec} %加這個就可以設定字體
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\usepackage[a4paper,margin=1in]{geometry}
%add additional author names and affiliations
\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”。比方說:
%\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{ForestGreen}{森林綠}}
%{\textcolor{purple!70}{淡紫色}}
%{\textcolor{PineGreen}{松樹綠}}
%{\textcolor{SpringGreen}{春天綠}}
%{\textcolor{ForestGreen}{森林綠}}
%{\textcolor{purple!70}{淡紫色}}
%{\textcolor{PineGreen}{松樹綠}}
%{\textcolor{SpringGreen}{春天綠}}
%\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}
%\affil[1,2]{ National Chiao Tung University}