Conditionals

Conditionals allow you to restrict chunks of your tex source to be processed in a certain context only:

Special comments

  %begin{latexonly}
  % ...
  %end{latexonly}

See LaTeX2HTML

HTML package

  \begin{htmlonly}
  % ...
  \end{htmlonly}
  % ...
  \begin{latexonly}
  % ...
  \end{latexonly}

TeX macros

  % ...
  \newif\ifpdf
  \ifx\pdfoutput\undefined
    \pdffalse
  \else
    \pdfoutput=1
    \pdftrue
  \fi
  % ...
  \ifpdf
  % ...
  \fi
Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.