[OS X TeX] Aligning equations with comments

Fri Mar 18 15:42:05 EDT 2011

All,

I've been using a lot of the following to provide comments for students reading the material in a text we are writing:

Solve the following system of equations.
\begin{align}
x+2y&=-5\label{eq:4.3.1a}\\
2x-y&=-5\label{eq:4.3.1b}
\end{align}

\medskip\noindent\textbf{Solution: }Our focus will be on eliminating the variable $x$. We note that is we multiply equation~\eqref{eq:4.3.1a} by $-2$, then add the result to equation~\eqref{eq:4.3.1b}, the $x$ terms will be eliminated.
\begin{align*}
-2x-4y&=-5
&&{\color{darkred}\text{Multiply equation~\eqref{eq:4.3.1a} by $-2$.}}\\
2x-y&=-5
&&{\color{darkred}\text{Equation~\eqref{eq:4.3.1b}.}}\\
-5y&=-10
\end{align*}

But now I need a bit more alignment on this part:

\begin{align*}
-2x-4y&=-5
&&{\color{darkred}\text{Multiply equation~\eqref{eq:4.3.1a} by $-2$.}}\\
2x-y&=-5
&&{\color{darkred}\text{Equation~\eqref{eq:4.3.1b}.}}\\
-5y&=-10