Roughly eight years ago, some colleagues and I had the good fortune to spend an extraordinary afternoon with Donald Knuth, the primary author of TeX, at his home on the Stanford University campus. Among many things, Donald showed us how he uses TeX to typeset his computer-science papers and books exactly the way he wants them to look. In particular, he applies special tweaks to achieve perfection, such as “smashing the descender” on one radicand to make a sum of square roots line up in a pleasing way, and such as shimming characters to place them more beautifully in a formula.
The present post illustrates a couple typographical niceties that Knuth might add to his documents. At the outset I need to warn the reader that such “tweaking” is a fine art. Knuth mentioned that he could recognize some authors by the way they tweak their TeX documents. Furthermore many TeXies don’t understand the technique that well. Barbara Beeton of the American Mathematical Society (AMS) and a key person in having the AMS adopt TeX told me that the AMS has to delete most user tweaking before publication because it doesn’t meet AMS standards. With that caveat emptor, here are two examples.
A favorite equation of mine is the mode locking equation
I wrote several papers and two book sections showing how this equation describes mode locking phenomena in coupled clocks, coupled oscillators in general, and lasers in particular. Looking at it, you can see that there’s a little too much room between the 2π and the integrand. You can pull the integrand to the left under the π by “smashing” its width. Inside the upper limit, you type \hsmash \pi , and the π displays, but has no horizontal width as in
The example Knuth showed us is adding the square root of x to the square root of y. If you just use the default layout in TeX (or Microsoft Office), you get
As you see, the square root of the y is a bigger than that of the x, since the y has a descender. But it would look better if we “smashed” the y’s descender (type \sqrt\dsmash y ) so that both square roots have the same size We also thought about automating such smashing, but the general case doesn’t appear to be described by a simple algorithm. Tweaking is an art! Hopefully you don’t need to tweak that often.
(As you see here, I still haven't been able to make technical documents display in this blog the elegant way they display in Word. Some day, hopefully!)