[texhax] question about \if

Vafa Khalighi vafakhlgh at gmail.com
Fri Nov 12 12:30:17 CET 2010


> And what do you want to test?
> * argument starts with `t',
> * after expansion the first token is `t',
> * the argument contains `t',
> * ...
> The context is important, are assigments allowed or is the
> test restricted to expandable contexts?
> ...
>
>
actually I want to have a group of tokens instead a single token.

To be more specific, this is what I have in mind:

\newcommand{\setmaindir}[1]{\if#1RTL\pagedir TRT\else \if#1LTR\pagedir
TLT\fi\fi}

so that

\setmaindir{RTL} gives  \pagedir TRT and
\setmaindir{LTR} gives \pagedir TLT


-- 
I prefer the most bloodcurdling death to living with humility. The only
country I am faithful to, is IRAN. Do not denigrate my last moments...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20101112/597844fe/attachment.html>


More information about the texhax mailing list