I want to typeset a proof and want to emphasize what I do in each step e.g. by underbracing an equal-sign when I substitute a variable. In addition I also want to align equal-signs in every line. Unfortunately I don't know how to align an underbraced equal-sign and a non underbraced equal-sign at the same time.
Question: How can I align the underbraced and the non underbraced equal-sign vertically?
\documentclass{report}
\usepackage{amsmath} % Mathe
\usepackage{mathtools} % Mathe
\usepackage{amsfonts} % Mathesymbole
\begin{document}
\begin{align*}
D(D^TD)^{-1} &\underbrace{=}_{\mathclap{D=B(B^TB)^{-1}}} B(B^TB)^{-1}((B(B^TB)^{-1})^TB(B^TB)^{-1})^{-1} \\
&= B(B^TB)^{-1}(((B^TB)^{-1})^TB^TB(B^TB)^{-1})^{-1}
\end{align*}
\end{document}
Best Answer
You need first of all to make the
\underbrace
a math relation, for spacing; but you also have to extend the space reserved to it, because an underbrace has a minimum width:So, if
\ueq
has no optional argument it produces an equal sign as wide as an underbraced one, otherwise it adds the underbrace.