安裝
首先要用 Latex 當然就是要先安裝軟體啦,這次選用的是MiKTeX,因為他排在wiki的第一個XD,而且又支援多個作業系統和unicode。安裝步驟就不贅述了,已經有很多人寫了不錯的文章(而且安裝這種事情看官網最準啦)。
裝完之後記得用 administrator 權限打開 MiKTeX console 檢查更新。
還有去把edit > preferences > typesetting > Default:
改成XeLaTeX+MakeIndex+BibTeX
安裝 package
這個其實就不用特別安裝,如果編譯時有缺,他就會問你要不要裝了。
關於中文字形
語法
測試範例
\documentclass[12pt, a4paper]{article} \usepackage{fontspec} \usepackage{xeCJK} %讓中英文字體分開設置 \setCJKmainfont{華康新特明體} %設定中文為系統上的字型,而英文不去更動,使用原TeX字型 \usepackage{amsmath} \usepackage{graphicx} \graphicspath{ {./images/} } \title{LaTeX first test} \author{ WildfootW } \begin{document} \maketitle \part {測試part} \section {測試section} \subsection {測試subsection} \subsubsection {測試subsubsection} \paragraph {測試paragraph} \subparagraph {測試subparagraph} 中文測試中文測試中文測試中文測試中文測試中文測試,中文測試中文測試,中文 測試中文測試中文測試中文測試中文測試中文測試,中文測試中文測試。中英文可以連打。 AAAAA{\tiny tiny}BBBBB English Test. 插入中文字,看看如何? This is a simple template for a XeLaTeX document using the article class, with the fontspec package to easily select fonts. \includegraphics[width=\textwidth]{Wildfoot_Logo_Version3} \begin{itemize} \item 第一大項,這裡是第一大項。 \item 第二大項,這裡是第二大項。 \begin{itemize} \item 第一小項,這裡是第一小項。 \item 第二小項,這裡是第二小項。 \end{itemize} \item 第三大項,這裡是第三大項。 \end{itemize} 總和生產函數:$Y = A \sqrt{L*K}$ \subsection A \[ \begin{aligned} % & for align \frac{\Delta Y}{Y} &= \frac{\Delta A}{A} + \frac{1}{2} * \frac{\Delta L}{L} + \frac{1}{2} * \frac{\Delta K}{K} \\ \frac{\Delta Y}{Y} &= 0.02\% + \frac{1}{2} * 1.38\% + \frac{1}{2} * 1.48\% \\ \frac{\Delta Y}{Y} &= 1.45\% \\ \end{aligned} \] \begin{tabular}[t]{lll} \hline column1 & column2 & column3 \\ \hline\hline item1 & item2 & item3 \\ itemA & itemB & itemC \\ \hline \end{tabular} \end{document}