Why overfull in terms of pts and underfull in terms of badness

overfullplain-textex-coreunderfullwarnings

I am reading Knuth's The TeXbook, and experimenting around as directed in Chapter 6, I found that the quality of overfull warnings is reported by x pt too wide where x is a decimal; whereas, that of underfull warnings are reported as badness N where N is a nonnegative integer.

Questions: Why not report both warnings in the same format (or in both formats)? Also, how to convert from one to another?


Edit:

This is how I understand it currently: x pt too wide means that the line sticks out of the right margin by x points; on the other hand, badness N means that the interword spacing is too wide (wide, not narrow, since we have "under"-full) by N units on a linear scale where 0 is "perfect". So, the underfill boxes won't stick out of the right margin. So it does make sense to not report the x pt too wide for underfill lines. However, not reporting the badness of overfull lines seems to suggest that the badness of each of the overfulls is the same, namely the worst 10000, is that so?

Best Answer

The amount a box is overfull is a length, it sticks out that much, so pt is as good a unit as any.

The amount a box is underful is not a length, it is a measure of how much any white space has been stretched to make the content stretch to the box dimensions. Badness is a formula which combines the stretch and shrink components of all white space in the box and gives a measure of how much it is stretched.

Related Question