latex常用数学公式

latex常用数学公式

最近需要写一些文档,里面会有大量的公式,写出好看的公式的过程真的很治愈:cat:,这一期博客主要来介绍一些常用的latex公式,内容很干。自己用markdown写的公式,渲染出来都是对的,但是放到博客上不知道怎么回事有一些奇奇怪怪的错误,大家直接粘贴代码就行。

参考: https://artofproblemsolving.com/wiki/index.php/LaTeX:Symbols https://artofproblemsolving.com/wiki/index.php/LaTeX:Commands

各种类型的符号表

数集符号

Symbol Command Symbol Command Symbol Command Symbol Command
\(\mathbb{R}\) \(\mathbf{R}\) \(\mathcal{R}\) \(\mathfrak{R}\)
\(\mathbb{Z}\) \(\mathbf{Z}\) \(\mathcal{Z}\) \(\mathfrak{Z}\)
\(\mathbb{Q}\) \(\mathbf{Q}\) \(\mathcal{Q}\) \(\mathfrak{Q}\)

操作符

Symbol Command Symbol Command Symbol Command
\[\pm\] \(\mp\) \(\times\)
\[\div\] \(\cdot\) \(\ast\)
\[\star\] \(\dagger\) \(\ddagger\)
\[\amalg\] \(\cap\) \(\cup\)
\(\uplus\) \(\sqcap\) \(\sqcup\)
\(\vee\) \(\wedge\) \(\oplus\)
\(\ominus\) \(\otimes\) \(\circ\)
\(\bullet\) \(\diamond\) \(\lhd\)
\(\rhd\) \(\unlhd\) \(\unrhd\)
\(\oslash\) \(\odot\) \(\bigcirc\)
\(\triangleleft\) \(\Diamond\) \(\bigtriangleup\)
\(\bigtriangledown\) \(\Box\) \(\triangleright\)
\(\setminus\) \(\wr\) \(\sqrt{x}\)
\(x^{\circ}\) x^{} \(\triangledown\) \(\sqrt[n]{x}\)
\(a^x\) a^x \(a^{xyz}\) a^{xyz} \(a_x\) a_x

关系符号

Symbol Command Symbol Command Symbol Command
\(\le\) \(\ge\) \(\neq\)
\(\sim\) \(\ll\) \(\gg\)
\(\doteq\) \(\simeq\) \(\subset\)
\(\supset\) \(\approx\) \(\asymp\)
\(\subseteq\) \(\supseteq\) \(\cong\)
\(\smile\) \(\sqsubset\) \(\sqsupset\)
\(\equiv\) \(\frown\) \(\sqsubseteq\)
\(\sqsupseteq\) \(\propto\) \(\bowtie\)
\(\in\) \(\ni\) \(\prec\)
\(\succ\) \(\vdash\) \(\dashv\)
\(\preceq\) \(\succeq\) \(\models\)
\(\perp\) \(\parallel\)
\(\mid\) \(\bumpeq\)

关系符号前面加一个n,就可以变成这些关系符号的反义

Symbol Command Symbol Command Symbol Command
\(\nmid\) \(\nleq\) \(\ngeq\)
\(\nsim\) \(\ncong\) \(\nparallel\)
\(\not<\) < \(\not>\) > \(\not=\) = or or
\(\not\le\) \(\not\ge\) \(\not\sim\)
\(\not \approx\) \(\not\cong\) \(\not\equiv\)
\(\not\parallel\) \(\nless\) \(\ngtr\)
\(\lneq\) \(\gneq\) \(\lnsim\)
\(\lneqq\) \(\gneqq\)

希腊字母

Symbol Command Symbol Command Symbol Command Symbol Command
\(\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\)

一些大写的希腊字母

Symbol Command Symbol Command Symbol Command Symbol Command
\(\Gamma\) \(\Delta\) \(\Theta\) \(\Lambda\)
\(\Xi\) \(\Pi\) \(\Sigma\) \(\Upsilon\)
\(\Phi\) \(\Psi\) \(\Omega\)

