I know that the point of \crcr
is to be a kind of "backup \cr
" in \halign
/\valign
, in that it only adds a \cr
if it wouldn't result in two in a row. Nonetheless it seems to find its way into the \halign
preamble, where it seems merely like a slightly-longer version of \cr
. For example, the plain Tex definition of \matrix
:
*\show\matrix
> \matrix=macro:
#1->\null \,\vcenter {%
\normalbaselines \m@th \ialign {%
\hfil $##$\hfil &&\quad \hfil $##$\hfil \crcr
\mathstrut \crcr
\noalign {\kern -\baselineskip }%
#1\crcr
\mathstrut \crcr
\noalign {\kern -\baselineskip }%
}%
}\,.
(I have added some formatting). I don't get why the preamble would end in \crcr
when \cr
works just as well, is the only option mentioned by the TeXbook, and when \crcr
doesn't seem to function as a backup \cr
in this case. Now, the third \crcr
does have that particular function here, but in the very simple alignment
\halign{#\crcr x}
you will get a "Missing \cr
inserted" error nonetheless. I have seen this idiom elsewhere so I assume it has some reason but I can't figure out what it is.
Best Answer
One explanation of the use of
\crcr
could be that it leaves redefinition of\cr
open to the user.An example of this is in @TH.’s answer on How to use \valign? where he redefines
\cr
to meanso one gets glue between columns in
\valign
. I think it is very clever.