Skip to content

Math accents in LaTeX

In math mode, write the accent command with the letter in braces: \hat{x} gives x̂, \bar{x} gives x̄, \vec{v} an arrow and \dot{x} a dot; \widehat and \overline stretch over several letters.

Accents on one letter

Accent commands take one argument, the thing to decorate. They keep the letter's spacing, so \hat{x} takes the same room as x.

Common accents

\hat{x} \quad \bar{x} \quad \tilde{n} \quad \vec{v} \quad \dot{x} \quad \ddot{x}
\quad \acute{a} \quad \grave{a} \quad \check{a} \quad \breve{a} \quad \mathring{a}

On an i or a j, use the dotless letters \imath and \jmath, so the accent does not sit on a dot: \hat{\imath}.

Wide accents, lines and braces

\widehat, \widetilde, \overline and \underline stretch over their whole argument. \overrightarrow draws a vector arrow over two points. \overbrace and \underbrace take a label with ^ or _.

Accents that stretch

\widehat{ABC} \qquad \widetilde{xyz} \qquad \overline{z + w} \qquad \underline{44}
\qquad \overrightarrow{PQ} \qquad
\underbrace{a + \cdots + a}_{n \text{ times}} = \overbrace{n a}^{\text{product}}
Rendered by Scissor LaTeX: Accents that stretch

Strike-through and boxes

\cancel, \bcancel and \xcancel from the cancel package strike a term through, which is handy for showing what cancels. \boxed from amsmath frames a result. \cancel draws a stroke up to the right and \bcancel one down to the right. \xcancel should draw both strokes as a cross, but Scissor LaTeX currently draws a single stroke, like \cancel.

Cancelling terms and boxing the result

LaTeXPreamble: \usepackage{cancel}Open in editor (opens in a new tab)
\frac{\cancel{3} \cdot 44}{\cancel{3}} = \boxed{44} \qquad \bcancel{x} \quad \xcancel{y}

All accents

Click a copy button to copy the command.

  • \not
  • \cancel
  • \xcancel
  • \bcancel
  • \sout
  • \grave
  • \acute
  • \hat
  • \widehat
  • \tilde
  • \widetilde
  • \bar
  • \breve
  • \dot
  • \ddot
  • \dddot
  • \ddddot
  • \H
  • \check
  • \widecheck
  • \u
  • \v
  • \r
  • \vec
  • \overrightarrow
  • \overleftarrow
  • \overline
  • \underline
  • \overbrace
  • \underbrace
  • \overbracket
  • \underbracket
  • \boxed

\overline and \underline work, as the example above shows, but they are missing from the grid. \H, \u, \v and \r in the grid are the math forms of the text accents ő, ă, č and å.

Questions and answers

What is the difference between \bar and \overline?

\bar is a short accent for one letter, x̄. \overline draws a line over its whole argument, so use it for more than one letter, as in the complex conjugate of z + w.

How do I write a vector with an arrow in LaTeX?

Use \vec{v} for a single letter and \overrightarrow{AB} for two or more. Many texts write vectors in bold instead: \mathbf{v}.

How do I write a dot for a time derivative?

\dot{x} gives one dot, \ddot{x} two, and \dddot{x} three.

Every example on this page is typeset by Scissor LaTeX when the site is built. Last updated 2026-11-06.