mathjax总结

Posted by ZhengYang on 2016-08-17

hexo写markdown中_与*一样,表示斜体或粗体,但mathjax中_表示下标,因此,
mathjax中换行\\,在markdown中写成\\\\
mathjax中下标_,在markdown改写成\_
mathjax中下标\{,在markdown改写成\\{
mathjax中下标\},在markdown改写成\\}

在markdown的表格中插入|,可以输入 \| 代替

公式右键-Show Math As-Tex Commands可以查看编辑

行中公式inline & 独立公式displayed

行中公式 inline

This is an example for $x_mu+ y_mu$.
mathjax写法
This is an example for \$x_mu+ y_mu\$.

独立公式 displayed

$$J\alpha(x) = \sum{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha}$$
mathjax写法
\$\$J\alpha(x) = \sum{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha}\$\$

希腊字母

名称 大写 Tex 小写 Tex
alpha $A$ A $\alpha$ \alpha
beta $B$ B $\beta$ \beta
gamma $\Gamma$ \Gamma $\gamma$ \gamma
delta $\Delta$ \Delta $\delta$ \delta
epsilon $E$ E $\epsilon$ \epsilon
zeta $Z$ Z $\zeta$ \zeta
eta $H$ H $\eta$ \eta
theta $\Theta$ \Theta $\theta$ \theta
iota $I$ I $\iota$ \iota
kappa $K$ K $\kappa$ \kappa
lambda $\Lambda$ \Lambda $\lambda$ \lambda
mu $M$ M $\mu$ \mu
nu $N$ N $\nu$ \nu
xi $\Xi$ \Xi $\xi$ \xi
omicron $O$ O $\omicron$ \omicron
pi $\Pi$ \Pi $\pi$ \pi
rho $P$ P $\rho$ \rho
sigma $\Sigma$ \Sigma $\sigma$ \sigma
tau $T$ T $\tau$ \tau
upsilon $\Upsilon$ \Upsilon $\upsilon$ \upsilon
phi $\Phi$ \Phi $\phi$ \phi
chi $X$ X $\chi$ \chi
psi $\Psi$ \Psi $\psi$ \psi
omega $\Omega$ \Omega $\omega$ \omega

数学符号

名称 显示 写法
上标 $x^{y^z}$ x\^{y\^z}
下标 $x_mu + y_mu$ x_mu+ y_mu
小括号 $()$ ()
中括号 $[]$ []
大括号 $\{\}$ \\{\\}
上取整 $\lceil \rceil$ \lceil \rceil
下取整 $\lfloor \rfloor$ \lfloor \rfloor
未调整括号大小 $\{3+\frac{7x+5}{1+y^2}\}$ \{3+\frac{7x+5}{1+y^2}\}
调整括号大小 $\left\{3+\frac{7x+5}{1+y^2}\right\}$ \left\{3+\frac{7x+5}{1+y^2}\right\}
求和 $\sum_1^n$ \sum\_1^n
积分1 $\int_1^\infty$ \int\_1^\infty
积分2 $\int_0^{+\infty}x^ne^{-x}dx$ \int_0^{+\infty}x^ne^{-x}dx
共轭转置 $U^{\dagger }U=UU^{\dagger }=I$ U^{\dagger}U=UU^{\dagger}=I
连乘 $\prod$ \prod
双积分 $\iint$ \iint
分式1 $\frac{a+1}{b+1}$ \frac{a+1}{b+1}
分式2 ${a+1}\over{b+1}$ {a+1}\over{b+1}
根式 $\sqrt{\frac{x}{y}}$ \sqrt{\frac{x}{y}}
根式 $\sqrt[4]{\frac{x}{y}}$ \sqrt[4]{\frac{x}{y}}
三角函数1 $sin(x)$ sin(x)
三角函数2 $arctan(x)$ arctan(x)
极限 $lim_{1\rightarrow+\infty}\frac{1}{n(n+1)}$ lim_{1\rightarrow+\infty}\frac{1}{n(n+1)}
比较运算符 $\lt \gt \leqslant \geqslant \neq \approx$ \lt \gt \leqslant \geqslant \neq \approx
算数符 $\times \div \pm \mp x \cdot y$ \times \div \pm \mp x \cdot y
排列 $\binom{n+1}{2k}$ \binom{n+1}{2k}
逻辑运算符 $\land \lor \lnot \forall \exists$ \land \lor \lnot \forall \exists
偏导1 $\frac{\partial{f(x)}}{\partial{x}}$ \frac{\partial{f(x)}}{\partial{x}}
偏导2 $\nabla_xf(x)$ \nabla_xf(x)
集合1 $\cup \cap \in $ \cup \cap \in
集合2 $\bigcup \bigcap$ \bigcup \bigcap
估计 $\hat f(x)$ \hat f(x)
装饰符1 $\overline A \underline B$ \overline A \underline B
装饰符2 $\widetilde C \widehat D$ \widetilde C \widehat D
装饰符3 $\fbox E$ \fbox E
装饰符4 $\overleftarrow F \underrightarrow G$ \overleftarrow F \underrightarrow G
装饰符5 $\overleftrightarrow H \underleftrightarrow I$ \overleftrightarrow H \underleftrightarrow I
装饰符6 $\overbrace{(n-2)+\underbrace{(n-1)+n}}$ \overbrace{(n-2)+\underbrace{(n-1)+n}}
装饰符7 $\underbrace{a\cdot a\cdots a}_{b\text{times}}$ \underbrace{a\cdot a\cdots a}_{b\text{times}}
装饰符8 $\acute{I} \check{J} \grave{K}$ \acute{I} \check{J} \grave{K}

