# Aligning equations with align

Imagine I have the following system

\begin{align}
a&=b\\
abc&=def+1\\
e&=mc^2-H(x,y,z)
\end{align}


I want to add a first column aligned in a different manner, like so

is this possible to do with align? If not, what good alternative could I use? Note that I want to index each equation separately, so I believe matrix wouldn't work.

• The number of & needs to be 2x number of alignments minus 1. So m & =0: & a & = b \\ will be the first line Commented Jun 11, 2022 at 12:14
• @daleif That's great! I didn't know it worked like that. Do you know if it is somehow possible to control the spacing between the left-hand column of equations (m's) and the right-hand one? Commented Jun 11, 2022 at 12:19
• The use alignedat instead, it needs the number of alignments as a parameter. It makes the dist between alignment columns zero and thus a manual space can be added between them. Commented Jun 11, 2022 at 12:20
• @daleif - Both the standalone aligned/aligned* and the embeddable alignedat/alignedat* environments provide ways to control the spacing between the left-hand and right-hand groups of equations.
– Mico
Commented Jun 11, 2022 at 13:10
• Not a direct answer, but this question indicates unfamiliarity with the possibilities provided by the amsmath package. Therefore, reading the user guide for amsmath (texdoc amsldoc) could be beneficial. Commented Jun 11, 2022 at 20:51

You asked in a follow-up comment:

Do you know if it is somehow possible to control the spacing between the left-hand column of equations (m's) and the right-hand one?

That's actually where the alignat and alignat* environments very much come into their own. Consider the following three alignat*{2} environments:

The first group shows that, in general, it's not a good idea to provide no separation instruction between the left-hand and right-hand equations. The second and third group differ only in where the instruction \qquad is placed: it's in row 2 for the middle group, and in row 1 for the third and final group. In practice, one would (should?) place the spacing instruction (here: \qquad) in the row for which the spacing is narrowest to begin with.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}
m&=0{:} &        a&=b\\
m&=1{:} &        abc&=def+1\\
m&=2{:} &        e&=mc^2-H(x,y,z)
\end{alignat*}

\begin{alignat*}{2}
m&=0{:} &        a&=b\\