The problem is I'd like to use multiple underbraces (or perhaps overbraces) which may also overlap. For example,
\underbrace{a + b}_\textrm{brace 1} + c + d = e
is the first brace. But I'd also like to have a second brace which underlines b, c, and d (and lies below the first brace).
How would I do that?
CRGreathouse
Oct16-08, 11:09 AM
\underbrace{\underbrace{a + b}_\textrm{brace 1} + c + d}_\textrm{brace 2}= e
cristo
Oct16-08, 11:28 AM
\underbrace{\underbrace{a + b}_\textrm{brace 1} + c + d}_\textrm{brace 2}= e
I originally did that (but then deleted it). He is asking for the brace to start under b and end at d.
alphysicist
Oct17-08, 12:59 AM
Hi rsq_a,
I'd like to typeset an expression like,
a + b + c + d = e
The problem is I'd like to use multiple underbraces (or perhaps overbraces) which may also overlap. For example,
\underbrace{a + b}_\textrm{brace 1} + c + d = e
is the first brace. But I'd also like to have a second brace which underlines b, c, and d (and lies below the first brace).
How would I do that?
How about these:
a + \underbrace{b \makebox[0pt][r]{$\displaystyle{\underbrace{\phantom{a+b}}_\textrm{brace 1}}$}
+ c + d}_\textrm{brace 2} = e
\underbrace{a + \makebox[0pt][l]{$\displaystyle{\underbrace{\phantom{b+c+d}}_\textrm{ brace 2}}$} b}_\textrm{brace 1} + c + d = e
\underbrace{a + \makebox[0pt][l]{$\displaystyle{\overbrace{\phantom{b+c+d}}^\textrm{ brace 2}}$} b}_\textrm{brace 1} + c + d = e
You can say that the makebox command here is causing the inner brace to have a width of zero, for the purpose of calculating the outer brace. Let me show you the steps:
I noticed that this last version looks fine on the forum, but what's really happening is that there are two copies of {\rm neutrons} + {\rm protons}; they are just right on top of each other. Sometimes they won't line up perfectly, so to make sure that you never see the duplicate contents, you can use the phantom command:
Depending on what is in your equation, you might also want to use the displaystyle command right after the $ in the makebox (like I have in my first several examples). Also in my own work I have sometimes had to explicitly add a space or two to make everything line up correctly.
rsq_a
Oct29-08, 04:48 AM
I forgot to thank you for this (have yet to return to writing). I also spotted this in a Wikipedia article -- not as easy as your technique (and not the kind of braces I wanted), but it'd be nice to keep the info for future reference: