You are here: Matthew KENWORTHY > Nelse > Getting the right Bounding Box for LaTeX

Getting the right Bounding Box for LaTeX


Postscript figures generated with PGPLOT work with the usual latex generating routines, but seem to fail with pdflatex.

Encapsulated postscript files have a BoundingBox defined in their header which is used by pdflatex to generate the right PDF image.

Two step process - convert the postscript file into an encapsulated postscript file, and the convert the encapsulated postscript file into a PDF file.

ps2eps -B -l -g -f f3_final1.ps

-f will force overwrite
-B ignores current BB
-g uses ghostscript BB device instead of externally called bbox routine
-l expands all BB dimensions by one point

Then use ps2pdf to get the PDF produced.

ps2pdf -dEPSCrop f3_final1.eps

Examining the pdf in ghostivew and in Preview now works.