2

I've noticed that it is possible to assign a value to a token list register without using = (the equality sign) as follows:

\newtoks\mytoks%
\mytoks{Hello, world!}% as opposed to \mytoks={Hello, world!}

However, according to the TeXbook, the = is mandatory.

Is this a known extension, or is this a bug in pdftex?

  • Where in the TeXbook are you citing that the = is mandatory? The example on p.212? In general, for many (every?) TeX command that employs the = for assignment, the = can be omitted. Lengths, for example. – Steven B. Segletes Aug 17 '17 at 12:32
  • @StevenB.Segletes: Yes, the first paragraph on p. 212. It's not an example, it's a normative statement: "To assign a new value to a token list parameter or register, you say ...". So is this a documented feature? – Evan Aad Aug 17 '17 at 12:35
  • 3
    This page is only a description, the rules are on page 275, there <equal> is describes as optional spaces or optional spaces and =. – Ulrike Fischer Aug 17 '17 at 12:42
4

Page 275 of the TeXbook:

"Assignment commands often include an = sign, but in all cases this sign is optional; you can leave it out if you don't mind the fact that the resulting TeX code might not look quite like an assignment."

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.