3

I am trying to align a set of equations using the right braces.

A similar question is asked here Align multiple equations within right braces

In my case, I would like to use also subequations to get (1a) and (1b).

Till now I was using rcases and the code was similar to this:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

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

\end{document}

The following picture indicates with red the changes I would like to have.

enter image description here

1
  • 1
    What you want is not very clear. Could you explain more?
    – Bernard
    Commented Apr 11, 2020 at 18:05

2 Answers 2

4

It also can be obtained with nested aligned environments, with a better spacing of the = sign. A variant would patch the rcases environment instead, with the same result:

\documentclass{article}
\usepackage{mathtools}

\makeatletter
\newcases{myrcases}{\thickspace}{%
  $\m@th{##}$\hfil}{$\m@th{##}$\hfil}{.}{\rbrace}
\makeatother

\usepackage{eqparbox}
\newcommand{\eqmathboxR}[2][D]{\eqmakebox[#1][r]{$\displaystyle#2$}}
\newcommand{\eqmathboxL}[2][S]{\eqmakebox[#1][l]{$\displaystyle#2$}}

\begin{document}

\begin{subequations}
\begin{alignat}{2}
    &\left.\begin{aligned}
        \eqmathboxR{a} &= b + c \\
    \eqmathboxR{d} &= e + f + g \\
   \eqmathboxR{h}&= \eqmathboxL{i + j + k + l}
    \end{aligned}\right\rbrace&\enspace &\text{three equations}\\[1ex]
 & \left. \begin{aligned}
\eqmathboxR{\implies m} & = n \\
 \eqmathboxR{o} & = \eqmathboxL{p*q}
 \end{aligned}\right\rbrace&\enspace &\text{another two equations}
 \end{alignat}
 \end{subequations}

\end{document}

enter image description here

3

You can pseudo align the braces by putting all expressions on the right handside of the = signs into boxes of equal width.

The package eqparbox serves exactly this purpose.

Unfortunately the different typographical properties of the braces disturbs the look. It should be possible to redefine the brace command that mathtools uses in case of the rcases environment. enter image description here

\documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}

\newcommand\EqMathBox[2][x]{%
    \eqparbox{#1}{$\displaystyle #2$}%
}

\begin{document}

\begin{subequations}
    \begin{align}
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        & \begin{rcases}
            \EqMathBox[left]{a}& = \EqMathBox{b + c}         \\
            \EqMathBox[left]{d}& = \EqMathBox{e + f + g}     \\
            \EqMathBox[left]{h}& = \EqMathBox{i + j + k + l \qquad\quad} \\
        \end{rcases}%
        \quad\text{three equations}       &&\\[1em]
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        & \begin{rcases}
            \EqMathBox[left]{m}& = \EqMathBox{n}             \\
            \EqMathBox[left]{o}& = \EqMathBox{p\cdot q}      \\
        \end{rcases}%
        \quad\text{another two equations} &&
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \end{align}
\end{subequations}

\end{document}
2
  • 1
    Essentially good, but the second brace is just a bit farther to the right because the m in the second group us wider than the beginning parts of either line in the first group. So both pre-= groups also need to be in equal-sized boxes. (Or some similar adjustment.) Commented Apr 11, 2020 at 22:23
  • @barbarabeeton Thank you for your comment! I was to focused on the braces... I will update the code accordingly Commented Apr 11, 2020 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .