Markdown 数学公式使用总结

1. 语法

1、行内公式

$...$ 表示行内公式,如 O_{1 - \left(\vert a \vert \over 2 \right)}\(O_{1 - \left(\vert a \vert \over 2 \right)}\)

2、多行公式

$$...$$ 表示多行公式,如 \sum_{i=0}^\infty x^2 = x_1 + x_2 + x_3 + ... + x_n

\[\sum_{i=0}^\infty x^2 = x_1 + x_2 + x_3 + ... + x_n \]

2. 上标、下标、分组

上标和下标

  • 上标: ^,如 x^y\(x^y\)
  • 下标:_,如 a_i\(a_i\)

分组

符号:{},例:C_n^2\(C_n^2\)C_{n^2}\(C_{n^2}\)

3. 希腊字母

公式 小写 公式 大写
\alpha \(\alpha\) \Alpha \(\Alpha\)
\beta \(\beta\) \Beta \(\Beta\)
\delta \(\delta\) \Delta \(\Delta\)
\epsilon \(\epsilon\) \Epsilon \(\Epsilon\)
\zeta \(\zeta\) \Zeta \(\Zeta\)
\eta \(\eta\) \Eta \(\Eta\)
\theta \(\theta\) \Theta \(\Theta\)
\iota \(\iota\) \Iota \(\Iota\)
\kappa \(\kappa\) \Kappa \(\Kappa\)
\lambda \(\lambda\) \Lambda \(\Lambda\)
\mu \(\mu\) \Mu \(\Mu\)
\nu \(\nu\) \Nu \(\Nu\)
\xi \(\xi\) \Xi \(\Xi\)
\pi \(\pi\) \Pi \(\Pi\)
\rho \(\rho\) \Rho \(\Rho\)
\sigma \(\sigma\) \Sigma \(\Sigma\)
\tau \(\kappa\) \Tau \(\Tau\)
\phi \(\phi\) \Phi \(\Phi\)
\psi \(\psi\) \Psi \(\Psi\)
\omega \(\omega\) \omega \(\Omega\)
\omicron \(\omicron\) \Omicron \(\Omicron\)
\gamma \(\gamma\) \Gamma \(\Gamma\)

斜体字母加上前缀 var\varDelta\(\varDelta\)

4. 算数运算

公式 符号
\times \(\times\)
\div \(\div\)
\cdot \(\cdot\)
< \(<\)
> \(>\)
\ll \(\ll\)
\gg \(\gg\)
\lll \(\lll\)
\pm \(\pm\)
\le\leq \(\le\)\(\leq\)
\ge\geq \(\ge\)\(\geq\)
\mp \(\mp\)
\leqq \(\leqq\)
\geqq \(\geqq\)
\neq \(\neq\)
\leqslant \(\leqslant\)
\geqslant \(\geqslant\)
\approx \(\approx\)

5. 集合

公式 符号
\complement \(\complement\)
\in \(\in\)
\notin \(\notin\)
/subset \(\subset\)
\subseteq \(\subseteq\)
\subsetneq \(\subsetneq\)
\cap \(\cap\)
\cup \(\cup\)
\varnothing \(\varnothing\)
\emptyset \(\emptyset\)

6. 逻辑运算

公式 符号
\land\wedge \(\land\)\(\wedge\)
\lor\vee \(\lor\)\(\vee\)
\lnot\neg \(\lnot\)\(\neg\)
\forall \(\forall\)
\exists \(\exists\)
\bot \(\bot\)
/top \(\top\)
\vdash \(\vdash\)
\Vdash \(\Vdash\)
\vDash \(\vDash\)
\models \(\models\)

7.括号

公式 符号
(x) \((x)\)
\Bigg(x \Bigg) \(\Bigg(x \Bigg)\)
\bigg(x \bigg) \(\bigg(x \bigg)\)
\Big(x \Big) \(\Big( x \Big)\)
\big(x \big) \(\big(x \big)\)
\{x \}\lbrace x \rbrace \(\{x \}\)\(\lbrace x \rbrace\)
[x] \([x]\)
\vert x \vert \(\vert x \vert\)
\Vert x \Vert \(\Vert x \Vert\)
\langle x \rangle \(\langle x \rangle\)
\lceil x \rceil \(\lceil x \rceil\)
\lfloor x \rfloor \(\lfloor x \rfloor\)
二项式系数:\dbinom nr \(\dbinom nr\)
\binom nrn \choose r \(\binom nr\)\(n \choose r\)

8. 空格

