一、数学公式
1.1 行内公式
直接使用$包围想输入的公式,如$y=x+1$
1.2 行间公式
方法一
使用equation块包围具体的公式,可以先在mathtype上打,然后复制粘贴到latex公式中。如下所示:
\begin{equation}\label{*}
*
\end{equation}
方法二
用两个$$包围行间公式,如果使用这种方法,编号需要手动添加
1.3 常用的希腊字符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
A and \alpha | A A A and α \alpha α | N and \nu | N N N and ν \nu ν |
B and \beta | B B B and β \beta β | \Xi and \xi | Ξ \Xi Ξ and ξ \xi ξ |
\Gamma and \gamma | Γ \Gamma Γ and γ \gamma γ | O and o | O O O and o o o |
\Delta and \delta | Δ \Delta Δ and δ \delta δ | \Pi , \pi and \varpi | Π \Pi Π, π \pi π and ϖ \varpi ϖ |
E , \epsilon and \varepsilon | E E E, ϵ \epsilon ϵ and ε \varepsilon ε | P , \rho and \varrho | P P P, ρ \rho ρ and ϱ \varrho ϱ |
Z and \zeta | Z Z Z and ζ \zeta ζ | \Sigma , \sigma and \varsigma | Σ \Sigma Σ, σ \sigma σ and ς \varsigma ς |
H and \eta | H H H and η \eta η | T and \tau | T T T and τ \tau τ |
\Theta , \theta and \vartheta | Θ \Theta Θ, θ \theta θ and ϑ \vartheta ϑ | \Upsilon and \upsilon | Υ \Upsilon Υ and υ \upsilon υ |
I and \iota | I I I and ι \iota ι | \Phi , \phi and \varphi | Φ \Phi Φ, ϕ \phi ϕ and φ \varphi φ |
K , \kappa and \varkappa | K K K, κ \kappa κ and ϰ \varkappa ϰ | X and \chi | X X X and χ \chi χ |
\Lambda and \lambda | Λ \Lambda Λ and λ \lambda λ | \Psi and \psi | Ψ \Psi Ψ and ψ \psi ψ |
M and \mu | M M M and μ \mu μ | \Omega and \omega | Ω \Omega Ω and ω \omega ω |
说明:
- 如果需要大写的希腊字母,将首字母大写即可
- 如果需要将字母斜体显示,使用
\var
前缀即可
1.4 运算符表
普通字符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\空格 | 空格 | \$ | $ |
\% | % \% % | \& | & \& & |
\_ | _ \_ _ | \{ | { \{ { |
\} | } \} } |
关系运算符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\pm | ± \pm ± | \times | × \times × |
\div | ÷ \div ÷ | \mid | ∣ \mid ∣ |
\nmid | ∤ \nmid ∤ | \cdot | ⋅ \cdot ⋅ |
\circ | ∘ \circ ∘ | \ast | ∗ \ast ∗ |
\bigodot | ⨀ \bigodot ⨀ | \bigotimes | ⨂ \bigotimes ⨂ |
\bigoplus | ⨁ \bigoplus ⨁ | \leq | ≤ \leq ≤ |
\geq | ≥ \geq ≥ | \neq | ≠ \neq = |
\approx | ≈ \approx ≈ | \equiv | ≡ \equiv ≡ |
\sum | ∑ \sum ∑ | \prod | ∏ \prod ∏ |
集合运算符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\emptyset | ∅ \emptyset ∅ | \in | ∈ \in ∈ |
\notin | ∉ \notin ∈/ | \subset | ⊂ \subset ⊂ |
\supset | ⊃ \supset ⊃ | \subseteq | ⊆ \subseteq ⊆ |
\supseteq | ⊇ \supseteq ⊇ | \bigcap | ⋂ \bigcap ⋂ |
\bigcup | ⋃ \bigcup ⋃ | \bigvee | ⋁ \bigvee ⋁ |
\bigwedge | ⋀ \bigwedge ⋀ | \biguplus | ⨄ \biguplus ⨄ |
\bigsqcup | ⨆ \bigsqcup ⨆ |
对数运算符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\log | log | \lg | Lg |
\ln | Ln |
三角运算符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\bot | ⊥ \bot ⊥ | \angle | ∠ \angle ∠ |
30^\circ | 3 0 ∘ 30^\circ 30∘ | \sin | sin \sin sin |
\cos | cos \cos cos | \tan | tan \tan tan |
\cot | cot \cot cot | \sec | sec \sec sec |
\csc | csc \csc csc |
逻辑运算符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\because | ∵ \because ∵ | \therefore | ∴ \therefore ∴ |
\forall | ∀ \forall ∀ | \exists | ∃ \exists ∃ |
\not= | ≠ \not= = | \not> | ≯ \not> > |
\not< | ≮ \not< < | \not\subset | ⊄ \not\subset ⊂ |
微积分运算符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\prime | ′ \prime ′ | \int | ∫ \int ∫ |
\iint | ∬ \iint ∬ | \iiint | ∭ \iiint ∭ |
\oint | ∮ \oint ∮ | \lim | lim \lim lim |
\infty | ∞ \infty ∞ | \nabla | ∇ \nabla ∇ |
1.5 其他符号
箭头符号
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\uparrow | ↑ \uparrow ↑ | \Uparrow | ⇑ \Uparrow ⇑ |
\downarrow | ↓ \downarrow ↓ | \Downarrow | ⇓ \Downarrow ⇓ |
\rightarrow | → \rightarrow → | \Rightarrow | ⇒ \Rightarrow ⇒ |
\leftarrow | ← \leftarrow ← | \Leftarrow | ⇐ \Leftarrow ⇐ |
\longrightarrow | ⟶ \longrightarrow ⟶ | \Longrightarrow | ⟹ \Longrightarrow ⟹ |
\longleftarrow | ⟵ \longleftarrow ⟵ | \Longleftarrow | ⟸ \Longleftarrow ⟸ |
带帽和连线符号
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\hat{y} | y ^ \hat{y} y^ | \check{y} | y ˇ \check{y} yˇ |
\breve{y} | y ˘ \breve{y} y˘ | \overline{a+b+c+d} | a + b + c + d ‾ \overline{a+b+c+d} a+b+c+d |
\underline{a+b+c+d} | a + b + c + d ‾ \underline{a+b+c+d} a+b+c+d | \overbrace{a+\underbrace{b+c}_{1.0}+d}^{2.0} | a + b + c ⏟ 1.0 + d ⏞ 2.0 \overbrace{a+\underbrace{b+c}_{1.0}+d}^{2.0} a+1.0 b+c+d 2.0 |
二、LaTex技巧
2.1 对齐和缩进
一行文本对齐
\leftline{左对齐}
\centerline{居中}
\rightline{右对齐}
多行文本或段落对齐
- 左对齐
\begin{flushleft}
...
\end{flushleft}
- 居中
\begin{center}
...
\end{center}
- 右对齐
\begin{flushright}
...
\end{flushright}
公式对齐
- 默认居中对齐,改成左对齐如下所示:
\documentclass[a4paper,fleqn]{article}
- 对某行公式进行左对齐
\begin{flalign}
your equation (1)
\end{flalign}
- 对某几行公式进行左对齐
\begin{flalign}
\begin{split}
your equation (1)
your equation (2)
\end{split}
\end{flalign}
- 其他方法
使用aligned、gathered等
2.2 大括号的使用
方法一:
$$ f(x)=\left\{
\begin{aligned}
x & = & \cos(t) \\
y & = & \sin(t) \\
z & = & \frac xy
\end{aligned}
\right.
$$
f
(
x
)
=
{
x
=
cos
(
t
)
y
=
sin
(
t
)
z
=
x
y
f(x)=\left\{ \begin{aligned} x & = & \cos(t) \\ y & = & \sin(t) \\ z & = & \frac xy \end{aligned} \right.
f(x)=⎩⎪⎪⎨⎪⎪⎧xyz===cos(t)sin(t)yx
方法二:
$$ F^{HLLC}=\left\{
\begin{array}{rcl}
F_L & & {0 < S_L}\\
F^*_L & & {S_L \leq 0 < S_M}\\
F^*_R & & {S_M \leq 0 < S_R}\\
F_R & & {S_R \leq 0}
\end{array}
\right.
$$
F
H
L
L
C
=
{
F
L
0
<
S
L
F
L
∗
S
L
≤
0
<
S
M
F
R
∗
S
M
≤
0
<
S
R
F
R
S
R
≤
0
F^{HLLC}=\left\{ \begin{array}{rcl} F_L & & {0 < S_L}\\ F^*_L & & {S_L \leq 0 < S_M}\\ F^*_R & & {S_M \leq 0 < S_R}\\ F_R & & {S_R \leq 0} \end{array} \right.
FHLLC=⎩⎪⎪⎨⎪⎪⎧FLFL∗FR∗FR0<SLSL≤0<SMSM≤0<SRSR≤0
方法三:
\begin{cases}
0& \text{x=0}\\
1& \text{x=1}
\end{cases}
f ( x ) = { 0 x=0 1 x=1 f(x)= \begin{cases} 0& \text{x=0}\\ 1& \text{x=1} \end{cases} f(x)={01x=0x=1
三、矩阵
3.1 基本语法
- 起始标记
\begin{matrix}
,结束标记\end{matrix}
- 每行末尾以
\\
进行换行,行间元素以&
分开进行对齐 - 例子
\begin{matrix}
1&0&0\\
0&1&0\\
0&0&1\\
\end{matrix}
1 0 0 0 1 0 0 0 1 \begin{matrix} 1&0&0\\ 0&1&0\\ 0&0&1\\ \end{matrix} 100010001
3.2 进阶知识
- 设置矩阵边框
pmatrix、bmatrix、Bmatrix:小括号、中括号、大括号边框 - 省略元素
横省略号:\cdots
竖省略号:\vdots
斜省略号:\ddots
- 例子
\begin{bmatrix}
{a_{11}}&{a_{12}}&{\cdots}&{a_{1n}}\\
{a_{21}}&{a_{22}}&{\cdots}&{a_{2n}}\\
{\vdots}&{\vdots}&{\ddots}&{\vdots}\\
{a_{m1}}&{a_{m2}}&{\cdots}&{a_{mn}}\\
\end{bmatrix}
[ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋱ ⋮ a m 1 a m 2 ⋯ a m n ] \begin{bmatrix} {a_{11}}&{a_{12}}&{\cdots}&{a_{1n}}\\ {a_{21}}&{a_{22}}&{\cdots}&{a_{2n}}\\ {\vdots}&{\vdots}&{\ddots}&{\vdots}\\ {a_{m1}}&{a_{m2}}&{\cdots}&{a_{mn}}\\ \end{bmatrix} ⎣⎢⎢⎢⎡a11a21⋮am1a12a22⋮am2⋯⋯⋱⋯a1na2n⋮amn⎦⎥⎥⎥⎤
四、补充内容
- 上标
^
,下标_
- 空格:
单个空格:a\ b
a b a\ b a b
四个空格:a\quad b
a b a\quad b ab - 尖括号:
\langle\rangle
⟨ ⟩ \langle\rangle ⟨⟩ - 使用
\left
和\right
:
(\frac{x}{y})
( x y ) (\frac{x}{y}) (yx)
\left(\frac{x}{y}\right)
( x y ) \left(\frac{x}{y}\right) (yx) - 省略号
\ldots
:与文本底线对齐的省略号
\cdots
:与文本中线对齐的省略号
例如:
f(x_1,x_2,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2
f ( x 1 , x 2 , … , x n ) = x 1 2 + x 2 2 + ⋯ + x n 2 f(x_1,x_2,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 f(x1,x2,…,xn)=x12+x22+⋯+xn2 - 分组
使用{}
将分组内容包包围,例如:
2^10
是 2 1 0 2^10 210,2^{10}
是 2 10 2^{10} 210 - 开根号
\sqrt[n]{3}
是 3 n \sqrt[n]{3} n3 - 分式
\frac{1}{5}
是 1 5 \frac{1}{5} 51
1 \over 5
是 1 5 1 \over 5 51