LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Heiko Oberdiek <[log in to unmask]>
Wed, 4 Mar 2009 11:42:57 +0100
text/plain (138 lines)
On Wed, Mar 04, 2009 at 06:26:56PM +1030, Will Robertson wrote:

> From a quick look over the requirements (supporting miniltx, etc) it  
> looks like epstopdf can just be called directly from graphics.cfg,  
> which is good news.

\AtEndOfPackage at least is necessary to prevent loading a package
inside the options section of the package that loads graphics.cfg.

> You probably know that already, but the reason I wanted to chime in  
> now was to encourage whomever does the work to make this the default:  
> (in case you weren't intending to do this anyway!)
> 
>     \epstopdfsetup{update,prepend}
> 
> It makes subsequent LaTeX runs much more bearable since it only  
> converts the EPS file as-necessary; without it, compilation can be  
> slowed down by orders of magnitude (in some cases).

I also prefer this setting. However there is a disadvantage:
This option setting assumes, the .eps file is the source file
and the pdf file is the converted file. But this may not always
be the case, the .eps file can be the converted file (e.g. for dvips).
Then the source .pdf file gets overwritten.
  Thus the comforts of automatical conversions are not without
risk.

> Perhaps the  
> "verbose" option should be added as well; I haven't really looked at  
> the difference that makes (and whether we should be bothering the user  
> with the extra information in the console).

Option "verbose" only writes into the .log file. Therefore I have
added it.

The following graphics.cfg automatically loads epstopdf if the
shell escape feature is enabled.
  Loading epstopdf can be prevented by defining \DoNotLoadEpstopdf
to anything than undefined or \relax, e.g.:

  \newcommand{\DoNotLoadEpstopdf}{}
  \documentclass{article}
  \usepackage{graphicx}

%%% cut %%% graphics.cfg %%% cut %%%
\ProvidesFile{graphics.cfg}%
  [2009/03/04 v1.6 graphics configuration of teTeX/TeXLive]%

% Select an appropriate default driver
\begingroup
  \chardef\x=0\relax
  % check pdfTeX
  \@ifundefined{pdfoutput}{}{%
    \ifnum\pdfoutput<1 %
    \else
      \chardef\x=1\relax
    \fi
  }%
  % check VTeX
  \@ifundefined{OpMode}{}{%
    \chardef\x=2\relax
  }%
  % check XeTeX
  \@ifundefined{XeTeXversion}{}{%
    \chardef\x=3\relax
  }%
\expandafter\endgroup
\ifcase\x
  % default case
  \def\[log in to unmask]
  \ExecuteOptions{dvips}%
\or
  % pdfTeX is running in pdf mode
  \def\[log in to unmask]
  \ExecuteOptions{pdftex}%
  % load package epstopdf if
  % * LaTeX is running (plain-TeX users are on their own)
  % * shell escpape (\write18) is enabled and
  % * \DoNotLoadEpstopdf does not exist or is not \relax.
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname DoNotLoadEpstopdf\endcsname\relax
    \begingroup\expandafter\expandafter\expandafter\endgroup
    \expandafter\ifx\csname AtEndOfPackage\endcsname\relax
    \else
      \AtEndOfPackage{%
        \RequirePackage{pdftexcmds}[2007/11/11]%
        \expandafter\ifx\csname pdf@shellescape\endcsname\relax
        \else
          \ifnum\pdf@shellescape>0 %
            \RequirePackage{epstopdf}[2007/10/02]%
            \@ifpackagelater{epstopdf}{2007/10/02}{%
              \epstopdfsetup{update,prepend,verbose}%
            }{}%
          \fi
        \fi
      }%
    \fi
  \fi
\or
  % VTeX is running
  \def\[log in to unmask]
  \ExecuteOptions{vtex}%
\else
  % XeTeX is running
  \def\[log in to unmask]
  \ExecuteOptions{xetex}%
\fi

% Fix for dvips and xdvi versions that can uncompress
% graphic files without an explicite call of gunzip.
% (The fix is not applied for miniltx.tex, because
% \AtEndOfPackage is not available in plainTeX.)
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname AtEndOfPackage\endcsname\relax
\else
  \AtEndOfPackage{%
    \begingroup
    \@ifundefined{DeclareGraphicsRule}{%
      \endgroup
    }{%
      \def\x{dvips.def}%
      \expandafter\endgroup
      \ifx\x\Gin@driver
        \DeclareGraphicsRule{.pz}{eps}{.bb}{}%
        \DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
        \DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
        \DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
        \DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}%
      \fi
    }%
  }%
\fi
\endinput
%%% cut %%% graphics.cfg %%% cut %%%

Yours sincerely
  Heiko <[log in to unmask]>

ATOM RSS1 RSS2