[texhax] Implementing control sequences with key values

Philip Taylor (Webmaster, Ret'd) P.Taylor at Rhul.Ac.Uk
Sun Nov 14 14:45:53 CET 2010



Vafa Khalighi wrote:
> You can set parameters with keyval or xkeyval packages. Is there any
> package that you can do the same with commands. So for example, you
> define a command, say, \direction which has two values RTL and LTR and
> is used in the following way:
>
> \direction=RTL or
>
> \direction=LTR
>
> Is it possible to implement these kind of control sequences

Not sensibly, because the RHS ("Right-hand side")
is not monadic as far as TeX is concerned.  The
nearest that TeX would easily allow for such assignments
are :

	\let \direction = \RTL (where \RTL must be pre=defined)

		or

	\direction = {RTL} (where \direction is a \toks variable)

** Phil.


More information about the texhax mailing list