# Vertical lines in matrices should be aligned

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}


## 2 Answers

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]. \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}


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. \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}