[pdftex] Document portable to both latex and pdflatex - FAQ Problem??

Jörg Spanke spanke at isas-dortmund.de
Thu Oct 18 10:33:23 CEST 2001


Hi,
I guess your preamble looks like:

----------------------- begin code ----------------
\documentclass[...]{...}
	\usepackage{...}
> Check for the existence of the variable \pdfoutput:
% Check for the existence of the variable \pdfoutput:

> \newif\ifpdf
> \ifx\pdfoutput\undefined
>   \pdffalse % we are not running PDFLaTeX
> \else
>   \pdfoutput=1 % we are running PDFLaTeX
>   \pdftrue
> \fi
> %Then use your new variable \ifpdf
> \ifpdf
>   \usepackage[pdftex]{graphicx}
>   \pdfcompresslevel=9
    \DeclareGraphicsExtensions{.jpg,.pdf,.mps,.png} 
    \graphicspath{{PDF/}}
> \else
>   \usepackage{graphicx}
    \usepackage[dvips]{graphicx}
    \DeclareGraphicsExtensions{.eps,.ps,.bmp,.tif,.tiff,.tga}  
    \graphicspath{{EPS/}} 
> \fi

\begin{document}

--------------- end code -------------------------

This is working for me and with the commands: 
\DeclareGraphicsExtensions{.eps,.ps,.bmp,.tif,.tiff,.tga}  
\graphicspath{{EPS/}} 

you can put all your graphics for "normal" LaTeX in a directory called "EPS" 
and the same graphics for pdflatex in the directory "PDF". Then you only use 
the first part of the filename for the \includegraphics command (see graphics 
manual). Please beware that pdflatex only accepts the file formats 
mentioned in the \DeclareGraphicsExtensions command.

Jörg



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Jörg Spanke
Institut für Spektrochemie und angewandte Spektroskopie
Bunsen-Kirchhoff Str. 11
44139 Dortmund
Germany

Tel. +49-231-1392-212
Fax. +49-231-1392-120
email spanke at isas-dortmund.de
www.isas-dortmund.de/2001/e/groups/321/staff/spanke.html

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



More information about the pdftex mailing list