# 收尾 · 速查总表与常见坑

> 把整个专栏收拢成一张分类速查表，再列出新手最常踩的十个坑——上下标忘加括号、% 吃掉半行、\bar 与 \overline 混用、sin 不加反斜杠……一次性帮你避开。

- 作者：David（道雾轩）
- 专栏：LaTeX 完全上手指南（https://daiw.org/manual/latex.md）
- 最后更新：2026-10-01
- 原文：https://daiw.org/manual/latex/recap
- 转载与引用：请注明出处并附原文链接（https://daiw.org/about/copyright）

# 收尾 · 速查总表与常见坑

走完前面十七章，LaTeX 数学输入的基本功就齐了。这一章不讲新东西，只做两件事：给你一张**按用途分类的速查表**随时回查，再列一份**新手十大坑**清单帮你避雷。

## 分类速查表

| 类别 | 高频命令 | 详见 |
| --- | --- | --- |
| 模式 | `$...$` 行内、`$$...$$` 行间 | [数学模式](https://daiw.org/manual/latex/math-modes) |
| 上下标 | `x^{2}`、`a_{i}`、`x_i^2` | [上下标](https://daiw.org/manual/latex/superscript-subscript) |
| 希腊字母 | `\alpha \beta \pi \Sigma \Omega` | [希腊字母](https://daiw.org/manual/latex/greek-letters) |
| 字体 | `\mathbb{R} \mathcal{L} \mathbf{x}` | [数学字体](https://daiw.org/manual/latex/math-fonts) |
| 分数根式 | `\frac{a}{b}`、`\sqrt[n]{x}`、`\binom{n}{k}` | [分数根式](https://daiw.org/manual/latex/fractions-roots) |
| 括号 | `\left( \right)`、`\lvert \rvert` | [定界符](https://daiw.org/manual/latex/delimiters) |
| 巨算符 | `\sum_{i=1}^{n}`、`\int_a^b`、`\lim` | [巨算符](https://daiw.org/manual/latex/big-operators) |
| 重音 | `\hat{x} \bar{x} \vec{v} \dot{x}` | [数学重音](https://daiw.org/manual/latex/math-accents) |
| 运算符 | `\times \cdot \cup \cap \oplus \otimes` | [二元运算符](https://daiw.org/manual/latex/binary-operators) |
| 关系符 | `\leq \geq \neq \approx \in \subseteq` | [关系符](https://daiw.org/manual/latex/relations) |
| 箭头 | `\to \mapsto \Rightarrow \xrightarrow{f}` | [箭头](https://daiw.org/manual/latex/arrows) |
| 函数 | `\sin \log \lim \operatorname{...}` | [函数与算子](https://daiw.org/manual/latex/functions-operators) |
| 杂项 | `\infty \partial \nabla \forall \exists` | [杂项符号](https://daiw.org/manual/latex/misc-symbols) |
| 矩阵 | `\begin{pmatrix} a & b \\ c & d \end{pmatrix}` | [矩阵](https://daiw.org/manual/latex/matrices) |
| 多行 | `aligned`、`cases`、`gathered` | [多行公式](https://daiw.org/manual/latex/multiline) |
| 间距 | `\, \quad \! \phantom{}` | [数学间距](https://daiw.org/manual/latex/spacing) |

## 新手十大坑

这十个坑，几乎每个初学者都栽过。记住它们，能省下大量「公式怎么不对」的排查时间。

**① 多字符上下标忘加 `{}`。** `x^10` 得到 $x^10$（只有 1 上天），要 $x^{10}$ 必须写 `x^{10}`。**超过一个字符就打括号。** → [上下标](https://daiw.org/manual/latex/superscript-subscript)

**② `x^y^z` 直接报错。** 连续两个 `^`(double superscript)不允许，得用括号说清层次：`x^{y^z}` 还是 `{x^y}^z`。

**③ `%` 吃掉半行。** `%` 是注释符，后面到行尾全没了。百分号要写 `\%`。查「公式莫名缺一截」先找没转义的 `%`。 → [杂项符号](https://daiw.org/manual/latex/misc-symbols)

**④ 函数名不加反斜杠。** `sin x` 是四个斜体变量连乘 $sin x$，要 $\sin x$ 得写 `\sin x`。所有具名函数都有反斜杠命令。 → [函数与算子](https://daiw.org/manual/latex/functions-operators)

**⑤ `\bar` 与 `\overline` 混用。** `\bar{x}` 是短横盖单字符，`\overline{AB}` 是能伸长的横线盖一串。`\hat` / `\widehat` 同理。 → [数学重音](https://daiw.org/manual/latex/math-accents)

**⑥ 绝对值用裸 `|`。** `|` 左右不分、间距可能不对，绝对值该用配对的 `\lvert x \rvert`、范数用 `\lVert x \rVert`。 → [定界符](https://daiw.org/manual/latex/delimiters)

**⑦ 大括号 `{` `}` 忘了转义。** 它们是分组符，直接写不显示，要可见的花括号得写 `\{` `\}`。

**⑧ 大括号 / 中文直接塞进公式。** 数学模式里字母是变量、空格被忽略，插入的自然语言要用 `\text{...}` 包起来，否则汉字被当变量连乘、间距全乱。 → [数学模式](https://daiw.org/manual/latex/math-modes)

**⑨ `\left` 和 `\right` 不成对。** 它俩必须一一配对（单边不显示的那侧用 `\left.` / `\right.` 占位），少一个就报错。 → [定界符](https://daiw.org/manual/latex/delimiters)

**⑩ 本站 / 在线环境用 `align` 不成。** KaTeX 及多数 Markdown 环境里，多行公式要放进 `$$...$$` 并用 `aligned`（带 `-ed`），不是顶层 `align`；`gather` 同理写 `gathered`。 → [多行公式](https://daiw.org/manual/latex/multiline)

<Callout type="info">
  再补一个**本站（以及 MDX / Notion 这类平台）特有**的坑：正文标题里如果直接写带花括号的命令（比如把 `\frac{a}{b}` 写进一个标题），`{}` 可能被平台当成**代码 / 表达式**解析而报错。在这类平台里，正文中的 LaTeX 命令**记得用行内代码反引号包起来**。纯 LaTeX 文档里没这个问题——这是「借 Markdown 平台写数学」时才有的差异。
</Callout>

## 结语

这个专栏的目标，从一开始就不是「速成」，而是**把最基础、最通用的数学输入基本功打扎实**：一类符号一篇，命令在左、效果在右，连 `^` 和 `_` 这种「一看就会」的东西也掰开揉碎。因为真正卡住人的，恰恰是这些不起眼的细节。

现在，几百个数学符号在你眼里应该不再是「一堆反斜杠」，而是**十几套有章可循的模式**：希腊字母是读音、上下标是 `^_` 加括号、字体是语义、多行是 `&` 和 `\\`。剩下的，就是**多写**——把这张速查表放在手边，遇到不会的就查、查了就用，用几次就成了肌肉记忆。

祝你从此和 LaTeX 数学公式，处成朋友。

## 参考文献

- [1] Overleaf.「Learn LaTeX in 30 minutes / Mathematical expressions.」https://www.overleaf.com/learn —— 本专栏的主要参考。
- [2] KaTeX.「Supported Functions & Support Table.」https://katex.org/docs/supported.html —— 本站渲染所依据的完整命令表。
- [3] 「The Comprehensive LaTeX Symbol List(Pakin).」https://ctan.org/pkg/comprehensive —— 想查更冷僻符号时的完备清单（数千个符号）。
