Consider the following MWE:
\documentclass{article}
\usepackage{amsmath,bbm}
\begin{document}
\begin{align}
&&&\cr
\end{align}
\end{document}
It generates both the "Missing number, treated as zero" and "Illegal unit of measure (pt inserted)" error messages. Why?
(My goal is to have 2 spaced equations on one line but no equation number for that line. I realize I can accomplish this with something like \begin{align} \nonumber a&=1 & b&=2\\ c\end{align}
but why is this necessary?)
Best Answer
\cr
is not a LaTeX command (it is a TeX primitive) and its use in the middle of an AMS alignment causes a chunk of the alignment code to be omitted as the correct code\\
sets up a lot of the internal measurement data before calling\cr
internally to finish the row.If you add
\tracingall
and compare the logs with\cr
and\\
then you will see that the specific cause of the error is that\cr
did not terminate the cell as intended and so the\maxcolumn@widths
macro was not correctly updated with the column widths.With
\cr
it isbut with
\\
it isalign
uses an\ifcase
to extract the relevant length as it considers each columnbut as it is too short, once it gets to column 3 it uses
\ifcase3
which means that it tries to read past this\or
list and you get:Don't use TeX primitives in the middle of complicated LaTeX code:-)