4

I have an array that looks like this:

expected

I'm not sure how I can add the curly brackets and text there.

I formatted the array like this:

\begin{equation*}
\begin{array}{r*{10}{l}}
    \trom{1} & 2 + x_1 -2 = x_1 & \\
    \trom{2} & 1 + 2s + 0t = x_2 & \\
             & 1 + 2s = x_2 \\
    \trom{3} & 0 + 2s + 3t = x_3 \\
             & \text{Some more calculations}
\end{array}
\end{equation*}

I tried to use the split environment within the array environment:

\begin{equation*}
\begin{array}{r*{10}{l}}
    \left .
    \begin{split}
        \trom{1} & 2 + x_1 -2 = x_1 & \\
        \trom{2} & 1 + 2s + 0t = x_2 & \\
                 & 1 + 2s = x_2 \\
    \end{split}

    \right \} \textit{Test....}
    \\

    \trom{3} & 0 + 2s + 3t = x_3 \\
             & \text{Some more calculations}

\end{array}
\end{equation*}

But that messes up the "grid":

Messed up grid

How can I use the split environment within an array environment? If that's not possible (or if there's a more elegant way), please post it instead.

2 Answers 2

6

split is not intended to be used in that way, you really want aligned instead.

Sample output

\documentclass{article}

\usepackage{mathtools}

\newcommand{\trom}[1]{\makebox[0pt][r]{\MakeUppercase{\romannumeral #1}}}

\begin{document}

\begin{equation*}
  \begin{split}
    &\!\left .  \!\begin{aligned}
        \trom{1}\quad & 2 + x_1 -2 = x_1  \\
        \trom{2}\quad & 1 + 2s + 0t = x_2  \\
        & 1 + 2s = x_2 \\
      \end{aligned}
    \right \} \textit{Test....}
    \\
    &\trom{3}\quad  0 + 2s + 3t = x_3 \\
    &\quad\text{Some more calculations}
  \end{split}
\end{equation*}

\end{document}
2
  • Thanks. That's what I've been looking for. I still have a question, though. Why did you add \!? A google search for Latex exclamation point|mark didn't turn up anything useful.
    – Matt3o12
    Commented May 15, 2015 at 17:54
  • Never mind. I just found it in another answer.
    – Matt3o12
    Commented May 15, 2015 at 18:20
2

Here is another option using arrays:

enter image description here

\documentclass{article}

\usepackage{amsmath}
\newcommand{\toRoman}[1]{\text{\MakeUppercase{\romannumeral #1}}}
\begin{document}

\begin{equation*}
  \renewcommand{\arraystretch}{1.2}% http://tex.stackexchange.com/a/31704/5764
  \begin{array}{r l}
    \multicolumn{2}{l}{\left.\kern-\nulldelimiterspace\begin{array}{@{}r l}
      \hphantom{\toRoman{3}}\makebox[0pt][r]{\toRoman{1}} & 2 + x_1 -2 = x_1 \\
      \toRoman{2} & 1 + 2s + 0t = x_2 \\
                  & 1 + 2s = x_2
      \end{array}\quad\right\} \text{Test \ldots}} \\
      \toRoman{3} & 0 + 2s + 3t = x_3 \\
                  & \text{Some more calculations}
  \end{array}
\end{equation*}

\end{document}

You must log in to answer this question.

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