ID #1006

I need to generate both DVI and PDF, what should I write in the source code?

\usepackage{ifpdf}
OR, use the following code (which is said to be unsafe/fragile?)
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\ifnum\pdfoutput=1
\pdftrue \else
\pdffalse
\fi
\fi
To use it,
\ifpdf
\usepackage{hyperref}
\else
% running latex
\fi

Tags: latex

Related entries:

You can comment this FAQ