Thursday, May 26, 2011

Typesetting on a grid 1: heightrounded

One thing that I dislike about LaTeX's output—especially in two columns—is that lines of prose are not typeset on a grid. I'm hoping to do a series of posts on little things that can be done to improve the situation. (There is the grid package, but I've never had it work for me.)

One thing that really stood out like a sore thumb to me, especially with two columns and large paragraphs is that frequently there is some small space between paragraphs. The reason for this is quite simple. Often one has fixed margin and leading requirements, say 1" margin on each side and a 12 pt leading. At 72.27 pt per inch and an 8.5" x 11" paper, one cannot get an integral number of lines of text per page. In fact, with a 1" margin and a 12 pt leading, one can fit 54 lines of text on the page with 2.43 pt to spare.

There are two things that can be done about this. The first is to change \topskip so that the top line of each page is moved down. The second is to change the \textheight so that the bottom of the page is moved up. The right way to do the second is to use the heightrounded option from the geometry package. Since it will be useful later, we will also set \topskip to \baselineskip. In essence, we will be doing both at once.

This looks something like this.
\topskip=\baselineskip
\usepackage[margin=1in,heightrounded]{geometry}
Note that we need to change \topskip before we use geometry since it uses the value of \topskip that is in force when the option is loaded. (Alternatively, one can use \geometry{heightrounded} to use the new value, for example if geometry has already been loaded.)