I read in "What is the difference between TeX and LaTeX?" that LaTeX is a collection of macros (an extension) built on top of TeX. Supposedly, TeX primitives should then behave in LaTeX the same way they do in TeX. However, it seems it is not always the case. In "How is \char processed in math mode?", it is explained why \char
behaves in text mode differently from math mode. But this is only in TeX. In LaTeX, however, \char
behaves identically in text and math modes, as it can be seen from the following example:
\documentclass{article}
\begin{document}
In text mode, we obtain \char"5. In math mode, we also obtain $\char"5$.
\end{document}
In TeX, the result is different:
In text mode, we obtain \char"5. In math mode, we obtain $\char"5$.
\bye
It seems that some TeX primitives (at least one: \char
) are redefined in LaTeX. I would like to know whether TeX primitives must be redefined in LaTeX. If yes, why? Are there other TeX primitives that are redefined in LaTeX? Are not TeX and LaTeX expected to produce the same result on such a simple piece of code (as in the example)?