Saturday, June 23, 2007

Latex: how to use conditional compilation

If you want to use condition to control your texts, better to use \ifthenelse.
Usage in pre-docu:
\usepackage{ifthen}
\newboolean{yourBoolVar}
\setboolean{yourBoolVar}{boolval} % boolvar=true or false

Usage in main body:
\ifthenelse {\boolean{yourBoolVar}}
{if true, go this code} {if false, go this}

3 comments:

Kamil said...

Thanks for that.

Unknown said...

yup thanks for that

Now I can compile for a paper
or book

THK said...

Thank you for this post. It's simple and helpful. :-)

Locations of visitors to this page