TeX in C
Explore TeX with modern c compiler.
PART 15: The command codes

枚举

enum  CatCode {
  ESCAPE , LEFT_BRACE , RIGHT_BRACE , MATH_SHIFT ,
  TAB_MARK , CAR_RET = 5 , MAC_PARAM , SUP_MARK ,
  SUB_MARK , IGNORE , SPACER = 10 , LETTER ,
  OTHER_CHAR , ACTIVE_CHAR , COMMENT , INVALID_CHAR = 15
}
 [#207]: 更多...
 
enum  TexCommandCode {
  RELAX = ESCAPE , OUT_PARAM = CAR_RET , ENDV = IGNORE , PAR_END = ACTIVE_CHAR ,
  MATCH = ACTIVE_CHAR , END_MATCH = COMMENT , STOP = COMMENT , DELIM_NUM = INVALID_CHAR ,
  MAX_CHAR_CODE = INVALID_CHAR , CHAR_NUM = 16 , MATH_CHAR_NUM , MARK ,
  XRAY , MAKE_BOX , HMOVE = 21 , VMOVE ,
  UN_HBOX , UN_VBOX , REMOVE_ITEM , HSKIP = 26 ,
  VSKIP , MSKIP , KERN , MKERN ,
  LEADER_SHIP = 31 , HALIGN , VALIGN , NO_ALIGN ,
  VRULE , HRULE = 36 , INSERT , VADJUST ,
  IGNORE_SPACES , AFTER_ASSIGNMENT , AFTER_GROUP = 41 , BREAK_PENALTY ,
  START_PAR , ITAL_CORR , ACCENT , MATH_ACCENT = 46 ,
  DISCRETIONARY , EQ_NO , LEFT_RIGHT , MATH_COMP ,
  LIMIT_SWITCH = 51 , ABOVE , MATH_STYLE , MATH_CHOICE ,
  NON_SCRIPT , VCENTER = 56 , CASE_SHIFT , MESSAGE ,
  EXTENSION , IN_STREAM , BEGIN_GROUP = 61 , END_GROUP ,
  OMIT , EX_SPACE , NO_BOUNDARY , RADICAL = 66 ,
  END_CS_NAME = 67 , MIN_INTERNAL = 68 , CHAR_GIVEN = 68 , MATH_GIVEN = 69 ,
  LAST_ITEM = 70 , MAX_NON_PREFIXED_COMMAND = 70 , TOKS_REGISTER = 71 , ASSIGN_TOKS ,
  ASSIGN_INT , ASSIGN_DIMEN , ASSIGN_GLUE , ASSIGN_MU_GLUE = 76 ,
  ASSIGN_FONT_DIMEN , ASSIGN_FONT_INT , SET_AUX , SET_PREV_GRAF ,
  SET_PAGE_DIMEN = 81 , SET_PAGE_INT , SET_BOX_DIMEN , SET_SHAPE ,
  DEF_CODE , DEF_FAMILY = 86 , SET_FONT , DEF_FONT ,
  REGISTER = 89 , MAX_INTERNAL = 89 , ADVANCE , MULTIPLY = 91 ,
  DIVIDE , PREFIX , LET , SHORTHAND_DEF ,
  READ_TO_CS = 96 , DEF , SET_BOX , HYPH_DATA ,
  SET_INTERACTION = 100 , MAX_COMMAND = 100 , UNDEFINED_CS = 101 , EXPAND_AFTER ,
  NO_EXPAND , INPUT , IF_TEST , FI_OR_ELSE = 106 ,
  CS_NAME , CONVERT , THE , TOP_BOT_MARK ,
  CALL = 111 , LONG_CALL , OUTER_CALL , LONG_OUTER_CALL ,
  END_TEMPLATE , DONT_EXPAND = 116 , GLUE_REF , SHAPE_REF ,
  BOX_REF , DATA
}
 [#208] 更多...
 

详细描述

枚举类型说明

◆ CatCode

enum CatCode

[#207]:

枚举值
ESCAPE 

[#207] [\\] escape delimiter.

LEFT_BRACE 

[#207] [{] beginning of a group.

RIGHT_BRACE 

[#207] [}] ending of a group.

MATH_SHIFT 

[#207] [$] mathematics shift character.

TAB_MARK 

[#207] [& | \span] alignment delimiter.

CAR_RET 

[#207] [\r | \cr | \crcr] end of line.

MAC_PARAM 

[#207] [#] macro parameter symbol.

SUP_MARK 

[#207] [^] superscript.

SUB_MARK 

[#207] [_] subscript.

IGNORE 

[#207] [\0 | ^^@] characters to ignore.

SPACER 

[#207] [ | \t] characters equivalent to blank space.

LETTER 

[#207] [A-Za-z] characters regarded as letters.

OTHER_CHAR 

[#207] none of the special character types.

ACTIVE_CHAR 

[#207] [~] characters that invoke macros.

COMMENT 

[#207] [%] characters that introduce comments.

INVALID_CHAR 

[#207] [\127 | ^^?] characters that shouldn't appear.

◆ TexCommandCode

[#208]

枚举值
RELAX 

[#207] [\relax] do nothing.

OUT_PARAM 

[#207] output a macro parameter.

ENDV 

[#207] end of <v_j> list in alignment template.

PAR_END 

[#207] [\par] end of paragraph.

MATCH 

[#207] match a macro parameter.

END_MATCH 

[#207] end of parameters to macro.

STOP 

[#207] [\end | \dump] end of job.

DELIM_NUM 

[#207] [\delimiter] specify delimiter numerically.

MAX_CHAR_CODE 

[#207] largest catcode for individual characters.

CHAR_NUM 

[#208] [\char] character specified numerically.

MATH_CHAR_NUM 

[#208] [\mathchar] explicit math code.

MARK 

[#208] [\mark] mark definition.

XRAY 

[#208] [\show, \showbox, ...] peek inside of TEX.

MAKE_BOX 

[#208] [\box, \copy, \hbox, ...] make a box.

HMOVE 

[#208] [\moveleft, \moveright] horizontal motion.

VMOVE 

[#208] [\raise, \lower] vertical motion.

UN_HBOX 

[#208] [\unhbox, \unhcopy] unglue a box.

UN_VBOX 

[#208] [\unvbox, \unvcopy] unglue a box.

REMOVE_ITEM 

[#208] [\unpenalty, \unkern, \unskip] nullify last item.

HSKIP 

[#208] [\hskip, \hfil, ...] horizontal glue.

VSKIP 

[#208] [\vskip, \vfil, ...] vertical glue.

MSKIP 

[#208] [\mskip] math glue.

KERN 

[#208] [\kern] fixed space.

MKERN 

[#208] [\mkern] math kern.

LEADER_SHIP 

[#208] [\shipout, \leaders, ...] use a box.

HALIGN 

[#208] [\halign] horizontal table alignment.

VALIGN 

[#208] [\valign] vertical table alignment.

NO_ALIGN 

[#208] [\noalign] temporary escape from alignment.

VRULE 

[#208] [\vrule] vertical rule.

HRULE 

[#208] [\hrule] horizontal rule.

INSERT 

[#208] [\insert] vlist inserted in box.

VADJUST 

[#208] [\vadjust] vlist inserted in enclosing paragraph.

IGNORE_SPACES 

[#208] [\ignorespaces] gobble SPACER tokens.

AFTER_ASSIGNMENT 

[#208] [\afterassignment] save till assignment is done.

AFTER_GROUP 

[#208] [\aftergroup] save till group is done.

BREAK_PENALTY 

[#208] [\penalty] additional badness.

START_PAR 

[#208] [\indent, \noindent] begin paragraph.

ITAL_CORR 

[#208] [\/] italic correction.

ACCENT 

[#208] [\accent] attach accent in text.

MATH_ACCENT 

[#208] [\mathaccent] attach accent in math.

DISCRETIONARY 

[#208] [\−, \discretionary] discretionary texts.

EQ_NO 

[#208] [\eqno, \leqno] equation number.

LEFT_RIGHT 

[#208] [\left, \right] variable delimiter.

MATH_COMP 

[#208] [\mathbin,...] component of formula.

LIMIT_SWITCH 

[#208] [\displaylimits,...] diddle limit conventions.

ABOVE 

[#208] [\above, \atop,...] generalized fraction.

MATH_STYLE 

[#208] [\displaystyle, ...] style specification.

MATH_CHOICE 

[#208] [\mathchoice] choice specification.

NON_SCRIPT 

[#208] [\nonscript] conditional math glue.

VCENTER 

[#208] [\vcenter] vertically center a vbox.

CASE_SHIFT 

[#208] [\lowercase, \uppercase] force specific case.

MESSAGE 

[#208] [\message, \errmessage] send to user.

EXTENSION 

[#208] [\write, \special,...] extensions to TEX.

IN_STREAM 

[#208] [\openin, \closein] files for reading.

BEGIN_GROUP 

[#208] [\begingroup] begin local grouping.

END_GROUP 

[#208] [\endgroup] end local grouping.

OMIT 

[#208] [\omit] omit alignment template.

EX_SPACE 

[#208] [\] explicit space.

NO_BOUNDARY 

[#208] [\noboundary] suppress boundary ligatures.

RADICAL 

[#208] [\radical] square root and similar signs.

END_CS_NAME 

[#208] [\endcsname] end control sequence.

MIN_INTERNAL 

[#208] the smallest code that can follow \the.

CHAR_GIVEN 

[#208] character code defined by \chardef.

MATH_GIVEN 

[#208] math code defined by \mathchardef.

LAST_ITEM 

[#208] [\lastpenalty, \lastker, \lastskip] most recent item.

MAX_NON_PREFIXED_COMMAND 

[#208] largest command code that can’t be \global.

TOKS_REGISTER 

[#209] [\toks] token list register.

ASSIGN_TOKS 

[#209] [\output, \everypar,...] special token list.

ASSIGN_INT 

[#209] [\tolerance, \day,...] user-defined integer.

ASSIGN_DIMEN 

[#209] [\hsize,...] user-defined length.

ASSIGN_GLUE 

[#209] [\baselineskip,...] user-defined glue.

ASSIGN_MU_GLUE 

[#209] [\thinmuskip,...] user-defined muglue.

ASSIGN_FONT_DIMEN 

[#209] [\fontdimen] user-defined font dimension.

ASSIGN_FONT_INT 

[#209] [\hyphenchar, \skewchar] user-defined font integer.

SET_AUX 

[#209] [\spacefactor, \prevdepth] specify state info.

SET_PREV_GRAF 

[#209] [\prevgraf] specify state info.

SET_PAGE_DIMEN 

[#209] [\pagegoal,...] specify state info.

SET_PAGE_INT 

[#209] [\deadcycles, \insertpenalties] specify state info.

SET_BOX_DIMEN 

[#209] [\wd, \ht, \dp] change dimension of box.

SET_SHAPE 

[#209] [\parshape] specify fancy paragraph shape.

DEF_CODE 

[#209] [\catcode,...] define a character code.

DEF_FAMILY 

[#209] [\textfont,] declare math fonts.

SET_FONT 

[#209] set current font ( font identifiers ).

DEF_FONT 

[#209] [\font] define a font file.

REGISTER 

[#209] [\count, \dimen,] internal register.

MAX_INTERNAL 

[#209] the largest code that can follow \the.

ADVANCE 

[#209] [\advance] ADVANCE a register or parameter.

MULTIPLY 

[#209] [\multiply] multiply a register or parameter.

DIVIDE 

[#209] [\divide] divide a register or parameter.

PREFIX 

[#209] [\global, \long, \outer] qualify a definition.

LET 

[#209] [\let, \futurelet] assign a command code.

SHORTHAND_DEF 

[#209] [\chardef, \countdef,...] code definition.

READ_TO_CS 

[#209] [\read] read into a control sequence.

DEF 

[#209] [\def, \gdef, \xdef, \edef] macro definition.

SET_BOX 

[#209] [\setbox] set a box.

HYPH_DATA 

[#209] [\hyphenation, \patterns] hyphenation data.

SET_INTERACTION 

[#209] [\batchmode,...] define level of interaction.

MAX_COMMAND 

[#209] the largest command code seen at big switch.

UNDEFINED_CS 

[#210] initial state of most eq_type fields.

EXPAND_AFTER 

[#210] [\expandafter] special expansion.

NO_EXPAND 

[#210] \noexpand[] special nonexpansion.

INPUT 

[#210] [\input, \endinput] input a source file.

IF_TEST 

[#210] [\if, \ifcase,] conditional text.

FI_OR_ELSE 

[#210] [\else,...] delimiters for conditionals.

CS_NAME 

[#210] [\csname] make a control sequence from tokens.

CONVERT 

[#210] [\number, \string,...] convert to text.

THE 

[#210] [\the] expand an internal quantity.

TOP_BOT_MARK 

[#210] [\topmark,...] inserted mark.

CALL 

[#210] non-long, non-outer control sequence.

LONG_CALL 

[#210] long, non-outer control sequence.

OUTER_CALL 

[#210] non-long, outer control sequence.

LONG_OUTER_CALL 

[#210] long, outer control sequence.

END_TEMPLATE 

[#210] end of an alignment template.

DONT_EXPAND 

[#210] the following token was marked by \noexpand.

GLUE_REF 

[#210] the equivalent points to a glue specification.

SHAPE_REF 

[#210] the equivalent points to a parshape specification.

BOX_REF 

[#210] the equivalent points to a box node, or is null.

DATA 

[#210] the equivalent is simply a halfword number.