3

I have an aligned equation that looks like:

\begin{align*}
 1 &+ 1\\
 120 &+ 120
\end{align*}

I would like to add an underbrace to one of the lines, but keep the alignment. However, when I do

\begin{align*}
 \underbrace{1 &+ 1}_{2}\\
 120 &+ 120
\end{align*}

I get errors. How can I achieve this behavior?

1

2 Answers 2

2

This does not assume centering, but does assume that 1&+1 and 1+1 are the same width.

\documentclass{article}
\usepackage{mathtools} % for \mathllap
\begin{document}
\begin{align*}
   1 &+ 1 \mathllap{\underbrace{\phantom{1 + 1}}_{2}}\\
   120 &+ 120
\end{align*}
\end{document}
\end{document}
0

For the case you've presented, alignment on the + symbols is equivalent to simple centering using a gather* environment (and no & alignment symbols). Thus, you could get your underbrace by writing

\documentclass{article}
\usepackage{amsmath} % for 'gather*' environment
\begin{document}
\begin{gather*} 
   \underbrace{1 + 1}_{2}\\
   120 + 120
\end{gather*}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .