1.LaTeX簡介
LaTeX(LATEX,音譯“拉泰赫”)是一種基於ΤΕΧ的排版系統,由美國計算機學家萊斯利·蘭伯特(Leslie Lamport)開發,利用這種格式,使用者能在幾天、甚至幾小時內生成很多具有書籍質量的印刷品。對於生成復雜表格和數學公式,表現尤為突出。因此它非常適用於生成高印刷質量的科技和數學類文檔。這里,我們簡要介紹一下LaTeX常用書寫數學公式的語法
2.公式類型
LaTeX數學公式按照他的展示形式,大致可以分為三種,分別是行內公式、獨立公式和多行公式,下面我對他們的用法逐個介紹。
行內公式
行內公式是可以讓公式在文中與文字或其他東西混編,不獨占一行。在數學模式下,符號會使用單獨的字體,字母通常是傾斜的意大利體,數字和符號則是直立體.而且,數學符號之間的距離也與一般的水平模式不同:
| 示例語法 | 顯示效果 |
|---|---|
| 可以混編:$3x + 5y = 30$ | 可以混編:\(3x + 5y = 30\) |
| 可以混編:3x + 5y = 30 | 可以混編:3x + 5y = 30 |
獨立公式
獨立公式單獨占一行,不和其他文字混編
| 示例語法 | 顯示效果 |
|---|---|
| 不可以混編:$ $3x + 5y = 30$ $ | 不可以混編:$$3x + 5y = 30$$ |
| 不可以混編:3x + 5y = 30 | 不可以混編:3x + 5y = 30 |
多行公式
在獨立公式中使用\\來換行
$$
x + y = 10\\
2x + y = 13
$$
效果如下所示:
\[x + y = 10\\ 2x + y = 13 \]
3.簡單語法
這里我介紹一下簡單的語法,包括字符的上下標,分數,開根號,加粗、傾斜字體等等。
| 實現功能 | 語句語法 | ... 展 示 效 果 ... |
|---|---|---|
| 上標 | ${(x+y)}^{3+x}$ | \({(x+y)}^{3+x}\) |
| 下標 | $x_1$ | \(x_1\) |
| 上下標級聯 | $x_1^2 + {y}_{1}^{2}=2$ | \(x_1^2 + {y}_{1}^{2}=2\) |
| 分數(fraction) | $z(x_1,y_1)=\frac{x_1^2}{y_1+x_1}$ | \(z(x_1,y_1)=\frac{x_1^2}{y_1+x_1}\) |
| 開根號 | $y=\sqrt{x^3+5}$ | \(y=\sqrt{x^3+5}\) |
| 開根號 | $y=\sqrt[n]{x^3+5}$ | \(y=\sqrt[n]{x^3+5}\) |
| 加粗(bold-font) | $f(x)=\textbf{x^2}+1$ | \(f(x)=\textbf{x^2}+1\) |
| 省略號(low dots, center dots) | $f(x_1, x_2, \ldots,x_n)=x_1+x_2+\cdots+x_n$ | \(f(x_1, x_2, \ldots,x_n)=x_1+x_2+\cdots+x_n\) |
| 符號矢量 | $\vec {ab}$ | \(\vec {ab}\) |
| 上箭頭 | $\overrightarrow{ab}$ | \(\overrightarrow{ab}\) |
4.運算符和特殊函數
常見符號
| 運算 | 語法 | 效果 |
|---|---|---|
| 加減、減加plus,minus | $\pm\mp$ | \(\pm\mp\) |
| 乘號 | $\times$ | \(\times\) |
| 除號 | $\div$ | \(\div\) |
| 不等於 | $\neq$ | \(\neq\) |
| 約等於 | $\approx$ | \(\approx\) |
| 恆等於 | $\equiv$ | \(\equiv\) |
| 大於等於 | $\geq$ | \(\geq\) |
| 小於等於 | $\leq$ | \(\leq\) |
| 相似 | $\sim$ | \(\sim\) |
| 正比於prop_to | $\propto$ | \(\propto\) |
| 垂直 | $\perp$ | \(\perp\) |
| 上划線 | $\overline{AB}$ | \(\overline{AB}\) |
| 左箭頭(單) | $\leftarrow$ | \(\leftarrow\) |
| 長左箭頭(單) | $\longleftarrow$ | \(\longleftarrow\) |
| 左箭頭(雙) | $\Leftarrow$ | \(\Leftarrow\) |
| 長左箭頭(雙) | $\Longleftarrow$ | \(\Longleftarrow\) |
| 右箭頭(單) | $\rightarrow$ | \(\rightarrow\) |
| 長右箭頭(單) | $\longrightarrow$ | \(\longrightarrow\) |
| 右箭頭(雙) | $\Rightarrow$ | \(\Rightarrow\) |
| 長右箭頭(雙) | $\Longrightarrow$ | \(\Longrightarrow\) |
| 雙向箭頭(單) | $\leftrightarrow$ | \(\leftrightarrow\) |
| 長雙向箭頭(單) | $\longleftrightarrow$ | \(\longleftrightarrow\) |
| 雙向箭頭(雙) | $\Leftrightarrow$ | \(\Leftrightarrow\) |
| 長雙向箭頭(雙) | $\Longleftrightarrow$ | \(\Longleftrightarrow\) |
常見運算
| 運算 | 語法 | 效果 |
|---|---|---|
| 累加 | $\sum_{k=2}^{2n} {k^3} = \frac{1}{2} n(n+2)$ | \(\sum_{k=2}^{2n}{k^3}=\frac{1}{2}n(n+2)\) |
| 累乘 | $\prod_{k=1}^{3n} {k^{\frac{1}{2}}} \approx \sum_{x=1}^{n} x^2$ | \(\prod_{k=1}^{3n} {k^{\frac{1}{2}}} \approx \sum_{x=1}^{n} x^2\) |
對數運算&三角運算
| 運算 | 語法 | 效果 |
|---|---|---|
| log | $\log_3{x}$ | \(\log_3{x}\) |
| ln | $\ln{x}$ | \(\ln{x}\) |
| lg | $\lg{x}$ | \(\lg{x}\) |
| sin | $\sin{x}$ | \(\sin{x}\) |
| cos | $\cos{x}$ | \(\cos{x}\) |
| sec | $\sec{x}$ | \(\sec{x}\) |
| csc | $\csc{x}$ | \(\csc{x}\) |
| tan | $\tan{x}$ | \(\tan{x}\) |
| arcsin | $\arcsin{x}$ | \(\arcsin{x}\) |
| arccos | $\arccos{x}$ | \(\arccos{x}\) |
| arctan | $\arctan{x}$ | \(\arctan{x}\) |
5.矩陣與求導
待更新
6.希臘文字
| 代碼 | 大寫 | 代碼 | 小寫 |
|---|---|---|---|
| A | ![]() |
\alpha | ![]() |
| B | ![]() |
\beta | ![]() |
| \Gamma | ![]() |
\gamma | ![]() |
| \Delta | ![]() |
\delta | ![]() |
| E | ![]() |
\epsilon | ![]() |
| Z | ![]() |
\zeta | ![]() |
| H | ![]() |
\eta | ![]() |
| \Theta | ![]() |
\theta | ![]() |
| I | ![]() |
\iota | ![]() |
| K | ![]() |
\kappa | ![]() |
| Lambda | ![]() |
\lambda | ![]() |
| M | ![]() |
\mu | ![]() |
| N | ![]() |
\nu | ![]() |
| Xi | ![]() |
\xi | ![]() |
| O | ![]() |
\omicron | ![]() |
| \Pi | ![]() |
\pi | ![]() |
| P | ![]() |
\rho | ![]() |
| \Sigma | ![]() |
\sigma | ![]() |
| T | ![]() |
\tau | ![]() |
| \Upsilon | ![]() |
\upsilon | ![]() |
| \Phi | ![]() |
\phi | ![]() |
| X | ![]() |
\chi | ![]() |
| \Psi | ![]() |
\psi | ![]() |
| \Omega | ![]() |
\omega | ![]() |
7.我的建議
最后,LaTeX數學公式規則很多很復雜,建議大家多多上手練一練,平時寫論文寫公式的時候,多多使用,同時也向大家推薦一下LaTex的在線公式編輯器,希望對大家日后的學習可以有所幫助!
















































