Showing posts with label quotation. Show all posts
Showing posts with label quotation. Show all posts

Sunday, March 20, 2011

Knuth quote V

Somewhat mysteriously, in the middle of the chapter on macros in The TeXbook, Knuth defines \rhead—the macro he uses to keep track of the running headline. The definition itself is a little odd in that when \rhead is executed, it globally redefines \rhead to be almost the same text sans the definition.
\def\rhead{Chapter \chapno: Definitions (aka Macros)% my little joke
  \gdef\rhead{Chapter \chapno: Definitions (also called Macros)}}
However, it is the comment here that interests me. What is his joke? My best guess is that he used macros to change the running headline after the page on which this \def appears. He never calls attention to this change in the text and never explains the joke.

Sunday, March 13, 2011

Knuth quote IV

When quoting Lamport about writing Greek letters being as easy as writing “... as easy as $\pi$” in The TeXbook, Knuth cites the book as LaTeX Document Preparation System. He comments,
Note: the final manual has a slightly different wording on p43.
It's now called "LaTeX: A Document Preparation System" (1986)
But I decided to cite the original, partly because I have
no smallcaps sans-serif `A' to match the new LaTeX logo!

Saturday, January 29, 2011

Knuth quote III

Here's a great one from the source code to TeX. It's the beginning of section 1154.
The simplest math formula is, of course, ‘$ $’, when no noads are generated. The next simplest cases involve a single character, e.g., ‘$x$’. Even though such cases may not seem to be very interesting, the reader can perhaps understand how happy the author was when ‘$x$’ was first properly typeset by TeX.
Being a programmer myself, I most certainly can.

A noad, by the way, is what TeX calls (most of) the elements of a math list. (It can also contain nodes, which are what appear in horizontal and vertical lists.)

Sunday, January 16, 2011

Knuth quote II

Okay, this one isn't a comment in code, yet it amuses me anyway. This is Exercise 24.1 in The TeXbook.
Can you think of a reason why you might want ‘A12’ to be a ‹hex digit› even though the letter A has category 11? (Don't worry if your answer is “no.”)
For the record, my answer was “yes.” Unfortunately, my reason wasn't correct.

Friday, January 14, 2011

Knuth quote I

Scattered throughout Knuth's programs are a number of great comments. I really enjoy encountering these and I thought I'd share them. (As I wrote in my first post, this blog is mostly a way for me to collect pieces of information. As such, I'm mostly collecting these quotes for me.)

In tex.web, line 950 is
last:=first; {cf.\ Matthew 19\thinspace:\thinspace30}
This line of code is assigning first to the variable last. You can find many versions of that verse here. The King James version is
But many [that are] first shall be last; and the last [shall be] first.