[XeTeX] command argument as macro

Michiel Kamermans pomax at nihongoresources.com
Thu Oct 8 12:45:17 CEST 2009


Hi all,

is it possible to use a command argument as macro itself? The idea is 
something like this:

\document{article}
\newcommand{\coma}{1}
\newcommand{\comb}{2}
\newcommand{\comc}{3}
\newcommand{\getnumber}[1]{ \#1 }
\begin{document}
\getnumber{coma}
\end{document}

To justify, I'm trying to rewrite the fontwrap package to use only 
xetexinterchar behaviour (so that it doesn't require perltex), but one 
of the options I want to put in is letting the user select which blocks 
to load behaviour for, if only a small number are required. since this 
means that blocks may have a different interchar class number depending 
on which ones the user wants loaded, I figured I'd assign classnumbers 
use a \classname macro, so that for basiclatin the classnumber is stored 
in the \BasicLatinClass macro. To then set up transition rules, I have 
two commands \setUTransitionTo[2] and \setUTransitionFrom[2] which take 
the classnumber as first argument, and the transition rule as second. 
While this works if you use "\BasicLatinClass" as first argument, it's 
much nicer for users if they can type \setUTransitionTo{BasicLatin}{..} 
instead ... but can this be done?

- Mike "Pomax" Kamermans
nihongoresources.com


More information about the XeTeX mailing list