公式 符号
无视空格:a b \(a b\)
a \qquad b \(a \qquad b\)
a \quad b \(a \quad b\)
a \ b \(a \ b\)
a \, b \(a \, b\)
a \; b \(a \; b\)
a \! b \(a \! b\)

9. 求和、积分、微分

公式 符号
\sum_1^n \(\sum_1^n\)
\sum_{i=0}^\infty x^2 \(\sum_{i=0}^\infty x^2\)
\int \(\int\)
\iint \(\iint\)
\iiint \(\iiint\)
\oint \(\oint\)
\prod \(\prod\)
\coprod \(\coprod\)
\bigcap \(\bigcap\)
\bigcup \(\bigcup\)
\bigvee \(\bigvee\)
\bigwedge \(\bigwedge\)
\infty \(\infty\)
\nabla \(\nabla\)
\partial x \(\partial x\)
\mathrm{d} x \(\mathrm{d} x\)
\dot x \(\dot x\)
\ddot x \(\ddot x\)

10. 分式、根号、函数

公式 符号
\frac 12 \(\frac 12\)
强制分式为显示模式:\dfrac 12 \(\dfrac 12\)
强制分式为文本模式:\tfrac 12 \(\tfrac 12\)
用于连续分式:\cfrac 12 \(\cfrac 12\)
\frac {x^2}{1+x} \(\frac {x^2}{1+x}\)
用于复杂分式:x^2 \over 1+x \(x^2 \over 1+x\)
\sqrt {x^3} \(\sqrt {x^3}\)
\sqrt[3] {\frac xy} \(\sqrt[3] {\frac xy}\)
\sin x \(\sin x\)
\lim_{x \to 0} \(\lim_{x \to 0}\)
\varinjlim \(\varinjlim\)
\varprojlim \(\varprojlim\)
\varliminf \(\varliminf\)
\varlimsup \(\varlimsup\)

11. 箭头符号

公式 符号
\rightarrow \(\rightarrow\)
\leftarrow \(\leftarrow\)
\Rightarrow \(\Rightarrow\)
\Leftarrow \(\Leftarrow\)
\longrightarrow \(\longrightarrow\)
\longleftarrow \(\longleftarrow\)
\Leftrightarrow \(\Leftrightarrow\)
\leftrightarrow \(\leftrightarrow\)
\Longleftrightarrow \(\Longleftrightarrow\)
\longleftrightarrow \(\longleftrightarrow\)
\xrightarrow[y>0] {x+y} \(\xrightarrow[y>0] {x+y}\)
a \to b \(a \to b\)
a \gets b \(a \gets b\)
a \implies b \(a \implies b\)
a \impliedby b \(a \impliedby b\)
\lim_{x \to 0} \(\lim_{x \to 0}\)
\longmapsto \(\longmapsto\)
\hookleftarrow \(\hookleftarrow\)

12. 几何和向量

公式 符号
\triangle \(\triangle\)
\Diamond \(\Diamond\)
\Box \(\Box\)
\odot \(\odot\)
\angle ABC \(\angle ABC\)
30^\circ \(30^\circ\)
\perp \(\perp\)
\sim \(\sim\)
\cong \(\cong\)
\\hat{a} \(\hat{a}\)
\vec{a} \(\vec{a}\)
\overrightarrow{AB} \(\overrightarrow{AB}\)
\overleftarrow{AB} \(\overleftarrow{AB}\)
\overleftrightarrow{AB} \(\overleftrightarrow{AB}\)
\widehat{e f g} \(\widehat{e f g}\)

13. 上、下划线和上、下括号

公式 符号
\overline{h i j} \(\overline{h i j}\)
\underline{h i j} \(\underline{h i j}\)
\underbrace{a+b+\cdots+z}_{10} \(\underbrace{a+b+\cdots+z}_{10}\)
\overbrace{a+b+\cdots+z}_{10} \(\overbrace{a+b+\cdots+z}_{10}\)

13. 特殊字符

公式 符号
\eth \(\eth\)
\S \(\S\)
\% \(\%\)
/dagger \(\dagger\)
\ddagger \(\ddagger\)
\ast* \(\ast\)\(*\)
\circ \(\circ\)
\bullet \(\bullet\)
\ldots \(\ldots\)
\cdots \(\cdots\)
\vdots \(\vdots\)
\ddots \(\ddots\)
\smile \(\smile\)
\frown \(\frown\)
\wr \(\wr\)
\oplus \(\oplus\)
\bigoplus \(\bigoplus\)
\otimes \(\otimes\)
\bigotimes \(\bigotimes\)
\bigodot \(\bigodot\)
\boxtimes \(\boxtimes\)
\boxplus \(\boxplus\)
\triangleleft \(\triangleleft\)
\triangleright \(\triangleright\)
\imath \(\imath\)
\hbar \(\hbar\)
\ell \(\ell\)
\mho \(\mho\)
\Finv \(\Finv\)
\Re \(\Re\)
\Im \(\Im\)
\wp \(\wp\)
\diamondsuit \(\diamondsuit\)
\heartsuit \(\heartsuit\)
\clubsuit \(\clubsuit\)
\spadesuit \(\spadesuit\)
\Game \(\Game\)
\flat \(\flat\)
\natural \(\natural\)
\sharp \(\sharp\)

