Math Accents in LaTeX: \hat, \bar, \vec, \tilde and \dot

Each accent carries a specific meaning, the narrow-versus-wide choice depends on how much sits under it, and some base symbols simply refuse the mark.

Maths accents are semantic marks, not decoration: a hat means an estimate, a bar a mean, a dot a time derivative. Two technical facts decide whether they look right — accents do not stretch, and some base symbols refuse the mark entirely. Which mark belongs to which meaning is the territory of Statistics Notation and Vectors; how marks compose with superscripts is Sub & Sup.

Which one to use

Situation Write this Because
An estimate or unit vector
\hat{x}
Narrow and fixed.
A sample mean
\bar{x}
Short bar; \overline for long names.
A time derivative
\dot{x}, \ddot{x}
Physics convention.
A vector arrow
\vec{v}
See vectors for the conventions.
A wide span
\widehat{ABC}, \widetilde{ABC}
Wide variants exist for two marks only.
An accent over a word
\text{}
Marks are for symbols, not prose.

The commands

What Type this Renders as
Hat for estimates Conventionally an estimator or a unit vector; the mark hugs one glyph.
\hat{\theta}
\hat{\theta}
Bar for means Sample average, and also complex conjugate in other fields — context decides.
\bar{x}
\bar{x}
Overline for wider spans A rule across several characters: segment lengths, closures, conjugates.
\overline{AB}
\overline{AB}
Vector arrow Narrow command for one symbol, wide command for a labelled directed segment.
\vec{v} \quad \overrightarrow{PQ}
\vec{v} \quad \overrightarrow{PQ}
Tilde Approximation or transformed object; the wide form when the base is multi-letter.
\tilde{y} \quad \widetilde{MM}
\tilde{y} \quad \widetilde{MM}
Single dot Derivative with respect to time. One dot per derivative, so a second-order needs \ddot.
\dot{x}
\dot{x}
Double dot Angular acceleration and the standard mechanics shorthand.
\ddot{\theta}
\ddot{\theta}
Other marks Rare in maths; check appears mainly in phonetics, grave and acute almost never.
\check{a} \quad \grave{b} \quad \acute{c}
\check{a} \quad \grave{b} \quad \acute{c}
Circle and prime Not accent commands, but they occupy the same visual slot, which is why collisions happen.
^{\circ} \quad f'
^{\circ} \quad f'
Under-placement The mirror family exists for rules below; used for underived labels and certain tensor notations.
\underline{\phantom{abc}}
\underline{\phantom{abc}}

Worked examples

Estimator versus parameter

\hat{p} = \frac{x}{n}, \qquad p = P(X=1)
\hat{p} = \frac{x}{n}, \qquad p = P(X=1)

The hat is doing real work: it separates the quantity you computed from the truth you are estimating.

Kinematics dots

\dot{s} = v, \qquad \ddot{s} = a
\dot{s} = v, \qquad \ddot{s} = a

Newtonian notation for time derivatives, compact enough to survive inside a multi-line derivation.

Accent on a subscripted base

\hat{\beta}_1
\hat{\beta}_1

The accent binds to the symbol, the subscript to the accented whole. Writing \beta_1^{\hat{}} gets the hierarchy backwards.

Wide versus narrow

\hat{\theta} \quad \widehat{\theta \phi}
\hat{\theta} \quad \widehat{\theta \phi}

A small hat over two symbols looks like it belongs to the first one; the wide form spreads the cover.

Common mistakes

  • Stacking two accents on the same symbol, e.g. \bar{\hat{x}}. KaTeX and TeX both shift one mark aside awkwardly; rename the symbol instead.
  • Applying \mathbf{\alpha} thinking it is an accent-adjacent style command. Bold Greek needs \boldsymbol{\alpha}; the plain bold command skips Greek entirely.
  • Using \hat{i} for the imaginary unit. It is a legitimate reading of some texts, but \mathrm{i} avoids colliding with the unit-vector convention.
  • Writing \tilde{a} when you meant a \approx b. The tilde accent marks a modified object; the tilde relation means approximately equal or similar.

Questions about this notation

What is the difference between \hat and \widehat?
Width. \hat places a small circumflex sized for one glyph; \widehat stretches to cover whatever is in the braces. Use the wide form for multi-character bases such as \widehat{ABC}.
Why does my accent float too high?
Because the base already carries something above it, typically a superscript or another accent. LaTeX stacks rather than merges, so drop one of the marks or restructure with a subscript label.
Can I put an accent over a word?
Only with the wide commands, and it rarely reads well. For a labelled rule use \overbrace{\text{word}}^{\text{note}} instead, which is designed for spanning material.
How do I write dot notation for a time derivative?
\dot{x} is the first derivative and \ddot{x} the second; both take exactly one argument and both need maths mode. For a third derivative amsmath provides \dddot{x}, and beyond that x^{\prime\prime\prime} reads better than a fourth dot. Accents over a multi-letter label want the wide forms — \overrightarrow{AB}, \widehat{AB} — because \hat{AB} squeezes a small hat over two letters.

Keep reading

Three ways into the same idea: the notation itself, the lesson that teaches it, and an article that applies it.