The Microtype Package
The short of this post is: if you use a recent LaTeX distribution, then by simply adding \usepackage{microtype} to the preamble, your document will look subtly nicer and the number of overfull/underfull hboxes will go down. In two-column publications, this package is really wonderful.
The tricks implemented in this package are called “microtypography”, which refers to techniques that enhance typography at a very small scale. (Tweaking \baselinestretch doesn’t count.
)
One such technique is character protrusion—the ability to slightly extend certain characters, like punctuations, into the right margin. When used properly, the right margin will actually look “more justified” than justified. (The example above protrudes the hyphens completely. See below for a more moderate protrusion example that demonstrates the “more justified” look.)
Another technique is font expansion—the ability to dynamically tweak the width of the fonts within a line very slightly. The effect of this technique is more even density across a page due to better line breaking, but it is by design meant to be virtually imperceptible. (You can see it in before-after comparisons below.)
Aesthetics aside, these two techniques can cut down on the number of bad hboxes because they give extra flexibility to the line-breaking algorithm in TeX. Their effectiveness clearly varies from document to document, but the extra elbow room cannot hurt and so you may as well use it in every document. I especially like it in two-column publications based on my experiments.
A whole thesis has been written about the techniques that lead to this package, and the package also comes with an extensive manual that describes other microtypographic techniques implemented by the package. I must note that if you use a PDF viewer that supports PDF 1.5 (current Foxit and Sumatra fans may need Adobe Reader), you can even interact with a “live demo” of character protrusion and font expansion on page 4 of the manual. This is a highly recommended exercise. The manual itself is, of course, typeset with both features turned on as an example of the package, and so at least you get to see character protrusion in action if you look for it.
Finally, system requirements: first of all, the package is smart and simply adding \usepackage{microtype} will “just work”. But you really want a recent pdfTeX backend, and you can upgrade to version 1.4 to reap all the benefits in your PDFs. Note that pdfTeX can also generate DVIs. I know, it sounds weird, but for instance, recent versions of MiKTeX actually generate DVIs via pdfTeX. (microtype was a big part of the reason I upgraded from 2.4, and that led me to undergo the conversion from Yap to dviout.) Font expansion is not available in DVI though, but character protrusion does work.