[texhax] TeX Queries 4: Overfull boxes

Philip TAYLOR P.Taylor at rhul.ac.uk
Thu Aug 2 11:39:29 CEST 2012

Reinhard Kotucha wrote:

> An overfull \hbox actually means that material is printed into the
> margin.

Is that not something of an oversimplification, Reinhard ?
Is that not the case only when the box in question is
a line box ?  In Knuth's example, cited by Paul, it is
an explicit \hbox and not a line box, and I would therefore
be /very/ surprised if it caused any material to be printed
in the margin.  Indeed, since we don't know from Knuth's
examples the final disposition of the \hboxen, we do not
know whether they will cause anything to be printed at all.

> The black boxes which are appended to overfull lines are a feature of
> TeX.  The plain TeX format sets \overfullrule=5pt just to indicate
> overlong lines visually.  Hence, Phil, they look horrible on purpose.

Oh, I know, I know !

> If in the final document some overfull \hbox'es are unavoidable, one
> can set \overfullrule=0pt and the black boxes will disappear (default
> in LaTeX, unfortunately).  However, it's better to increase the value
> of \hsize temporarily when computer code is typeset.  This allows to
> write into the margin but you'll be warned if the increased value is
> exceeded.

Surely, if one must descend to such hacks, one should increase \hfuzz,
not \hsize ?

> Didn't you write a TUGboat article about all these things (fine-tuning
> TeX documents in order to avoid overfull boxes) many years ago?

I did, and later Frank Mittelback shewed that it was overkill, and
there was a far simpler way to achieve my goal; but I still remember
and use my method, and have possibly never tried Frank's !
>   > 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.
> Since TeX is not aware of background colours (or colours in general),
> it only leaves a gap (interword glue, in TeX parlance).  It doesn't
> fill anything with colours.

Hence my use of the passive voice : "which will then be filled", and
not the active "which TeX will then fill".  My point was to help
Paul to appreciate that what I had been calling "white space" is
neither explicit nor necessarily white.

MIL-05991/237/2012-B : Any loss of data or other computer malfunction 
resulting directly or indirectly from the use of Linux will be regarded 
as a self-inflicted injury and treated accordingly.  Users of Mac OS/X 
will be assumed to be insane.  You have been warned ...

More information about the texhax mailing list