3

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
\begin{equation}
\left. \begin{split}
a&= b \\
c&= d
\end{split}\qquad\right\}\label{eq1} \\
\end{equation}
Here the alignment is off
\begin{align}
\left. \begin{aligned}
a&= b \\
c&= d
\end{aligned}\qquad\right\}\label{eq1} \\
\left. \begin{aligned} 
aaaaaaaaaaaaaaaa&= b \\
c&= ddddddddddddddddddddddddddddddddddd
\end{aligned}\qquad\right\}\label{eq1}
\end{align}
\end{document}

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

David Carlisle
  • 757,742
tchakravarty
  • 2,427
  • 3
  • 26
  • 45

2 Answers2

4

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:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
This works
\begin{equation}
\left. \begin{aligned}
a&= b \\
c&= d
\end{aligned}\qquad\right\}\label{eq0} \\
\end{equation}
Here the alignment is off
\begin{align}
\left. \begin{aligned}
\phantom{aaaaaaaaaaaaaaaa}\llap{$\displaystyle a$}&= \rlap{$\displaystyle b$}\phantom{ddddddddddddddddddddddddddddddddddd} \\
c&= d
\end{aligned}\qquad\right\}\label{eq1} \\
\left. \begin{aligned} 
aaaaaaaaaaaaaaaa&= b \\
c&= ddddddddddddddddddddddddddddddddddd
\end{aligned}\qquad\right\}\label{eq2}
\end{align}
\end{document}
David Carlisle
  • 757,742
  • 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 http://tex.stackexchange.com/q/1938/8863 which uses a similar maximum width technique. – tchakravarty Aug 09 '12 at 19:53
3

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}

enter image description here

David Carlisle
  • 757,742
percusse
  • 157,807
  • Thanks. I guess you and David Carlisle have the same answer, so I am marking his based purely on the time stamp. :) – tchakravarty Aug 09 '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 09 '12 at 20:36