Go to the first, previous, next, last section, table of contents.


\charsubdef: Character substitutions

The most important primitive MLTeX adds is \charsubdef, used in a way reminiscent of \chardef:

\charsubdef composite [=] accent base

Each of composite, accent, and base are font glyph numbers, expressed in the usual TeX syntax: `\e symbolically, '145 for octal, "65 for hex, 101 for decimal.

MLTeX's \charsubdef declares how to construct an accented character glyph (not necessarily existing in the current font) using two character glyphs (that do exist). Thus it defines whether a character glyph code, either typed as a single character or using the \char primitive, will be mapped to a font glyph or to an \accent glyph construction.

For example, if you assume glyph code 138 (decimal) for an e-circumflex and you are using the Computer Modern fonts, which have the circumflex accent in position 18 and lowercase `e' in the usual ASCII position 101 decimal, you would use \charsubdef as follows:

\charsubdef 138 = 18 101

For the plain TeX format to make use of this substitution, you have to redefine the circumflex accent macro \^ in such a way that if its argument is character `e' the expansion \char138 is used instead of \accent18 e. Similar \charsubdef declaration and macro redefinitions have to be done for all other accented characters.

To disable a previous \charsubdef c, redefine c as a pair of zeros. For example:

\charsubdef '321 = 0 0  % disable N tilde

(Octal '321 is the ISO Latin-1 value for the Spanish N tilde.)

\charsubdef commands should only be given once. Although in principle you can use \charsubdef at any time, the result is unspecified. If \charsubdef declarations are changed, usually either incorrect character dimensions will be used or MLTeX will output missing character warnings. (The substitution of a \charsubdef is used by TeX when appending the character node to the current horizontal list, to compute the width of a horizontal box when the box gets packed, and when building the \accent construction at \shipout-time. In summary, the substitution is accessed often, so changing it is not desirable, nor generally useful.)


Go to the first, previous, next, last section, table of contents.