I am trying to subtract one equation from another but I can't get it to display the way that I want. This is what I have right now.
\begin{align*}
&y&=2x+5\\
-&&\\
&y&=3x+10\\\hline
&0&=-x-5
\end{align*}
alignequations
I am trying to subtract one equation from another but I can't get it to display the way that I want. This is what I have right now.
\begin{align*}
&y&=2x+5\\
-&&\\
&y&=3x+10\\\hline
&0&=-x-5
\end{align*}
Best Answer
This does not look very good but seems close to what your code is attempting to do, where I use
\cline{}
to draw the horizontal line, and\phantom{y=}
to push the minus sign to the leftRecomended Solution:
However, I would suggest the use of
\intertext
or\shortintertext
from themathtools
package, and refer to the equations:Notes:
(??)
in the cross reference.\shortintertext
yields better spacing but requires an additional package. Alternatively, you can use\intertext
which is available inamsmath
.mathtools
package already includesamsmath
.Code: