# Align multiple equations within right braces

I'm trying to make an array of equations where some of them are marked with right braces. For the right braces I have used the rcases command from the solution offered at: https://tex.stackexchange.com/a/47563/131192. I want the equations to be aligned at the equal sign, but I can't manage to do so. Here is an example of what I'm trying to do, but it doesn't give me good results:

\documentclass{article}
\usepackage{amsmath}

\newenvironment{rcases}
{\left.\begin{aligned}}
{\end{aligned}\right\rbrace}

\begin{document}

\begin{align*}
&\begin{rcases}
a &= b + c \\
d &= e + f + g \\
h &= i + j + k + l
\end{rcases}
\text{ three equations}\\
&\begin{rcases}
\implies m &= n \\
o &= p*q
\end{rcases}
\text{another two equations}
\end{align*}

\end{document}


Thanks for any help!

• BTW, mathtools already has an ' rcases' environment with a slightly different definition. Commented Apr 21, 2017 at 14:56

This falls into the general category of aligning things in different (aligned) environments. One solution is to use \hphantom to compensate for the differences. The other is to put them all into one environment and try to align the right braces to the corresponding text using (for example) \vphantom.

\documentclass{article}
\usepackage{amsmath}

\newenvironment{rcases}
{\left.\begin{aligned}}
{\end{aligned}\right\rbrace}

\begin{document}

This uses \verb$\hphantom$.
\begin{align*}
&\begin{rcases}
\hphantom{\implies m}\llap{$a$} &= b + c \\
d &= e + f + g \\
h &= i + j + k + l
\end{rcases}
\text{ three equations}\\
&\begin{rcases}
\implies m &= n \\
o &= p*q
\end{rcases}
\text{another two equations}.
\end{align*}

This uses \verb$\vphantom$
\begin{equation*}
\begin{aligned}
a &= b + c \\
d &= e + f + g \\
h &= i + j + k + l\\
\implies m &= n \\
o &= p*q
\end{aligned}
\begin{aligned}
&\left.\vphantom{\begin{aligned}
a &= b + c \\
d &= e + f + g \\
h &= i + j + k + l
&\left.\vphantom{\begin{aligned}
\implies m &= n \\
o &= p*q
\end{aligned}
\end{equation*}

\end{document}


• Thank you, I tried to use \phantom earlier but with no success. This is great. Commented Apr 21, 2017 at 17:41

Like this:

or this (with simpler code)

The first case:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align*}
&\
\left.\begin{aligned}
a & = b + c \\
d & = e + f + g \\
h & = i + j + k + l
\end{aligned}\right\}       \text{ three equations}   \\
\raisebox{1.75ex}{$\implies$}
&
\left.\begin{aligned}
m & = n \\
o & = p*q
\end{aligned}\right\}   \text{another two equations}
\end{align*}
\end{document}


The second case:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align*}
\begin{align*}
&\
\left.\begin{aligned}
a & = b + c \\
d & = e + f + g \\
h & = i + j + k + l
\end{aligned}\right\}       \text{ three equations}   \\
\implies
&
\left.\begin{aligned}
m & = n \\
o & = p*q
\end{aligned}\right\}   \text{another two equations}
\end{align*}
\end{document}