Over- and Underlining

LaTeX provides commands for making overlines or underlines, or putting braces over or under some material.


Underline text. Works inside math mode, and outside. The line is always completely below the text, taking account of descenders, so in \(\underline{y}\) the line is lower than in \(\underline{x}\). This command is fragile (see \protect).

Note that the package ulem does text mode underlining and allows line breaking as well as a number of other features. See the documentation on CTAN. See also \hrulefill & \dotfill for producing a line, for such things as a signature.


Put a horizontal line over text. Works inside math mode, and outside. For example, \overline{x+y}. Note that this differs from the command \bar (see Math accents).


Put a brace under math. For example, this (1-\underbrace{1/2)+(1/2}-1/3) emphasizes the telescoping part. Attach text to the brace by using subscript, _, or superscript, ^, as here.


The superscript appears on top of the expression, and so can look unconnected to the underbrace.


Put a brace over math, as with \overbrace{x+x+\cdots+x}^{\mbox{\(k\) times}}. See also \underbrace.

The package mathtools adds an over- and underbrace, as well as some improvements on the braces. See the documentation on CTAN.

© 2007–2018 Karl Berry
Public Domain Software