[Tex/LaTex] Why not use \cr instead of \\ in tables


In plain TeX \cr is used to mark the end of a row in a table.
In LaTeX \\ is usually used instead.

\\ takes an optional argument, which \cr does not support. But I never use that anyway, I prefer booktabs' \addlinespace.

As I have found out recently \\ does not always work, see this bug which was closed with this commit which adds a subsection to the documentation explaining that \cr should be used instead. If the last column of a table is a S column (defined by the siunitx package) and text is appended to this column (with the array package's <{...} syntax) the spacing is wrong when using \\ but correct when using \cr.

So I am wondering: Why not always use \cr instead of \\ to denote the end of a row in a table?

Best Answer

The argument against using \cr is really the generic argument that applies to any use of undocumented internal interfaces in any software.

\cr is not a documented latex command, the documented commands to end table rows are \\ and \tabularnewline.

In the default implementation, if you are not using the * form or [] argument, \\ basically just does \cr so using \cr directly comes to the same thing. However as it isn't a documented latex command the implementation of tables could change so that they were not equivalent, also conversions of latex to html etc have no reason to expect to see \cr in a document and so may fail.

If some package has a bug that means \cr is needed then that's a bug that should be fixed, or if some package defines an environment where \cr is expected then it is that package documentation not latex documentation (or this answer) that says if you should use it.

Related Question