Code Monkey Monday- Cropping Images in LaTeX

Suppose you have an image that you wish to insert into your LaTeX document or presentation. You can crop the image to your specifications prior to saving and importing it, using your favorite image editing software. Or you can crop it on import, with the following syntax:

\includegraphics[trim=1cm 2cm 1cm 2cm,clip,width=1in]{imageName}

The trim command takes the specified amount off of the left, bottom, right, and top of the image, respectively. The width command tells LaTeX how big to make the image in print, scaling it up or down as necessary.

Leave a Reply

Your email address will not be published. Required fields are marked *