This question is a generalization of
How to nicely lay out a parentheses-enclosed overbrace/underbrace?
Now we have parentheses with some parts of the content, of different heights, having an underbrace. Example:
\documentclass{minimal}
\begin{document}
$\left( 1 \cdot 2 \cdot \frac{3}{4} \cdot 5^2 \right)$
$\left( \underbrace{1}_{x} \cdot 2 \cdot \underbrace{\frac{3}{4}}_{\int y} \cdot 5^2 \right)$
\end{document}
produces:
which is very ugly. How can I make the underbraces ignored for the purposes of sizing the parentheses, but count for the space to the next line of text? The solution must allow me to write something like
$\magicparens{%
underbrace{1}_{x} \cdot 2 \cdot \underbrace{\frac{3}{4}}_{\int y} \cdot 5^2%
}$
and have it work. No manually specifying any sizes or lengths.
Bonus points for a second version which make all the underbraces vertically aligned.
\left
and\right
for the parentheses”… Do you have some special reason for requiring auto-resizing parentheses?\[ \biggl(1 \cdot 2 \cdot \frac{3}{4} \cdot 5^2 \biggr) \biggl(\underbrace{1}_{x} \cdot 2 \cdot \underbrace{\frac{3}{4}}_{\int y} \cdot 5^2 \biggr) \]
\tfrac
is much too small when the rest of formulae is in\displaystyle
. But maybe\mfrac
would look fine.