字体

\mathbf ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

\mathcal ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

\mathfrak ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

\matksf ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

\mathbb ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

\mathtt ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

\mathit ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\mathit{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

\boldsymbol ABCDEFGHIJKLMNOPQRSTUVWXYZabc123\boldsymbol{ABCDEFGHIJKLMNOPQRSTUVWXYZabc123}

数学符号

矩阵

以黑塞矩阵为例:

H(f)=[2fx122fx1x22fx1xn2fx2x12fx222fx2xn2fxnx12fxnx22fxnxn]H(f) = \left[\begin{matrix} \frac{\partial^2 f}{\partial x_1^2} & \frac{\partial^2 f}{\partial x_1 \partial x_2} & \dots & \frac{\partial^2 f}{\partial x_1 \partial x_n} \\ \frac{\partial^2 f}{\partial x_2 \partial x_1} & \frac{\partial^2 f}{\partial x_2^2} & \dots & \frac{\partial^2 f}{\partial x_2 \partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial^2 f}{\partial x_n \partial x_1} & \frac{\partial^2 f}{\partial x_n \partial x_2} & \dots & \frac{\partial^2 f}{\partial x_n \partial x_n} \\ \end{matrix} \right]

\dots \dots \vdots \vdots \ddots \ddots \cdots \cdots

偏导符号 \partial \partial

梯度符号 \nabla f\nabla f

矩阵\begin{matrix} \dots \begin{end}, 要记得使用\left \right, 否则括号会很小

1
2
3
4
\left[\begin{matrix}

\end{matrix}
\right]

也可以这么写

1
2
3
4
5
\begin{bmatrix}
0&1&2\\
3&4&5\\
6&7&8\\
\end{bmatrix}

[012345678]\begin{bmatrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{bmatrix}

符号

数学符号

加减号 \pm ±\pm

根号 \sqrt a\sqrt{a}

双竖线 \| a\|a\|

上折线 \hat a^\hat{a}

上波浪线 \tilde a~\tilde{a}

波浪号 \sim \sim

取并集 \cup \cup

取交集 \cap \cap

空集 \emptyset \emptyset

连加 \sum \sum

连乘 \prod \prod

积分 \int \int

偏导 \partial \partial

异或 \otimes \otimes

同或 \odot \odot

相关于 \propto \propto

矩阵concat \otimes \oplus

无限 \infty

向下取整 \lfloor \rfloor \lfloor \rfloor

向上取整 \lceil \rceil \lceil \rceil

圆圈 \circ \circ

圆圈1 \textcircled1 \textcircled1

恒等于 \equiv \equiv

约等于 \simeq \simeq

希腊符号

μ\mu \mu

ϵ\epsilon \epsilon

δ\delta \delta

ξ\xi \xi

Λ\Lambda \Lambda

其他符号

\star \star

\bigstar \bigstar

多行公式

& 表示分隔, \\ 表示换行

公式下括号

\underbrace

A=kjg(j,kp(skx))tsentence relevanceA = \underbrace{\frac{\sum_{k\neq j}g(\boldsymbol{j}, \boldsymbol{k}p(\boldsymbol{s}_k|\boldsymbol{x}))}{t}}_{\text{sentence relevance}}

等号对齐

KPI=(N+S)WPI=N+SI=W\begin{aligned} KPI&=(N+S)W \\ PI&=N+S \\ I&=W \end{aligned} \\

loss=(yiQ(s,a;θ))2=(r+γmaxQ(s,a;θ)Q(s,a;θ))2\begin{aligned} loss&=(y_i-Q(s,a;\theta))^2 \\ &=(r+\gamma \max Q(s^{'},a^{'};\theta^{-})-Q(s,a;\theta)) ^2\\ \end{aligned}

1
2
3
4
5
$$\begin{aligned}
KPI&=(N+S)W \\
PI&=N+S \\
I&=W
\end{aligned}$$

中括号/大括号

无括号

012345678\begin{matrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{matrix}

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

中括号

[012345678] \begin{bmatrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{bmatrix}

1
2
3
4
5
6
7
$$
\begin{bmatrix}
0&1&2\\
3&4&5\\
6&7&8\\
\end{bmatrix}
$$

大括号

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

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

竖线 (行列式)

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

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

双竖线

012345678 \begin{Vmatrix} 0&1&2\\ 3&4&5\\ 6&7&8\\ \end{Vmatrix}

1
2
3
4
5
6
7
$$
\begin{Vmatrix}
0&1&2\\
3&4&5\\
6&7&8\\
\end{Vmatrix}
$$

分段函数

f(x)={2x,x>03x,x0f(x) = \begin{cases} 2x,\,\,x>0\\ 3x,\,\,x\le0\\ \end{cases}

1
2
3
4
5
6
7
$$
f(x) =
\begin{cases}
2x,\,\,x>0\\
3x,\,\,x\le0\\
\end{cases}
$$