Arrows for Matrix Row Operations

You can use \xrightarrow, with some help in order to equalize the widths.

\documentclass{article}
\usepackage{amsmath,mathtools}

\newenvironment{sysmatrix}[1]
 {\left(\begin{array}{@{}#1@{}}}
 {\end{array}\right)}
\newcommand{\ro}[1]{%
  \xrightarrow{\mathmakebox[\rowidth]{#1}}%
}
\newlength{\rowidth}% row operation width
\AtBeginDocument{\setlength{\rowidth}{3em}}

\begin{document}

\begin{alignat*}{2}
\begin{sysmatrix}{rrr|r}
 1 &  2 & 0 & 0 \\
-1 &  1 & 2 & 0 \\
 1 &  0 & 1 & 5 \\
 0 & -2 & 1 & 4
\end{sysmatrix}
&\!\begin{aligned}
&\ro{r_2+r_1}\\
&\ro{r_3-r_1}
\end{aligned}
\begin{sysmatrix}{rrr|r}
1 &  2 & 0 & 0 \\
0 &  3 & 2 & 0 \\
0 & -2 & 1 & 5 \\
0 & -2 & 1 & 4
\end{sysmatrix}
&&\ro{(1/3)r_2}
\begin{sysmatrix}{rrr|r}
1 &  2 &   0 & 0 \\
0 &  1 & 2/3 & 0 \\
0 & -2 &   1 & 5 \\
0 & -2 &   1 & 4
\end{sysmatrix}
\\
&\!\begin{aligned}
&\ro{r_3+2r_2}\\
&\ro{r_4+2r_2}
\end{aligned}
\begin{sysmatrix}{rrr|r}
1 &  2 &   0 & 0 \\
0 &  1 & 2/3 & 0 \\
0 &  0 & 7/3 & 5 \\
0 &  0 & 7/3 & 4
\end{sysmatrix}
&&\ro{(3/7)r_3}
\begin{sysmatrix}{rrr|r}
1 &  2 &   0 & 0 \\
0 &  1 & 2/3 & 0 \\
0 &  0 &   1 & 15/7 \\
0 &  0 & 7/3 & 4
\end{sysmatrix}
\end{alignat*}

\end{document}

enter image description here


Here a minimal MWE, enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\begin{document}
\(\begin{pmatrix}
3 &  3& 3\\ 
 3&  3& 3\\ 
 3&  3& 3
\end{pmatrix} \overset{r_1+r_2}{\longrightarrow} 
\begin{pmatrix}
3 &  3& 3\\ 
 3&  3& 3\\ 
 3&  3& 3
\end{pmatrix} \underset{\overset{r_1-4r_2}{\longrightarrow}}{\overset{r_1+r_2}{\longrightarrow}}\)
\end{document}

or you see at

Formatting arrows between rows of corresponding matrices

Side by Side matrices

Tags:

Matrices