GeneralHow to Crop Pictures in Latex

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

How to Crop Pictures in Latex

Post by pankaj »

Hi All,

Anyone got any idea on how to crop images in Latex?

Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

How to Crop Pictures in Latex

Post by Stefan Kottwitz »

Hi pankaj,

when including images by \includegraphics there are optional parameters concerning viewport and cropping, see Documentation of the Graphics bundle 4.4 Including Graphics Files.
Btw. I've sometimes used the tool pdfcrop to crop pdf files externally before including them.

Stefan
LaTeX.org admin
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

Re: How to Crop Pictures in Latex

Post by pankaj »

Hi Stefan,

Thanks for referring to those pages. Will go through them soon.

btw i came across following commands for cropping an image at a site http://web.reed.edu/cis/help/latex/Graphics.html

\begin{figure}[htbp]
\begin{centering}
\caption{A Figure}
\includegraphics[clip=true, viewport=.0in .0in 1in 1in]{figure}
\label{subd3}
\end{centering}
\end{figure}

When i compile using these, i get an error like

! Package keyval Error: p undefined.

Anyidea on this?

n yeah pdfcrop seems to be an interesting thing.

Thanks
Pankaj
User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

Re: How to Crop Pictures in Latex

Post by Stefan Kottwitz »

Hi Pankaj,

this code works for me. Perhaps the problem is caused by other code - could you show a complete example that produces this error?

Stefan
LaTeX.org admin
Post Reply