§207  TEX82  PART 15: THE COMMAND CODES 73

207. The command codes. Before we can go any further, we need to define symbolic names for the internal code numbers that represent the various commands obeyed by TEX. These codes are somewhat arbitrary, but not completely so. For example, the command codes for character types are fixed by the language, since a user says, e.g., ‘ ` $ ’ to make a math delimiter, and the command code math shift is equal to 3. Some other codes have been made adjacent so that case statements in the program need not consider cases that are widely spaced, or so that case statements can be replaced by if statements.

At any rate, here is the list, for future reference. First come the “catcode” commands, several of which share their numeric codes with ordinary commands when the catcode cannot emerge from TEX’s scanning routine.

74  PART 15: THE COMMAND CODES  TEX82 §208

define escape = 0 { escape delimiter (called in The TEXbook) } define relax = 0 { do nothing ( ) } define left brace = 1 { beginning of a group ( ) } define right brace = 2 { ending of a group ( ) } define math shift = 3 { mathematics shift character ( $ ) } define tab mark = 4 { alignment delimiter ( , ) } define car ret = 5 { end of line ( carriage return, , ) } define out param = 5 { output a macro parameter } define mac param = 6 { macro parameter symbol ( # ) } define sup mark = 7 { superscript ( ) } define sub mark = 8 { subscript ( ) } define ignore = 9 { characters to ignore ( ) } define endv = 9 { end of ⟨v_{j}⟩ list in alignment template } define spacer = 10 { characters equivalent to blank space ( ␣ ) } define letter = 11 { characters regarded as letters ( , ) } define other char = 12 { none of the special character types } define active char = 13 { characters that invoke macros ( ) } define par end = 13 { end of paragraph ( ) } define match = 13 { match a macro parameter } define comment = 14 { characters that introduce comments ( % ) } define end match = 14 { end of parameters to macro } define stop = 14 { end of job ( , ) } define invalid char = 15 { characters that shouldn’t appear ( ) } define delim num = 15 { specify delimiter numerically ( ) } define max char code = 15 { largest catcode for individual characters } 208. Next are the ordinary run-of-the-mill command codes. Codes that are min internal or more represent internal quantities that might be expanded by ‘ ’.

define char num = 16 { character specified numerically ( ) } define math char num = 17 { explicit math code ( ) } define mark = 18 { mark definition ( ) }

define xray = 19 { peek inside of TEX (  ,  , etc. ) }
define make box = 20 { make a box (  ,  ,  , etc. ) }
define hmove = 21 { horizontal motion (  ,  ) }
define vmove = 22 { vertical motion (  ,  ) }
define un hbox = 23 { unglue a box (  ,  ) }
define un vbox = 24 { unglue a box (  ,  ) }
define remove item = 25 { nullify last item (  ,  ,  ) }
define hskip = 26 { horizontal glue (  ,  , etc. ) }
define vskip = 27 { vertical glue (  ,  , etc. ) }

define mskip = 28 { math glue ( ) } define kern = 29 { fixed space ( ) } define mkern = 30 { math kern ( ) } define leader ship = 31 { use a box ( , , etc. ) } define halign = 32 { horizontal table alignment ( ) } define valign = 33 { vertical table alignment ( ) } define no align = 34 { temporary escape from alignment ( ) } define vrule = 35 { vertical rule ( ) } define hrule = 36 { horizontal rule ( ) } define insert = 37 { vlist inserted in box ( ) } define vadjust = 38 { vlist inserted in enclosing paragraph ( ) } define ignore spaces = 39 { gobble spacer tokens ( ) } define after assignment = 40 { save till assignment is done ( ) } define after group = 41 { save till group is done ( ) } define break penalty = 42 { additional badness ( ) } define start par = 43 { begin paragraph ( , ) } define ital corr = 44 { italic correction ( ) } define accent = 45 { attach accent in text ( ) } define math accent = 46 { attach accent in math ( ) } define discretionary = 47 { discretionary texts ( , ) }

define eq no = 48 { equation number (  ,  ) }
define left right = 49 { variable delimiter (  ,  ) }

define math comp = 50 { component of formula ( , etc. ) } define limit switch = 51 { diddle limit conventions ( , etc. ) } define above = 52 { generalized fraction ( , , etc. ) } define math style = 53 { style specification ( , etc. ) } define math choice = 54 { choice specification ( ) } define non script = 55 { conditional math glue ( ) } define vcenter = 56 { vertically center a vbox ( ) }

define case shift = 57 { force specific case (  ,  ) }
define message = 58 { send to user (  ,  ) }
define extension = 59 { extensions to TEX (  ,  , etc. ) }
define in stream = 60 { files for reading (  ,  ) }

define begin group = 61 { begin local grouping ( ) } define end group = 62 { end local grouping ( ) } define omit = 63 { omit alignment template ( ) } define ex space = 64 { explicit space ( ␣ ) } define no boundary = 65 { suppress boundary ligatures ( ) } define radical = 66 { square root and similar signs ( ) } define end cs name = 67 { end control sequence ( ) } define min internal = 68 { the smallest code that can follow } define char given = 68 { character code defined by } define math given = 69 { math code defined by } define last item = 70 { most recent item ( , , ) } define max non prefixed command = 70 { largest command code that can’t be }

209. The next codes are special; they all relate to mode-independent assignment of values to TEX’s internal registers or tables. Codes that are max internal or less represent internal quantities that might be expanded by ‘ ’.

define toks register = 71 { token list register ( ) }

define assign toks = 72 { special token list (  ,  , etc. ) }
define assign int = 73 { user-defined integer (  ,  , etc. ) }

define assign dimen = 74 { user-defined length ( , etc. ) } define assign glue = 75 { user-defined glue ( , etc. ) } define assign mu glue = 76 { user-defined muglue ( , etc. ) } define assign font dimen = 77 { user-defined font dimension ( ) }

define assign font int = 78 { user-defined font integer (  ,  ) }
define set aux = 79 { specify state info (  ,  ) }

define set prev graf = 80 { specify state info ( ) } define set page dimen = 81 { specify state info ( , etc. ) } define set page int = 82 { specify state info ( , ) } define set box dimen = 83 { change dimension of box ( , , ) } define set shape = 84 { specify fancy paragraph shape ( ) } define def code = 85 { define a character code ( , etc. ) } define def family = 86 { declare math fonts ( , etc. ) } define set font = 87 { set current font ( font identifiers ) } define def font = 88 { define a font file ( ) } define register = 89 { internal register ( , , etc. ) } define max internal = 89 { the largest code that can follow } define advance = 90 { advance a register or parameter ( ) } define multiply = 91 { multiply a register or parameter ( ) } define divide = 92 { divide a register or parameter ( ) }

define prefix = 93 { qualify a definition (  ,  ,  ) }
define let = 94 { assign a command code (  ,  ) }
define shorthand def = 95 { code definition (  ,  , etc. ) }

define read to cs = 96 { read into a control sequence ( ) } define def = 97 { macro definition ( , , , ) } define set box = 98 { set a box ( ) } define hyph data = 99 { hyphenation data ( , ) } define set interaction = 100 { define level of interaction ( , etc. ) } define max command = 100 { the largest command code seen at big switch } 210. The remaining command codes are extra special, since they cannot get through TEX’s scanner to the main control routine. They have been given values higher than max command so that their special nature is easily discernible. The “expandable” commands come first.

define undefined cs = max command + 1 { initial state of most eq type fields } define expand after = max command + 2 { special expansion ( ) } define no expand = max command + 3 { special nonexpansion ( ) } define input = max command + 4 { input a source file ( , ) } define if test = max command + 5 { conditional text ( , , etc. ) } define fi or else = max command + 6 { delimiters for conditionals ( , etc. ) } define cs name = max command + 7 { make a control sequence from tokens ( ) } define convert = max command + 8 { convert to text ( , , etc. ) } define the = max command + 9 { expand an internal quantity ( ) } define top bot mark = max command + 10 { inserted mark ( , etc. ) } define call = max command + 11 { non-long, non-outer control sequence } define long call = max command + 12 { long, non-outer control sequence } define outer call = max command + 13 { non-long, outer control sequence } define long outer call = max command + 14 { long, outer control sequence } define end template = max command + 15 { end of an alignment template } define dont expand = max command + 16 { the following token was marked by } define glue ref = max command + 17 { the equivalent points to a glue specification } define shape ref = max command + 18 { the equivalent points to a parshape specification } define box ref = max command + 19 { the equivalent points to a box node, or is null } define data = max command + 20 { the equivalent is simply a halfword number }