[texhax] TeX Queries 4: Overfull boxes

Philip TAYLOR P.Taylor at rhul.ac.uk
Wed Aug 1 16:08:56 CEST 2012



Paul Stanley wrote:
> Hi
> extract from TeXbook, chapter 6:
>
> [start quote]
> \begindisplay
> \hbox spread-1em{You don't get spaces between words narrower than this,\
> and}\cr
> \hbox spread+1.679895em{you don't get spaces between words wider than
> this.}\cr
> \enddisplay
> [end quote]
>
> Does the above depend on the size of the font? Presumably the physical
> width of em varies from font to font.

Yes, it "depends", but it all depends on what you mean by "depends".
The dimensions of the box will vary with the font size; the effects
that DEK is describing will not.
>
> What is a box?
> Does it refer to an imaginary box encapsulating the line?

Yes, the "imaginary" is the key; it exists as a TeX data
structure, but the resulting DVI does not (as far as I can
recall) contain boxes; I believe that it contains only the
contents of boxes (but I would be very happy to be corrected
here).

> What does `\hbox' do?

An \hbox is a horizontal box; it contains things that are stacked
horizontally; a \vbox is a vertical box : it contains things that
are stacked vertically.

> Anything else the list considers important about overfull boxes?

They almost always indicate an error (in thinking, or in
coding, or in allowing for boundary conditions, or whatever)
but not always; and they can generate horrible black solid
boxes (real boxes, at least as far as ink or toner can make
a real box) when they occur in typeset lines.
>
> I'll leave "underfull" for another thread, unless the list considers it
> relevant.

An underfull box will usually contain more white space than
is optimal for the size of the box and the size of the contents.
(perhaps "will always contain" : I'd need to think about this).
How the space is distributed is very much a function of the
contents of the box.  And of course the "white space" is virtual
white space : a gap will be left in the corresponding typeset
output, which will then be filled with the default background
colour for that region.

** Phil.


More information about the texhax mailing list