Currently, my epstopdf is not able to convert eps to pdf correctly due to the boundingbox (atend) bug that the epstopdf does not support. However, I intend to use pdfcrop on the generated pdf file and that usually fix the white space problem. However, I have to manually fix every generated file. Is there a way to automate this in latex? For example, automatically calling pdfcrop immediately after epstopdf. I tried using DeclareGraphicsRule in epstopdf but it wasn't working.

Please advise. Thanks a lot ! :)

  • 1
    Which bug? atend is supported by epstopdf. Nov 7, 2012 at 10:56

1 Answer 1


The following adds an option crop to graphicx/\includegraphics. If enabled, it adds pdfcrop to the conversion of .eps to .pdf.

Because pdfcrop is not added to the restricted shell escape command list, full shell escape is needed: --shell-escape (TeX Live) or --enable-write18 (MiKTeX).

If the file is converted and uptodate, changing the option crop does not have an effect. Also the option does not affect other image files.


  \csname Gin@pdfcrop#1\endcsname
  epstopdf --outfile=%
    tmp-image.pdf #1 &&
    pdfcrop tmp-image.pdf \OutputFile

Example usages:

  • oh wow.. this works beautifully! Thanks so much.. appreciate it :) :)
    – Ivan
    Nov 7, 2012 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .