[texhax] \newif, \csname and \endcsname

Heiko Oberdiek heiko.oberdiek at googlemail.com
Mon Jan 31 14:10:57 CET 2011


On Mon, Jan 31, 2011 at 11:05:48PM +1100, Vafa Khalighi wrote:

> Thanks for all the replies
> 
> 
> > Or with one \expandafter only:
> >
> > \newcommand{\printtest}{%
> >  \csname ifok\expandafter\endcsname
> >     \csname ifnotok\endcsname
> >      print test%
> >    \fi
> >  \fi
> > }
> >
> > The first \csname is not the problem, but the
> > second hides an internal conditional (\ifnotok),
> > that is unhided by \expandafter.
> >
> >
> Thanks.  What about when you have three conditional?


\csname if...\expandafter\endcsname
  \csname if...\expandafter\endcsname
    \csname if...\endcsname
      ... 
    \fi
  \fi
\fi

You got the idea?

After the first \csname the internal conditionals should match.

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list