I'm new to LaTeX and was wondering if there is a more beautiful way to have the matrices aligned than below?
Below is a sample code from the picture above
:
\begin{alignat*}{2}
&\!\begin{aligned}
&\ro{r_1 \rightarrow r_1 - r_2a }\\
&\ro{r_3 \rightarrow r_3 - r_2(3-a) }\\
\end{aligned}
\begin{sysmatrix}{rrr|r}
1 & 0 & 2 & -\frac{2a}{a^2-2} \\
0 & 1 & 0 & \frac{a^2}{a^2-2} \\
0 & 0 & -2 & \frac{1}{a^2-2}(-a^2+2a-4)
\end{sysmatrix}
&\!\begin{aligned}
&\ro{r_1 \rightarrow r_1 + r_3 }\\
\end{aligned}
\begin{sysmatrix}{rrr|r}
1 & 0 & 2 & -\frac{a^2+4}{a^2-2} \\
0 & 1 & 0 & \frac{a^2}{a^2-2} \\
0 & 0 & -2 & \frac{1}{a^2-2}(-a^2+2a-4)
\end{sysmatrix}
\end{alignat*}
\begin{alignat*}{2}
&\!\begin{aligned}
&\ro{r_3 \rightarrow \frac{r_3}{-2} }\\
\end{aligned}
\begin{sysmatrix}{rrr|r}
1 & 0 & 0 & -\frac{a^2+4}{a^2-2} \\
0 & 1 & 0 & \frac{a^2}{a^2-2} \\
0 & 0 & 1 & \frac{\frac{a^2}{2}-a+2}{a^2-2}
\end{sysmatrix}
\end{alignat*}
\begin{alignat*}{2}
\begin{sysmatrix}{rrr|r}
x_1\\
x_2\\
x_3
\end{sysmatrix}
&\!\begin{aligned}
&{=}\\
\end{aligned}
\begin{sysmatrix}{rrr|r}
-\frac{a^2+4}{a^2-2} \\
\frac{a^2}{a^2-2} \\
\frac{\frac{a^2}{2}-a+2}{a^2-2}
\end{sysmatrix}
\end{alignat*}

\documentclassto\end{document}as things stand,\roappears to be a custom command of yours, andsysmatrixan environment from some package. Giving us a MWE helps us understand what you have so far, and gives us a starting point. – Teepeemm Apr 30 '19 at 13:59