Skip to main content
v2026.11,986 entries · CC-BY 4.0

LaTeX Under Text: Underline, Underbrace and Underset

Which LaTeX command puts text under text or math: uline, underline, underbrace or underset, with a table matching each to its job.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

Short answer. “LaTeX under text” can mean four different jobs, and each has its own command: \uline{text} (ulem package) underlines ordinary text, \underline{math} underlines a formula, \underbrace{math}_{label} puts a brace and a label beneath a formula, and \underset{below}{base} (amsmath) places one symbol under another. Pick the command by the job, using the table below.

What it is used for in research

Researchers reach for these commands when typesetting manuscripts, theses and problem sets: underlining a defined term in a draft, annotating a term in an equation with a brace and a note, or setting a limit or condition under an operator. The same page is also a map for readers who searched the phrase without knowing which of the four meanings they need.

Which command for which job

Job Command Comes from Worth knowing
Underline ordinary text \uline{important} ulem package Underlined text can stretch between words and break across lines.
Underline a formula $\underline{x+y}$ LaTeX kernel The line is always completely below the content, so it sits lower under y than under x.
Brace and label under a formula $\underbrace{1/3+1/4}_{>1/2}$ LaTeX kernel The label is attached as a subscript.
One symbol under another \underset{below}{base} amsmath package Works for a relation or any other symbol.
Several lines under an operator \substack amsmath package Multiline subscripts and superscripts, for example under a sum.

Install or access

\underline and \underbrace are part of LaTeX itself, so they need no package. The other commands come from packages hosted on CTAN, the Comprehensive TeX Archive Network: ulem for text underlining, amsmath for \underset and \substack, and optionally mathtools for under-brackets. Load them in the preamble with \usepackage{ulem}, \usepackage{amsmath} and \usepackage{mathtools}. For working in a shared project, see LaTeX and Overleaf for collaborative writing for working in a shared project.

Step-by-step

1. Underline text (ulem)

  1. Add \usepackage{ulem} to the preamble.
  2. Wrap the words: \uline{important}.
  3. For other line styles use \uuline (double), \uwave (wavy), \dashuline (dashed) or \dotuline (dotted).

The ulem documentation (2019/11/18) notes that \uline leaves the original \underline available for math mode. By default ulem also turns \emph and \em text into underlining; to keep italic emphasis, load it as \usepackage[normalem]{ulem} or switch back with \normalem. The same package supplies strikeout; see crossing out text in LaTeX.

For a blank line to write on (a signature or placeholder), the LaTeX reference points to \hrulefill and \dotfill rather than underlining. See also horizontal lines in LaTeX.

2. Underline a formula

Write $\underline{x+y}$. Because the line accounts for descenders, $(\underline{y})$ is drawn lower than $(\underline{x})$. The LaTeX reference describes \underline as robust since about 2019 and fragile before that. For the line above a formula instead, see overline in LaTeX.

3. Put a brace and label under a formula (underbrace)

Write $\underbrace{1/3+1/4}_{>1/2}$. The brace goes under the math and the text after the underscore becomes the label. The reference’s own example is $(1-\underbrace{1/2)+(1/2}-1/3)$. A superscript on \underbrace is set on top of the expression and can look unconnected to it. For over-braces use \overbrace{x+x+\cdots+x}^{\mbox{$k$ times}}. The mathtools package (on CTAN) adds \overbracket and \underbracket and improved braces if the standard shape does not suit.

4. Put one symbol under another (underset)

The amsmath User’s Guide (v2.1, section 4.10, “Affixing symbols to other symbols”) says LaTeX provides \stackrel for a superscript above a binary relation, while amsmath’s \overset and \underset place one symbol above or below another symbol, whether it is a relation or something else. \overset{*}{X} puts a superscript-size * above X, and \underset is the analogue underneath. \overunderset takes three arguments (above, below, same base).

5. Stack lines under an operator (substack)

amsmath’s \substack builds multiline subscripts and superscripts, for example several conditions under a summation. For limits on a limit operator, see the lim command in LaTeX. For accents above a letter, see vectors in LaTeX.

Output and how to read it

  • Text underline: a continuous line beneath the words; it may span line breaks.
  • Math underline: a single line beneath the whole formula, positioned below the lowest descender in it.
  • Underbrace: a brace beneath the formula with the label attached below it.
  • Underset: the first argument is placed below the base symbol given in the second.

Troubleshooting

  • Italic emphasis turned into underlines: ulem redefines \emph; load \usepackage[normalem]{ulem} or use \normalem.
  • Underlined text will not wrap: ordinary \underline text cannot break across lines; use \uline from ulem for text that must break across lines.
  • Uneven underlines in a formula: expected, since the line follows descenders; the same line under x and y sits at different heights.
  • Undefined control sequence for \underset: amsmath is not loaded.
  • Brace label looks detached: put the label in the subscript (_{...}), not a superscript.

Free alternatives

Need Option Package
Text underline without ulem \hrulefill, \dotfill for fill-in lines LaTeX kernel
Square-edged brackets under math \underbracket mathtools
Symbol under symbol \underset amsmath

All of these packages are distributed on CTAN.

FAQ

How do I underline text in LaTeX?

Load the ulem package and write \uline{text}. It allows line breaks, unlike \underline.

How do I put text under a math expression?

Use \underbrace{expression}_{text} for a brace and label, or \underset{text}{expression} from amsmath for the text alone.

Why did emph start underlining after I loaded ulem?

ulem’s default behaviour; use the \normalem option.

Sources

  • LaTeX2e unofficial reference manual (June 2026), section 16.5, “Over- or under math”: latexref.xyz, read 2026-11-08.
  • amsmath User’s Guide v2.1, section 4.10 (CTAN): amsldoc.pdf, read 2026-11-08.
  • ulem package documentation, Donald Arseneau, 2019/11/18: ulem.pdf, read 2026-11-08.
  • mathtools on CTAN: ctan.org/pkg/mathtools.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about LaTeX Under Text: Underline, Underbrace and Underset

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →