[OS X TeX] Automatic Conversion of Graphics?

Bruno Voisin bvoisin at mac.com
Wed Jan 26 12:38:51 CET 2005


Le 26 janv. 05, à 11:36, Jan Hegewald a écrit :

> - don´t add the file extension when including:
> \includegraphics[...]{fig}
> - put the corresponding files in different folders, e.g. the print 
> version in a folder called graphics_print and the screen version in a 
> folder called graphics_screen. So you have graphics_print/fig.pdf and 
> graphics_screen/fig.png
> - now tell \includegraphics where to look via the \graphicspath 
> command:
> \graphicspath{{./graphics_print/}} to include the print version and 
> \graphicspath{{./graphics_screen/}} to include the screen version.

I recently used a similar trick, for a document available in both "fat" 
version (about 80 MB, with PDF figures) and light version (about 5 MB, 
with some figures converted to JPEG). This was done by first preparing 
the figures in both formats, putting them in separate directories, then 
writing in the LaTeX source file:

\graphicspath{{Figures/JPG/}{Figures/PDF/}}

and then:

\DeclareGraphicsExtensions{.jpg,.pdf}  % for light output
%\DeclareGraphicsExtensions{.pdf}       % for fat output

The first line told LaTeX to use the JPEG figures if available, and the 
PDF figures otherwise. The second line (when uncommented, and the first 
commented out) told LaTeX to use PDF figures exclusively.

In this approach, the first step (putting the figure files in different 
formats in different directories) is actually unnecessary, the ordering 
of the extensions in \DeclareGraphicsExtensions is actually enough for 
the required effect. I just used different directories for cleaner file 
organization.

Oh, and this all worked with the graphics package as well (instead of 
graphicx).

Bruno Voisin




--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list