# Overfull hbox warning when including graphics

I'm getting the error:

Overfull \hbox (14.34999pt too wide) in paragraph at lines 374--375
[][] |


when including graphics files. The files are in EPS format. Below is an example:

\begin{figure}
\includegraphics{mov.eps}
\caption{Recall vs. Diversity}
\label{fig:movdiv}
\end{figure}


When I look at the PDF output the figures are a little bit out of the margin.

However, while generating the EPS graphics files I don't give any size options. So I don't understand why I'm getting this error. Doesn't LaTeX adjust the size of the EPS files?

-

## 1 Answer

No, LaTeX does not adjust the size of included graphics. They are included in their natural size if you don't provide any size options. The natural size depends on the internal settings of the image file.

In your case the image seems to be simply to large for the current line width (\linewidth). You can resize the image to be only that wide using the width=\linewidth option of \includegraphics[..]{..}.

If you only want to resize overly large images down see my answer to Scale (resize) large images (graphics) that exceed page margins. You can also make the overwide images push into the margin, left and/or right, as shown in Center figure that is wider than \textwidth.

-
That worked. Thank you. One other question: there is also the \textwidth option. Which one do you prefer (\linewidth or textwidth) with includegraphics? –  Ahmet Yılmaz Jan 27 '13 at 17:47
@AhmetYılmaz: \linewidth is equal to \textwidth in normal text and inside figure, but will be narrower inside environments like quote where the lines are indeed shorter, while \textwidth is the official width of the text, i.e. the page width minus both margins. In most cases both work, but \linewidth would be saver, however \textwidth is more commonly used it seems. See also Difference between \textwidth, \linewidth and \hsize. –  Martin Scharrer Jan 27 '13 at 17:50
OK, thanks again –  Ahmet Yılmaz Jan 27 '13 at 17:52