In 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 handle the verbatim environment nor the \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 load/install any special package.


Comments

comments powered by Disqus