TeX control word (source code)

= TeX control word
{c}

A \b[TeX control word] is a <TeX control sequence> scanned from an escape followed by a maximal run of characters with <TeX category code> 11. The scanner then enters the space-skipping <TeX input state> S.<TeX source code by Donald E. Knuth>[Scan a control sequence: letter scanning and skip_blanks]{ref}

For example, after `\def\word{Q}`, the input `\word   X` yields `QX`; the spaces terminate the name and are skipped. The input `\word X` does the same. By contrast, `\wordX` names a single different command, so removing the separator does not preserve the token sequence.

Token identity and current meaning are separate. Define `\def\call{\word}`, then redefine `\word` to yield `R`. Expanding `\call` now yields `R`, because its stored command token still names `word`. This is useful when reading <TeX macros>: the spelling identifies the command, while its current definition controls expansion.