TeXblog

 Typography with TeX and LaTeX

EPS file with incorrect BoundingBox

10 June 2008 by Stefan Kottwitz

If an included eps image does not show up at the right position the coordinates of the BoundingBox may be incorrect. You could get an impression of if you open the image with an external viewer like gsview (Evince).

epstool provides a quick solution in two steps:

  1. it generates a TIFF4 preview raster image and calculates the BoundingBox coordinates from it,
  2. it creates the eps image with the right BoundingBox but without TIFF4 preview.

The temporary eps file including the preview can be deleted afterwards. For options/ parameters of epstool see its manpage (man epstool in the shell) or the epstool homepage.

Here are the command I used:

epstool -b -t4 --output tempfile.eps wrongfile.eps
epstool -p --output corrected.eps tempfile.eps
rm tempfile.eps

If you have many eps files with incorrect BoundingBox you could create a shell script for correction, you even could combine it with the use of the find utility.

To install epstool on Debian Linux or Ubuntu Linux you could use apt-get:

sudo apt-get install epstool

On Ubuntu Linux you also could use Synaptic to install epstool, you will find it in the section Graphics (universe) or by the search button.

Discussed in the LaTeX Community Forum.

This entry was posted on 10 June 2008 at 3:09 PM and is filed under Tools for LaTeX, Graphics, Linux/ Ubuntu Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply