【博客】Markdown常见公式语法

一些常见的markdown公式汇总。

行内公式与独行公式

行内公式:将公式插入到本行内,符号:\(\$ 公式内容 \$\)

独行公式:将公式插入到新的一行内,并且居中,符号:\(\$\$ 公式内容 \$\$\)

上下标

符号 markdown eg.
上标 ^ a^0->\(a^0\)
下标 _ a_0->\(a_0\)
组合 { } a_{pre}->\(a_{pre}\)

括号

算式 markdown
(, ) (, )
[, ] [, ]
⟨,⟩ \lang, \rang 或 \langle, \rangle
∣,∣ \lvert, \rvert
∥,∥ \lVert, \rVert
{,} \lbrace, \rbrace 或 \{, \}
\(\big(x\big)\) \big( x \big)
\(\Big( x \Big)\) \Big( x \Big)
\(\bigg( x \bigg)\) \bigg( x \bigg)
\(\Bigg( x \Bigg)\) \Bigg( x \Bigg)

分数

算式 markdown
\(\frac{a}{b}\) \frac{a}{b}

开方

算式 markdown
\(\sqrt{a + b}\) \sqrt{a + b}
\(\sqrt[n]{a + b}\) \sqrt[n]{a + b}

累加/累乘

算式 markdown
\(\sum_{i = 0}^{n}\frac{1}{i^2}\) \sum_{i = 0}^{n}\frac{1}{i^2}
\(\prod_{i = 0}^{n}\frac{1}{x^2}\) \prod_{i = 0}^{n}\frac{1}{x^2}

对数

算式 markdown
\(\ln{a + b}\) \ln{a + b}
\(\log_{a}^{b}\) \log_{a}^{b}
\(\lg{a + b}\) \lg{a + b}

关系符号

算式 markdown
\(\leq\) \leq
\(\geq\) \geq
\(\equiv\) \equiv
\(\models\) \models
\(\prec\) \prec
\(\succ\) \succ
\(\sim\) \sim
\(\perp\) \perp
\(\preceq\) \preceq
\(\succeq\) \succeq
\(\simeq\) \simeq
\(\mid\) \mid
\(\ll\) \ll
\(\gg\) \gg
\(\asymp\) \asymp
\(\parallel\) \parallel
\(\approx\) \approx
\(\cong\) \cong
\(\neq\) \neq
\(\doteq\) \doteq
\(\propto\) \propto
\(\bowtie\) \bowtie
\(\Join\) \Join
\(\smile\) \smile
\(\frown\) \frown
\(\vdash\) \vdash
\(\dashv\) \dashv

集合

算式 markdown
\(\emptyset\) \emptyset
\(\in\) \in
\(\ni\) \ni
\(\notin\) \notin
\(\subset\) \subset
\(\supset\) \supset
\(\not\subset\) \not\subset
\(\subseteq\) \subseteq
\(\supseteq\) \supseteq
\(\cup\) \cup
\(\bigcup\) \bigcup
\(\cap\) \cap
\(\bigcap\) \bigcap
\(\uplus\) \uplus
\(\biguplus\) \biguplus
\(\sqsubset\) \sqsubset
\(\sqsupset\) \sqsupset
\(\sqcap\) \sqcap
\(\sqsubseteq\) \sqsubseteq
\(\sqsupseteq\) \sqsupseteq
\(\vee\) \vee
\(\wedge\) \wedge
\(\setminus\) \setminus

希腊字母