字体

名称 显示 写法 注意
黑板粗体1 $\mathbb{AaBb12} AaBb12$ \mathbb{AaBb12} AaBb12
黑板粗体2 $\Bbb{AaBb12} AaBb12$ \Bbb{AaBb12} AaBb12 好像只有大写字母有变化
黑体 $\mathbf{AaBb12}$ \mathbf{AaBb12}
希腊字母黑体 $\boldsymbol{\mu sigma}$ \boldsymbol{\mu sigma}
罗马字体 $\mathrm{AaBb12}$ \mathrm{AaBb12}
手写体 $\mathscr{AaBb12}$ \mathscr{AaBb12}
Fraktur字体 $\mathfrak{AaBb12}$ \mathfrak{AaBb12}

例子

公式 写法 注意
$x^{y^z}=(1+{e}^x)^{-2xy^w}$ \$x\^{y\^z}=(1+{e}\^x)\^{-2xy\^w}\$
$f(x,y,z) = 3y^2 z \left( 3+\frac{7x+5}{1+y^2} \right)$ \$f(x,y,z) = 3y\^2 z \left( 3+\frac{7x+5}{1+y\^2} \right)\$
$\int_0^{+\infty}x^ne^{-x}dx$ \$\int_0\^{+\infty}x\^ne\^{-x}dx\$
$e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n$ \$e\^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)\^n\$
$$e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n$$ \$\$e\^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)\^n\$\$ 注意\$和\$\$d的区别

分类表达式
$$
f(x)= \begin{cases}
n=1, if\ x\ is\ even\\
n=2, if\ x\ is\ odd\\
n=3, if\ x\ is\ 0
\end{cases}
$$
表格
$$
\begin{array}{c|cccc}
n & \text{Left} & \text{Center} & \text{Right} & \text{last} \\
\hline
1 & 0.24 & 1 & 125 & 235 \\
2 & 0.24 & 1 & 125 & 235 \\
3 & 0.24 & 1 & 125 & 235 \\
\end{array}
$$
矩阵
$$
\begin{pmatrix}
1 & a_1 & a_1^2 & \cdots & a_1^n\\
1 & a_2 & a_2^2 & \cdots & a_2^n \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
1 & a_n & a_n^2 & \cdots & a_n^n \\
\end{pmatrix}
$$
公式推导1
$$\begin{align} E&=\sum_{n=1}^{N}exp{-t_nf_{m-1}(\mathbf{x_n})-\frac12t_n\alpha_my_m(\mathbf{x_n})}\\
& =\sum_{n=1}^{N}w_n^{(m)}exp\left\{-\frac12t_n\alpha_my_m(\mathbf{x_n})\right\}
\end{align}
$$
公式推导2
$$\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}$$

Reference

  1. http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference
  2. http://mlworks.cn/posts/introduction-to-mathjax-and-latex-expression/
  3. http://docs.mathjax.org/en/latest/tex.html
  4. https://www.v2ex.com/t/209928