文章目录
为美赛做个准备吧,正好把latex一些用法整理一下。
以tex live为准。
字体
罗马字体 \mathrm{}
for i in range(97, 123):
print('$\\mathrm{{{0}}}$'.format(chr(i)))
$\mathrm{*}$
for i in range(65, 91):
print('$\\mathrm{{{0}}}$'.format(chr(i)))
$\mathrm{*}$
斜体 \mathit{}
$\mathit{*}$
for i in range(97, 123):
print('$\\mathit{{{0}}}$'.format(chr(i)))
for i in range(65, 91):
print('$\\mathit{{{0}}}$'.format(chr(i)))
粗体 \mathbf{}
$\mathbf{*}$
for i in range(97, 123):
print('$\\mathbf{{{0}}}$'.format(chr(i)))
for i in range(65, 91):
print('$\\mathbf{{{0}}}$'.format(chr(i)))
无衬线-f \mathsf{}
$\mathsf{*}$
for i in range(97, 123):
print('$\\mathsf{{{0}}}$'.format(chr(i)))
for i in range(65, 91):
print('$\\mathsf{{{0}}}$'.format(chr(i)))
打字机字体 \mathtt{}
$\mathtt{*}$
for i in range(97, 123):
print('$\\mathtt{{{0}}}$'.format(chr(i)))
for i in range(65, 91):
print('$\\mathtt{{{0}}}$'.format(chr(i)))
书法字体 \mathcal{}
$\mathcal{*}$
for i in range(65, 91):
print('$\\mathcal{{{0}}}$'.format(chr(i)))
注:小写字母貌似没有
黑板粗体 \mathbb{} \usepackage{amssymb}
$\mathbb{*}$
for i in range(65, 91):
print('$\\mathbb{{{0}}}$'.format(chr(i)))
注: 小写字母貌似没有
德文尖角体 \mathfrak{} \usepackage{amssymb}
$\mathfrak{*}$
for i in range(97, 123):
print('$\\mathfrak{{{0}}}$'.format(chr(i)))
for i in range(65, 91):
print('$\\mathfrak{{{0}}}$'.format(chr(i)))
花体 \mathscr{} \usepackage{mathrsfs}
$\mathscr{}$
for i in range(65, 91):
print('$\\mathscr{{{0}}}$'.format(chr(i)))
注:小写貌似没有
数学符号表(摘自《140分钟学会LaTex》)
数学模式重音符号(头顶上的那玩意)
希腊字母
二元关系
$\not\in$
̸ ∈ \not\in ̸∈
二元运算符
“大”运算符
箭头
定界符
大定界符
其他符号(AMS的符号就不贴了)
一些数学公式写法的例子
$\mathbf{Var}[(CR)_{ij}] = \mathop{\sum}\limits_{t=1}^{c}\mathbf{Var}[X_t]
=\mathop{\sum}\limits_{k=1}^{n}\frac{A_{ik}^{2}B_{kj}^{2}}{cp_k}
-\frac{1}{c}(AB)_{ij}^2$
V a r [ ( C R ) i j ] = ∑ t = 1 c V a r [ X t ] = ∑ k = 1 n A i k 2 B k j 2 c p k − 1 c ( A B ) i j 2 \mathbf{Var}[(CR)_{ij}] = \mathop{\sum}\limits_{t=1}^{c}\mathbf{Var}[X_t] =\mathop{\sum}\limits_{k=1}^{n}\frac{A_{ik}^{2}B_{kj}^{2}}{cp_k} -\frac{1}{c}(AB)_{ij}^2 Var[(CR)ij]=t=1∑cVar[Xt]=k=1∑ncpkAik2Bkj2−c1(AB)ij2
\begin{displaymath}
\begin{array}{ll}
\min & E[\|AB-CR\|_F^2]\\
s.t. & \mathop{\sum}\limits_{i=1}^{n}p_i = 1
\end{array}
\end{displaymath}
min E [ ∥ A B − C R ∥ F 2 ] s . t . ∑ i = 1 n p i = 1 \begin{array}{ll} \min & E[\|AB-CR\|_F^2]\\ s.t. & \mathop{\sum}\limits_{i=1}^{n}p_i = 1 \end{array} mins.t.E[∥AB−CR∥F2]i=1∑npi=1
\[ #\usepackage{amssymb, amsmath}
\begin{split}
x_k = & x_{k-1} + \gamma_k[A_kx_{k-1}-(x_{k-1}^{\top}A_kx_{k-1})x_{k-1}]\\
=& x_{k-1} + \gamma_k[Ax_{k-1}-(x_{k-1}^{\mathrm{T}}Ax_{k-1})x_{k-1}]\\
&+\gamma_k[(A_k-A)x_{k-1}-(x_{k-1}^{\top}(A_k-A)x_{k-1})x_{k-1}
\end{split}
\]
\begin{equation} \label{eq:1}
\frac{\mathrm{d}\|z\|_2^{2}}{\mathrm{d}t} = 2z\frac{\mathrm{d}z}{\mathrm{d}t} = 0
\end{equation}
#\ref{eq:1}引用
$\underbrace{a+b+\cdots+z}_{26}$
a + b + ⋯ + z ⎵ 26 \underbrace{a+b+\cdots+z}_{26} 26 a+b+⋯+z
\begin{displaymath}
\mathbf{X} =
\left( \begin{array}{ccc}
x_{11} & x_{12} & \ldots \\
x_{21} & x_{22} & \ldots \\
\vdots & \vdots & \ddots
\end{array} \right)
\end{displaymath}
\begin{displaymath}
y = \left\{ \begin{array}{ll}
a & \textrm{if $d>c$}\\
b+x & \textrm{in the morning}\\
l & \textrm{all day long}
\end{array} \right.
\end{displaymath}
y = { a if d > c b + x in the morning l all day long y = \left\{ \begin{array}{ll} a & \textrm{if $d>c$}\\ b+x & \textrm{in the morning}\\ l & \textrm{all day long} \end{array} \right. y=⎩⎨⎧ab+xlif d>cin the morningall day long
\begin{displaymath}
\left(\begin{array}{c|c}
1 & 2 \\
\hline
3 & 4
\end{array}\right)
\end{displaymath}
( 1 2 3 4 ) \left(\begin{array}{c|c} 1 & 2 \\ \hline 3 & 4 \end{array}\right) (1324)
\begin{displaymath}
{}^{12}_{\phantom{1}6}\textrm{C}
\qquad \textrm{versus} \qquad
{}^{12}_{6}\textrm{C}
\end{displaymath}
1 6 12 C versus 6 12 C {}^{12}_{\phantom{1}6}\textrm{C} \qquad \textrm{versus} \qquad {}^{12}_{6}\textrm{C} 1612Cversus612C
\begin{displaymath}
\frac{\mathrm{d}f}{\mathrm{d}\theta}=
\mathrm{(\cos \theta, -\sin \theta)}
\left(\begin{array}{cc}
\mathrm{x_1^T}\\
\mathrm{x_2^T}
\end{array} \right)
\mathrm{A}
\mathrm{(x_1, x_2)}
\left(\begin{array}{cc}
\sin \theta\\
\cos \theta
\end{array} \right)
\end{displaymath}