Posts tagged ‘ifthen’

Conditional typesetting with ifthen

ifthen.sty allows the definition of various interesting constructs to control, which parts of a document are printed. Here’s a short example for the use of boolean variables:

\documentclass{minimal}
 
\usepackage{ifthen}
\newboolean{somevariable}
\setboolean{somevariable}{false}
 
\begin{document}
 
\ifthenelse{\boolean{somevariable}}{Text if somevariable is true.}{Text if somevariable is false.}
 
\end{document}

ifthen (PDF)

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website