(click anywhere to close)

[LaTeX] Math Accents

category: Writing | course: LaTeX Math | difficulty:

It’s already been discussed that you can’t use text within a math environment like you normally would – that’s what makes this math mode special. But, there are certain simple elements you can add to characters (or strings of characters), that change its meaning in a very important way, much like accents do to regular text. For example, adding an arrow above a letter magically turns it into a vector! I like to call these math accents, and this chapter provides all of them, ordered by their type

Real Accents

These look the most like accents you’re used to, and are typically used on a single character, to place something above it. They can be used on multiple characters, but some need their wide counterpart to be able to do so properly. If you use the regular command on multiple characters, it simply places the accent in regular size above it, centred.

Regular Command

Wide Command




Adds an arrow from left to right



Adds an arrow from right to left



Adds a hat, or “rooftop”



Adds a tilde, or “wavy line”



Adds a single dot



Adds a double dot



Adds a reverse hat, or check symbol



Adds a breve, or “cup”



Adds an accent acute



Adds an accent grave



Adds a bar, or “overline”

Another very important characteristic of these real accents, is that they can be composed; using multiple after each other simply keeps adding the accents above each other.

    \vec{x} - \overrightarrow{xyz} - \overleftarrow{xyz}\\
    \hat{x} - \widehat{xyz}\\
    \tilde{x} - \widetilde{xyz}\\

One-Argument Commands

These are somewhat like accents, but have no wide counterpart, and can’t all be stacked on top of each other – this ability is only available to overlines and underlines.




Slashes diagonally through the character, used mostly for turning an equal sign into a not-equal sign.


Also slashes diagonally through its argument, but from bottom left to top right. Requires the cancel package.


Adds a line above it


Adds a line underneath it

The first command only accepts single-character arguments.


$\not=  \quad  \cancel{XYZ}  \quad  \overline{XYZ}  \quad  \underline{XYZ}$

Two-Argument Commands

These accept two arguments of arbitrary length, and place the text from one of the arguments above or below the other. They are automatically centred, and the first two have their brace automatically stretched to the correct length.




Places arg2 above arg1, using a brace to group arg1


Places arg2 below arg1, using a brace to group arg1


Places arg1 above arg2


Places arg1 below arg2

    \overbrace{a + \ldots + a}^{n \times a} \\
    \underbrace{a + \ldots + a}_{n \times a} \\
    a \overset{def}{=} b \\
    a \underset{def}{=} b
Do you like my tutorials?
To keep this site running, donate some motivational food!
Chocolate Milk