I have already read the posts detailing how to create text that does not take up any space. My question is if I am doing it correctly in this instance.
\documentclass{article}
\usepackage{mathtools}
\newcommand{\n}{\makebox[0pt][r]{$-$}}
\begin{document}
Not using my custom command
\begin{alignat*}{3}
a_1 & {}-{} & a_2 & {}={} & -3\\
&& a_2 & {}={} & 8\\
&& - a_2 & {}={} & 8
\end{alignat*}
Using my custom command
\begin{alignat*}{3}
a_1 & {}-{} & a_2 & {}={} & -3\\
&& a_2 & {}={} & 8\\
&& \n a_2 & {}={} & 8
\end{alignat*}
\end{document}
The command \n seems a bit hacky to me, so I was wondering if there is a better resolution to my problem.


\llapand\rlap. They can have unexpected effects, which\makeboxhasn't. – egreg Jan 29 '17 at 00:31\mathllap(sincemathtoolsis loaded, which would simplify the definition of the command)? – Bernard Jan 29 '17 at 00:40