[Tex/LaTex] Horizontal line in the middle (text alignment)

inline()rules

MWE:

\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\begin{document}

\begin{gather*}
y=3x-6 --- {1}\\
y=-x+5 --- {2}\\
\end{gather*}

\end{document}

Picture:
enter image description here

How do I join the three dashes?

I tried \rule and \line but they only give me a line aligned to the bottom of the text.

Best Answer

If you want rule:

\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\begin{document}

\begin{gather*}
y=3x-6 \mathrel{\vcenter{\hbox{\rule{2cm}{1pt}}}} {1}\\
y=-x+5 \mathrel{\vcenter{\hbox{\rule{2cm}{1pt}}}} {2}\\
\end{gather*}

\end{document}

enter image description here

Depending on how long the rule should be, you may change the dimension or simply use \text{---}..

Related Question