[texhax] implementation of x' in math
Karl Berry
karl at freefriends.org
Thu Sep 30 17:54:42 CEST 2004
Hi Alexandru,
>> How is the translation of $x'$ into $x^{\prime}$ implemented?
See plain.tex and the TeXbook and/or TeX for the Impatient (I think we
talked about this in TFTI, although I don't recall for sure).
The short answer is:
\mathcode`\'="8000
This makes ' be an active character in math mode.
The definition starts like this:
{\catcode\'=\active \gdef'{^\bgroup\prim at s}}
\prim at s uses \futurelet to look for multiple consecutive ' characters.
Hope this helps,
karl
More information about the texhax
mailing list