Last Updated: 2024-03-27 07:36:29 Wednesday
-- TOC --
数学本身就是一套非常严谨的符号体系。
本小站所有数学式子,都使用KaTeX渲染!
\(\forall\),\forall
\(\exist\),\exist
\(\iff\),\iff
,if and only if
\(\rightarrow\),\rightarrow
\(\Longrightarrow\),\Longrightarrow
,首字母大写
\(\longrightarrow\),\longrightarrow
,首字母小写
\(\leftarrow\),\leftarrow
\(\Longleftarrow\),\Longleftarrow
,首字母大写
\(\longleftarrow\),\longleftarrow
,首字母小写
\(\nwarrow\nearrow\swarrow\searrow\),,\nwarrow\nearrow\swarrow\searrow\
\(\cdots\),\cdots
\(\ddots\),\ddots
\(\vdots\),\vdots
\(\bar{p}\),\bar{p}
\(\overline{p}\),\overline{p}
\(\vec{E}\), \vec{E}
\(\overleftarrow{E}\),\overleftarrow{E}
\(\overrightarrow{E}\),\overrightarrow{E}
\(\hat{O}\), \hat{O}
\(\tilde{A}\),上波浪线,\tilde{A}
\(\widetilde{A}\),,\widetilde{A}
\(\dot{a}\),上点,\dot{a}
\(\ddot{a}\),,\ddot{a}
\(\sim\),\sim
,\(\not\sim\),\not\sim
\(\equiv\),\equiv
\(\left\lfloor\frac{a}{b}\right\rfloor\),下取整,\left\lfloor\frac{a}{b}\right\rfloor
\(\left\lceil\frac{a}{b}\right\rceil\),上取整,\left\lceil\frac{a}{b}\right\rceil
\(\sum\limits_{i=0}^{n}\),sum,\sum\limits_{i=0}^{n}
,用\limits可以将符号放在上下位置,让公式更好看。
\(\prod\limits_{i=1}^n\),prod,\prod\limits_{i=1}^n
\(\nabla\),表示梯度,\nabla
\(\times\),叉乘,\times
\(\cdot\),点乘,\cdot
\(\div\),除法,\div
\(\sqrt[n]{ab}\),开n次根号,\sqrt[n]{ab}
\(\pm\),正负号,\pm
\(\approx\),约等于,\approx
\(\infty\),无穷,\infty
\(\lim\),极限,\lim
\(\cup\),Union,\cup
\(\cap\),Intersection,\cap
\(\because\),Because,\because
\(\therefore\),Therefore,\therefore
\(\int_a^b\),积分,\int_a^b
\(\iint\),,\iint
\(\bowtie\),,\bowtie
,⟕,⟖,⟗
在LaTex表达式中,直接键入空格是没有效果的。
em
是一个相对长度的单位,最初是指字母M的宽度,故名em(equal m)。现指字符宽度的倍数,用法如:0.8em, 1.2em,2em等。通常1em=16px
!
\(a\qquad b\), a\qquad b
\(a\quad b\), a\quad b
,2em宽度
\(a\ b\), a\ b
,这就是一个转义空格
\(\text{hi, LaTex...!}\),\text{hi, LaTex...!}
,也可以用这种方式嵌入空格,但只能是单空格
\tfrac
\tfrac{2{\cdot}\tfrac{\sin{\tfrac{a}{2}}}{\cos{\tfrac{a}{2}}}}{\tfrac{1}{\cos^2{\tfrac{a}{2}}}}
\(\tfrac{2{\cdot}\tfrac{\sin{\tfrac{a}{2}}}{\cos{\tfrac{a}{2}}}}{\tfrac{1}{\cos^2{\tfrac{a}{2}}}}\)
\frac
\frac{2{\cdot}\frac{\sin{\frac{a}{2}}}{\cos{\frac{a}{2}}}}{\frac{1}{\cos^2{\frac{a}{2}}}}
\(\frac{2{\cdot}\frac{\sin{\frac{a}{2}}}{\cos{\frac{a}{2}}}}{\frac{1}{\cos^2{\frac{a}{2}}}}\)
\cfrac
\cfrac{2{\cdot}\cfrac{\sin{\cfrac{a}{2}}}{\cos{\cfrac{a}{2}}}}{\cfrac{1}{\cos^2{\cfrac{a}{2}}}}
\(\cfrac{2{\cdot}\cfrac{\sin{\cfrac{a}{2}}}{\cos{\cfrac{a}{2}}}}{\cfrac{1}{\cos^2{\cfrac{a}{2}}}}\)
\dfrac
,从效果上看,似乎这个最好!
\dfrac{2{\cdot}\dfrac{\sin{\dfrac{a}{2}}}{\cos{\dfrac{a}{2}}}}{\dfrac{1}{\cos^2{\dfrac{a}{2}}}}
\(\dfrac{2{\cdot}\dfrac{\sin{\dfrac{a}{2}}}{\cos{\dfrac{a}{2}}}}{\dfrac{1}{\cos^2{\dfrac{a}{2}}}}\)
小括号(parentheses):()
方括号(square brackets):[]
尖括号(angle brackets):< >
大括号(curly braces):{ }
\((\frac{1}{3})\)
\([\frac{1}{3}]\)
\(\langle\frac{1}{3}\rangle\)
\(\{\frac{1}{3}\}\)
\((\frac{1}{3})\)
\([\frac{1}{3}]\)
\(\langle\frac{1}{3}\rangle\)
\(\{\frac{1}{3}\}\)
有时在显示分数的时候,需要让括号的高度能够与分数的高度匹配起来,这时就需要用到 \left
和 \right
语法,用这两个语法来分别表示左边和右边的括号:
\(\left(\frac{1}{1+\frac{1}{3}}\right)\)
\(\left[\frac{1}{1+\frac{1}{3}}\right]\)
\(\left\langle\frac{1}{1+\frac{1}{3}}\right\rangle\)
\(\left\{\frac{1}{1+\frac{1}{3}}\right\}\)
\(\left(\frac{1}{1+\frac{1}{3}}\right)\)
\(\left[\frac{1}{1+\frac{1}{3}}\right]\)
\(\left\langle\frac{1}{1+\frac{1}{3}}\right\rangle\)
\(\left\{\frac{1}{1+\frac{1}{3}}\right\}\)
用 \big、\bigg、\Big、\Bigg
可能会更美观。在写单边括号时我个人还喜欢使用 \bigl{ 或 \bigr} 这种。
\(\big\{\frac{1}{1+\frac{1}{3}}\big\}\)
\(\bigg\{\frac{1}{1+\frac{1}{3}}\bigg\}\)
\(\Big\{\frac{1}{1+\frac{1}{3}}\Big\}\)
\(\Bigg\{\frac{1}{1+\frac{1}{3}}\Bigg\}\)
\bigl\{...\bigr\}
\(\big\{\frac{1}{1+\frac{1}{3}}\big\}\)
\(\bigg\{\frac{1}{1+\frac{1}{3}}\bigg\}\)
\(\Big\{\frac{1}{1+\frac{1}{3}}\Big\}\)
\(\Bigg\{\frac{1}{1+\frac{1}{3}}\Bigg\}\)
\(\bigl\{...\bigr\}\)
再来一个猛的:
\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)
\(\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)\)
斜除号就是 /
这个符号,英文叫Forward Slash
,编程语言都使用这个符号来表示除法。
x = a^\frac{1}{2/3}/b
\(x = a^\frac{1}{2/3}/b\)
如何写一个方程组:
\begin{cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\notag \end{cases}
效果如下:
$$\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \notag \end{cases}$$
左边那个大括号是自动加上去的,\\
表示换行。
\sigma'(z) = \begin{cases}
1, & \text{if } z > 0 \\
0, & \text{if } z \le 0 \tag{ABCD} \end{cases}
$$ \sigma'(z) = \begin{cases} 1, & \text{if } z > 0 \\ 0, & \text{if } z \le 0 \tag{ABCD} \end{cases} $$
&
符号用来确定多行表达式对齐的位置。
\text{...}
就是一段文本,中间可以有空格,貌似只有这种方式能够在公式中加空格。
\tag{A}
给整个表达式加上一个tag,这里常用数字tag。
如果想写多行等式,每一行在等号的位置对齐,如下:
\begin{aligned}
f(x)&=(m+n)^{2}\\
&=m^{2}+2mn+n^{2}\\
\tag{3} \end{aligned}
$$\begin{aligned} f(x) &= (m+n)^{2}\nonumber \\ &= m^{2}+2mn+n^{2} \nonumber \\ \end{aligned}$$
这个示例,就不再是\begin{cases},而是\begin{align}。
更多对齐的情况,注意蓝色部分,那不是数字,是字母l和r:
\begin{array}{ll}
z &=&a\\
f(x,y,z)&=&x+y+z
\tag{4} \end{array}
$$\begin{array}{ll} z &=&a\\ f(x,y,z)&=&x+y+z \tag{4} \end{array}$$
\begin{array}{rl}
z &=&a\\
f(x,y,z)&=&x+y+z
\tag{5} \end{array}
$$\begin{array}{rl} z &=&a\\ f(x,y,z)&=&x+y+z \tag{5} \end{array}$$
\begin{array}{lr}
z &=&a\\
f(x,y,z)&=&x+y+z
\tag{6} \end{array}
$$\begin{array}{lr} z &=&a\\ f(x,y,z)&=&x+y+z \tag{6} \end{array}$$
\begin{array}{rr}
z &=&a\\
f(x,y,z)&=&x+y+z
\tag{7} \end{array}
$$\begin{array}{rr} z &=&a\\ f(x,y,z)&=&x+y+z \tag{7} \end{array}$$
列向量:
\begin{bmatrix}
1 \\ 3 \\ 5 \end{bmatrix}
$$\begin{bmatrix} 1 \\ 3 \\ 5 \end{bmatrix}$$
多个列向量就是matrix:
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \end{bmatrix}
$$\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}$$
上面用的都是{bmatrix},还有其它的不同的“括号”:
\begin{pmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \end{pmatrix}
$$\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}$$
\begin{Bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \end{Bmatrix}
$$\begin{Bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{Bmatrix}$$
\begin{vmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \end{vmatrix}
$$\begin{vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{vmatrix}$$
\begin{Vmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \end{Vmatrix}
$$\begin{Vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{Vmatrix}$$
下面是很大的矩阵的写法:
\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_m & a_m^2 & \cdots & a_m^n
\end {pmatrix}
$$\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_m & a_m^2 & \cdots & a_m^n \end{pmatrix}$$
增广矩阵,augmented matrix:
\left [
\begin {array} {cc|c}
1&2&3\\
4&5&6
\end {array}
\right ]
$$\left [ \begin {array} {cc|c} 1&2&3\\ 4&5&6 \end {array} \right ]$$
一个小矩阵:
\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr)
$$\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr)$$
本文链接:https://cs.pynote.net/math/202109091/
-- EOF --
-- MORE --