Markdown与数学公式
1 基本语法
2 形式语法
2.1 希腊字母
希腊字母(小写) |
Markdown表达形式 |
希腊字母(大写) |
Markdown表达形式 |
![\alpha](https://math.jianshu.com/math?formula=%5Calpha) |
\alpha |
![\Alpha](https://math.jianshu.com/math?formula=%5CAlpha) |
\Alpha |
![\beta](https://math.jianshu.com/math?formula=%5Cbeta) |
\beta |
![\Beta](https://math.jianshu.com/math?formula=%5CBeta) |
\Beta |
![\gamma](https://math.jianshu.com/math?formula=%5Cgamma) |
\gamma |
![\Gamma](https://math.jianshu.com/math?formula=%5CGamma) |
\Gamma |
![\delta](https://math.jianshu.com/math?formula=%5Cdelta) |
\delta |
![\Delta](https://math.jianshu.com/math?formula=%5CDelta) |
\Delta |
![\epsilon](https://math.jianshu.com/math?formula=%5Cepsilon) |
\epsilon |
![\Epsilon](https://math.jianshu.com/math?formula=%5CEpsilon) |
\Epsilon |
![\zeta](https://math.jianshu.com/math?formula=%5Czeta) |
\zeta |
![\Zeta](https://math.jianshu.com/math?formula=%5CZeta) |
\Zeta |
![\eta](https://math.jianshu.com/math?formula=%5Ceta) |
\eta |
![\Eta](https://math.jianshu.com/math?formula=%5CEta) |
\Eta |
![\theta](https://math.jianshu.com/math?formula=%5Ctheta) |
\theta |
![\Theta](https://math.jianshu.com/math?formula=%5CTheta) |
\Theta |
![\iota](https://math.jianshu.com/math?formula=%5Ciota) |
\iota |
![\Iota](https://math.jianshu.com/math?formula=%5CIota) |
\Iota |
![\kappa](https://math.jianshu.com/math?formula=%5Ckappa) |
\kappa |
![\Kappa](https://math.jianshu.com/math?formula=%5CKappa) |
\Kappa |
![\lambda](https://math.jianshu.com/math?formula=%5Clambda) |
\lambda |
![\Lambda](https://math.jianshu.com/math?formula=%5CLambda) |
\Lambda |
![\mu](https://math.jianshu.com/math?formula=%5Cmu) |
\mu |
![\Mu](https://math.jianshu.com/math?formula=%5CMu) |
\Mu |
![\nu](https://math.jianshu.com/math?formula=%5Cnu) |
\nu |
![\Nu](https://math.jianshu.com/math?formula=%5CNu) |
\Nu |
![\xi](https://math.jianshu.com/math?formula=%5Cxi) |
\xi |
![\Xi](https://math.jianshu.com/math?formula=%5CXi) |
\Xi |
![\omicron](https://math.jianshu.com/math?formula=%5Comicron) |
\omicron |
![\Omicron](https://math.jianshu.com/math?formula=%5COmicron) |
\Omicron |
![\pi](https://math.jianshu.com/math?formula=%5Cpi) |
\pi |
![\Pi](https://math.jianshu.com/math?formula=%5CPi) |
\Pi |
![\rho](https://math.jianshu.com/math?formula=%5Crho) |
\rho |
![\Rho](https://math.jianshu.com/math?formula=%5CRho) |
\Rho |
![\sigma](https://math.jianshu.com/math?formula=%5Csigma) |
\sigma |
![\Sigma](https://math.jianshu.com/math?formula=%5CSigma) |
\Sigma |
![\tau](https://math.jianshu.com/math?formula=%5Ctau) |
\tau |
![\Tau](https://math.jianshu.com/math?formula=%5CTau) |
\Tau |
![\upsilon](https://math.jianshu.com/math?formula=%5Cupsilon) |
\upsilon |
![\Upsilon](https://math.jianshu.com/math?formula=%5CUpsilon) |
\Upsilon |
![\varphi](https://math.jianshu.com/math?formula=%5Cvarphi) |
\varphi |
![\varPhi](https://math.jianshu.com/math?formula=%5CvarPhi) |
\varPhi |
![\phi](https://math.jianshu.com/math?formula=%5Cphi) |
\phi |
![\Phi](https://math.jianshu.com/math?formula=%5CPhi) |
\Phi |
![\chi](https://math.jianshu.com/math?formula=%5Cchi) |
\chi |
![\Chi](https://math.jianshu.com/math?formula=%5CChi) |
\Chi |
![\psi](https://math.jianshu.com/math?formula=%5Cpsi) |
\psi |
![\Psi](https://math.jianshu.com/math?formula=%5CPsi) |
\Psi |
![\Omega](https://math.jianshu.com/math?formula=%5COmega) |
\omega |
![\Omega](https://math.jianshu.com/math?formula=%5COmega) |
\Omega |
2.2 上标与下标
- 下标使用“_“,上标使用“^”,例如
的表达式为:
$x_i^2$
- 上下标可以嵌套使用,例如
的表达式为:
$x^{y^z}$
- 默认情况下,“_“、“^”之后的一位才是上下标的内容,当超过一个字符,使用“{ }”括起来,例如
的表达式为:
$x_{2i}^{2+b}$
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![x_i^2](https://math.jianshu.com/math?formula=x_i%5E2) |
x_i^2 |
![x_{2i}^{2+b}](https://math.jianshu.com/math?formula=x_%7B2i%7D%5E%7B2%2Bb%7D) |
x_{2i}^{2+b} |
![\hat{a}](https://math.jianshu.com/math?formula=%5Chat%7Ba%7D) |
\hat{a} |
![\acute{a}](https://math.jianshu.com/math?formula=%5Cacute%7Ba%7D) |
\acute{a} |
![\grave{a}](https://math.jianshu.com/math?formula=%5Cgrave%7Ba%7D) |
\grave{a} |
![\breve{a}](https://math.jianshu.com/math?formula=%5Cbreve%7Ba%7D) |
\breve{a} |
![\bar{a}](https://math.jianshu.com/math?formula=%5Cbar%7Ba%7D) |
\bar{a} |
![\widetilde{a}](https://math.jianshu.com/math?formula=%5Cwidetilde%7Ba%7D) |
\widetilde{a} |
![\check{a}](https://math.jianshu.com/math?formula=%5Ccheck%7Ba%7D) |
\check{a} |
![\tilde{a}](https://math.jianshu.com/math?formula=%5Ctilde%7Ba%7D) |
\tilde{a} |
![\dot{a}](https://math.jianshu.com/math?formula=%5Cdot%7Ba%7D) |
\dot{a} |
![\ddot{a}](https://math.jianshu.com/math?formula=%5Cddot%7Ba%7D) |
\ddot{a} |
![\vec{a}](https://math.jianshu.com/math?formula=%5Cvec%7Ba%7D) |
\vec{a} |
![\widehat{a}](https://math.jianshu.com/math?formula=%5Cwidehat%7Ba%7D) |
\widehat{a} |
2.3 括号
- 表达式中()、[]均可正常使用,但{}的表达式分为为:
\{
、\}
- 左、右括号的标记形式:
- 左括号
\left(
,\left[
,\left\{
- 右括号
\right)
,\right]
,\right\}
- 上、下花括号的表达形式:
$$
\underbrace{a \dots a}_{24个}?\overbrace{b \dots b}^{17个}
$$
- 上、下连线符的表达形式:
- 上连线符:
$\overline{a+b+c+d}$
- 下连线符:
$\underline{a+b+c+d}$
- 上、下括号与连线符的混合使用
$$
A=\overbrace{(a+b)+\underbrace{(c+d)i}_{\text{虚数}}}^{复数}+(e+f)+\underline{(g+h)}
$$
- 大括号右多行赋值的表达形式:
$$
P(x|pa_x)=\begin{cases} 1, &x=f(pa_x) \\0, &other\ values\end{cases}
$$
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\left(\dots\right)](https://math.jianshu.com/math?formula=%5Cleft(%5Cdots%5Cright)) |
\left(\dots\right) |
![\vert](https://math.jianshu.com/math?formula=%5Cvert) |
\vert |
![\Vert](https://math.jianshu.com/math?formula=%5CVert) |
\Vert |
![\langle](https://math.jianshu.com/math?formula=%5Clangle) |
\langle |
![\rangle](https://math.jianshu.com/math?formula=%5Crangle) |
\rangle |
![\lceil](https://math.jianshu.com/math?formula=%5Clceil) |
\lceil |
![\rceil](https://math.jianshu.com/math?formula=%5Crceil) |
\rceil |
![\lfloor](https://math.jianshu.com/math?formula=%5Clfloor) |
\lfloor |
![\rfloor](https://math.jianshu.com/math?formula=%5Crfloor) |
\rfloor |
![\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)](https://math.jianshu.com/math?formula=%5CBiggl(%5Cbiggl(%5CBigl(%5Cbigl((x)%5Cbigr)%5CBigr)%5Cbiggr)%5CBiggr)) |
\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) |
|
|
![\vert x \vert](https://math.jianshu.com/math?formula=%5Cvert%20x%20%5Cvert) |
\vert x \vert |
|
|
2.4 对数函数
-
函数底数使用“_”表示,其表达式为:
$\log_{a}{x}$
2.5 矩阵
表达式 |
Markdown表达形式 |
![\begin{matrix} 0&1 \\1&0 \end{matrix}](https://math.jianshu.com/math?formula=%5Cbegin%7Bmatrix%7D%200%261%20%5C%5C1%260%20%5Cend%7Bmatrix%7D) |
\begin{matrix} 0&1 \1&0 \end{matrix} |
![\begin{pmatrix} 0&-i \\i&0 \end{pmatrix}](https://math.jianshu.com/math?formula=%5Cbegin%7Bpmatrix%7D%200%26-i%20%5C%5Ci%260%20%5Cend%7Bpmatrix%7D) |
\begin{pmatrix} 0&1 \1&0 \end{pmatrix} |
![\begin{bmatrix} 0&-1 \\1&0 \end{bmatrix}](https://math.jianshu.com/math?formula=%5Cbegin%7Bbmatrix%7D%200%26-1%20%5C%5C1%260%20%5Cend%7Bbmatrix%7D) |
\begin{bmatrix} 0&-1 \1&0 \end{bmatrix} |
![\begin{Bmatrix} 1&0 \\0&1 \end{Bmatrix}](https://math.jianshu.com/math?formula=%5Cbegin%7BBmatrix%7D%201%260%20%5C%5C0%261%20%5Cend%7BBmatrix%7D) |
\begin{Bmatrix} 1&0 \0&1 \end{Bmatrix} |
![\begin{vmatrix} a&b \\c&d \end{vmatrix}](https://math.jianshu.com/math?formula=%5Cbegin%7Bvmatrix%7D%20a%26b%20%5C%5Cc%26d%20%5Cend%7Bvmatrix%7D) |
\begin{vmatrix} a&b \c&d \end{vmatrix} |
![\begin{Vmatrix} i&0 \\0&-i\end{Vmatrix}](https://math.jianshu.com/math?formula=%5Cbegin%7BVmatrix%7D%20i%260%20%5C%5C0%26-i%5Cend%7BVmatrix%7D) |
\begin{Vmatrix} i&0 \0&-i\end{Vmatrix} |
2.6 求和与积分
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\sum](https://math.jianshu.com/math?formula=%5Csum) |
\sum |
![\int](https://math.jianshu.com/math?formula=%5Cint) |
\int |
![\sum_1^n](https://math.jianshu.com/math?formula=%5Csum_1%5En) |
\sum_1^n |
![\sum_{i=0}^\infty i^2](https://math.jianshu.com/math?formula=%5Csum_%7Bi%3D0%7D%5E%5Cinfty%20i%5E2) |
\sum_{i=0}^\infty i^2 |
![\prod](https://math.jianshu.com/math?formula=%5Cprod) |
\prod |
![\infty](https://math.jianshu.com/math?formula=%5Cinfty) |
\infty |
![\bigcup](https://math.jianshu.com/math?formula=%5Cbigcup) |
\bigcup |
![\bigcap](https://math.jianshu.com/math?formula=%5Cbigcap) |
\bigcap |
![\iint](https://math.jianshu.com/math?formula=%5Ciint) |
\iint |
![\iiint](https://math.jianshu.com/math?formula=%5Ciiint) |
\iiint |
2.7 条件偏导
-
\partial
标记条件偏导
- 条件偏导的表达形式示例:
$$
\left.\frac{\partial f(x,y)}{\partial x}\right|_{x=0}
$$
2.7 根号开方
-
\sqrt
标记根号开方,基本语法为:$\sqrt[开方次数]{开方因子}$
- 根号开方的几种表达形式:
表达式 |
Markdown表达形式 |
![\sqrt{x^3}](https://math.jianshu.com/math?formula=%5Csqrt%7Bx%5E3%7D) |
\sqrt{x^3} |
![\sqrt[3]{\frac xy}](https://math.jianshu.com/math?formula=%5Csqrt%5B3%5D%7B%5Cfrac%20xy%7D) |
\sqrt[3]{\frac xy} |
2.8 分数
- 分数的语法单元1
$\frac{分子}{分母}$
- 分数的语法单元2
$分子\over 分母$
(用pandoc无法转成Word)
- 分数的几种表达形式:
表达式 |
Markdown表达形式 |
![\frac ab](https://math.jianshu.com/math?formula=%5Cfrac%20ab) |
\frac ab |
![\frac {a+1}{b-1}](https://math.jianshu.com/math?formula=%5Cfrac%20%7Ba%2B1%7D%7Bb-1%7D) |
\frac {a+1}{b-1} |
![a+1 \over b+1](https://math.jianshu.com/math?formula=a%2B1%20%5Cover%20b%2B1) |
a+1 \over b+1 |
![\cfrac{a}{b}](https://math.jianshu.com/math?formula=%5Ccfrac%7Ba%7D%7Bb%7D) |
\cfrac{a}{b} |
2.9 特殊函数
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\lim](https://math.jianshu.com/math?formula=%5Clim) |
\lim |
![\lim_{x \to 0}](https://math.jianshu.com/math?formula=%5Clim_%7Bx%20%5Cto%200%7D) |
\lim_{x \to 0} |
![\hat{x}](https://math.jianshu.com/math?formula=%5Chat%7Bx%7D) |
\hat{x} |
![\widehat{xy}](https://math.jianshu.com/math?formula=%5Cwidehat%7Bxy%7D) |
\widehat{xy} |
![\check{a}](https://math.jianshu.com/math?formula=%5Ccheck%7Ba%7D) |
\check{a} |
![\breve{a}](https://math.jianshu.com/math?formula=%5Cbreve%7Ba%7D) |
\breve{a} |
![\bar{a}](https://math.jianshu.com/math?formula=%5Cbar%7Ba%7D) |
\bar{a} |
![\tilde{a}](https://math.jianshu.com/math?formula=%5Ctilde%7Ba%7D) |
\tilde{a} |
![\acute{a}](https://math.jianshu.com/math?formula=%5Cacute%7Ba%7D) |
\acute{a} |
![\grave{a}](https://math.jianshu.com/math?formula=%5Cgrave%7Ba%7D) |
\grave{a} |
![\mathring{a}](https://math.jianshu.com/math?formula=%5Cmathring%7Ba%7D) |
\mathring{a} |
|
|
![\imath](https://math.jianshu.com/math?formula=%5Cimath) |
\imath |
![\jmath](https://math.jianshu.com/math?formula=%5Cjmath) |
\jmath |
![\overline{xyz}](https://math.jianshu.com/math?formula=%5Coverline%7Bxyz%7D) |
\overline{xyz} |
![\vec{x}](https://math.jianshu.com/math?formula=%5Cvec%7Bx%7D) |
\vec{x} |
![\overleftarrow{xyz}](https://math.jianshu.com/math?formula=%5Coverleftarrow%7Bxyz%7D) |
\overleftarrow{xyz} |
![\overrightarrow{xyz}](https://math.jianshu.com/math?formula=%5Coverrightarrow%7Bxyz%7D) |
\overrightarrow{xyz} |
![\overleftrightarrow{xyz}](https://math.jianshu.com/math?formula=%5Coverleftrightarrow%7Bxyz%7D) |
\overleftrightarrow{xyz} |
![\dot x](https://math.jianshu.com/math?formula=%5Cdot%20x) |
\dot x |
![\ddot{x}](https://math.jianshu.com/math?formula=%5Cddot%7Bx%7D) |
\ddot{x} |
2.10 特殊符号
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\pm](https://math.jianshu.com/math?formula=%5Cpm) |
\pm |
![\mp](https://math.jianshu.com/math?formula=%5Cmp) |
\mp |
![\times](https://math.jianshu.com/math?formula=%5Ctimes) |
\times |
![\div](https://math.jianshu.com/math?formula=%5Cdiv) |
\div |
![\mid](https://math.jianshu.com/math?formula=%5Cmid) |
\mid |
![\nmid](https://math.jianshu.com/math?formula=%5Cnmid) |
\nmid |
![\not\gt](https://math.jianshu.com/math?formula=%5Cnot%5Cgt) |
\not\gt |
![\not\lt](https://math.jianshu.com/math?formula=%5Cnot%5Clt) |
\not\lt |
![\lt](https://math.jianshu.com/math?formula=%5Clt) |
\lt |
![\gt](https://math.jianshu.com/math?formula=%5Cgt) |
\gt |
![\le](https://math.jianshu.com/math?formula=%5Cle) |
\le |
![\ge](https://math.jianshu.com/math?formula=%5Cge) |
\ge |
![\leq](https://math.jianshu.com/math?formula=%5Cleq) |
\leq |
![\geq](https://math.jianshu.com/math?formula=%5Cgeq) |
\geq |
![\leqslant](https://math.jianshu.com/math?formula=%5Cleqslant) |
\leqslant |
![\geqslant](https://math.jianshu.com/math?formula=%5Cgeqslant) |
\geqslant |
![\leqq](https://math.jianshu.com/math?formula=%5Cleqq) |
\leqq |
![\geqq](https://math.jianshu.com/math?formula=%5Cgeqq) |
\geqq |
![\approx](https://math.jianshu.com/math?formula=%5Capprox) |
\approx |
![\sim](https://math.jianshu.com/math?formula=%5Csim) |
\sim |
![\simeq](https://math.jianshu.com/math?formula=%5Csimeq) |
\simeq |
![\cong](https://math.jianshu.com/math?formula=%5Ccong) |
\cong |
![\equiv](https://math.jianshu.com/math?formula=%5Cequiv) |
\equiv |
![\neq](https://math.jianshu.com/math?formula=%5Cneq) |
\neq |
![\sum](https://math.jianshu.com/math?formula=%5Csum) |
\sum |
![\prod](https://math.jianshu.com/math?formula=%5Cprod) |
\prod |
![\ast](https://math.jianshu.com/math?formula=%5Cast) |
\ast |
|
|
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\in](https://math.jianshu.com/math?formula=%5Cin) |
\in |
![\notin](https://math.jianshu.com/math?formula=%5Cnotin) |
\notin |
![\subset](https://math.jianshu.com/math?formula=%5Csubset) |
\subset |
![\supset](https://math.jianshu.com/math?formula=%5Csupset) |
\supset |
![\subseteq](https://math.jianshu.com/math?formula=%5Csubseteq) |
\subseteq |
![\subsetneq](https://math.jianshu.com/math?formula=%5Csubsetneq) |
\subsetneq |
![\supseteq](https://math.jianshu.com/math?formula=%5Csupseteq) |
\supseteq |
![\supsetneq](https://math.jianshu.com/math?formula=%5Csupsetneq) |
\supsetneq |
![\cup](https://math.jianshu.com/math?formula=%5Ccup) |
\cup |
![\cap](https://math.jianshu.com/math?formula=%5Ccap) |
\cap |
![\bigcup](https://math.jianshu.com/math?formula=%5Cbigcup) |
\bigcup |
![\bigcap](https://math.jianshu.com/math?formula=%5Cbigcap) |
\bigcap |
![\emptyset](https://math.jianshu.com/math?formula=%5Cemptyset) |
\emptyset |
![\varnothing](https://math.jianshu.com/math?formula=%5Cvarnothing) |
\varnothing |
![\vee](https://math.jianshu.com/math?formula=%5Cvee) |
\vee |
![\wedge](https://math.jianshu.com/math?formula=%5Cwedge) |
\wedge |
![\bigvee](https://math.jianshu.com/math?formula=%5Cbigvee) |
\bigvee |
![\bigwedge](https://math.jianshu.com/math?formula=%5Cbigwedge) |
\bigwedge |
![\bigodot](https://math.jianshu.com/math?formula=%5Cbigodot) |
\bigodot |
![\bigotimes](https://math.jianshu.com/math?formula=%5Cbigotimes) |
\bigotimes |
![\mathbb{R}](https://math.jianshu.com/math?formula=%5Cmathbb%7BR%7D) |
\mathbb{R} |
![\mathbb{Z}](https://math.jianshu.com/math?formula=%5Cmathbb%7BZ%7D) |
\mathbb{Z} |
表达式 |
Markdown表达形式 |
![\log](https://math.jianshu.com/math?formula=%5Clog) |
\log |
![\lg](https://math.jianshu.com/math?formula=%5Clg) |
\lg |
![\ln](https://math.jianshu.com/math?formula=%5Cln) |
\ln |
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\angle](https://math.jianshu.com/math?formula=%5Cangle) |
\angle |
![n^\circ](https://math.jianshu.com/math?formula=n%5E%5Ccirc) |
n^\circ |
![\sin](https://math.jianshu.com/math?formula=%5Csin) |
\sin |
![\sec](https://math.jianshu.com/math?formula=%5Csec) |
\sec |
![\cos](https://math.jianshu.com/math?formula=%5Ccos) |
\cos |
![\csc](https://math.jianshu.com/math?formula=%5Ccsc) |
\csc |
![\tan](https://math.jianshu.com/math?formula=%5Ctan) |
\tan |
![\cot](https://math.jianshu.com/math?formula=%5Ccot) |
\cot |
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\prime](https://math.jianshu.com/math?formula=%5Cprime) |
\prime |
![\int](https://math.jianshu.com/math?formula=%5Cint) |
\int |
![\iint](https://math.jianshu.com/math?formula=%5Ciint) |
\iint |
![\iiint](https://math.jianshu.com/math?formula=%5Ciiint) |
\iiint |
![\oint](https://math.jianshu.com/math?formula=%5Coint) |
\oint |
![\oiint](https://math.jianshu.com/math?formula=%5Coiint) |
\oiint |
![\oiiint](https://math.jianshu.com/math?formula=%5Coiiint) |
\oiiint |
![\infty](https://math.jianshu.com/math?formula=%5Cinfty) |
\infty |
![\lim](https://math.jianshu.com/math?formula=%5Clim) |
\lim |
![\nabla](https://math.jianshu.com/math?formula=%5Cnabla) |
\nabla |
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\because](https://math.jianshu.com/math?formula=%5Cbecause) |
\because |
![\therefore](https://math.jianshu.com/math?formula=%5Ctherefore) |
\therefore |
![\forall](https://math.jianshu.com/math?formula=%5Cforall) |
\forall |
![\exists](https://math.jianshu.com/math?formula=%5Cexists) |
\exists |
![\not ={}](https://math.jianshu.com/math?formula=%5Cnot%20%3D%7B%7D) |
\not ={} |
![\not \subset](https://math.jianshu.com/math?formula=%5Cnot%20%5Csubset) |
\not \subset |
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\rightarrow](https://math.jianshu.com/math?formula=%5Crightarrow) |
\rightarrow |
![\leftarrow](https://math.jianshu.com/math?formula=%5Cleftarrow) |
\leftarrow |
![\Rightarrow](https://math.jianshu.com/math?formula=%5CRightarrow) |
\Rightarrow |
![\Leftarrow](https://math.jianshu.com/math?formula=%5CLeftarrow) |
\Leftarrow |
![\longrightarrow](https://math.jianshu.com/math?formula=%5Clongrightarrow) |
\longrightarrow |
![\longleftarrow](https://math.jianshu.com/math?formula=%5Clongleftarrow) |
\longleftarrow |
![\Longrightarrow](https://math.jianshu.com/math?formula=%5CLongrightarrow) |
\Longrightarrow |
![\Longleftarrow](https://math.jianshu.com/math?formula=%5CLongleftarrow) |
\Longleftarrow |
![\downarrow](https://math.jianshu.com/math?formula=%5Cdownarrow) |
\downarrow |
![\uparrow](https://math.jianshu.com/math?formula=%5Cuparrow) |
\uparrow |
![\Downarrow](https://math.jianshu.com/math?formula=%5CDownarrow) |
\Downarrow |
![\Uparrow](https://math.jianshu.com/math?formula=%5CUparrow) |
\Uparrow |
![\leftrightarrow](https://math.jianshu.com/math?formula=%5Cleftrightarrow) |
\leftrightarrow |
![\Leftrightarrow](https://math.jianshu.com/math?formula=%5CLeftrightarrow) |
\Leftrightarrow |
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\setminus](https://math.jianshu.com/math?formula=%5Csetminus) |
\setminus |
![\to](https://math.jianshu.com/math?formula=%5Cto) |
\to |
![\land](https://math.jianshu.com/math?formula=%5Cland) |
\land |
![\lor](https://math.jianshu.com/math?formula=%5Clor) |
\lor |
![\top](https://math.jianshu.com/math?formula=%5Ctop) |
\top |
![\bot](https://math.jianshu.com/math?formula=%5Cbot) |
\bot |
![\lnot](https://math.jianshu.com/math?formula=%5Clnot) |
\lnot |
![\mapsto](https://math.jianshu.com/math?formula=%5Cmapsto) |
\mapsto |
![\vdash](https://math.jianshu.com/math?formula=%5Cvdash) |
\vdash |
![\vDash](https://math.jianshu.com/math?formula=%5CvDash) |
\vDash |
![\star](https://math.jianshu.com/math?formula=%5Cstar) |
\star |
![\bullet](https://math.jianshu.com/math?formula=%5Cbullet) |
\bullet |
![\oplus](https://math.jianshu.com/math?formula=%5Coplus) |
\oplus |
![\prec](https://math.jianshu.com/math?formula=%5Cprec) |
\prec |
![\lhd](https://math.jianshu.com/math?formula=%5Clhd) |
\lhd |
![\nabla](https://math.jianshu.com/math?formula=%5Cnabla) |
\nabla |
![\aleph_0](https://math.jianshu.com/math?formula=%5Caleph_0) |
\aleph_0 |
![\Re](https://math.jianshu.com/math?formula=%5CRe) |
\Re |
![\varepsilon](https://math.jianshu.com/math?formula=%5Cvarepsilon) |
\varepsilon |
![\ell](https://math.jianshu.com/math?formula=%5Cell) |
\ell |
![{n+1 \choose 2K}](https://math.jianshu.com/math?formula=%7Bn%2B1%20%5Cchoose%202K%7D) |
{n+1 \choose 2K} |
![\binom{n+1}{2K}](https://math.jianshu.com/math?formula=%5Cbinom%7Bn%2B1%7D%7B2K%7D) |
\binom{n+1}{2K} |
2.11 空格与省略号
表达式 |
Markdown表达形式 |
备注 |
![a\!b](https://math.jianshu.com/math?formula=a%5C!b) |
$a\!b$ |
紧贴 |
![ab](https://math.jianshu.com/math?formula=ab) |
![ab](https://math.jianshu.com/math?formula=ab) |
默认空格 |
![a\ b](https://math.jianshu.com/math?formula=a%5C%20b) |
$a\ b$ |
大空格 |
![a\quad b](https://math.jianshu.com/math?formula=a%5Cquad%20b) |
$a\quad b$ |
quad空格 |
![a\qquad b](https://math.jianshu.com/math?formula=a%5Cqquad%20b) |
$a\qquad b$ |
两个quad空格 |
- 省略号包括两种类型:
- 与文本底线对齐:
\ldots
- 与文本中线对齐:
\cdots
- 竖直对齐:
\vdots
- 斜对齐:
\ddtos
- 省略号的表达形式示例:
$f(x_1,x_2,\ldots,x_n)=x_1^2+x_2^2+\cdots+x_n^n$
2.12 字体
表达式 |
Markdown表达形式 |
表达式 |
Markdown表达形式 |
![\mathbb{ABCDE}](https://math.jianshu.com/math?formula=%5Cmathbb%7BABCDE%7D) |
\mathbb{ABCDE} |
![\Bbb{ABCDE}](https://math.jianshu.com/math?formula=%5CBbb%7BABCDE%7D) |
\Bbb{ABCDE} |
![\mathbf{abcde}](https://math.jianshu.com/math?formula=%5Cmathbf%7Babcde%7D) |
\mathbf{abcde} |
![\mathtt{ABCDE}](https://math.jianshu.com/math?formula=%5Cmathtt%7BABCDE%7D) |
\mathtt{ABCDE} |
![\mathrm{ABCDE}](https://math.jianshu.com/math?formula=%5Cmathrm%7BABCDE%7D) |
\mathrm{ABCDE} |
![\mathsf{ABCDE}](https://math.jianshu.com/math?formula=%5Cmathsf%7BABCDE%7D) |
\mathsf{ABCDE} |
![\mathcal{ABCDE}](https://math.jianshu.com/math?formula=%5Cmathcal%7BABCDE%7D) |
\mathcal{ABCDE} |
![\mathscr{ABCDE}](https://math.jianshu.com/math?formula=%5Cmathscr%7BABCDE%7D) |
\mathscr{ABCDE} |
![\mathfrak{abcde}](https://math.jianshu.com/math?formula=%5Cmathfrak%7Babcde%7D) |
\mathfrak{abcde} |
![\boldsymbol{A}](https://math.jianshu.com/math?formula=%5Cboldsymbol%7BA%7D) |
\boldsymbol{A} |
2.13 其他
- 文本内容
\mbox{文本内容}
- 字体控制(使得符号大小适中)
\displaystyle
- 数字标签
\tag{数字}
3 高级应用
3.1 方程式
- 方程式语法单元1
$$\begin{equation}…\end{equation}
,使用\\
换行
$$
\begin{equation}
E=mc^2 \\
\end{equation}
$$
- 方程式语法单元2
$$\begin{align}…\end{align}
,使用\\
换行,&\text{注释}
添加方程式的注释说明,\tag n
添加公式编号
$$
\begin{align}
\sqrt{37} &= \sqrt{\frac{73^2-1}{12^2}} &\text{方程式注释} \tag 1 \\
&= \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \tag 2 \\
&= \sqrt{\frac{73^2}{12^2}}\cdot\sqrt{\frac{73^2-1}{73^2}} \tag 3 \\
&= \frac{73}{12}\sqrt{1-\frac{1}{73^2}} \tag 4 \\
& \approx \frac{73}{12}\left(1-\frac{1}{2\cdot 73^2}\right) \tag 5 \\
\end{align}
$$
- 方程式语法单元3
$$\begin{eqnarray}…\end{eqnarray}
,使用\\
换行
$$
\begin{eqnarray}f(x,y)
&=& 2xy+(x-y)^2 \\
&=& x^2+y^2 \\
\end{eqnarray}
$$
3.2 矩阵与行列式
- 矩阵语法单元
$$\begin{matrix}…\end{matrix}$$
,使用&
分隔同行元素,\\
换行
$$
\begin{matrix}
1 & x & x^2 \\
1 & y & y^2 \\
1 & z & z^2 \\
\end{matrix}
$$
- 行列式语法单元
$$\left|\begin{matrix}…\end{matrix}\right|$$
,使用&
分隔同行元素,\\
换行
$$
\left|
\begin{matrix}
x_{11} & x_{12} & \cdots & x_{1d} \\
x_{21} & x_{22} & \cdots & x_{2d} \\
\vdots & \vdots & \ddots & \vdots \\
x_{m1} & x_{m2} & \cdots & x_{md} \\
\end{matrix}
\right|
$$
- 使用
begin{array}
和end{array}
输入数组,其中使用c、l、r分别表示居中对齐、左对齐和右对齐,\hline
输入水平分割线,&
隔开每个元素
$$
\begin{array}{c|clr}
n & \text{a} & \text{b} & \text{c} \\
\hline
1 & 0.97 & 0.83 & 123 \\
2 & 0.87 & 0.68 & 129 \\
3 & -0.02 & 0.88 & 101 \\
\end{array}
$$
![\left( \begin{array}{ccccc} 1 & 2 & 3 & 4 & 5 \\ 1 & 2 & 3 & 4 & 5 \\ 1 & 2 & 3 & 4 & 5 \\ \end{array} \right)](https://math.jianshu.com/math?formula=%5Cleft(%20%5Cbegin%7Barray%7D%7Bccccc%7D%201%20%26%202%20%26%203%20%26%204%20%26%205%20%5C%5C%201%20%26%202%20%26%203%20%26%204%20%26%205%20%5C%5C%201%20%26%202%20%26%203%20%26%204%20%26%205%20%5C%5C%20%5Cend%7Barray%7D%20%5Cright))
$$
\left(
\begin{array}{ccccc}
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5 \\
\end{array}
\right)
$$
![\left[ \begin{array}{cc|c} 1 & 1 & 1 \\ 2 & 2 & 2 \\ \hline 3 & 3 & 3 \\ \end{array} \right]](https://math.jianshu.com/math?formula=%5Cleft%5B%20%5Cbegin%7Barray%7D%7Bcc%7Cc%7D%201%20%26%201%20%26%201%20%5C%5C%202%20%26%202%20%26%202%20%5C%5C%20%5Chline%203%20%26%203%20%26%203%20%5C%5C%20%5Cend%7Barray%7D%20%5Cright%5D)
$$
\left[
\begin{array}{cc|c}
1 & 1 & 1 \\
2 & 2 & 2 \\
\hline
3 & 3 & 3 \\
\end{array}
\right]
$$
3.3 方程组
- 方程组语法单元1
$$\left\{\begin{array}…\end{array}\right\}$$
,使用\\
换行
$$
\left\{
\begin{array}{c}
a_1x + a_2y + a_3z=d_1 \\
b_1x + b_2y + b_3z=d_2
\end{array}
\right.
$$
- 方程组语法单元2
$$\begin{cases}…\end{cases}$$
,使用\\
换行
$$
\begin{cases}
a_1x + b_1y + c_1z =d_1 \\
a_2x + b_2y + c_2z =d_2 \\
a_3x + b_3y + c_3z =d_3
\end{cases}
$$
3.4 分段函数
- 分段函数语法单元
$$f(x)=\begin{cases}…\end{cases}$$
,使用\\
换行
$$
f(x)=
\begin{cases}
\dfrac{x}{2}, & \text{if $x$ is even} \\
3x+1, & \text{if $x$ is odd}
\end{cases}
$$
3.5 求和
- 默认求和公式
$$
\sum_{k=1}^n{x_k}
$$
- 强制求和公式
$$
\sum\limits_{k=1}^n{x_k}
$$
![\sum\nolimits_{k=1}^n{x_k}](https://math.jianshu.com/math?formula=%5Csum%5Cnolimits_%7Bk%3D1%7D%5En%7Bx_k%7D)
$$
\sum\nolimits_{k=1}^n{x_k}
$$
- 多行限制条件求和公式
$$
\prod_{k_0,k_1,\ldots>0\atop k_0+k_1+\cdots=n}{A_{k_0}A_{k_1}\cdots}
$$
3.6 常用数学公式
- 线性模型
$$
h(\theta)= \sum_{j=0}^n \theta_jx_j
$$
- 均方误差
$$
J(\theta)= \frac{1}{2m} \sum_{i=0}^m (y^i-h_{\theta} (x^i))^2
$$
- 批量梯度下降
$$
\frac{\partial J(\theta)}{\partial {\theta}_j}= -\frac1m \sum_{i=0}^m(y^i-h_{\theta}(x^i))x_j^i
$$
- 其他公式
$$
\sideset {^a_b}{^c_d}\prod ^e_f
$$
![\underset{e}{\overset{f}{_a^bM_c^d}}](https://math.jianshu.com/math?formula=%5Cunderset%7Be%7D%7B%5Coverset%7Bf%7D%7B_a%5EbM_c%5Ed%7D%7D)
$$
\underset{e}{\overset{f}{_a^bM_c^d}}
$$
![\lim_{x\rightarrow{\infty}}(1+\frac{1}{x})^{x}=e](https://math.jianshu.com/math?formula=%5Clim_%7Bx%5Crightarrow%7B%5Cinfty%7D%7D(1%2B%5Cfrac%7B1%7D%7Bx%7D)%5E%7Bx%7D%3De)
$$
\lim_{x\rightarrow{\infty}}(1+\frac{1}{x})^{x}=e
$$
![\int_{a}^{b}f(x)dx=F(b)-F(a)](https://math.jianshu.com/math?formula=%5Cint_%7Ba%7D%5E%7Bb%7Df(x)dx%3DF(b)-F(a))
$$
\int_{a}^{b}f(x)dx=F(b)-F(a)
$$
3.7 解决\frac
字符显示过小的问题
使用\dfrac
解决\frac
字符显示过小的问题,例如:
![x_1^*=\dfrac{a_{22}r_1-a_{12}r_2}{a_{11}a_{22}-a_{12}a_{21}}](https://math.jianshu.com/math?formula=x_1%5E*%3D%5Cdfrac%7Ba_%7B22%7Dr_1-a_%7B12%7Dr_2%7D%7Ba_%7B11%7Da_%7B22%7D-a_%7B12%7Da_%7B21%7D%7D)
$$
x_1^*=\dfrac{a_{22}r_1-a_{12}r_2}{a_{11}a_{22}-a_{12}a_{21}}
$$
参阅资料
1.超详细 LaTex数学公式
2.math-上花括号或下花括号
3.LaTeX技巧心得255:用laTeX排版大括号的三种方法
4.使用CSDN的markdown编辑器插入数学公式
5.CSDN-markdown 之 LaTeX 特殊公式格式笔记
6.试试LaTeX插入数学公式
7.LaTeX快速入门:一文浅谈TeX排版语法
8.latex排版知识点总结——(特殊符号、公式)
9.Latex语法(符号及数学公式)
10.在博客中使用LaTeX插入数学公式