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:

 \caption{Recall vs. Diversity}

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 1


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? Commented Jan 27, 2013 at 17:47
  • 2
    @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. Commented Jan 27, 2013 at 17:50
  • 3
    LaTeX Noobs (me): this answer says change \includegraphics{myimage.png} to \includegraphics[width=\linewidth]{myimage.png}
    – JoseOrtiz3
    Commented Jun 10, 2019 at 7:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .