Re: \mathcode, a altri codenames

#68738
Up
0
Down
::


Quello che mi viene in mente è una tabellona del genere:

`\def\getcode#1{%
% …
\if\noexpand#1a\number`a \fi
\if\noexpand#1b\number`b \fi
\if\noexpand#1c\number`c \fi
\if\noexpand#1d\number`d \fi
% …
\if\noexpand#1\bgroup\number`\{ \fi
% …
}

\let\xa=a
\let\xd=d

\getcode\xa

\getcode\xd

\getcode\bgroup

\bye`
Una nota TeXnica: dopo \let\xa=a, \xa non è una macro (il TeXbook usa sempre “macro” per indicare un token espandibile).

Ciao
Enrico

Go to top