Whenever I try to use the alignat environment, it doesn't seem to work on my computer! I tried the following simple code (my file had \usepackage{amsmath}):
\begin{alignat}{3}
\min \quad x_1 & + 2x_2 & + 4x_3 & & & \\
\text{s.t.} \quad x_1 & + x_2 & + 3x_3 & = & 5 & \\
2x_1 & + x_2 & + 6x_3 & = & 8 & \\
x_1 &, x_2 &, x_3 & \geq & 0 & .
\end{alignat}
On compilation, I get the following error:
! Missing # inserted in alignment preamble. <to be read again>
\crcr l.114 \end{alignat}
Any ideas why this might be?

