How do I
- remove the additional space around \underbrace
- justify the text under it, if the latter is longer than the text above it?
To illustrate the issue:
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\newcommand{\underbracewithoutspace}[2]{\mathrlap{\underbrace{\phantom{#1\strut}}_{#2}}#1}
\begin{document}
\begin{equation}
\underbrace{a+b}_{\text{a long blah blah blah}}+c
\end{equation}
% using the technique of
% https://tex.stackexchange.com/questions/24912/remove-additional-space-around-underbrace
\begin{equation}
\underbracewithoutspace{a+b}{\text{a long blah blah blah}}+c
\end{equation}
\end{document}
The first line (plain \underbrace) tries to center the text under the brace, while the second version (taken from this question: Remove additional space around \underbrace{…}) puts the brace under the wrong symbol.
As a more minor issue: is there a way of aligning what's above the brace with what's below it? In this example, I'm after aligning the
– Zhenya Sep 22 '11 at 19:26ain the 'a long ' with theain the formula.