TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When trying to crop an EPS-figure with trim=<left> <bottom> <right> <top>, clip, ... it results in strange behavior. Please find a MWE and a image of the result below.

It seems like the cropping is done only for the top and the right (or twice). In this post you can read the proceeding until now, to get the boundaries of the EPS recognized by xetex.def and dvipdfmx.def.



    \caption{No clipping}
    \includegraphics[trim = 100 0 0 0, clip, width=\linewidth]{Beispiel.eps}
    \caption{Trimming left}

    \includegraphics[trim = 0 100 0 0, clip, width=\linewidth]{Beispiel.eps}
    \caption{Trimming bottom}
    \includegraphics[trim = 0 0 100 0, clip, width=\linewidth]{Beispiel.eps}
    \caption{Trimming right}

    \includegraphics[trim = 0 0 0 100, clip, width=\linewidth]{Beispiel.eps}
    \caption{Trimming top}
    \includegraphics[trim = 100 100 100 100, clip, width=\linewidth]{Beispiel.eps}
    \caption{Cropping all}



share|improve this question
up vote 3 down vote accepted

trim for EPS files with xetex.def is broken. As workaround convert the EPS files to PDF:

  • epstopdf file.eps
  • ps2pdf -dEPSCrop file.eps

Then include the PDF version of the images in the TeX file.

share|improve this answer
Ok, taking a pdf works. Transferring with \usepackage{epstopdf}, \includegraphics{Beispiel} and initexmf --edit-config-file=miktex\config\pdftex.ini => EnableWrite18=t results in xelatex> Package epstopdf Warning: Drivers other than 'pdftex.def' are not supported.. PDF made by ghostview has a lot of margin. Inkscape works perfect. But not a solution for all my figures to transfer them to PDF by hand. – LaRiFaRi Jun 18 '13 at 13:52

Clipping is broken in xetex.def up to version 0.94, but this is fixed in version 0.95 and following. In the forthcoming TeX Live 2013 the version of xetex.def is 0.97. The most recent version corrects also some glitches in the order the options are processed.

Here's an example.

\includegraphics[clip,trim=3cm 3cm 3cm 3cm,width=.5\textwidth]{tiger.eps}


\includegraphics[trim=3cm 3cm 3cm 3cm,width=.5\textwidth]{tiger.eps}

TeX Live 2013

enter image description here

TeX Live 2012

enter image description here

share|improve this answer
How did you get TeX Live 2013? – kiss my armpit Jun 18 '13 at 13:53
He's testing TL 2013 (tug.org/texlive/pretest.html) – daleif Jun 18 '13 at 13:55
@mozartstraße Test version, but now it's the one that will be released. Just a few days left. Don't run to the servers that provide the test version: they are few and overloading them is not a good idea. Just be patient for a couple of weeks. – egreg Jun 18 '13 at 13:57
@daleif and egreg: OK. Thank you! – kiss my armpit Jun 18 '13 at 13:58
trim=3cm 3cm 3cm 3cm should have select the middle of the image, not the lower left part. Thus xetex.def 0.97/TL 2013 is still broken. :-( – Heiko Oberdiek Jun 18 '13 at 14:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.