I have bunch of pgfplots (plots and bar charts in my document) and when I compile I get errors like:

Overfull \hbox (1.17287pt too wide) in paragraph at lines 2121--2122

Sometimes it also tell underfull as well. What does these mean ? Any general pointers on how to solve them ? Do they mean anything bad ?


1 Answer 1


Let's start with a quote from Knuth's TeXbook (Chapter 11)

TeX makes complicated pages by starting with simple individual characters and putting together in larger units, and putting these together in still larger units, and so on.

Whenever you look at a (La)TeX document, imagine putting on a pair of glasses that allows you to 'x-ray' the page's structure- what you would see is that each page is made up of boxes.

In particular, there are horizontal boxes (hboxes) and vertical boxes (vboxes). TeX is able to make beautiful documents by making the content of each box fit 'ideally' using its stretchable glue. When something simply will not fit, either because it is too big or too small, then you get overfull and underfull boxes respectively.

When TeX encounters such situations, it is kind enough to tell you in the .log file so that you can make a decision for yourself as to whether you need to make changes; ultimately, you have to decide if you think they mean anything bad. Note that TeX will also give you a badness rating, with 10000 being the worst.

If you prefer a more visual approach, then you can load the draft option to your documentclass, for example


which ensures that your output is highlighted with black boxes in any of the offending areas.

For more details see any of the 'related' links on the right hand side of this page, perhaps starting with What does "overfull hbox" mean?

In terms of your 'specific' case, it sounds like one of your graphs is over-stretching its boundaries- perhaps it is going over a minipage, or into the page margin. If you're happy with the output, then you typically don't have to worry too much (unless the people viewing your document are also going to grep your .log file).

  • 3
    You could mention perhaps that setting \hfuzz=<length> makes TeX tolerate an excess size equal to <length> before it considers a horizontal box overfull (this can be useful to get rid of overfull hboxes messages for small lengths (1.5pt maximum). Sep 2, 2012 at 4:33

You must log in to answer this question.

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