[Tex/LaTex] Equation alignment – linear equations

equationshorizontal alignmentvertical alignment

How can I produce the following equations with Latex? Note the alignment of terms in the linear equations and the "hints" to the right. I have tried using the ordinary cases by could not get the result I wanted without having \ all over the place.

perfectly aligned linear equations with hints

Best Answer

You can also use the systeme package:

\documentclass{article}
\usepackage{systeme}
\begin{document}

\systeme{-x    +  z =  3 @(a), 
        -2x -y + 5z = -1 @(b), 
         2x +y      =  1 @(c)}

\end{document}

enter image description here

Related Question