TeXbook 中是否存在非纯 TeX 控制序列?

TeXbook 中是否存在非纯 TeX 控制序列?

我正在浏览电子书源文件texbook.tex 来自CTAN在其中,我遇到了控制字对\begintt\endtt(例如,第 445–447 行,看起来像是用于标记源代码)。但我在电子书,它们也不在 Knuth 的plain.tex宏文件中。我也在$ tex '\show\begintt'命令行上尝试过,它返回未定义。

我想知道,texbook.texCTAN 是否是 Knuth 创作的实际原始文件?因为他在撰写原始书籍时使用任何他不会作为“纯 TeX”包含的宏似乎很奇怪(至少对我来说)。

答案1

\begintt\endtt定义在manmac.tex

\outer\def\begintt{$$\let\par=\endgraf \ttverbatim \parskip=\z@
  \catcode`\|=0 \rightskip-5pc \ttfinish}
{\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
  |obeylines % end of line is active
  |gdef|ttfinish#1^^M#2\endtt{#1|vbox{#2}|endgroup$$}}

实际上\endtt不是一个宏,而只是一个用于决定在何处停止逐字列表的分隔符。

TeXbook 的来源始于

% This manual is copyright (C) 1984 by the American Mathematical Society.
% All rights are reserved!
% The file is distributed only for people to see its examples of TeX input,
% not for use in the preparation of books like The TeXbook.
% Permission for any other use of this file must be obtained in writing
% from the copyright holder and also from the publisher (Addison-Wesley).
\loop\iftrue
  \errmessage{This manual is copyrighted and should not be TeXed}\repeat
\pausing1 \input manmac

相关内容