From PPwiki

Latex: Conditions

Within a LaTeX document, conditions regarding the compilation of specific portions of the text could be included

The \ifthenelse instruction provided by the ifthen package is a solution to deal with conditions but it is quite sensitive and does not stand verbatim environment nor \verb command.

Getting back to the genuine Tex commands appears a more robust solution.

Exemple :

% define a condition
\newif\ifmycondition

\myconditiontrue
% define mycondition as true

% \myconditionfalse
% define mycondition as false


\ifmycondition
% if mycondition is true print this :
hello my condition is true
\else
% if mycondition is false print this :
hello my condition is false
\fi

There is not need to declare any special package

Retrieved from http://pierrepoulain.free.fr/wiki/Latex/Conditions
Page last modified on January 26, 2010, at 06:52 PM