# How to vertically shift an underbrace?

Is there a way to vertically shift an underbrace downwards?

My Problem is, that the underscripts in the following code overlap:

\begin{equation*}
\mathbf{v}_n \approx \sum_{m} \underbrace{\mathbf{T}^{(m)} \mathbf{W}}_{\mathclap{\text{m-te Transformation aller Basisvektoren}}} H_{:,n}^{(m)}.
\end{equation*}


Is there a way to solve this?

-

If you want the explanation text all on one line, there's not much to do:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
This is what you could do
\begin{equation*}
\mathbf{v}_n \approx \sum_{\raisebox{.3ex}{$\scriptstyle m$}}
\underbrace{\mathbf{T}^{(m)}
\mathbf{W}}_{\mathclap{\substack{\text{$m$-te}\\
\text{Transformation}\\
\text{aller Basisvektoren}}}}
H_{:,n}^{(m)}.
\end{equation*}
but I'd prefer something like
\begin{equation*}
\mathbf{v}_n \approx \sum_{m} \mathbf{T}^{(m)}\mathbf{W} H_{:,n}^{(m)},
\end{equation*}
where $\mathbf{T}^{(m)}\mathbf{W}$ is the $m$-th transformation of
all basis vectors.

\end{document}


Alternatively,

\begin{equation*}
\mathbf{v}_n \approx \sum_{\raisebox{.3ex}{$\scriptstyle m$}}
\underbrace{\mathbf{T}^{(m)}\mathbf{W}}%
_{\mathclap{\substack{\uparrow\\
\text{$m$-te Transformation aller Basisvektoren}}}}
H_{:,n}^{(m)}.
\end{equation*}


I'd surely prefer the explanation after the formula.

-

Instead of moving the second argument of \underbrace down by some amount to keep it from clashing with the m in \sum_m, you could use \nolimits immediately after \sum to side-set the term m, thereby moving it up and out of the way of the material contained in the second argument of \underbrace.

Avoiding this clash solves only one typographic problem. The second argument of \underbrace is awfully long, making it less than obvious what the underbrace refers to. To alleviate this problem a bit, you could break up the underbrace material across two lines (using \substack) and set it in \tiny (rather than \scriptsize) size:

However, I think it's far more elegant -- and helpful to your readers! -- to place the explanation of what \mathbf{T}^{(m)} \mathbf{W} means in the body text, as @egreg suggests doing in his answer.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\mathbf{v}_n \approx \sum\nolimits_{m}
\underbrace{\mathbf{T}^{(m)} \mathbf{W}}_{%
\mathclap{\text{$m$-te Transformation aller Basisvektoren}}}
H_{:,n}^{(m)}.
\end{equation*}
\end{document}


Code for second version of equation:

$\mathbf{v}_n \approx \sum\nolimits_{m} \underbrace{\mathbf{T}^{(m)} \mathbf{W}}_{% \mathclap{\substack{\text{\tiny m-te Transformation}\\ \text{\tiny aller Basisvektoren}} }} H_{:,n}^{(m)}.$

-

Taking @egreg's second solution as a starting point, a variant with the flalign* environment gives a better vertical spacing:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

Text text text text text text text text text text text text text text text text text text text text text text text text text.
\begin{flalign*}
&  &  \begin{gathered}
\mathbf{v}_n \approx \sum_m\mathbf{T}^{(m)}\mathbf{W} H_{:,n}^{(m)},
\end{gathered}  &  &  \\
\text{\rlap{where $\mathbf{T}^{(m)}\mathbf{W}$ is the $m$-th transformation of all basis vectors.}} %& &  &  &  &
\end{flalign*}

Text text text text text text text text text text text text text text text text text text text text text text text text text.
\begin{equation*}
\mathbf{v}_n \approx \sum_m\mathbf{T}^{(m)}\mathbf{W} H_{:,n}^{(m)},
\end{equation*}
where $\mathbf{T}^{(m)}\mathbf{W}$ is the $m$-th transformation of all basis vectors.

Text text text text text text text text text text text text text text text text text text text text text text text text text.

\end{document}


-
What does using the nested flalign* and gathered environments achieve in the present context? Separately, how does the use of these environments help solve the OP's issue with the clash between m (in \sum_{m} and the second argument of the subsequent \underbrace? –  Mico Jul 26 at 15:15
I was proposing what I think is an improvement with respect to suggesting an explanation on its own line rather than with an underbrace. –  Bernard Jul 26 at 15:22
Thanks. You may want to make this aspect of your contribution a wee bit more explicit. I may not be the only person who missed it... :-) –  Mico Jul 26 at 15:26
Yes, I know I can be somewhat elliptical at times. I'll add a few words. May I suggest the explanation (in the underbrace solution) be typed in, say, \footnotesize, so that there will be a clear difference between the formula itself and the explanation? –  Bernard Jul 26 at 15:32