14

Is it possible to clip a figure inserted with \includegraphics to contents? That is, remove all surrounding whitespace.

1
  • Please, do not forget that when you clip/crop a pdf file containing vector-like data, you do not reduce the size of the file. For instance, if you want to zoom into a big image, the big image will be stored in your final file even though a small portion only will be visible. This may also hold true for raster images. If you just want to reduce white space, it is ok.
    – pluton
    Jan 11 '11 at 21:30
12

If your figure is in pdf format, use pdfcrop to automatically crop all whitespace before inserting it.

If it's not in pdf format - you could create a pdf of it before. ;-)

Though there are graphic software tools to crop jpg and png as well. For example, ImageMagick with convert -trim filename on the command prompt.

0
7
\includegraphics[viewport=llx lly urx ury, clip]{file}
\includegraphics[trim=llx lly urx ury, clip]{file}
2
  • I know this, but I have to open the file, look for coordinates...
    – Marin
    Jan 11 '11 at 20:29
  • 3
    @Marin: no, with package overpicyou can get a temporay grid
    – user2478
    Jan 11 '11 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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