Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
 [][] 
[35]

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

share|improve this question
1  
Overfull: when your line passes the line width. Underfull: when your line has width smaller than line width, so it will use a lot of blank spaces to justify it. If you use the draft option on the class you can see some black marks on the right margin to show the overfull parts. –  Sigur Sep 2 '12 at 1:40
2  
Partial duplicate: What does “overfull hbox” mean? –  Werner Sep 2 '12 at 6:18
1  

1 Answer 1

up vote 7 down vote accepted

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

 \documentclass[draft]{article}

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).

share|improve this answer
    
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). –  Gonzalo Medina Sep 2 '12 at 4:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.