Re: [tetex 3.0] Swapping between dvi and pdf

Ronald Kuehn <[email protected]> Thu, 29 Sep 2005 22:55:26 +0200
Newsgroups gmane.comp.tex.tetex.general
Message-ID <[email protected]>
On Thursday, September 29, 2005 at 18:28:09 CEST, Kev Buckley wrote:
> 
> I used ensure I got the right output by having constructs at the top
> of the source files like this:
> 
> \newif\ifpdf
> \ifx\pdfoutput\undefined
>     \pdffalse       % we are not running PDFLaTeX
> \else
>     \pdfoutput=1    % we are running PDFLaTeX
>     \pdftrue
> \fi
> 
> \ifpdf
>  ... do some pdf things
> \fi
> 
> \ifpdf
>   \usepackage[pdftex]{color}
> \else
>   \usepackage{color}
> \fi
> 
> and so on.
> 
> latex file      didn't define "pdfoutput" so it miised the PDF stuff out
>                   and crated a DVI
> 
> pdflatex file   did define "pdfoutput" so it included PDF specific stuff
>                  and created a PDF
> 
> teTex's pdflatex/latex always seems ot define pdfoutput even when 
> I try   -output-format=dvi
> 
> Have I missed something ?
> 
> Could I just have installed it incorrectly ?

Hi,

since latex and pdflatex both call pdftex in teTeX 3.0, the previous
method of detecting pdf output does not work. Please use ifpdf.sty:

\usepackage{ifpdf}
\ifpdf
	... running in pdf mode
\else
	... running in dvi mode
\fi

Regards,
   Ronald