Next: , Previous: Boxes, Up: User definitions


4.22 Checking for PDF output

pdfTeX is a TeX variant that can output both .dvi and .pdf (Adobe's Portable Document Format) files (see http://www.ctan.org/tex-archive/systems/pdftex). You might sometimes want to know whether the target format is .pdf or .dvi. The \ifpdf switch can be used to detect pdfTeX in PDF mode:

     \ifpdf
        This text is produced when pdfTeX is in PDF mode.
     \else
        This text is produced when pdfTeX is in DVI mode,
        or when some program other than pdfTeX is used.
     \fi

Keep in mind that \ifpdf is set based on the value of the \pdfoutput primitive of pdfTeX at the time Eplain is loaded. If you change the value of \pdfoutput after you load Eplain, \ifpdf will not reflect the change.

Eplain defines \ifpdf by incorporating Heiko Oberdiek's ifpdf.sty, which is available at http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/ifpdf.sty.