參考資料https://gavin_nicholas.coding.me/archives/
1. 如何輸入括號和分隔符
() 、 [] 和 | 表示自己, {} 表示 {} 。當要顯示大號的括號或分隔符時,要用 \left 和 \right 命令。
例子:$$f(x,y,z) = 3y^2z \left( 3+\frac{7x+5}{1+y^2} \right)$$ ,顯示:
\[f(x,y,z) = 3y^2z \left( 3+\frac{7x+5}{1+y^2} \right) \]
有時候要用\left.或\right.進行匹配而不顯示本身。
例子:$$\left. \frac{ {\rm d}u}{ {\rm d}x} \right| _{x=0}$$,顯示:
\[\left. \frac{ {\rm d}u}{ {\rm d}x} \right| _{x=0} \]
1.1 偏導
$$\frac{\partial^{2}y}{\partial x^{2}}$$
\[\frac{\partial^{2}y}{\partial x^{2}} \]
2. 運算符:
| 關系運算符 | markdown語言 | 集合運算符 | markdown語言 |
|---|---|---|---|
| \(\pm\) | $\pm$ |
\(\emptyset\) | $\emptyset$ |
| \(\times\) | $\times$ |
\(\in\) | $\in$ |
| \(\div\) | $\div$ |
\(\notin\) | $\notin$ |
| \(\mid\) | $\mid$ |
\(\subset\) | $\subset$ |
| \(\nmid\) | $\nmid$ |
\(\supset\) | $\supset$ |
| \(\cdot\) | $\cdot$ |
\(\subseteq\) | $\subseteq$ |
| \(\circ\) | $\circ$ |
\(\supseteq\) | $\supseteq$ |
| \(\ast\) | $\ast$ |
\(\bigcap\) | $\bigcap$ |
| \(\bigodot\) | $\bigodot$ |
\(\bigcup\) | $\bigcup$ |
| \(\bigotimes\) | $\bigotimes$ |
\(\bigvee\) | $\bigvee$ |
| \(\bigoplus\) | $\bigoplus$ |
\(\bigvee\) | $\bigvee$ |
| \(\leq\) | $\leq$ |
\(\bigwedge\) | $\bigwedge$ |
| \(\geq\) | $\geq$ |
\(\biguplus\) | $\biguplus$ |
| \(\neq\) | $\neq$ |
\(\bigsqcup\) | $\bigsqcup$ |
| \(\approx\) | $\approx$ |
||
| \(\equiv\) | $\equiv$ |
\(\ll\) | $\ll$ |
| \(\sum\) | $\sum$ |
||
| \(\prod\) | $\prod$ |
\(\sim\) | $\sim$ |
| \(\coprod\) | $\coprod$ |
\(\backsim\) | $\backsim$ |
| \(\prec\) \(\preceq\) \(\succ\) \(\succeq\) | $\prec$ $\preceq$ $\succ$ $\succeq$ |
| 對數運算符 | markdown語言 | 戴帽符號 | markdown語言 | 連線符號 | markdown語言 |
|---|---|---|---|---|---|
| \(\log\) | $\log$ |
\(\hat{y}\) | $\hat{y}$ |
\(\overline{a+b+c+d}\) | $\overline{a+b+c+d}$ |
| \(\lg\) | $\lg$ |
\(\check{y}\) | $\check{y}$ |
\(\underline{a+b+c+d}\) | $\underline{a+b+c+d}$ |
| \(\ln\) | $\ln$ |
\(\breve{y}\) | $\breve{y}$ |
\(\overbrace{a+\underbrace{b+c}{1.0}+d}^{2.0}\) | $\overbrace{a+\underbrace{b+c}{1.0}+d}^{2.0}$ |
| 三角運算符 | markdown語言 | 微積分運算符 | markdown語言 | 邏輯運算符 | markdown語言 |
|---|---|---|---|---|---|
| \(\bot\) | $\bot$ |
\(\prime\) | $\prime$ |
\(\because\) | $\because$ |
| \(\angle\) | $\angle$ |
\(\int\) | $\int$ |
\(\therefore\) | $\therefore$ |
| \(30^\circ\) | $30^\circ$ |
\(\iint\) | $\iint$ |
\(\forall\) | $\forall$ |
| \(\sin\) | $\sin$ |
\(\iiint\) | $\iiint$ |
\(\exists\) | $\exists$ |
| \(\cos\) | $\cos$ |
\(\iiiint\) | $\iiiint$ |
\(\not=\) | $\not=$ |
| \(\tan\) | $\tan$ |
\(\oint\) | $\oint$ |
\(\not>\) | $\not>$ |
| \(\cot\) | $\cot$ |
\(\lim\) | $\lim$ |
\(\not\subset\) | $\not\subset$ |
| \(\sec\) | $\sec$ |
\(\infty\) | $\infty$ |
||
| \(\csc\) | $\csc$ |
\(\nabla\) | $\nabla$ |
| 箭頭符號 | markdown語言 |
|---|---|
| \(\uparrow\) | $\uparrow$ |
| \(\downarrow\) | $\downarrow$ |
| \(\Uparrow\) | $\Uparrow$ |
| \(\Downarrow\) | $\Downarrow$ |
| \(\rightarrow\) | $\rightarrow$ |
| \(\leftarrow\) | $\leftarrow$ |
| \(\Rightarrow\) | $\Rightarrow$ |
| \(\Leftarrow\) | $\Leftarrow$ |
| \(\longrightarrow\) | $\longrightarrow$ |
| \(\longleftarrow\) | $\longleftarrow$ |
| \(\Longrightarrow\) | $\Longrightarrow$ |
| \(\Longleftarrow\) | $\Longleftarrow$ |
| \(f: {\mathbf x_t} \mapsto {\mathbf y_t}\) | $f: {\mathbf x_t} \mapsto {\mathbf y_t}$ |
| \(\Longleftrightarrow\) | \Longleftrightarrow |
更多關於箭頭的符號見:MathJax 支持的 Latex 符號總結(各種箭頭符號)
特殊符號
- \(\boldsymbol{\hat y} = \boldsymbol{W} \boldsymbol{x}\) 的輸入
代碼:
$\boldsymbol{\hat y} = \boldsymbol{W} \boldsymbol{x}$
- \(\ell_p\) 范數:
$\ell_p$
對於一些特殊的數學符號可以使用 \operatorname{} 或者 \text{} 來進行轉換,如:$\text{cov}$ 和 $\operatorname{s.t.}$ 便顯示為:\(\text{cov}\) 和 \(\operatorname{s.t.}\)
還有:
$A \xrightarrow{f} B \; a \; \bot b \; \overset{def}{=}$
\(A \xrightarrow{f} B \; a \; \bot b \; \overset{def}{=}\)
$$
\underset{x\in S\subseteq X}{\operatorname{arg\,max}}\, f(x) := \{x \mid x\in S \wedge \forall y \in S : f(y) \le f(x)\}.
$$
\[ \underset{x\in S\subseteq X}{\operatorname{arg\,max}}\, f(x) := \{x \mid x\in S \wedge \forall y \in S : f(y) \le f(x)\}. \]
$$
\operatorname*{\arg\max}_{x\in S\subseteq X}\, f(x) := \{x \mid x\in S \wedge \forall y \in S : f(y) \le f(x)\}.
$$
\[\operatorname*{\arg\max}_{x \in S \subseteq X}\, f(x) := \{x \mid x\in S \wedge \forall y \in S : f(y) \le f(x)\}. \]
- 更多特殊符號可以訪問:Detexify
- 更多關於數學符號的內容,參 考 L ATEX Mathematical Symbols
- 關於數學符號的解釋見 List of mathematical symbols by subject
- 更多精彩參考http://www.cnblogs.com/q735613050/p/7253073.html
對齊多行公式
$$
\begin{aligned}
a &= b^2 + c^2\\
&= w^3 + b
\end{aligned}
$$
顯示:
\[\begin{aligned} a &= b^2 + c^2\\ &= w^3 + b \end{aligned} \]
關於矩陣的語法
$$
\begin{Bmatrix}
1&2&3\\
4&5&6\\
7&8&9
\end{Bmatrix}
\tag{7}
$$
顯示:
\[\begin{Bmatrix} 1&2&3\\ 4&5&6\\ 7&8&9 \end{Bmatrix} \tag{7} \]
更多矩陣設計:
$$
\begin{vmatrix}
1&2&3\\
4&5&6\\
7&8&9
\end{vmatrix}
\tag{8}
$$
$$
\begin{Vmatrix}
1&2&3\\
4&5&6\\
7&8&9
\end{Vmatrix}
\tag{9}
$$
$$
\bigl(
\begin{smallmatrix}
...
\end{smallmatrix}
\bigr)
$$
$$
\left[
\begin{array}{cc|c}
1 & 2 & 3 \\
4 & 5 & 6
\end{array}
\right] \tag{12}
$$
顯示:
\[\begin{vmatrix} 1&2&3\\ 4&5&6\\ 7&8&9 \end{vmatrix} \tag{8} \]
\[\begin{Vmatrix} 1&2&3\\ 4&5&6\\ 7&8&9 \end{Vmatrix} \tag{9} \]
\[\bigl( \begin{smallmatrix} ... \end{smallmatrix} \bigr) \]
\[\left[ \begin{array}{cc|c} 1 & 2 & 3 \\ 4 & 5 & 6 \end{array} \right] \tag{12} \]
