在输入数学公式的时候,需要在数学公式的前后加入$符号,将需要输入的公式加入到$中间。

  • 行内公式
$行内公式$
  • 行间公式
?
行间公式
?

角标(上下标)

  • 上标 ^
  • 下标 _
名称 数学表达式 markdown公式
上标 aba^bab $a^b$
下标 aba_bab $a_b$

开方

  • \sqrt[ ]{ } : [ ]中写的是开几次方,{ }中写的是需要开方的数值。
名称 数学表达式 markdown公式
开方号 1005\sqrt[5]{100}5100 $\sqrt[5]{100}$

分数

  • \frac{ }{ } : 第一个{ }写分子,第二个{ }写分母。
名称 数学表达式 markdown公式
分数 3+8a5b+6\frac{3+8a}{5b+6}5b+63+8a $\frac{3+8a}{5b+6}$

累加

  • \sum_{ }^{ }
名称 数学表达式 markdown公式
求和号 ∑3xn\sum{3x^n}3xn $\sum{3x^n}$
带范围求和 ∑n=1N3xn\sum_{n=1}^N {3x^n}n=1N3xn $\sum_{n=1}^N {3x^n}$

累乘

  • \prod_{ }^{ }
名称 数学表达式 markdown公式
累乘号 ∏3xn\prod{3x^n}3xn $\prod{3x^n}$
带范围累乘 ∏n=1N3xn\prod_{n=1}^N{3x^n}n=1N3xn $\prod_{n=1}^N{3x^n}$

积分

  • \int_{ }^{ }
名称 数学表达式 markdown公式
积分 ∫−NNex dx\int_{-N}^{N} e^x \,dxNNexdx $\int_{-N}^{N} e^x \,dx$
二重积分 ∬Vμ(u,v) du dv\iint_V \mu(u,v) \,du\,dvVμ(u,v)dudv $\iint_V \mu(u,v) \,du\,dv$
三重积分 ∭Vμ(u,v,w) du dv dw\iiint_V \mu(u,v,w) \,du\,dv\,dwVμ(u,v,w)dudvdw \iiint_V \mu(u,v,w) \,du\,dv\,dw
Oriented line integral ∮Cf(s) ds\oint_C f(s) \,dsCf(s)ds $\oint_V f(s) \,ds$

微分

名称 数学表达式 markdown公式
偏微分 ∂Q∂t=∂s∂t\frac{\partial Q}{\partial t} = \frac{\partial s}{\partial t}tQ=ts \frac{\partial Q}{\partial t} = \frac{\partial s}{\partial t}

正无穷、负无穷

  • \infty
名称 数学表达式 markdown公式
正无穷 +∞+\infty+ $+\infty$
负无穷 −∞-\infty $-\infty$

极限

名称 数学表达式 markdown公式
右箭头 lim⁡n→+∞n\lim_{n\to+\infty}nlimn+n $\lim_{n\to+\infty}n$
极限 f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim\limits_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h}f(x)=h0limhf(x+h)f(x) $f'(x) = \lim\limits_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h}$

关系运算符

名称 数学表达式 markdown公式
大于等于 ≥\geq $\geq$
小于等于 ≤\leq $\leq$
不等于 ≠\not== $\not=$
不小于 ≮\not<< $\not<$

二元运算符

名称 数学表达式 markdown公式
加减 ±\pm± $\pm$
点乘 ⋅\cdot $\cdot$
×\times× $\times$
÷\div÷ $\div$

集合运算符

名称 数学表达式 markdown公式
包含于 ⊂\subset $\subset$
真包含于 ⫋\subsetneqq $\subsetneqq$
包含 ⊃\supset $\supset$
真包含 ⫌\supsetneqq $\supsetneqq$
不包含 ⊅\not\supset $\not\supset$
属于 ∈\in $\in$
相交 ∩\cap $\cap$
相并 ∪\cup $\cup$
空集 ∅\emptyset $\emptyset$

对数运算符

名称 数学表达式 markdown公式
对数 log⁡218\log_2{18}log218 $\log_2{18}$
对数 ln⁡\lnln $\ln$

三角运算符

名称 数学表达式 markdown公式
30度角 30∘30^\circ30 $30^\circ$
正弦 sin⁡\sinsin $\sin$
余弦 cos⁡\coscos $\cos$
正切 tan⁡\tantan $\tan$

二项式系数

名称 数学表达式 markdown公式
二项式系数 (nm)\binom n m(mn) \binom n m
二项式系数 (nm)n \choose m(mn) n \choose m

箭头

名称 数学表达式 markdown公式
左箭头 ←\leftarrow $\leftarrow$
右箭头 →\rightarrow $\rightarrow$
长箭头 ⟶\longrightarrow $\longrightarrow$
上箭头 ↑\uparrow $\uparrow$
下箭头 ↓\downarrow $\downarrow$

定界符

名称 数学表达式 markdown公式
() ()()() $()$
big ()\big(\big)() $\big(\big)$
Big ()\Big(\Big)() $\Big(\Big)$
bigg ()\bigg(\bigg)() $\bigg(\bigg)$
Bigg ()\Bigg(\Bigg)() $\Bigg(\Bigg)$
自动调整大小 ()\left(\right)() $\left(\right)$

声调