箭头

Symbol Command Symbol Command
\(\gets\) \(\to\)
\(\leftarrow\) \(\Leftarrow\)
\(\rightarrow\) \(\Rightarrow\)
\(\leftrightarrow\) \(\Leftrightarrow\)
\(\mapsto\) \(\hookleftarrow\)
\(\leftharpoonup\) \(\leftharpoondown\)
\(\rightleftharpoons\) \(\longleftarrow\)
\(\Longleftarrow\) \(\longrightarrow\)
\(\Longrightarrow\) \(\longleftrightarrow\)
\(\Longleftrightarrow\) \(\longmapsto\)
\(\hookrightarrow\) \(\rightharpoonup\)
\(\rightharpoondown\) \(\leadsto\)
\(\uparrow\) \(\Uparrow\)
\(\downarrow\) \(\Downarrow\)
\(\updownarrow\) \(\Updownarrow\)
\(\nearrow\) \(\searrow\)
\(\swarrow\) \(\nwarrow\)
\(\overrightarrow{AB}\) \(\overleftarrow{AB}\)
\(\overleftrightarrow{AB}\)

一些奇奇怪怪的点

Symbol Command Symbol Command
\(\cdot\) \(\vdots\)
\(\dots\) \(\ddots\)
\(\cdots\)

字母上的强调符号

Symbol Command Symbol Command Symbol Command
\(\hat{x}\) \(\check{x}\) \(\dot{x}\)
\(\breve{x}\) \(\acute{x}\) \(\ddot{x}\)
\(\grave{x}\) \(\tilde{x}\) \(\mathring{x}\)
\(\bar{x}\) {x} \(\vec{x}\)

当对 \(i\)\(j\)应用强调符号时,可以使用:

Symbol Command Symbol Command
\(\vec{\jmath}\) \(\tilde{\imath}\)

和 有一个更宽的版本,\(\hat{7+x}\)\(\widehat{7+x}\)两种箭头是有区别的:

Symbol Command Symbol Command
\(\widehat{7+x}\) \(\widetilde{abc}\)

其他一些奇怪的符号

Symbol Command Symbol Command Symbol Command
\(\infty\) \(\triangle\) \(\angle\)
\(\aleph\) \(\hbar\) \(\imath\)
\(\jmath\) \(\ell\) \(\wp\)
\(\Re\) \(\Im\) \(\mho\)
\(\prime\) \(\emptyset\) \(\nabla\)
\(\surd\) \(\partial\) \(\top\)
\(\bot\) \(\vdash\) \(\dashv\)
\(\forall\) \(\exists\) \(\neg\)
\(\flat\) \(\natural\) \(\sharp\)
\(\backslash\) \(\Box\) \(\Diamond\)
\(\clubsuit\) \(\diamondsuit\) \(\heartsuit\)
\(\spadesuit\) \(\Join\) \(\blacksquare\)
\(\diamondsuit\) \(\mathbb{R}\) (represents all real numbers) \(\checkmark\)
\(\heartsuit\) \(\in\) \(\cup\)
\(\S\) \(\P\) \(\Vdash\)
\(\vDash\)

括号

In mathematics, sometimes we need to enclose expressions in brackets, braces or parentheses. Some of these work just as you'd imagine in LaTeX; type ( and ) for parentheses, [ and ] for brackets, and | and | for absolute value. However, other symbols have special commands:

Symbol Command Symbol Command Symbol Command
\[\{\] { \[\}\] } \(\|\) |
\(\backslash\) \(\lfloor\) \(\rfloor\)
\(\lceil\) \(\rceil\) \(\langle\)
\(\rangle\)

编写数学公式

下标和上标

下标和上标(例如指数)可以分别使用下划线_和箭头^符号。

