# Brace delimited sets of equations inside AMS align with common alignment

I would like to extend the following way of typesetting equations with a trailing brace to more than one set of equation.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
This works
$$\left. \begin{split} a&= b \\ c&= d \end{split}\qquad\right\}\label{eq1} \\$$
Here the alignment is off
\begin{align}
\left. \begin{aligned}
a&= b \\
c&= d
\left. \begin{aligned}
aaaaaaaaaaaaaaaa&= b \\
c&= ddddddddddddddddddddddddddddddddddd
\end{align}
\end{document}


How can I fix it so that the latter two sets are aligned?

-

Your MWE generates warnings about split and repeated labels. It helps when answering if the initial example doesn't generate unrelated errors (as it makes it easier to check that no errors have been introduced)

One way (not as automatic as you might wish) is to insert the large entries from the second group into the first:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
This works
\left. \begin{aligned} a&= b \\ c&= d \end{aligned}\qquad\right\}\label{eq0} \\
Here the alignment is off
\begin{align}
\left. \begin{aligned}
\phantom{aaaaaaaaaaaaaaaa}\llap{$\displaystyle a$}&= \rlap{$\displaystyle b$}\phantom{ddddddddddddddddddddddddddddddddddd} \\
c&= d
\left. \begin{aligned}
aaaaaaaaaaaaaaaa&= b \\
c&= ddddddddddddddddddddddddddddddddddd
\end{align}
\end{document}

-
Thanks. Yes, I typed up that MWE in a bit of a hurry. I wish there were a slightly more automatic solution, but this will do. Since then I have also found tex.stackexchange.com/q/1938/8863 which uses a similar maximum width technique. – tchakravarty Aug 9 '12 at 19:53

One less phantom use but still not automated and using the rcases environment from mathtools package.

\documentclass{article}
\usepackage{amsmath,mathtools}
\begin{document}
\begin{align}
\begin{rcases}
\begin{aligned}
a&=b\\
c&=d\phantom{dddddddddddddddddd}
\end{aligned}
\end{rcases}\\
\begin{rcases}
\begin{aligned}
aaaaaaaaaaaa&=b\\
c&=ddddddddddddddddddd
\end{aligned}
\end{rcases}
\end{align}
\end{document}


-
Thanks. I guess you and David Carlisle have the same answer, so I am marking his based purely on the time stamp. :) – tchakravarty Aug 9 '12 at 19:51
@fgnu No problem at all. If you have to choose between David and me, he always wins, no matter the time stamp is :) – percusse Aug 9 '12 at 20:36