I am trying to typeset an equation that has overlapping over and under braces as per the image below:
I have managed to typeset it using a sort of a hack, by typing the equation twice, once using \phantom
commands and then raising it. Is there an easier way, perhaps a macro? MWE for the image above is shown below.
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\[a+b+\overbrace{c+d+e+f+g}^{x}+h+i+k+l=e^2\]
\vspace{-35pt}
\[\phantom{+b+c+d+}\underbrace{\phantom{e+f+g+h+i}}_{y}\phantom{+k+=e^2}\]
\end{document}
Best Answer