[OS X TeX] Aligning equations with comments

David Arnold dwarnold45 at suddenlink.net
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
&&{\color{darkred}\text{Add the two equations.}}
\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
&&{\color{darkred}\text{Add the two equations.}}
\end{align*}

I need to align x-terms, operator, y-terms, equal sign, and right-hand sides in their own columns, while keeping my comment space to the right. I also need to underline that second equation before writing that third equation.

Sounds like some sort of tabular environment that extends the width of the page.

Has anyone done this before? Any suggestions?

David


More information about the MacOSX-TeX mailing list