一、数学公式
1.1 行内公式
直接使用$包围想输入的公式,如$y=x+1$
1.2 行间公式
方法一
使用equation块包围具体的公式,可以先在mathtype上打,然后复制粘贴到latex公式中。如下所示:
\begin{equation}\label{*}
*
\end{equation}
方法二
用两个$$包围行间公式,如果使用这种方法,编号需要手动添加
1.3 常用的希腊字符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
A and \alpha | A AA and α \alphaα | N and \nu | N NN and ν \nuν |
B and \beta | B BB and β \betaβ | \Xi and \xi | Ξ \XiΞ and ξ \xiξ |
\Gamma and \gamma | Γ \GammaΓ and γ \gammaγ | O and o | O OO and o oo |
\Delta and \delta | Δ \DeltaΔ and δ \deltaδ | \Pi , \pi and \varpi | Π \PiΠ, π \piπ and ϖ \varpiϖ |
E , \epsilon and \varepsilon | E EE, ϵ \epsilonϵ and ε \varepsilonε | P , \rho and \varrho | P PP, ρ \rhoρ and ϱ \varrhoϱ |
Z and \zeta | Z ZZ and ζ \zetaζ | \Sigma , \sigma and \varsigma | Σ \SigmaΣ, σ \sigmaσ and ς \varsigmaς |
H and \eta | H HH and η \etaη | T and \tau | T TT and τ \tauτ |
\Theta , \theta and \vartheta | Θ \ThetaΘ, θ \thetaθ and ϑ \varthetaϑ | \Upsilon and \upsilon | Υ \UpsilonΥ and υ \upsilonυ |
I and \iota | I II and ι \iotaι | \Phi , \phi and \varphi | Φ \PhiΦ, ϕ \phiϕ and φ \varphiφ |
K , \kappa and \varkappa | K KK, κ \kappaκ and ϰ \varkappaϰ | X and \chi | X XX and χ \chiχ |
\Lambda and \lambda | Λ \LambdaΛ and λ \lambdaλ | \Psi and \psi | Ψ \PsiΨ and ψ \psiψ |
M and \mu | M MM 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^\circ30∘ | \sin | sin \sinsin |
\cos | cos \coscos | \tan | tan \tantan |
\cot | cot \cotcot | \sec | sec \secsec |
\csc | csc \csccsc |
逻辑运算符
输入 | 符号 | 输入 | 符号 |
---|---|---|---|
\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 \limlim |
\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.0b+c+d2.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\ ba b
四个空格:a\quad b
a b a\quad bab - 尖括号:
\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^2f(x1,x2,…,xn)=x12+x22+⋯+xn2 - 分组
使用{}
将分组内容包包围,例如:
2^10
是2 1 0 2^10210,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 551