9

At the beginning of Chapter 3: Controlling TeX of his TeXbook, Knuth explains that control sequences come in two flavours: control words and control symbols.

Control words

The first kind, like \input, is called a control word; it consists of an escape character followed by one or more letters, followed by a space or by something besides a letter. [...] In case you're wondering what a "letter" is, the answer is that TeX normally regards the 52 symbols A...Z and a...z as letters. The digits 0...9 are not considered to be letters, so they don't appear in control sequences of the first kind.

Control symbols

A control sequence of the other kind, like \', is called a control symbol; it consists of the escape character followed by a single nonletter.

To test my understanding of those categories, I tried compiling the following code (with pdftex)... and was surprised not to get any error!

\def\10{foo}
\def\20{bar}
\10\20
\bye

In fact, a PDF output was generated without mishap:

enter image description here

The reason I'm puzzled is that \10 and \20 don't seem to fall into either category of allowed control-sequence names (as defined above):

  1. They contain nonletters; therefore, they can't be considered control words.
  2. They consist of the escape character (\) followed by more than just one nonletter; therefore, they can't be considered control symbols.

What am I missing?

jub0bs
  • 58,916

1 Answers1

15

In this case the 0 is part of the parameter text and acts as a delimiter token. So you are really defining \1 and \2 and are specifying that a 0 delimiter token is required after. You can use this mechanism for delimiting parameters.

Roelof Spijker
  • 17,663
  • 5
  • 55
  • 63