Following code
... \begin{align}
\begin{array}
1 & 2 & 3\\
1 & 2 & 3
\end{array}
\end{align}...
results in numerous errors:
- Argument of \array has an extra } (line 0)
- Missing $ inserted \end{align}
- Missing \endgroup inserted \end{align}
- Extra }, or forgotten $ \end{align}
- \begin{align} on input line 101 ended by \end{array}. \end{align}
- Misplaced alignment tab character & \end{align} (2x, same line)
- Misplaced \omit \end{align}
- Misplaced \cr \end{align}
- Misplaced alignment tab character & \end{align} (2x)
- Misplaced \cr \end{align}
- Extra }, or forgotten $ \end{align} (2x)
- Missing number, treated as zero \end{align}
- Illegal unit of measure (pt inserted) \end{align}
- Missing number, treated as zero (3x, line 0)
- Missing $ inserted \end{align}
- Display math should end with $$ (line 0)
- Missing $ inserted \end{align}
- Missing \endgroup inserted \end{align}
- Extra }, or forgotten $ \end{align}
- Missing $ inserted \end{align}
- Too many }'s \end{align}
- \begin{document} ended by \end{array}. (line 0)
- Misplaced \noalign \end{align} (2x)
- Too many }'s \end{align}
- \begin{document} ended by \end{align}. \end{align}
- Display math should end with $$ (line 0)
Of course code without this compiles just fine.
All errors are at line 109 (\end{align}
), except those at line 0.
Matrix environment (examples) also compiles with errors, but fewer. These are:
- Paragraph ended before \array was complete I've inserted a
begin-math/end-math symbol since I think
- Missing \right. inserted I've inserted something that you may have
forgotten.
- Missing \endgroup inserted
I'm using TexStudio on Ubuntu. I also tried with Geany but it throws the same errors.
Best Answer
You need to specify the
array
format; for example:Some new information has been given in the comments; the problem comes from using the
arrayjob
andamsmath
packages simultaneously, as this example shows:Processing the above document triggers the error
The conflict comes from the macro name
\array
used byarrayjob
which conflicts with macros inamsmath
; thearrayjobx
package (which is an improved version of arrayjob) solves this issue using the macro\arrayx
instead. Thus, in order to prevent the conflict between the packagesarrayjob
andamsmath
, usearrayjobx
instead ofarrayjob
:I am aware that there's no point in using
array
insidealign
as I did in my answer; if the only intent is to get a displayed (numbered) expression, theequation
environment would be a better choice; if no display number is needed, then\[...\]
is enough. I kept the originalalign
just in the hope that the OP's actual expression deserves its use.