> 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

Beginning with teTeX-3.0, the engine used by latex was changed to pdfetex.
pdfetex is able to produce dvi is \pdfoutout is set to 0 which is the
default which is set during generation of latex.fmt.

Your code only looks for the existence of the primitive \pdfoutout,
but without checking its value. pdftex could always be used to generate
both dvi *and* pdf according to the setting of \pdfoutout at the moment
that the first page is shipped out.

In my point of view, you code was never totally right and it now
breaks. Someone else has written a better implementation of the \ifpdf
switch. To use it, just load ifpdf.sty, e.g. \usepackage{ifpdf} or
\RequirePackage{ifpdf}:

> \ifpdf
>   \usepackage[pdftex]{color}
> \else
>   \usepackage{color}
> \fi

With teTeX you have a color.cfg which is ware of choosing the right
driver, so this is an example of "bad style". Using
   \usepackage{color}
should always do the right thing.

> Reading the obvious posting at the list archive, I get the idea I
> might not have to do the jumping through \ifdef\pdfoutput anyway
> but so far, the penny (pfennig ?) hasn't dropped for me.
                         ^^^^^^^ Groschen in German

In short, just replace
  \newif\ifpdf
  \ifx\pdfoutput\undefined
      \pdffalse       % we are not running PDFLaTeX
  \else
      \pdfoutput=1    % we are running PDFLaTeX
      \pdftrue
  \fi
by
  \usepackage{ifpdf}

and replace
  \ifpdf
    \usepackage[pdftex]{color}
  \else
    \usepackage{color}
  \fi
by
  \usepackage{color}

Thomas

Reply via email to