There are a number of tricks which are useful when inserting images into your latex document.


Most of the ready-made images supplied by LHCb are in the Encapsulated PostScript format. (I assume this to be the case for the other "big" experiments.) Since we're using pdflatex we'll need to convert them to the PDF format before we can use them in our document.

Use epstopdf to convert an eps file to a PDF file:

epstopdf originalFile.eps

this will produce "originalFile.pdf".

Occasionally the orignal eps file does not have the correct bounding box etc. and is interpreted incorrectly when epstopdf converts it. In this case you should run eps2eps which will "sanitise" the orignal eps file.

eps2eps originalFile.eps sanitisedFile.eps

You can now covert the files to PDF without worry.

A handy way of converting all your eps files to PDF is to use xargs:

ls *eps | xargs -i epstopdf '{}'

On occasion I've found that the bounding box in the PDF/EPS file is far too large. To correct it or to crop the image so it fits nicely on your page simply edit the PDF using a text editor (I use emacs).

emacs myPDF.pdf

Search for the bounding box definition:

Ctrl-s MediaBox

The Bounding box generally looks like this:
/Type/Page/MediaBox [0 300 435 680]

The numbers define the height and width of the image, play around with the numbers until you are happy.