18.6 Overfull “hboxes”

TeX is sometimes unable to typeset a line within the normal margins. This most often occurs when TeX comes upon what it interprets as a long word that it cannot hyphenate, such as an electronic mail network address or a very long identifier. When this happens, TeX prints an error message like this:

Overfull @hbox (20.76302pt too wide)

(In TeX, lines are in “horizontal boxes”, hence the term, “hbox”. ‘@hbox’ is a TeX primitive not used in the Texinfo language.)

TeX also provides the line number in the Texinfo source file and the text of the offending line, which is marked at all the places that TeX considered hyphenation. See Debugging with TeX, for more information about typesetting errors.

If the Texinfo file has an overfull hbox, you can rewrite the sentence so the overfull hbox does not occur, or you can decide to leave it. A small excursion into the right margin often does not matter and may not even be noticeable.

If you have many overfull boxes and/or an antipathy to rewriting, you can coerce TeX into greatly increasing the allowable interword spacing, thus (if you’re lucky) avoiding many of the bad line breaks, like this:

@tex
\global\emergencystretch = .9\hsize
@end tex

(You should adjust the fraction as needed.) This huge value for \emergencystretch cannot be the default, since then the typeset output would generally be of noticeably lower quality; its default value is ‘.15\hsize’. \hsize is the TeX dimension containing the current line width.

For any overfull boxes you do have, TeX will print a large, ugly, black rectangle beside the line that contains the overfull hbox unless told otherwise. This is so you will notice the location of the problem if you are correcting a draft.

To prevent such a monstrosity from marring your final printout, write the following in the beginning of the Texinfo file on a line of its own, before the @titlepage command:

@finalout