# How to vertically align multiple equations with text underset?

How do you vertically align equality signs when one of them has some text underset? My solution is:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[american]{babel}

\usepackage{amsmath}

\begin{document}
\begin{align*}
a &\underset{\text{explanation}}{=} b + c\\
d &\underset{\phantom{\text{explanation}}}{=} e + f + d
\end{align*}
\end{document}


However, that's not very elegant especially when several \underset are involved.

• Are you actually referring to horizontal alignment? – Werner Apr 18 '12 at 22:48

The result is not particularly pleasing. If you don't need equation numbers, then an array can do:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[american]{babel}

\usepackage{amsmath,array}

\begin{document}
\begin{align*}
a &\underset{\text{explanation}}{=} b + c\\
d &\underset{\phantom{\text{explanation}}}{=} e + f + d
\end{align*}

$\renewcommand{\arraystretch}{1.5}\setlength{\arraycolsep}{0pt} \begin{array}{r >{{}}c<{{}} l} a &\underset{\text{explanation}}{=} & b + c\\ d &= & e + f + d \end{array}$
\end{document}


• Thanks for your help. Equation numbers would be nice to have. But I see, it's not trivial. I just tried to work with alignat but couldn't find a solution. Another solution is to use \mathclap around the text, but then of course the word extends over the left- and right-hand side -- which is ugly, too. – Marius Hofert Apr 19 '12 at 5:43
I use \stackrel to put text above arrows and stuff. I confess that I'm not sure, but I think it's part of the amsmath package. Try
$\stackrel{-\frac{1}{6} R_3}{\longrightarrow}$