Question: 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*}

```

Answer: 
Here is my solution:
![enter image description here](https://i.stack.imgur.com/HLkh2.png)

```
\documentclass[]{article}

\usepackage{amsmath}
\begin{document}
\begin{alignat*}{4}
    &y&=&&2x&&+&5\\   
    -\hspace*{.5em}&y&=&&3x&&+&10\\[-2.5ex]\cline{2-8}\\[-4.8ex]
    &0&=&&-x&&-&5    
\end{alignat*}

\end{document}

```

I use the `alignat` enviroment from `amsmath`
I write it like this:

```
\[\frac{\begin{matrix} y=2x+5\\ y=3x+10 \end{matrix}}{0=-x-5}\ -\]

```