2

On page 349 of the TeXbook the definition of \magstep is given as

\def\magstep#1{\ifcase#1 1000\or
  1200\or 1440\or 1728\or 2074\or 2488\fi\relax}

But in plain.tex of texlive the line 391 says:

\def\magstep#1{\ifcase#1 \@m\or 1200\or 1440\or 1728\or 2074\or 2488\fi\relax}

Why does it say \@m (which is defined as \mathchardef\@m=1000) instead of 1000?

The version number in the file plain.tex is \def\fmtversion{3.141592653} and thus identical to the version number in the TeXbook.

2
  • I suspect it might be related to this. However, there are others who know the internals of TeX much better than me. Dec 7, 2020 at 15:45
  • 1
    @ecki The difference between 1000 and \@m is duly covered by this provision at the bottom of p. 342 of the TeXbook (appendix B): Our purpose in the rest of this appendix will be to discuss the contents of plain.tex. However, we will not include a verbatim description, because some parts of that file are too boring, and because the actual macros have been “optimized” with respect to memory space and running time. Unoptimized versions of the macros are easier for humans to understand, so we shall deal with those; plain.tex contains equivalent constructions that work better on a machine.
    – frougon
    Dec 7, 2020 at 16:08

1 Answer 1

3

The definition of \magstep has always been with \@m, as far as I know.

Looking in the SAIL archives http://www.saildart.org/[TEX,SYS]/ we can see that \magstep made its appearance in the version dated 1983-07-27 and the code is

\def\magstephalf{1095 }
\def\magstep#1{\ifcase#1 \@m\or 1200\or 1440\or 1728\or 2074\or 2488\fi\relax}

The TeXbook lies every now and then. Small white lies, usually, like in this case. Using \@m saves three tokens in memory. On the other hand, the code in appendix B shows 1000 for readability.

Similarly, plain.tex has

\textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
\def\rm{\fam\z@\tenrm}
\textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
\def\mit{\fam\@ne} \def\oldstyle{\fam\@ne\teni}
\textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
\def\cal{\fam\tw@}

but the TeXbook maintans it's

\textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
\def\rm{\fam0 \tenrm}
\textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
\def\mit{\fam1 } \def\oldstyle{\fam1 \teni}
\textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
\def\cal{\fam2 }

One token instead of two. In 1983 and earlier (and also for several years later) memory was in very short supply and even saving one had its value. Hence, “wasting” a \dimen register with \newdimen\z@ \z@=0pt saved a lot of memory, allowing to say \z@ instead of (with a space) or 0pt  in many places.

Thanks to frougon, here's an appropriate quotation from the TeXbook (p. 342):

Somewhere in your computer system you should be able to find a file called plain.tex that contains exactly what has been preloaded into the running TeX system that you use. Our purpose in the rest of this appendix will be to discuss the contents of plain.tex. However, we will not include a verbatim description, because some parts of that file are too boring, and because the actual macros have been “optimized” with respect to memory space and running time. Unoptimized versions of the macros are easier for humans to understand, so we shall deal with those; plain.tex contains equivalent constructions that work better on a machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .