Hi, how would I go about including conditional statements in Latex?
if
\ifdef DRAFT \else
%%% do some PSTricks stuff in here
\fi
and then I'm able to set DRAFT=1 in some other file, ie a style file.
Thanks!!!
General ⇒ Conditional Statements in Latex
NEW: TikZ book now 40% off at Amazon.com for a short time.

Conditional Statements in Latex
That's in tex. In latex, you'd use the ifthen package which provides stuff like
(Spacing changed to be suggestive; by default it's just \ifthenelse{}{}{} )
(Spacing changed to be suggestive; by default it's just \ifthenelse{}{}{} )
Conditional Statements in Latex
The etoolbox package offers a solution that is a bit cleaner (no namespace polluting) and faster to type:
If you want to check for the draft class option, you should use the ifdraft package instead.
Code: Select all
Code, edit and compile here:
\usepackage{etoolbox}\newtoggle{DRAFT}...\iftoggle{DRAFT}{yes}{no}