Overbrace between lines in align environment
With array
it's quite simple. I give two versions, one without and one with arrows. A couple of local definitions are useful to make the code more compact, so in the argument to array
we need not use @{}
to suppress intercolumn space and use C
instead of >{{}}c<{{}}
(that adds empty atoms in order to make the automatic spaces around binary relations or operations to be inserted).
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\begin{document}
\begin{equation*}
\setlength{\arraycolsep}{0pt}
\newcolumntype{C}{>{{}}c<{{}}}
\renewcommand{\arraystretch}{1.2}
\begin{array}{c C c C c C c}
p(6,3) &=& [p(3,3)] &+& \langle p(4,2)\rangle &+& p(5,1) \\
&=& \overbrace{\,[p(0,3)+p(1,2)+p(2,1)]\,}
&+& \overbrace{\langle p(2,2)+p(3,1)\rangle}
&+& p(5,1)
\end{array}
\end{equation*}
\begin{equation*}
\setlength{\arraycolsep}{0pt}
\newcolumntype{C}{>{{}}c<{{}}}
\begin{array}{c C c C c C c}
p(6,3) &=& [p(3,3)] &+& \langle p(4,2)\rangle &+& p(5,1) \\
&& \uparrow && \uparrow \\
&=& \overbrace{\,[p(0,3)+p(1,2)+p(2,1)]\,}
&+& \overbrace{\langle p(2,2)+p(3,1)\rangle}
&+& p(5,1)
\end{array}
\end{equation*}
\end{document}
In the second instance (with arrows), increasing the interrow spacing would be bad.
I added \,
on either side of the first object with \overbrace
in order to avoid the brace to clash with the square brackets and yield a more uniform appearance if compared with the angle brackets.
You can use left alignment and asymmetric braces with the abraces
package.
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{abraces}
\begin{document}
\begin{equation*}
\setlength{\arraycolsep}{0pt}
\newcolumntype{C}{>{{}}c<{{}}}
\renewcommand{\arraystretch}{1.2}
\begin{array}{c C l C l C c}
p(6,3) &=& \,[p(3,3)] &+& \langle p(4,2)\rangle &+& p(5,1) \\
&=& \aoverbrace[L1U9R]{\,[p(0,3)+p(1,2)+p(2,1)]\,}
&+& \aoverbrace[L1U6R]{\langle p(2,2)+p(3,1)\rangle}
&+& p(5,1)
\end{array}
\end{equation*}
\end{document}
The parameters have to be computed “by eye”, though.
Something like this?
\documentclass{article}
\usepackage{amsmath} % for \overbrace macro and align* environment
\newlength\lenA
\newlength\lenB
\newcommand\mybox[2]{\parbox{#1}{\centering$\displaystyle #2$}}
\begin{document}
\newcommand\termA{{\overbrace{[p(0,3) + p(1,2) + p(2,1)]}^{\uparrow}}}
\newcommand\termB{{\overbrace{\langle p(2,2) + p(3,1) \rangle}^{\uparrow}}}
\settowidth\lenA{$\displaystyle\termA$}
\settowidth\lenB{$\displaystyle\termB$}
\begin{align*}
p(6,3) &= \mybox{\lenA}{[p(3,3)]} + \mybox{\lenB}{\langle p(4,2) \rangle} + p(5,1) \\
&= \termA + \termB + p(5,1)
\end{align*}
\end{document}
Another way, with alignat*
and eqparbox
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}
\begin{document}
\begin{alignat*}{3}
p(6,3) &= \eqmathbox{[p (3,3)] } & & +\eqmathbox[m]{ \langle p (4,2) \rangle} & & + p(5,1) \\
&={} \overbrace{\eqmathbox{\bigl[p(0,3) + p(1,2) + p(2,1)\bigr]}}^{\uparrow} & & + \overbrace{\eqmathbox[m]{\bigl\langle p(2,2) + p(3,1) \bigr\rangle}}^{\uparrow}{} & & + p(5,1)
\end{alignat*}
\end{document}