LaTeX 文档结构:\documentclass 定义类型,\usepackage 加载宏包,$...$ 行内公式,$$...$$ 独立公式。
文档结构
1
2
3
4
5
| \documentclass{article} % 文档类型
\usepackage{amsmath} % 宏包
\begin{document}
正文内容
\end{document}
|
文本格式
| 命令 | 效果 |
|---|
\textbf{} | 加粗 |
\textit{} | 斜体 |
\underline{} | 下划线 |
章节层级
1
2
3
| \section{一级}
\subsection{二级}
\subsubsection{三级}
|
数学公式
行内:$a + b = c$
独立:
1
2
3
4
| $$E = mc^2$$
\begin{equation}
\int_a^b f(x) dx
\end{equation}
|
常用语法
| 功能 | 语法 | 效果 |
|---|
| 上标 | x^2 | $x^2$ |
| 下标 | a_i | $a_i$ |
| 分式 | \frac{a}{b} | $\frac{a}{b}$ |
| 根号 | \sqrt{x} | $\sqrt{x}$ |
| 求和 | \sum_{i=1}^n | $\sum_{i=1}^n$ |
| 积分 | \int_a^b | $\int_a^b$ |
| 极限 | \lim_{x \to 0} | $\lim_{x \to 0}$ |
集合符号
| 符号 | 命令 |
|---|
| $\in$ | \in |
| $\notin$ | \notin |
| $\subseteq$ | \subseteq |
| $\cup$ | \cup |
| $\cap$ | \cap |
| $\emptyset$ | \emptyset |
| $\forall$ | \forall |
| $\exists$ | \exists |
数集
| 符号 | 含义 |
|---|
| $\mathbb{N}$ | 自然数 |
| $\mathbb{Z}$ | 整数 |
| $\mathbb{Q}$ | 有理数 |
| $\mathbb{R}$ | 实数 |
| $\mathbb{C}$ | 复数 |
矩阵
1
2
| \begin{pmatrix} a & b \\ c & d \end{pmatrix}
\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}
|
概率统计
| 符号 | 命令 |
|---|
| $P(A)$ | P(A) |
| $\mathbb{E}[X]$ | \mathbb{E}[X] |
| $\mathrm{Var}(X)$ | \mathrm{Var}(X) |
| $X \sim N(\mu, \sigma^2)$ | X \sim N(\mu, \sigma^2) |
必备宏包
1
| \usepackage{amsmath, amssymb, mathtools}
|
Comments