Skip to main content

Module codes

Module codes 

Source
Expand description

Character codes: IniTeX defaults and LuaTeX’s packed math and delimiter codes.

LuaTeX reports math codes (\mathcode, \Umathcodenum) as class·2²¹ + family·2²⁴ + character; a math-active code has class 8. Delimiter codes pack small and large variants; −1 means “not a delimiter”.

Constants§

MATH_ACTIVE
The internal math code meaning “math active” (TeX’s "8000). LuaTeX reports it as 8·2²¹ (which is also the packed code of family 1, character 0), but keeps the two apart internally.
MATH_GIVEN_PACKED
Flag on a \mathchardef value (math_given) that came from a number of "8000 or more: the rest is a packed math code (see crate::scan’s scan_math_given).
UNDEFINED_MATH_PARAM
Value of an unset \Umath… parameter (LuaTeX’s undefined_math_parameter).

Functions§

delcode_from_classic
Converts a TeX 24-bit delimiter code ("uvvxyy… as \delcode takes it) to the internal form; −1 stays −1.
delcode_report
The value \the\delcode reports for an internal delimiter code.
initex_delcode
Default \delcode: 0 for ., −1 otherwise.
initex_lccode
Default \lccode: ASCII letters map to lowercase.
initex_mathcode
Default \mathcode: digits are variable family 0, letters variable family 1, everything else class 0 family 0.
initex_sfcode
Default \sfcode: 999 for ASCII uppercase letters, 1000 otherwise.
initex_uccode
Default \uccode: ASCII letters map to uppercase.
math_char
The character of a packed math code.
math_class
The math class of a packed math code.
math_code
Packs a LuaTeX math code.
math_code_report
The value \the\mathcode and \Umathcodenum report for an internal math code.
math_fam
The family of a packed math code.
math_given_report
The number \the reports for a math_given value: TeX’s class·"1000 + family·"100 + character, without masking.
math_param_is_glue
Whether \Umath… parameter p is a spacing (muglue) parameter.