[texhax] if condition: is macro body empty? [xifthen]

Uwe Lück uwe.lueck at web.de
Tue Feb 17 12:55:12 CET 2009


At 11:02 12.02.09, Philip G. Ratcliffe wrote:

>Unfortunately I need some conditionals like this:
>\ifx\buffer\empty\else
>   \begin{itemize}
>     \buffer
>   \end{itemize}
>\fi

With xifthen -- see p. 4 of documentation

     http://www.ctan.org/tex-archive/macros/latex/contrib/xifthen/xifthen.pdf

this could have been done without any TeX primitives:

     \ifthenelse{\isequivalentto{\buffer}{\empty}}
       {}
       {\begin{itemize} \buffer \end{itemize}}

You may object that \empty is Plain TeX, not LaTeX ...

Cheers,

     Uwe.



More information about the texhax mailing list