[Tex/LaTex] Vertical lines in matrices should be aligned

arraysmath-modematrices

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}

Best Answer

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}