[texhax] \hline in align environment

Sebastian Canagaratna s-canagaratna at onu.edu
Mon Jan 5 05:30:39 CET 2009


When discussing elimination of variables in simultaneous equations, it 
is usual to have a horzontal line after the two equations which are 
being added and subtracted. This appears to be difficult to do in 
amsmath align environment. There was a question about this about three 
years ago, but there were no satisfactory answers usign align, as far as 
I can gather. Here is my solution.

\begin{align*}
       4x+  6y -2z &= -4\\
        x -y +2z   &=  9\\[-0.2in] 
\underline{\phantom{4x+6y-2z}}&\underline{\phantom{y}}\underline{\phantom{-4y}}\\
        5x + 5y    &= 5\\
         x + y &= 1
\end{align*}
I have used underline and for alignment, instead of using \phantom{=} it 
is necessary to use \phantom{y} otherwise the lines don't algin 
horizontally. Similarly the added y in -4y.

It is because of this alignment problem that the 2nd equation cannot be 
directly underlined, as the line from &\phantom{=} will be a little 
higher. I guess one might try &\underline{=\phantom{y}}, but I haven't 
tried this. If its works, it will be shorter.

I'll be interested in other solutions.


Sebastian Canagaratna
Department of Chemistry and Biochemistry
Ada, Ohio 45810


More information about the texhax mailing list