# How to fix multiple alignment

I have this MWE

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[version=4]{mhchem}

\begin{document}

\begin{alignat*}{4}
\ce{&i &&-> i + r_I, \qquad
&r_i &&-> r_I + I, \\
&I + Lac &&-> I \cdot Lac, \qquad
&I \cdot Lac &&-> I + Lac, \\
&I + o &&-> I \cdot o, \qquad
&I \cdot o &&-> I + o, \\
&o + RNAP &&-> o \cdot RNAP, \qquad
&o \cdot RNAP &&-> o + RNAP, \\
&o \cdot RNAP &&-> o + RNAP + r, \qquad
&r &&-> r + Z, \\
&Lac + Z &&-> Z, \qquad
&r_I &&-> \emptyset, \\
&I \cdot Lac &&-> Lac, \\
&z &&-> \emptyset
}
\end{alignat*}

\end{document}


And what I want from this is like two columns of the equations (ie two equations on each line) but both columns to be aligned. After looking at Multiple alignment I still can't see how to get it to work for this case.

• Your code doesn't compile as is, Please fix. – Mico Apr 24 '18 at 9:56
• Should be working now?? – Gragbow Apr 24 '18 at 10:17

Two observations: since you want two columns of alignments, you have to use \begin{alignat*}{2}, not 4. Note this requires 3 & (whereas 4 columns would require 7). The first & is for the alignment point of the first column, the second is here to introduce the second column, and the third is for the alignment point in the second column.

The alignat environment lets you have control on the spacing between the columns, but you only have to add a \qquad in a single row – usually the one which has the shortest distance between the end of the first column and the beginning of the second column. Here it seems the best choice is the fourth row.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[version=4]{mhchem}

\begin{document}

\begin{alignat*}{2}
\ce{i &-> i + r_I, &r_i & -> r_I + I, \\
I + Lac & -> I \cdot Lac, & I \cdot Lac & -> I + Lac, \\
I + o & -> I \cdot o, & I \cdot o & -> I + o, \\
o + RNAP & -> o \cdot RNAP, &\qquad o \cdot RNAP & -> o + RNAP, \\
o \cdot RNAP & -> o + RNAP + r, & r & -> r + Z, \\
Lac + Z & -> Z, & r_I & -> \emptyset, \\
I & -> \emptyset, & I \cdot Lac & -> Lac, \\
r & -> \emptyset, & z & -> \emptyset
}
\end{alignat*}

\end{document}


Switching to the align environment as follows:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[version=4]{mhchem}

\begin{document}

\begin{align*}
\ce{
i &-> i + r_I,      &          r_i &-> r_I + I,   \\
I + Lac &-> I \cdot Lac,  &  I \cdot Lac &-> I + Lac,   \\
I + o &-> I \cdot o,    &    I \cdot o &-> I + o,     \\
o + RNAP &-> o \cdot RNAP, & o \cdot RNAP &-> o + RNAP,  \\
o \cdot RNAP &-> o + RNAP + r, &            r &-> r + Z,     \\
Lac + Z &-> Z,            &          r_I &-> \emptyset, \\
I &-> \emptyset,    &  I \cdot Lac &-> Lac,       \\
r &-> \emptyset,    &            z &-> \emptyset  \\
}
\end{align*}

\end{document}


Gives the following result:

Is this what you want?

• Yep. I originally tried to use the \align command but it kept going wrong, so i looked at the thread I linked which said to used \alignat – Gragbow Apr 24 '18 at 15:28