数学表达式 markdown公式
N→\overrightarrow{N}N \overrightarrow{N}
xˉ\bar{x}xˉ \bar{x}
ηˋ\grave{\eta}ηˋ \grave{\eta}
x˙\dot{x}x˙ \dot{x}
ηˊ\acute{\eta}ηˊ \acute{\eta}
a˘\breve{a}a˘ \breve{a}
α^\hat{\alpha}α^ \hat{\alpha}
αˇ\check{\alpha}αˇ \check{\alpha}
y¨\ddot{y}y¨ \ddot{y}
ι~\tilde{\iota}ι~ \tilde{\iota}

占位宽度

名称 数学表达式 markdown公式
两个 m 的宽度 aba\qquad bab $a\qquad b$
一个 m 的宽度 aba\quad bab $a\quad b$
1/3m 宽度 a ba\ ba b $a\ b$
2/7m 宽度 a  ba\;bab $a\;b$
1/6m 宽度 a ba\,bab $a\,b$
紧贴,缩进1/6m宽度 a ⁣ba\!bab $a\!b$

Cases

y={+xif  x>0−xif  x<0y=\begin{cases} +x \qquad \text{if } \ x > 0 \\ -x \qquad \text{if } \ x < 0 \end{cases}y={+xif  x>0xif  x<0

$y=\begin{cases}
+x \qquad \text{if } \  x > 0  \\
-x \qquad \text{if } \  x < 0
\end{cases}$

几何符号

名称 数学表达式 markdown公式
三角形 △\triangle \triangle
正方形 □\Box \Box
菱形 ◊\Diamond \Diamond
角名 ∠ABC\angle ABCABC \angle ABC
垂直 ⊥\perp \perp

希腊字母

字母名称 大写 markdown公式 小写 markdown公式
alpha AAA $A$ α\alphaα $\alpha$
beta BBB $B$ β\betaβ $\beta$
gamma Γ\GammaΓ $\Gamma$ γ\gammaγ $\gamma$
delta Δ\DeltaΔ $\Delta$ δ\deltaδ $\delta$
epsilon EEE $E$ ϵ\epsilonϵ $\epsilon$
varepsilon ε\varepsilonε $\varepsilon$
zeta ZZZ $Z$ ζ\zetaζ $\zeta$
eta EEE $E$ η\etaη $\eta$
theta Θ\ThetaΘ $\Theta$ θ\thetaθ $\theta$
iota III $I$ ι\iotaι $\iota$
kappa KKK $K$ κ\kappaκ $\kappa$
lambda Λ\LambdaΛ $\Lambda$ λ\lambdaλ $\lambda$
Mu MMM $M$ μ\muμ $\mu$
nu NNN $N$ ν\nuν $\nu$
xi Ξ\XiΞ $\Xi$ ξ\xiξ $\xi$
omicron OOO $O$ ο\omicronο $\omicron$
pi Π\PiΠ $\Pi$ π\piπ $\pi$
rho PPP $P$ ρ\rhoρ $\rho$
sigma Σ\SigmaΣ $\Sigma$ σ\sigmaσ $\sigma$
tau TTT $T$ τ\tauτ $\tau$
upsilon Υ\UpsilonΥ $\Upsilon$ υ\upsilonυ $\upsilon$
phi Φ\PhiΦ Φ\PhiΦ ϕ\phiϕ $\phi$
varphi φ\varphiφ $\varphi$
chi XXX $X$ χ\chiχ $\chi$
psi Ψ\PsiΨ $\Psi$ ψ\psiψ $\psi$
omega Ω\OmegaΩ $\Omega$ ω\omegaω $\omega$

空心字母与Fraktur字母

名称 数学表达式 markdown公式
A A\mathbb{A}A $\mathbb{A}$
B B\mathfrak{B}B $\mathfrak{B}$

举例

数学表达式 markdown公式
x=−b±b2−4ac2ax=\frac{-b\pm\sqrt{b^2-4ac}}{2a}x=2ab±b24ac $x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$

矩阵

简单矩阵

使用$\begin{matrix}…\end{matrix}$来生成矩阵,其中…表示的是 LaTeX 的矩阵命令,矩阵命令中每一行以 \ 结束,矩阵的元素之间用 & 来分隔开。如:

123456789\begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix}147258369

$\begin{matrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{matrix}$

带括号的Matrix

使用 \left … \right 或者把公式命令中的 matrix 改成 pmatrix、bmatrix、Bmatrix、vmatrix、Vmatrix等。

{123456789}\left\{ \begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} \right\} 147258369

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

or

 \begin{Bmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{Bmatrix}

(123456789)\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix} 147258369


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

or


 \begin{pmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{pmatrix}

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

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

∣123456789∣\begin{vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{vmatrix} 147258369

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

or

 \begin{vmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{vmatrix}

∥123456789∥\begin{Vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{Vmatrix} 147258369

 \begin{Vmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{Vmatrix} \tag{6}

分段函数

?
P_{r-j}=
 \begin{cases}
   0 &\mbox{if $r-j$ is odd}\\\
   r!(-1)^{(r-j)/2} &\mbox{if $r-j$ is even}
   \end{cases}
?

KaTeX parse error: Undefined control sequence: \mbox at position 32: …n{cases} 0 &\̲m̲b̲o̲x̲{if $r-j$ is od…

参考:

  • http://blog.csdn.net/Linear_Luo/article/details/52224996
  • https://blog.csdn.net/bendanban/article/details/44221279
  • https://blog.csdn.net/destinytaoer/article/details/78761520
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