大写 markdown 小写 markdown
\(\Alpha\) \Alpha \(\alpha\) \alpha
\(\Beta\) \Beta \(\beta\) \beta
\(\Gamma\) \Gamma \(\gamma\) \gamma
\(\Delta\) \Delta \(\delta\) \delta
\(\Epsilon\) \Epsilon \(\epsilon\) \epsilon
\(\varepsilon\) \varepsilon
\(\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
\(\Omicron\) \Omicron \(\omicron\) \omicron
\(\Pi\) \Pi \(\pi\) \pi
\(\Rho\) \Rho \(\rho\) \rho
\(\Sigma\) \Sigma \(\sigma\) \sigma
\(\Tau\) \Tau \(\tau\) \tau
\(\Upsilon\) \Upsilon \(\upsilon\) \upsilon
\(\Phi\) \Phi \(\phi\) \phi
\(\varphi\) \varphi
\(\Chi\) \Chi \(\chi\) \chi
\(\Psi\) \Psi \(\psi\) \psi
\(\Omega\) \Omega \(\omega\) \omega

省略号

算式 markdown
\(\dots\) \dots
\(\ldots\) \ldots
\(\cdots\) \cdots
\(\vdots\) \vdots
\(\ddots\) \ddots

eg. x_1, x_2, \dots, x_n \quad \quad 1, 2, \cdots, n \quad \quad \vdots \quad\quad \ddots \[ x_1, x_2, \dots, x_n \quad \quad 1, 2, \cdots, n \quad \quad \vdots \quad\quad \ddots \]

空格

算式 markdown 描述
\(123\!123\) 123\!123 空格距离:-3/18 em
\(123\,123\) 123\,123 空格距离:3/18 em
\(123\:123\) 123\:123 空格距离:4/18 em
\(123\;123\) 123\;123 空格距离:5/18 em
\(123\quad123\) 123\quad123 空格距离:1 em
\(123\qquad123\) 123\qquad123 空格距离:2 em

公式

分支公式

y=

\begin{cases}

-x,\quad x\leq 0\\

x, \quad x>0

\end{cases}

\tag{1}

\[ y= \begin{cases} -x,\quad x\leq 0\\ x, \quad x>0 \end{cases} \tag{1} \]

矩阵

无括号:

\begin{matrix}

1 & 2 & 3\\

4 & 5 & 6 \\

7 & 8 & 9

\end{matrix}

\tag{1}

\[ \begin{matrix} 1 & 2 & 3\\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} \tag{1} \] 小括号:

\left(

\begin{matrix}

1 & 2 & 3\\

4 & 5 & 6 \\

7 & 8 & 9

\end{matrix}

\right)

\tag{2}

\[ \left( \begin{matrix} 1 & 2 & 3\\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} \right) \tag{2} \]

中括号:

\left[

\begin{matrix}

1 & 2 & 3\ 

4 & 5 & 6 \ 

7 & 8 & 9

\end{matrix}

\right]

\tag{3}

\[ \left[ \begin{matrix} 1 & 2 & 3\\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} \right] \tag{3} \]

大括号:

\left{

\begin{matrix}

1 & 2 & 3\ 

4 & 5 & 6 \ 

7 & 8 & 9

\end{matrix}

\right}

\tag{4}

\[ \left\{ \begin{matrix} 1 & 2 & 3\\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} \right\} \tag{4} \]

带省略号:

\left[

\begin{matrix}

a & b & \cdots & a\

b & b & \cdots & b\

\vdots & \vdots & \ddots & \vdots\\

c & c & \cdots & c

\end{matrix}

\right]

\tag{5}

\[ \left[ \begin{matrix} a & b & \cdots & a\\ b & b & \cdots & b\\ \vdots & \vdots & \ddots & \vdots\\ c & c & \cdots & c \end{matrix} \right] \tag{5} \]

带横线/竖线分割的矩阵:

\left[

\begin{array}{c|cc}

1 & 2 & 3 \ 

4 & 5 & 6 \ 

7 & 8 & 9

\end{array}

\right]

\tag{6}

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

\left[

\begin{array}{cc}

1 & 2 & 3 \ \hline

4 & 5 & 6 \ 

7 & 8 & 9

\end{array}

\right]

\tag{7}

\[ \left[ \begin{array}{cc} 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ 7 & 8 & 9 \end{array} \right] \tag{7} \]

积分

算式 markdown
\(\prime\) \prime
\(\int\) \int
\(\iint\) \iint
\(\iiint\) \iiint
\(\oint\) \oint
\(\nabla\) \nabla
\(\int_0^2 x^2 dx\) \int_0^2 x^2 dx

逻辑运算

算式 markdown
\(\because\) \because
\(\therefore\) \therefore
\(\forall\) \forall
\(\exist\) \exist
\(\vee\) \vee
\(\wedge\) \wedge
\(\bigvee\) \bigvee
\(\bigwedge\) \bigwedge

上下标符号

