LaTeX語法介紹
什么是LaTeX
LaTeX(LATEX,音譯"拉泰赫")是一種基于TeX的排版系統(tǒng),最大的特點就是可以生成復(fù)雜表格和數(shù)學(xué)公式,它非常適用于生成高印刷質(zhì)量的科技和數(shù)學(xué)類文檔同時也適用于生成從簡單的信件到完整書籍的所有其他種類的文檔。
LaTeX文件的框架如下:
\documentclass{article}
\begin{document}
This is the body of the article
\end{document}
簡單的規(guī)則
常用字符
- 空格:LaTeX中空格不起作用。
- 換行:用控制命令“\ \”,或“ \newline”。
- 分段:用控制命令“\par” 或空出一行。
- 換頁:用控制命令“\newpage”或“\clearpage”。
特殊字符
| 特殊字符 | LaTeX命令 |
|---|---|
| # | \ # |
| ¥ | \¥ |
| % | % |
| & | & |
| - | \ - |
| { | \ { |
| } | \ } |
| ^ | ^{} |
| ~ | ~{} |
注: \blackslash表示“ \”。
頁面控制命令
頁面寬度:\textwidth=14.5cm
頁面高度:\textheight=21.5cm
系統(tǒng)默認(rèn):字號10pt= 五號字;西文字體為羅馬字體;
textwidth=12.2cm,textheight=18.6cm。(相當(dāng)于美國標(biāo)準(zhǔn)信紙大小。)
常見數(shù)學(xué)公式排版命令
行中數(shù)學(xué)公式狀態(tài)命令
\begin{math} 數(shù)學(xué)公式 \end{math}
簡式1: \ ( 數(shù)學(xué)公式 \ )
簡式2: ¥ 數(shù)學(xué)公式 ¥
獨立數(shù)學(xué)公式狀態(tài)命令
\begin{displaymath} 數(shù)學(xué)公式 \end{displaymath}
簡式1: \ [ 數(shù)學(xué)公式 \ ]
簡式2: ¥¥ 數(shù)學(xué)公式 ¥¥
使用LaTex 編輯表格
\begin{tabular}{|r|l|}\hline
Header & Row \ \hline \hline
A & Silly \ \hline
tabular & structure \ \hline
\end{tabular}
注:其中&號代表分割線,也就是將一行表格分割為一塊一塊
\ \代表換行
小編有話說
以上為LaTeX常用的語法格式,如需其他幫助,請查閱相關(guān)資料!