5

I want to align the lines inside an aligned that is nested inside a split with the rest of the equation.

This is an example:

\usepackage{amsmath}

\begin{equation}
  \begin{split}
    \text{max:} 
      \quad & A,\\
    \text{s.t.:} 
      \quad & B,\\
            & \left.
            \begin{aligned}
            & C,\\
            & D,\\
            \end{aligned}
            \right\} \quad(\text{stuff}),\\
            & E.
  \end{split}
\end{equation}

mwe_aligned

I would like C and D in the rendering above to be aligned with A, B, and E. I understand that \left. is what creates that space, but I don't know what to replace it with (Whatever I replace it with, I get a Missing delimiter error).

3 Answers3

2

\left. inserts \nulldelimiterspace and you need two \!s

\documentclass[a4paper, 11pt]{book}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \begin{split}
    \text{max:}
      \quad & A,\\
    \text{s.t.:}
      \quad & B,\\
            & \left.\kern-\nulldelimiterspace
            \!\!\begin{aligned}
            & C,\\
            & D,\\
            \end{aligned}
            \right\} \quad(\text{stuff}),\\
            & E.
  \end{split}
\end{equation}
\end{document}

enter image description here

1

Two solutions, both using the rcases environment, from mathtools. The second solution replaces the split environment with alignedat; it allows to typeset the \quadonly once.

     \documentclass[a4paper, 11pt]{book}
    \usepackage[utf8]{inputenc}
    \usepackage{fourier, heuristica}

    \usepackage{mathtools}

    \begin{document}

\begin{equation}
  \begin{split}
    \text{max:}
      \quad & A,\\
    \text{s.t.:}
      \quad & B,\\
            & \mkern-6mu
            \begin{rcases}
            C,\\
            D,\\
            \end{rcases}
            \quad(\text{stuff}),\\
            & E.
  \end{split}
\end{equation}

\begin{equation}
  \begin{alignedat}{2}
    \text{max:}
      & \quad && A, \\
    \text{s.t.:}
       & & &B, \\
  & & &\mkern-6mu
 \begin{rcases}
 C,\\
 D,\\
 \end{rcases}
 \quad(\text{stuff}), \\
             & && E.
  \end{alignedat}
\end{equation}

    \end{document} 

enter image description here

Bernard
  • 271,350
1

Just use a nested array, so you don't really have to fiddle with the horizontal space adjustment (except for the "null delimiter" \left.):

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}
  % http://tex.stackexchange.com/a/31704/5764
  \renewcommand{\arraystretch}{1.2}
  \begin{array}{r@{\quad}l}
    \text{max:}  & A, \\
    \text{s.t.:} & B, \\
                 & \left.\kern-\nulldelimiterspace
                 \begin{array}{@{}l}
                   C, \\
                   D,
                 \end{array}\right\} \qquad \text{(stuff),} \\
                 & E.
  \end{array}
\end{equation}
\end{document}
Werner
  • 603,163