logo

Brace terms in Tex 📂Writing

Brace terms in Tex

Code

In TeX, when indicating the number of terms, the \overbrace and \underbrace commands are commonly used to group multiple terms. To use these two commands, you need to load the amsmath package via \usepackage{amsmath}.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$
x + n = x + \overbrace{1 + \cdots + 1}^{n \text{ times}}
$$

$$
xn = \underbrace{x + \cdots + x}_{n \text{ times}}
$$
\end{document}

Both commands take the formula to be grouped as the first argument, and how it will be grouped as the second argument. Note that \overbrace is preceded by a caret ^ for the second argument, while \underbrace is preceded by an underscore _.

x+n=x+1++1n times x + n = x + \overbrace{1 + \cdots + 1}^{n \text{ times}}

xn=x++xn times xn = \underbrace{x + \cdots + x}_{n \text{ times}}