LaTex 公式速查
本文仅提供的能够在 中使用的 公式。
如何插入 公式?
- 行内公式:
$公式$ - 独立公式:
$$公式$$
函数
对数与指数
a^x
\sqrt{x}
\sqrt[3]{x}
\sqrt[a]{x}
\exp x
\log x
\lg x
\ln x
三角函数
\sin x
\cos x
\tan x
\cot x
\sec x
\csc x
\arcsin x
\arccos x
\arctan x
\sinh x
\cosh x
\tanh x
其他函数
最小值: \min x 最大值: \max x
最大公约数: \gcd x
角度: \deg
极限: \lim_{x \to \infty}f(x)
上确界: \sup M
下确界: \inf M
行列式: \det A
维数: \dim A
矩阵kernel: \ker A
投影: \Pr
同调群: \hom
复数的幅角: \arg z
向下取整: \lfloor x \rfloor
向上取整: \lceil x \rceil
自定义函数: \operatorname{function} x
符号
运算符
\pm
\mp
\dotplus
\times
\div
\frac{a}{b}
\divideontimes
\backslash
\cdot
\ast
\circ
\bullet
\boxplus
\boxminus
\boxtimes
\boxdot
\oplus
\ominus
\otimes
\oslash
\odot
bigoplus
\bigotimes
\bigodot
集合
\{ \}
\empty
\varnothing
\in
\notin 或 \not\in
\ni
\notni 或 \not\ni
\cap
\Cap
\sqcap
\bigcap
\cup
\Cup
\sqcup
\bigcup
\bigscup
\uplus
\biguplus
\subset
\Subset
\sqsubset
\supset
\Supset
\sqsupset
\subseteq
\nsubseteq
\subsetneq
\varsubsetneq
\sqsubseteq
\supseteq
\nsupseteq
\supsetneq
\varsupsetneq
\sqsupseteq
\sqsupset
\subseteqq
\nsubseteqq
\subsetneqq
\varsubsetneqq
\supseteqq
\nsupseteqq
\supsetneqq
\varsupsetneqq
关系符号
\ne 或 \neq
\equiv
\not\equiv
\doteq
\doteqdot
\sim
\nsim
\backsim
\thicksim
\simeq
\backsimeq
\eqsim
\cong
\ncong
\approx
\thickapprox
\approxeq
\asymp
\propto
\varpropto
\ngtr
\gg
\ggg
\not\ggg
\gtrdot
\ngtr
\lneq
\leqq
\nleq
\nleqq
\lneqq
\lvertneqq
\ge
\geq
\gneq
\geqq
\ngeq
\ngeqq
\gneqq
\gvertneqq
几何符号
\parallel
\nparallel
\shortparallel
nshortparallel
\perp
\angle
\sphericalangle
\measuredangle
45^\circ
\Box
\blacksquare
\diamond
\Diamond
\lozenge
\blacklozenge
\bigstar
\bigcirc
\triangle
\bigtriangleup
\bigtriangledown
\vartriangle
\triangledown
\blacktriangle
\blacktriangledown
\blacktriangleleft
\blacktriangleright
逻辑符号
\forall
\exists
\nexists
\therefore
\because
\And
\mid
\lor 或 \vee
\land 或 \wedge
\bar{q}
\overline{q}
\lnot 或 \neg
\bot
\top
\vdash
\dashv
\vDash
\Vdash
\models
\ulcorner
\urcorner
\llcorner
\lrcorner
箭头 - arrow
\rightarrow
\nrightarrow
\longrightarrow
\Rightarrow
\nRightarrow
\Longrightarrow
\leftarrow
n\leftarrow
\longleftarrow
\Leftarrow
\nLeftarrow
\Longleftarrow
\leftrightarrow
\nleftrightarrow
\Leftrightarrow
\nLeftrightarrow
\longleftrightarrow
iff
\Longleftrightarrow
\uparrow
\downarrow
\updownarrow
\Uparrow
\Downarrow
\nearrow
\swarrow
\nwarrow
\searrow
\rightharpoonup
\rightharpoondown
\leftharpoonup
\leftharpoondown
\upharpoonleft
\downharpoonleft
\upharpoonright
\downharpoonright
\rightleftharpoons
\leftrightharpoons
\curvearrowleft
\curvearrowright
\circlearrowleft
\circlearrowright
\Lsh
\Rsh
\upuparrows
\downdownarrows
\leftleftarrows
\rightrightarrows
\stackrel{text}{\longrightarrow}
\stackrel{text}{\longleftarrow}
\stackrel{text}{\downarrow}
\stackrel{text}{\uparrow}
希腊字母
\alpha
\beta
\gamma
\delta
\epsilon
\varepsilon
\zeta
\eta
\theta
\vartheta
\iota
\kappa
\lambda
\mu
\nu
\xi
\pi
\varpi
\rho
\varrho
\sigma
\varsigma
\tau
\upsilon
\phi
\varphi
\chi
\psi
\omega
\Gamma
\Delta
\Theta
\Lambda
\Xi
\Pi
\Sigma
\Upsilon
\Phi
\Psi
\Omega
字体
黑板报粗体
只对大写字母有效
\mathbb{FONT}
粗体
对大小写字母、希腊字母都有效
\mathbf{FONT}
\mathbf{font}
\mathbf{\digamma\Theta\Nu\Tau}
斜体
\mathit{1234567890}
\mathit{abcdefg}
\mathit{ABCDEFG}
无衬线体
\mathsf{ABCDEFG}
手写体
\mathcal{ABCDEFG}
注释文本
用 text{} 在公式中添加文本: \text{注释信息}
颜色
格式:
\color{颜色}{文本}旧版浏览器支持:
\color{gray}{text}
\color{silver}{text}
\color{blue}{text}
\color{yellow}{text}
\color{red}{text}
\color{lime}{text}
\color{green}{text}
\color{fuchsia}{text}
较新浏览器支持 \color{#rgb}{text} 来自定义更多的颜色,#rgb 的 r、g、b 分别可以是十六进制表示的 0~255 的数。
\color{#ffdddd}{text}
\color{#ff8888}{text}
\color{#ffaa11}{text}
\color{#ffccaa}{text}
\color{#ffdd66}{text}
\color{#ffbbee}{text}
\color{#aaaaff}{text}
\color{#7777ff}{text}
\color{#66ccff}{text}
\color{#99ccff}{text}
\color{#00eeff}{text}
\color{#bbffee}{text}
\color{#99ff99}{text}
\color{#44bb66}{text}
\color{#44ff77}{text}
\color{#0088ff}{text}
\color{#22cc88}{text}
\color{#777777}{text}
\color{#aaaaaa}{text}
\color{#f0f0f0}{text}
空格
\,表示一个窄空格, M 的宽度\或\:表示一个中等空格\;表示一个大空格\quad表示一个字母 M 宽度的空格\qquad表示两个 \quad 的宽度\!表示一个负的窄空格,缩进 的宽度\\表示换行
上下标与积分等
x^2
x^{a+b}
a_1
a_{ij}
前置上下标: {}_1^2\!x_3^4
正上方标记: \sum\limits^n
正下方标记: \min\limits_{i \leq k \leq j - 1}
导数: x^\prime 或 x'
导数点: \dot{x}
向量: \vec{x}
左长箭头: \overleftarrow{a + b}
右长箭头: \overrightarrow{a + b}
\widehate{abc}
上弧: \overset{\frown}{AB}
上划线: \overline{abc}
下划线: \underline{abc}
上括号: \overbrace{1 + 2 + \cdots + 100}
上括号示例: \begin{matrix}5050\\\overbrace{1 + 2 + \cdots + 100}\end{matrix}
下括号: \underbrace{1 + 2 + \cdots + 100}
下括号示例: \begin{matrix}\underbrace{1 + 2 + \cdots + 100}\\5050\end{matrix}
求和: \sum_{k = 1}^{\infty} f(x)
求和: \Sigma_{x = 1}^{t = \infty} f(x)
求积: \prod_{i = 1}^{n} x_i
上积: \coprod_{i = 1}^{n} x_i
极限: \lim_{x\to\infty} f(x)
积分: \int_{a}^{b} f(x)dx
双重积分: \iint_{a}^{b} f(x) \, dx \, dy
三重积分: \iiint_a^{b} f(x) \, dx \, dy \, dz
闭合的曲线、曲面积分: \oint_{C} x^2 \, dx+ y \, dy
分式
分数: \frac{a + b}{c + d}
\frac{dx}{dy}
连分式: \cfrac{1}{2 + \cfrac{3}{4 + \cfrac{5}{6 + \cdots}}}
\cfrac{a_1}{b1 + \cfrac{a_2}{b_2 + \cfrac{a_3}{b_3 + \cdots}}}
二项式系数: C_n^r = \dbinom{n}{r}
矩阵
语法:
\begin{类型}
公式
\end{类型}矩阵中 & 分隔元素,\\ 进行换行 横三点: \cdots
竖三点: \vdots
斜三点: \ddots
无框矩阵 - matrix
\begin{matrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{matrix}行列式 - vmatrix
\begin{vmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{21} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{vmatrix}范数矩阵 - Vmatrix
\begin{Vmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,1} & \cdots & a_{2,n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n,1} & a_{n,2} & \cdots & a_{n,n}
\end{Vmatrix}小括号矩阵 - pmatrix
\begin{pmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{pmatrix}大括号矩阵 - Bmatrix
\begin{Bmatrix}
a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
a_{31} & a_{32} & a_{33} & a_{34} \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{Bmatrix}方括号矩阵 - bmatrix
\begin{bmatrix}
a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\
a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\
a_{31} & a_{32} & a_{33} & \cdots & a_{3n} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & a_{n3} & \cdots & a_{nn}
\end{bmatrix}边框 - boxed{}
\begin{bmatrix}
\boxed{-1} & 3 & 0 & 2 \\
0 & \boxed{1} & 3 & 1 \\
0 & 0 & 0 & \boxed{2} \\
0 & 0 & 0 & 0
\end{bmatrix}\\数组 - array
\begin{array}{}
a & b \\
c & d
\end{array}定界符
语法:
\left 符号
公式
\right 符号竖线
\left |
\begin{array}{}
a_{11} & a_{12} \\
a_{13} & a_{14} \\
\end{array}
\right |小括号
\left (
\begin{array}{}
a_{11} & a_{12} \\
a_{13} & a_{14} \\
\end{array}
\right )大括号
\left \{
\begin{array}{}
a_{11} & a_{12} \\
a_{13} & a_{14} \\
\end{array}
\right \}注:
{}为特殊字符,无法直接使用,应使用\{和\}来输出
方括号
\left [
\begin{array}{}
a_{11} & a_{12} \\
a_{13} & a_{14} \\
\end{array}
\right ]分割线
实竖线
\left [
\begin{array}{c|c|c|c|c}
a_{11} & a_{12} & a_{13} & a_{14} & a_{15}\\
a_{21} & a_{22} & a_{23} & a_{24} & a_{25}\\
a_{31} & a_{32} & a_{33} & a_{34} & a_{35}\\
a_{41} & a_{42} & a_{43} & a_{44} & a_{45}\\
a_{51} & a_{52} & a_{53} & a_{54} & a_{55}
\end{array}\\
\right ]虚竖线
\left [
\begin{array}{c:c:c:c:c}
a_{11} & a_{12} & a_{13} & a_{14} & a_{15} \\
a_{21} & a_{22} & a_{23} & a_{24} & a_{25} \\
a_{31} & a_{32} & a_{33} & a_{34} & a_{35} \\
a_{41} & a_{42} & a_{43} & a_{44} & a_{45} \\
a_{51} & a_{52} & a_{53} & a_{54} & a_{55}
\end{array}
\right ]\\实横线 - \hline
\left [
\begin{array}{}
a_{11} & a_{12} & a_{13} & a_{14} & a_{15} \\
\hline
a_{21} & a_{22} & a_{23} & a_{24} & a_{25} \\
\hline
a_{31} & a_{32} & a_{33} & a_{34} & a_{35} \\
\hline
a_{41} & a_{42} & a_{43} & a_{44} & a_{45} \\
\hline
a_{51} & a_{52} & a_{53} & a_{54} & a_{55}
\end{array}
\right ]虚横线 - \hdashline
\left [
\begin{array}{}
a_{11} & a_{12} & a_{13} & a_{14} & a_{15} \\
\hdashline
a_{21} & a_{22} & a_{23} & a_{24} & a_{25} \\
\hdashline
a_{31} & a_{32} & a_{33} & a_{34} & a_{35} \\
\hdashline
a_{41} & a_{42} & a_{43} & a_{44} & a_{45} \\
\hdashline
a_{51} & a_{52} & a_{53} & a_{54} & a_{55}
\end{array}
\right ]应用 - 分块矩阵
\left [
\begin{array}{cc:cc}
1 & 0 & 1 & -2 \\
0 & 1 & 0 & 1 \\
\hdashline
-1 & 2 & -1 & 0 \\
0 & -1 & 0 & -1
\end{array}
\right ]应用 - 制作表格
\boxed{
\begin{array}{c|c}
矩阵类型 & 关键字 \\ \hline
|A| & vmatrix \\ \hline
\parallel & Vmatrix \\ \hline
() & pmatrix \\ \hline
\{\} & Bmatrix \\ \hline
[\ ] & bmatrix
\end{array}
}条件表达式,方程式
条件表达式 - cases
f(x) =
\begin{cases}
\begin{aligned}
\frac{\sin x}{|x|},x \ne 0 \\
1,x = 0\\
\end{aligned}
\end{cases}编号的方程式 - equation
\begin{equation}
z = (a+b)^4= a^4 + 4a^3b + 6a^2b^2 + 4ab^3 + b^4.
\end{equation}多公式有编号 - align
\begin{align}
\nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \\
\nabla \cdot \mathbf{B} &= 0 \\
\nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\
\nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0\varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}
\end{align}多公式无编号 - align*
多公式无编号
\begin{align*}
E = mc^2 \\
e^{i\pi} + 1 = 0
\end{align*}单方程式多行写
\begin{align*}
z & = (a+b)^4 \\
& = (a+b)^2(a+b)^2 \\
& = (a^2+2ab+b^2)(a^2+2ab+b^2) \\
& = a^4 + 4a^3b + 6a^2b^2 + 4ab^3 + b^4
\end{align*}\begin{align*}
& a_1 \wedge a_2 \wedge \cdots \wedge (a_i \wedge x) \wedge a_{i + 1} \wedge \cdots \wedge a_n\\
& = (a_1 \wedge a_2 \wedge \cdots \wedge a_i \wedge a_{i + 1} \wedge \cdots \wedge a_n) \wedge x\\
& = x \wedge x\\
& = 0
\end{align*}自定义对齐方式
在 align 或 align* 环境下,在公式左侧添加 & 可以使得公式左对齐,否则默认为居中对齐。 实际上将 & 的作用是为公式设置一个对齐点,多个公式的对齐点会在同一竖线上。
- 将标记的 和 之间保持对齐
\begin{align*}
\phi(N) &= N - \frac{N}{p_1} - \frac{N}{p_2} \cdots - \frac{N}{p_k}\\
& +\frac{N}{p_1p_2} + \frac{N}{p_1p_3} + \cdots\\
& +\frac{N}{p_1p_2p_3} - \frac{N}{p_2p_2p_4} \cdots\\
& +\cdots \\
& = N \times \frac{p_1 - 1}{p_1} \times \frac{p_2 - 1}{p_2}\cdots \times \frac{p_m - 1}{p_m}
\end{align*}- 将 之间保持对齐
方程组
\begin{cases}
x + y - z = 0 \\
2x - y + z = 2 \\
x + y + 2z = 4
\end{cases}或者
\left\{ \begin{aligned}
x + y - z = 0 \\
2x - y + z = 2 \\
x + y + 2z = 4
\end{aligned} \right.
\left\{ 公式 \right.实现只有左边出现界定符大括号{\begin{aligned} 公式 \end{aligned}实现公式右对齐