You can think of three groups of parameters that are used by TeX when typesetting a paragraph, those that are set by the typesetter and the font designer, and those calculated by TeX internally. The \badness
is calculated by TeX internally, whereas \tolerance
is set by the typesetter to tell TeX what can be tolerated in terms of line and overall paragraph badness.
Tweaking these parameters is a bit of a black art.
Run the following minimal with pdfTeX.
\overfullrule=0.1pt
\hsize150pt
\def\astory{Fast pace and mechanically intensive
facilities such as data-centers, hospitals, and
laboratories typically require the most intense
coordination efforts. Architectural and structural
systems are often designed first with allowances
for MEP systems. Tensions between the size of
these MEP spaces, usable floor space,
and ceiling height exist. }
\astory
\the\tolerance,
\the\pretolerance,
\the\hbadness,
\the\hfuzz,
\the\emergencystretch,
% Second test
\pretolerance=150
\tolerance=753
\hbadness=752
\hfuzz0pt
\emergencystretch=0em
\astory
\bye
In the minimal the paragraph is typeset, firstly with default values and second without. The first one produces a lot of overfull and underfull boxes. We get rid of them by suitably adjusting the \tolerance
. In this particular example I set the tolerance to one higher than the hbadness value reported by TeX. This eliminated all the underfull warnings.
There is a nice surprise when you set the \hsize
from 150pt to 160pt and this is where the "black art" part comes along!