# Braces (not)containing \underbrace

This:

 \left\{
\begin{array}{l}
\frac{da}{dt}=\sum\limits_kJ_k\sin(D_{ok})\\
\frac d{dt}\left\{\begin{array}{c}e\\i\end{array}\right\}=A+\sum\limits_kJ_k\sin(D_{ok})\\
\frac d{dt}\left\{\begin{array}{c}\epsilon\\\Pi\\\Omega\end{array}\right\}=\underbrace{B-\sum\limits_kK_k\cos(D_{ok})}_{\mbox{functions }F\mbox{ from (2)}}
\end{array}
\right.


looks like this:

but I want it looking like this:

• Do you have the images mixed up? – Werner Mar 26 '14 at 17:02
• No, they're ok. – xkasienka Mar 26 '14 at 18:00
• Strange, since neither of the answers provide the output you "want", yet you've accepted one...? – Werner Mar 26 '14 at 18:07
• I just want the biggest brace no to contain the horizontal one. Is my english so bad? I can't see what I wrote wrong... – xkasienka Mar 26 '14 at 18:12
• The important part is that you received an answer that satisfied your request. – Werner Mar 26 '14 at 18:31

Using a simple \smash won't do, because the spacing below the display would be wrong.

I'll exploit the fact that the material to be underbraced is small in height with respect to the line it belongs to.

\documentclass{article}
\usepackage{mathtools}
\usepackage{lipsum} % just for the example

\newcommand{\smashlastub}[1]{%
\sbox0{\let\smash\relax$#1$}
\vphantom{\usebox0}
\sbox2{$#1$}
\raisebox{\dimexpr(\ht0-\ht2)}{\usebox2}
}

\begin{document}
\lipsum*[2]
$\smashlastub{ \begin{dcases} \frac{da}{dt}=\sum\limits_kJ_k\sin(D_{ok})\\ \frac{d}{dt}\begin{Bmatrix}e\\i\end{Bmatrix}=A+\sum\limits_kJ_k\sin(D_{ok})\\ \frac{d}{dt}\begin{Bmatrix}\epsilon\\\Pi\\\Omega\end{Bmatrix}= \smash{\underbrace{B-\sum_{k}K_k\cos(D_{ok})}_{\text{functions F from (2)}}} \end{dcases}}$
\lipsum[3]
\end{document}


So the whole display is typeset twice, one without smashing the underbrace, one smashing it. The difference in height is taken into account for raising the second box.

Note how using amsmath and mathtools environments improves the overall appearance.

• It looks fantastic :) – xkasienka Mar 26 '14 at 17:21
• Ok, in my document it isn't so fantastic. I don't what I've done wrog, but now all \underbrace and \overbrace are looking like this: link – xkasienka Mar 26 '14 at 17:54
• @xkasienka That's really strange. Are you perhaps using unicode-math? – egreg Mar 26 '14 at 18:11
• I think I'm not, because I don't even know what it is. – xkasienka Mar 26 '14 at 18:16
• @xkasienka If this happened after adding mathtools some more information is needed; please, try making a minimal example and open a new question with it. – egreg Mar 26 '14 at 18:19

\smash is your friend:

\documentclass{article}
\begin{document}
$\left\{ \begin{array}{l} \frac{da}{dt}=\sum\limits_kJ_k\sin(D_{ok})\\ \frac d{dt}\left\{\begin{array}{c}e\\i\end{array}\right\}=A+\sum\limits_kJ_k\sin(D_{ok})\\ \frac d{dt}\left\{\begin{array}{c}\epsilon\\\Pi\\ \Omega\end{array}\right\}= \smash{\underbrace{B-\sum\limits_kK_k\cos(D_{ok})}_{\mbox{functions }F\mbox{ from (2)}}} \end{array} \right.$
\end{document}


i didn't move the brace lower, since it seems to apply to only the last expression.

• ...nor did you use amsmath! :) – Werner Mar 26 '14 at 17:05
• But now the text under this equation overlaps 'functions F from (2)' I can put empty line beneath and its ok :) – xkasienka Mar 26 '14 at 17:14