[Tex/LaTex] How on earth did Knuth do it

booksknuth

Donald Knuth has written what are arguably the most beautiful books with the TeX system.

Now I understand that Knuth wrote them in plain TeX, and still uses plain TeX for his current projects. Which, to me at least, raises the question: how is it even possible to write a book of any significant size without the benefit of the LaTeX macros and the CTAN packages, some of which, I believe, will only work with LaTeX?

For instance, how did he do his drawings? How did he define his environments? (Did he?) How did he manage floats?

Best Answer

Knuth created a great little macro package; it should be in your local TeX installation as manmac.tex. He used it for the TeXbook. Reading it is very instructive. He does things like footnotes, inserts, and figures. There's a "proof mode" which changes the behavior of some things while you're proofing a manuscript. He has the proper macros for setting fonts down to 7pt size (including adjusting math mode fonts, symbols, strut boxes, etc.). He's got custom output routines. He's got a special syntax for verbatim text. He builds his own index. He has environments for double columns.

It's only 700ish lines of code. It's really worth studying. He even explains much of it in the TeXbook.

As Barbara Beeton pointed out in a comment, taocpmac.tex is used to typeset the Art of Computer Programming Series. It is also well worth studying.