# 数学重音 · 帽子、箭头与横线

> 估计值 \hat y、向量 \vec v、均值 \bar x、导数 \dot x——给字母戴上帽子、箭头、横线，是数学记号的日常。这一章分清「单字符版」和「加宽版」：\hat 与 \widehat、\bar 与 \overline、\vec 与 \overrightarrow。

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

# 数学重音 · 帽子、箭头与横线

数学里到处是「戴帽子的字母」：统计估计量 $\hat{\theta}$、单位向量 $\hat{\imath}$、平均值 $\bar{x}$、时间导数 $\dot{x}$、位移向量 $\vec{v}$。这些叫**数学重音(math accent)**。它们分两类：**给单个字符戴的**，和**能横跨一串符号加宽的**——分清这两类，是本章的关键。

## 单字符重音

戴在**一个字符**头上，尺寸固定。最常用的一批：

| 命令 | 效果 | 常见用途 |
| --- | --- | --- |
| `\hat{x}` | $\hat{x}$ | 估计值、单位向量 |
| `\bar{x}` | $\bar{x}$ | 平均值、闭包、共轭 |
| `\vec{v}` | $\vec{v}$ | 向量 |
| `\dot{x}` | $\dot{x}$ | 一阶时间导数 |
| `\ddot{x}` | $\ddot{x}$ | 二阶时间导数 |
| `\tilde{f}` | $\tilde{f}$ | 近似、傅里叶变换 |
| `\check{s}` | $\check{s}$ | háček |
| `\breve{a}` | $\breve{a}$ | 短音 |
| `\acute{e}` | $\acute{e}$ | 尖音 |
| `\grave{e}` | $\grave{e}$ | 钝音 |
| `\mathring{a}` | $\mathring{a}$ | 上圈 |

物理里的**点导数**特别常见：$\dot{x}$ 是速度、$\ddot{x}$ 是加速度（牛顿记法），`\dot{x}`、`\ddot{x}` 一敲就出来，比写 `\frac{dx}{dt}` 利落。

<Callout type="info">
  给 **i、j 戴帽子**别忘了用**无点版** `\imath` / `\jmath`（见 [拉丁字母一章](https://daiw.org/manual/latex/latin-accents)）：`\hat{\imath}` → $\hat{\imath}$ 比 `\hat{i}` → $\hat{i}$ 干净——后者帽子和字母的点会「打架」。物理单位向量 $\hat{\imath}, \hat{\jmath}, \hat{k}$ 就该这么写。
</Callout>

## 加宽重音：罩住一串符号

单字符版罩不住多个字符——`\hat{AB}` 的帽子太小、不好看。要罩住**一串**，用**加宽版**，它们会**自动变长**：

| 单字符版 | 加宽版 | 效果对比 |
| --- | --- | --- |
| `\hat{x}` → $\hat{x}$ | `\widehat{ABC}` | $\widehat{ABC}$ |
| `\tilde{x}` → $\tilde{x}$ | `\widetilde{ABC}` | $\widetilde{ABC}$ |
| `\bar{x}` → $\bar{x}$ | `\overline{ABC}` | $\overline{ABC}$ |
| — | `\underline{ABC}` | $\underline{ABC}$ |

<Callout type="warn">
  **别混用：`\bar` 和 `\overline` 不一样。** `\bar{x}` 是一条**短横**、盖在单个字符上($\bar{x}$)；`\overline{x}` 是一条**能伸长**的横线（$\overline{x}$、$\overline{AB}$）。单个字母的平均值用 `\bar`，要盖住一串（如复共轭 $\overline{z_1 z_2}$、集合闭包 $\overline{A \cup B}$）用 `\overline`。`\hat` 与 `\widehat` 同理。**记混了，横线要么太短要么盖不全。**
</Callout>

## 向量箭头：\vec 与 \overrightarrow

向量记号也分两种：

- **`\vec{v}`**：单字符上的小箭头，$\vec{v}$——最常用。
- **`\overrightarrow{AB}`**：能罩住一串的长箭头，专门写「从 A 到 B 的向量」$\overrightarrow{AB}$。

| 命令 | 效果 |
| --- | --- |
| `\vec{v}` | $\vec{v}$ |
| `\overrightarrow{AB}` | $\overrightarrow{AB}$ |
| `\overleftarrow{AB}` | $\overleftarrow{AB}$ |
| `\overleftrightarrow{AB}` | $\overleftrightarrow{AB}$ |

几何里「向量 $\overrightarrow{AB}$」必须用 `\overrightarrow`（长箭头指明方向和端点）；物理里抽象的「向量 $\vec{v}$」用 `\vec` 就好。

## 花括号标注：\overbrace 与 \underbrace

想给一串式子**打括号 + 加说明**（常用于推导里标注「这一坨等于什么」），用 `\overbrace`（上）/ `\underbrace`（下），再配上下标写说明：

```latex
$$ \underbrace{1 + 2 + \cdots + n}_{\text{共 } n \text{ 项}} = \frac{n(n+1)}{2} $$
```

$$ \underbrace{1 + 2 + \cdots + n}_{\text{共 } n \text{ 项}} = \frac{n(n+1)}{2} $$

```latex
$$ \overbrace{a + a + \cdots + a}^{n \text{ 个}} = na $$
```

$$ \overbrace{a + a + \cdots + a}^{n \text{ 个}} = na $$

说明文字记得用 `\text{}` 包住（否则汉字被当变量，见 [数学模式](https://daiw.org/manual/latex/math-modes)）。这对命令在讲解性的推导里极其好用。

## 小结与下一章

数学重音的关键是**分清宽窄**：单字符戴 `\hat` `\bar` `\vec` `\dot`，一串符号上罩 `\widehat` `\overline` `\overrightarrow`；标注推导用 `\overbrace` / `\underbrace`。再记住 i、j 戴帽用无点版——这块就扎实了。

常用构造这一站（分数、根式、括号、巨算符、重音）走完，公式的「骨架」齐了。下一站转向**符号词典**：按用途分类，把二元运算符、关系符、箭头、函数、杂项符号一类一类查全。先从最基础的**二元运算符**开始。👉 [二元运算符：加减乘除之外](https://daiw.org/manual/latex/binary-operators)。

## 参考文献

- [1] Overleaf.「Mathematical expressions — accents.」https://www.overleaf.com/learn/latex/Mathematical_expressions —— 数学重音命令。
- [2] KaTeX.「Supported Functions — Accents / Overlap and Spacing.」https://katex.org/docs/supported.html#accents —— 本站可用重音与 `\overbrace` 等。