Symbol Command Symbol Command
\(2^{2}\) 2^2 \(\textstyle a_i\) a_i
\(\textstyle 2^{23}\) 2^{23} \(\textstyle n_{i-1}\) n_{i-1}
\(a^{i+1}_3\) a^{i+1}_3 \(x^{3^2}\) x^{3^2}
\(2^{a_i}\) 2^{a_i} \(2^a_i\) 2^a_i

分式

使用来进行渲染

Symbol Command
\(\frac {1}{2}\) or
\(\frac{2}{x+2}\)
\(\frac{1+\frac{1}{x}}{3x + 2}\)

如果分号比较多,建议用,看起来更大也舒服很多

Symbol Command
\(\cfrac{2}{1+\cfrac{2}{1+\cfrac{2}{1+\cfrac{2}{1}}}}\)
\(\frac{2}{1+\frac{2}{1+\frac{2}{1+\frac{2}{1}}}}\)

累加,累乘,求极限,求对数一类的符号

分别使用命令、、。要表示下限和上限,或对数的底,使用_和^的方式与下标和上标相同。

Symbol Command
\(\textstyle \sum_{i=1}^{\infty}\frac{1}{i}\) _{i=1}^{}
\(\textstyle \prod_{n=1}^5\frac{n}{n-1}\) _{n=1}^5
\(\textstyle \lim_{x\to\infty}\frac{1}{x}\) _{x}
\(\textstyle \lim\limits_{x\to\infty}\frac{1}{x}\) _{x}
\(\textstyle \log_n n^2\) _n n^2

其中一些符号在latex的显示模式下更漂亮:

Symbol Command
\sum_{i=1}^{\infty}\frac{1}{i} _{i=1}^{}
\prod_{n=1}^5\frac{n}{n-1} _{n=1}^5
\lim_{x\to\infty}\frac{1}{x} _{x}

模运算符号

Symbol Command
\(9\equiv 3 \bmod{6}\) 9
\(9\equiv 3 \pmod{6}\) 9
\(9\equiv 3 \mod{6}\) 9
\(9\equiv 3\pod{6}\) 9

三角函数

Symbol Command Symbol Command Symbol Command
\(\textstyle \cos\) \(\textstyle \sin\) \(\textstyle \tan\)
\(\sec\) \(\textstyle \textstyle \csc\) \(\textstyle \cot\)
\(\textstyle \arccos\) \(\textstyle \arcsin\) \(\textstyle \arctan\)
\(\textstyle \cosh\) \(\textstyle \sinh\) \(\textstyle \tanh\)
\(\textstyle \coth\)

矩阵

我们可以使用\begin{array}…\end{array}命令构建数组或矩阵,并使用

其他符号

Symbol Command Symbol Command Symbol Command
\(\arg\) \(\textstyle\deg\) \(\textstyle\det\)
\(\dim\) \(\textstyle\exp\) \(\textstyle\gcd\)
\(\hom\) \(\inf\) \(\ker\)
\(\textstyle\lg\) \(\liminf\) \(\limsup\)
\(\textstyle\max\) \(\textstyle\min\) \(\Pr\)
\(\sup\)

其中一些命令的下标方式与求和、乘积和对数相同。有些渲染在显示模式和常规数学模式下不同。

Symbol Command Symbol Command Symbol Command
\(\dim_x\) _x \(\textstyle\gcd_x\) _x \(\inf_x\) _x
\(\liminf_x\) _x \(\limsup_x\) _x \(\textstyle\max_x\) _x
\(\textstyle\min_x\) _x \(\Pr_x\) _x \(\sup_x\) _x

矩阵

把矩阵单独放在一个板块是因为矩阵有很多花招,很多很多不同的表示

1. 数字周围无符号

数字周围无符号

\[ \begin{matrix} 1&0\\ 0&1 \end{matrix} \]

1
2
3
4
\begin{matrix}
1&0\\
0&1
\end{matrix}

小括号+p

\[ \begin{pmatrix} 1&0\\ 0&1 \end{pmatrix} \]

