10

Is there a way to split the overbrace so that it appears in two halves over a multi-line equation. Something like

/-----------Overbrace Label----
  Equation over which to place 
          ----------------------\
           the overbrace.
Caramdir
  • 89,023
  • 26
  • 255
  • 291
crasic
  • 1,606

1 Answers1

12

One approach would be to use the adjustbox package from Martin Scharrer. It provides a \clipbox{<llx> <lly> <urx> <ury>}{<text>} macro for trimming and clipping output. Both \overbraces in each line is clipped - the top from the right by specifying a value for <urx> and bottom from the left by specifying a value for <llx>. The following minimal example highlights this proof of concept:

\documentclass{article}
\usepackage{amsmath}
\usepackage{adjustbox}% http://ctan.org/pkg/adjustbox
\begin{document}
\begin{multline*}
  f(x)=a_0+a_1x+a_2x^2+\clipbox{-2 0 5 0}{$\overbrace{a_3x^3+a_4x^4+\cdots+a_{i-1}x^{i-1}+\hspace{1em}}^{\text{some text}}$} \\[\jot]
       \clipbox{100 0 -2 0}{$\overbrace{\phantom{\hspace{10em}}a_ix^i+a_{i+1}x^{i+1}}$}+\cdots+a_{n-1}x^{n-1}
\end{multline*}
\end{document}

Overlapping multline braces

Specifying a value of -2 for either <llx> or <urx> in the above code makes sure that the brace end left in view is not potentially trimmed ever so slightly. The other thing to make sure is that the braces are adjusted for the correct clipping. Otherwise, for example, the bottom brace will still show a cusp. I'm sure some manual tweaking will provide you with the flavour of multi-line overbrace that you want.


For completeness, here is a description on how to achieve overlapping under-/overbraces if you have an equation on a single line. Reprinting parts of the equation using \phantom can be used so that the horizontal placement is accurate. Here is a minimal working example demonstrating the principle:

\documentclass{article}
\usepackage{mathtools}% For \mathclap, \mathllap, \mathrlap
\begin{document}
\[
  f(x)=\mathrlap{\underbrace{\vphantom{a_{n-1}}\phantom{a_0+a_1x+a_2x^2}}_{\text{some text}}}
       \mathrlap{\phantom{a_0+a_1x+}\overbrace{\phantom{\:a_2x^2+a_3x^3+\cdots}}^{\text{some other text}}}
       a_0+a_1x+a_2x^2+a_3x^3+\underbrace{\cdots+a_{n-1}x^{n-1}}_{\text{some more text}}+a_nx^n
\]
\end{document}

Overlapping \underbrace + \overbrace

The mathtools package provides similar math mode overlapping macros to the textual \rlap, \clap and \llap counterparts. Respectively, these macros allow right r, center c and left l overlap within math mode. The use of \phantom{...} allows for correct horizontal placement, while \vphantom{...} ensures correct vertical placement across \underbraces.

Werner
  • 603,163