算式 markdown
\(\bar{a}\) \bar{a}
\(\overline{a}\) \overline{a}
\(\acute{a}\) \acute{a}
\(\breve{a}\) \breve{a}
\(\grave{a}\) \grave{a}
\(\dot{a}\) \dot{a}
\(\ddot{a}\) \ddot{a}
\(\hat{a}\) \hat{a}
\(\check{a}\) \check{a}
\(\breve{a}\) \breve{a}
\(\tilde{a}\) \tilde{a}
\(\vec{a}\) \vec{a}
\(\overline{a + b + c + d}\) \overline{a + b + c + d}
\(\underline{a + b + c + d}\) \underline{a + b + c + d}
\(\overbrace{a + b + c + d}\) \overbrace{a + b + c + d}
\(\underline{a + b + c + d}\) \underline{a + b + c + d}
\(\overbrace{a + \underbrace{b + c}_{1.0} + d}^{2.0}\) \overbrace{a + _{1.0} + d}^{2.0}

二元运算符

算式 markdown 描述
\(\pm\) \pm 正负号
\(\mp\) \mp 负正号
\(\times\) \times 乘号
\(\div\) \div 除号
\(\ast\) \ast 六角星号
\(\star\) \star 五角星号
\(\mid\) \mid 竖线
\(\nmid\) \nmid
\(\circ\) \circ
\(\bigcirc\) \bigcirc
\(\bullet\) \bullet
\(\cdot\) \cdot
\(\odot\) \odot
\(\bigodot\) \bigodot
\(\oslash\) \oslash
\(\ominus\) \ominus
\(\otimes\) \otimes
\(\bigotimes\) \bigotimes
\(\oplus\) \oplus
\(\bigoplus\) \bigoplus
\(\wr\) \wr
\(\diamond\) \diamond
\(\Diamond\) \Diamond
\(\triangle\) \triangle
\(\bigtriangleup\) \bigtriangleup
\(\bigtriangledown\) \bigtriangledown
\(\triangleleft\) \triangleleft
\(\triangleright\) \triangleright
\(\lhd\) \lhd
\(\rhd\) \rhd
\(\unlhd\) \unlhd
\(\dagger\) \dagger
\(\ddagger\) \ddagger
\(\amalg\) \amalg

极限

算式 markdown
\(\lim\) \lim
\(\rightarrow\) \rightarrow
\(\infty\) \infty
\(\lim_{n\rightarrow+\infty}n\) \lim_{n\rightarrow+\infty}n

三角函数

算式 markdown
\(\sin\) \sin
\(\cos\) \cos
\(\tan\) \tan
\(\cot\) \cot
\(\sec\) \sec
\(\csc\) \csc
\(\bot\) \bot
\(\angle\) \angle
\(40^\circ\) 40^\circ

向量

算式 markdown
\(\vec{a}\) \vec{a}

箭头

算式 markdown
\(\uparrow\) \uparrow
\(\downarrow\) \downarrow
\(\updownarrow\) \updownarrow
\(\Uparrow\) \Uparrow
\(\Downarrow\) \Downarrow
\(\Updownarrow\) \Updownarrow
\(\rightarrow\) \rightarrow
\(\leftarrow\) \leftarrow
\(\leftrightarrow\) \leftrightarrow
\(\Rightarrow\) \Rightarrow
\(\Leftarrow\) \Leftarrow
\(\Leftrightarrow\) \Leftrightarrow
\(\longrightarrow\) \longrightarrow
\(\longleftarrow\) \longleftarrow
\(\longleftrightarrow\) \longleftrightarrow
\(\Longrightarrow\) \Longrightarrow
\(\Longleftarrow\) \Longleftarrow
\(\Longleftrightarrow\) \Longleftrightarrow
\(\mapsto\) \mapsto
\(\longmapsto\) \longmapsto
\(\hookleftarrow\) \hookleftarrow
\(\hookrightarrow\) \hookrightarrow
\(\rightharpoonup\) \rightharpoonup
\(\leftharpoondown\) \leftharpoondown
\(\rightleftharpoons\) \rightleftharpoons
\(\leftharpoonup\) \leftharpoonup
\(\rightharpoondown\) \rightharpoondown
\(\leadsto\) \leadsto
\(\leadsto\) \leadsto
\(\searrow\) \searrow
\(\swarrow\) \swarrow
\(\nwarrow\) \nwarrow
0%