1
2
3
4
\begin{pmatrix}
1&0\\
0&1
\end{pmatrix}

中括号+b

\[ \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} \]

1
2
3
4
\begin{bmatrix}
1&0\\
0&1
\end{bmatrix}

大括号+B

\[ \begin{Bmatrix} 1&0\\ 0&1 \end{Bmatrix} \]

1
2
3
4
\begin{Bmatrix}
1&0\\
0&1
\end{Bmatrix}

单竖线+v

\[ \begin{vmatrix} 1&0\\ 0&1 \end{vmatrix} \]

1
2
3
4
\begin{vmatrix}
1&0\\
0&1
\end{vmatrix}

双竖线+V

\[ \begin{Vmatrix} 1&0\\ 0&1 \end{Vmatrix} \]

1
2
3
4
\begin{Vmatrix}
1&0\\
0&1
\end{Vmatrix}

省略号

使用 \dots水平 \vdots 竖直 \ddots倾斜 \hdotsfor{}跨列省略号。大括号中填共几列 如: \[ \begin{bmatrix} a_{11} & \dots & a_{1n}\\ &\ddots & \vdots \\ a_{n1}& & a_{nn} \end{bmatrix} \]

1
2
3
4
5
6
7
$$
\begin{bmatrix}
a_{11} & \dots & a_{1n}\\
&\ddots & \vdots \\
a_{n1}& & a_{nn}
\end{bmatrix}
$$

分块矩阵

\[ \begin{bmatrix} \begin{matrix}1&0\\0&1\end{matrix}& \text{\Large 0}\\ \text{\Large 0}&\begin{matrix}1&0\\0&1\end{matrix} \end{bmatrix} \]

\Large 0是比普通的零要大一些的

上面矩阵的代码为:

1
2
3
4
5
6
$$
\begin{bmatrix}
\begin{matrix}1&0\\0&1\end{matrix}& \text{\Large 0}\\
\text{\Large 0}&\begin{matrix}1&0\\0&1\end{matrix}
\end{bmatrix}
$$

\text是在数学编辑模式下临时使用文本编辑,在公式中输入汉字都要使用此标签。分块矩阵就是矩阵的嵌套,仔细阅读代码就能理解 。

三角矩阵

\[ \begin{bmatrix} a_{11}&a_{12} & \dots & a_{1n}\\ &a_{22}&\dots&a_{2n}\\ &&\ddots&\vdots\\ &{\huge 0}&&a_{nn} \end{bmatrix} \]

具体代码如下

1
2
3
4
5
6
7
8
$$
\begin{bmatrix}
a_{11}&a_{12} & \dots & a_{1n}\\
&a_{22}&\dots&a_{2n}\\
&&\ddots&\vdots\\
&{\huge 0}&&a_{nn}
\end{bmatrix}
$$

方程组

方程组四舍五入也算半个矩阵吧 \[ \begin{equation} \begin{cases} l_{11}y_{1} = 1 \\ l_{21}y_{1} + l_{22}y_{2} = 0 \\ l_{31}y_{1} + l_{32}y_{2} + l_{33}y_{3} = 0 \\ l_{41}y_{1} + l_ {42}y_{2} + l_{43}y_{3} + l_{44}y_{4} = 0 \end{cases} \end{equation} \]

1
2
3
4
5
6
7
8
9
10
$$
\begin{equation}
\begin{cases}
l_{11}y_{1} = 1 \\
l_{21}y_{1} + l_{22}y_{2} = 0 \\
l_{31}y_{1} + l_{32}y_{2} + l_{33}y_{3} = 0 \\
l_{41}y_{1} + l_ {42}y_{2} + l_{43}y_{3} + l_{44}y_{4} = 0
\end{cases}
\end{equation}
$$

latex常用数学公式
http://example.com/2022/10/25/latex常用数学公式/
作者
harper
发布于
2022年10月25日
许可协议