14. 阵列、矩阵、等式对齐、分段函数、编号

1、阵列

语法: $$\begin{array} … \end{array}$$r 右对齐,l 左对齐,c 居中,| 垂直线,\hline 横线,\\ 换行,元素之间以 & 间隔

$$
  \begin{array} {c|lcr}
    n & \text{Left} & \text{Center} & \text{Right} \\
    \hline
    1 & 0.24 & 1 & 125 \\
    2 & -1 & 189 & -8 \\
    3 & -20 & 2000 & 1+10i
  \end{array}
$$

\[\begin{array} {c|lcr} n & \text{Left} & \text{Center} & \text{Right} \\ \hline 1 & 0.24 & 1 & 125 \\ 2 & -1 & 189 & -8 \\ 3 & -20 & 2000 & 1+10i \end{array} \]

2、矩阵

语法: $$\begin{matrix} … \end{matrix}$$,每行以 \\ 结尾,元素之间以 & 间隔

$$
  \begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
  \end{matrix}
$$

\[\begin{matrix} 1 & x & x^2 \\ 1 & y & y^2 \\ 1 & z & z^2 \\ \end{matrix} \]

添加括号:

  • pmatrix :()
  • bmatrix :[ ]
  • Bmatrix
  • vmatrix :| |
  • Vmatrix :‖ ‖

添加省略号:

$$
\begin{pmatrix}
  1 & a_1^2 & a_1^2 & \cdots & a_1^2 \\
  1 & a_2^2 & a_2^2 & \cdots & a_2^2 \\
  \vdots & \vdots & \vdots & \ddots & \vdots \\
  1 & a_n^2 & a_n^2 & \cdots & a_n^2 \\
\end{pmatrix}
$$

\[\begin{pmatrix} 1 & a_1^2 & a_1^2 & \cdots & a_1^2 \\ 1 & a_2^2 & a_2^2 & \cdots & a_2^2 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 1 & a_n^2 & a_n^2 & \cdots & a_n^2 \\ \end{pmatrix} \]

水平增广矩阵,使用阵列语法:

$$ 
  \left[
    \begin{array}{cc|c}
      1&2&3\\
      4&5&6
    \end{array}
  \right] 
$$

\[\left[ \begin{array}{cc|c} 1&2&3\\ 4&5&6 \end{array} \right] \]

垂直增广矩阵:

$$
  \begin{pmatrix}
    a & b\\
    c & d\\
    \hline
    1 & 0\\
    0 & 1
  \end{pmatrix}
$$

\[\begin{pmatrix} a & b\\ c & d\\ \hline 1 & 0\\ 0 & 1 \end{pmatrix} \]

3、等式对齐

语法: \begin{align} … \end{align},每行以 \\ 结尾,元素之间以 & 间隔

$$
  \begin{align}
    \sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\
     & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ 
     & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\
     & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ 
     & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right)
  \end{align}
$$

\[\begin{align} \sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\ & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\ & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right) \end{align} \]

4、分段函数

语法: \begin{cases} … \end{cases},每行以 \\ 结尾,元素之间以 & 间隔

$$
  f(n) =
    \begin{cases}
      n/2,  & \text{if $n$ is even} \\
      3n+1, & \text{if $n$ is odd}
    \end{cases}
$$

\[f(n) = \begin{cases} n/2, & \text{if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases} \]

$$  
  \left.
    \begin{array}{l}
    \text{if $n$ is even:}&n/2\\
    \text{if $n$ is odd:}&3n+1
    \end{array}
  \right\}
  =f(n)
$$

\[\left. \begin{array}{l} \text{if $n$ is even:}&n/2\\ \text{if $n$ is odd:}&3n+1 \end{array} \right\} =f(n) \]

5、编号

语法:\tag

$$ 
  y=x^2        \tag{1.5a}
$$

\[y=x^2 \tag{1.5a} \]

posted @ 2023-02-15 11:12  凡223  阅读(65)  评论(0编辑  收藏  举报