5

I'm trying to write matrices one below the other but I want the vertical lines (compare example below) to be aligned. Eventually, there will be several matrices in one document - in the example below there are only two.

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{align}
\begin{array}{l}
\mathrm{I} \\
\mathrm{II} \\
\mathrm{III} \\
\end{array}
\left (
\begin{array}{rrr|r}
3 & 6 & 3 & 3 \\
2 & 1 & -1 & -1 \\
-1 & 2 & 2 & 1 \\
\end{array}
\right )
\begin{array}{c}
\\
\mathrm{II} + \left (-\frac 2 3 \right ) \cdot \mathrm{I} \\
\mathrm{III} + \left (\frac 1 3 \right ) \cdot \mathrm{I}\\
\end{array}
\end{align}
\begin{align}
\begin{array}{l}
\mathrm{I^{**}}\\
\mathrm{II^{**}} \\
\mathrm{III^{***}} \\
\end{array}
\left (
\begin{array}{rrr|r}
1 & 0 & 0 & 1 \\
0 & 1 & 0 & -1 \\
0 & 0 & 1 & 2 \\
\end{array}
\right )
\end{align} 
\end{document}
5

If the numbers in the last column are of the same size, you can just put both matrices in the same align and put the alignment point (&) just after the matrices. I also added some extra space between the two lines with \\[2\jot].

enter image description here

\documentclass{article}    
\usepackage{amsmath}

\begin{document}
\begin{align}
\begin{array}{l}
\mathrm{I} \\
\mathrm{II} \\
\mathrm{III} 
\end{array}
\left (
\begin{array}{rrr|r}
3 & 6 & 3 & 3 \\
2 & 1 & -1 & -1 \\
-1 & 2 & 2 & 1 
\end{array}
\right )&
\begin{array}{c}
\\
\mathrm{II} + \left (-\frac 2 3 \right ) \cdot \mathrm{I} \\
\mathrm{III} + \left (\frac 1 3 \right ) \cdot \mathrm{I}
\end{array}
\\[2\jot]
\begin{array}{l}
\mathrm{I^{**}}\\
\mathrm{II^{**}} \\
\mathrm{III^{***}} 
\end{array}
\left (
\begin{array}{rrr|r}
1 & 0 & 0 & 1 \\
0 & 1 & 0 & -1 \\
0 & 0 & 1 & 2 
\end{array}
\right )&
\end{align} 
\end{document}
7

In order to further ease the reader's ability to let his/her eye roam vertically across the display, I would not only align the two vertical bars but also the various columns of the matrices through judicious insertions of \phantom{-} instructions.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
\begin{array}{l}
\mathrm{I} \\
\mathrm{II} \\
\mathrm{III\phantom{^{***}}} \\
\end{array}
&\left (
\begin{array}{rrr|r}
3 & \phantom{-}6 & 3 & 3 \\
2 & 1 & -1 & -1 \\
-1 & 2 & 2 & 1 \\
\end{array}
\right )
\begin{array}{l}
\\
\mathrm{II} + \left (-\tfrac 2 3 \right ) \cdot \mathrm{I} \\
\mathrm{III} + \left (\tfrac 1 3 \right ) \cdot \mathrm{I}\\
\end{array}
\\
\begin{array}{l}
\mathrm{I^{**}}\\
\mathrm{II^{**}} \\
\mathrm{III^{***}} \\
\end{array}
&\left (
\begin{array}{rrr|r}
\phantom{-}1 & \phantom{-}0 & \phantom{-}0 & 1 \\
0 & 1 & 0 & -1 \\
0 & 0 & 1 & 2 \\
\end{array}
\right )
\end{align*} 
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.