Underbrace in LaTeX (\underbrace{x+y}_{\text{sum}})
- LaTeX command
\underbrace{x+y}_{\text{sum}}- Package
- Add to your preamble:
\usepackage{amsmath} - Mode
- Math mode only
Where it is used
Puts a curly brace under an expression, with a label set through a subscript beneath it.
Textbooks use \underbrace to explain pieces of an equation, such as marking \underbrace{\frac{1}{2}mv^2}_{\text{kinetic}} in an energy balance or counting terms in a product. The label goes in a subscript right after the command; use \text for words and \scriptstyle content for short math. The brace stretches to the exact width of its argument. Nested or overlapping braces need care: you can underbrace part of an expression that is already overbraced, but braces cannot cross each other. Like \overbrace, it is best in display math.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Underbrace: $\underbrace{x+y}_{\text{sum}}$
\[ E = \underbrace{\tfrac{1}{2} m v^2}_{\text{kinetic}} + mgh \]
\end{document}Related symbols
- Cancel
\cancel{x} - Overbrace
\overbrace{x+y}^{\text{sum}} - Boxed Formula
\boxed{x} - Ring
\mathring{x} - Check
\check{x} - Breve
\breve{x}
Frequently asked questions
- How do I write Underbrace in LaTeX?
- Type \underbrace{x+y}_{\text{sum}} in math mode, for example $E = \underbrace{\tfrac{1}{2} m v^2}_{\text{kinetic}} + mgh$. Load amsmath first with \usepackage{amsmath}.
- Which package do I need for \underbrace{x+y}_{\text{sum}}?
- \underbrace{x+y}_{\text{sum}} needs amsmath: add \usepackage{amsmath} to your preamble before the document starts.
- Can I use \underbrace{x+y}_{\text{sum}} in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\underbrace{x+y}_{\text{sum}}$ in running text.
Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf
Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI
- Gumawa ng magagandang TikZ diagrams gamit ang AI
- Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
- Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers