Posted on 05 Nov 2009
So, this is essentially the saga of how I typeset my Princeton undergraduate senior thesis. Several people have expressed interest in seeing how it was done, so I figured I’d write up my collected wisdom as an article here. I’ll present this material as an annotated version of the document preamble.
I decided to use the book class here, as I needed chapter divisions. Article would have worked just as well. The 10pt specifier really isn’t used, but it’s what I started with, so I left it in.
This is a package that implements a few really ingenious extensions in PDFLaTeX. If you’re using that to produce your output PDFs (and you should be), this will implement margin kerning (allowing certain letters to stick outside the margin to trick the eye into perceiving a straight margin) and microtypographic font size changes (making a few individual letters larger and smaller by fractions of a point in order to make the “color” of the page more uniform overall). Also used for letterspacing (but see the caveat below).
This is a simple call to the geometry package to set the page size. I chose to typeset the book in 6x9 inch format, and use what is an approximately golden-rule proportioned main text block.
This is the selection of my fonts. I purchased Adobe Sabon, and followed something like this OpenType font installation guide for converting the fonts into PostScript. The first command enables the LY1 font encoding, and the second temporarily sets the default font to the proportional-number (full-height numbers) version of the font. Then, the Euler math font package is loaded, as it balances well with Sabon. The proportional font package is loaded before this so the Euler math packages takes the full-height numbers from that font for use in math mode. Then, the proper old-style figure font is selected.
UPDATE 5/12/09: If you’re using Sabon, and particularly the Sabon OpenType fonts that I mention above, I can now very highly recommend Michael Gaehrken’s page with really nice packages for both Sabon itself and a really fine-looking Sabon math mode.
Several things could make this process a little different. First, if you don’t use the Euler math font package (others include the Mathdesign package that has Utopia, Garamond, and Charter math, or the Minion Pro math package), your math package might provide its own numbers. Alternately, you might want to see if you like the Euler numbers themselves, by adding the “euler-digits” option to the eulervm package. Regardless, if you don’t need the digits from your text font, you don’t need to set twice—just set it to “psbj” (or the appropriate code for your font) after ading the fontenc package.
Also, one reported source of problems when creating a new set of TeX fonts is an incomplete .fd file. In my TeX installation, the .fd files are located in tex/latex/sabon under the local TeX tree. The .fd file should contain many lines of the form “”, with psb perhaps substituted for your own font family. The two options after “psb” (the “m” and “n” above) are the various font weights and shapes, respectively. Unless you have a very complete font package (like the phenomenally extensive, beautiful, and pricey Sabon Next), you will probably only have fonts for the varieties “m/n”, “m/sc”, “m/it”, “b/n”, and “b/it”. This, however, is not enough to satisfy TeX. You’ll need to have aliases such that all the following varieties are available:
The shape “sl” above is “slanted,” which I’ve generally aliased to “it”, and the “bx” weight is “bold extended width,” which I’ve aliased to “b”. An individual alias line should look something like:
In this line, I’ve aliased psb/b/it (bold italics) to psb/b/n, since the version of Sabon I purchased doesn’t contain a bold-italic variant. Make sure your font has all the appropriate varieties defined, and you should save yourself much headache later.
Finally, we load a few generic packages (mathrsfs for the calligraphic font and lettrine for large initial capitals), and define a command for when we want to temporarily switch to proportional figures. The DeclareMathSizes command increases the size of sub- and superscripts, which seemed a touch too small throughout the work. Finally, fourier-orns includes a nice selection of ornaments, one of which appears on the title page.
This sets up commands that will letterspace both capitals and small caps, something that should be done for all extended runs of all caps and small caps in a work. NOTE! The textls command is provided by the microtype package, and uses letterspacing implemented in the core of PDFLaTeX. However, this requires a VERY NEW version of PDFLaTeX—you will either need to compile a new binary from the PDFTeX source, or download at least version 2007 of TeX Live. Otherwise, you can try to use the older and significantly more liable to break “soul” package. I warn you, though, that downloading the latest PDFLaTeX build will save MUCH consternation.
Set the paragraph indent to 1em.
Not sure if I ever used anything in these packages, but I include them in every document I write.
The tabularx package allows natural table column sizing, and the booktabs package documentation should be required reading for anyone who ever typesets a table. The rotating package allows one to set a table sideways, and it also automatically knows to rotate a table to the “outside” of a two-sided work like a book.
I use the subfig package for subfigures, and the standard graphicx package for graphics. The XY-pic package is great for making small on-the-fly line drawings using nothing but TeX source.
This is the package that allows one to easily change the formatting of section titles. The more detailed configuration for that formatting is below, but the default options here set titles to text-size by default, turn off bold-face, and set ragged-right.
This block configures the typesetting of footnotes. First, we load the footmisc package, whose sole purpose is to make the horizontal rule above footnotes behave properly—the rule should only appear above a footnote that has been continued from a previous page, unlike the normal TeX method of placing a rule before every block of footnotes. The redefinition of makes footnote numbers smaller (by making them double-superscript). The redefinition of changes the body of the footnote itself to actually display as “1. Text” instead of “¹Text”. The “splitfootnoterule” command sets the width of the footnote rule. The “footnotesize” sets a proper size for footnotes, and the “thefootnote” command causes the footnote numbers to be set in proportional (not old-style) figures.
The natbib command sets up the first part of the bibliography formatting. I wanted to use author-date citations, and allow the ability to remove the author’s name from the citation and print only the year. The command is redefined to print (Author 2007) and the command will produce just (2007). That effect is produced by the natbib package options, the redefinition of the cite commands, and the bibpunct command. Finally, the bibsection redefinition does a complicated method to make the bibliography properly appear in the table of contents, and the bibhang and bibsep commands are cosmetic formatting options.
On the advice of Robert Bringhurst [editorial comment: READ THIS BOOK], I decided early on to give up the long em dash in place of the spaced en dash. I wanted the ability to change my mind later, so I defined the command. It’s no longer than typing the dash in by hand to simply type in the command itself, so I decided to leave it in.
The fancy headers package just sets up normal book-style headers, with no gigantic rules.
See the comment. Whenever LaTeX is forced to insert a blank page, I don’t want that page to have headers, footers, page numbers, and so on.
Here’s the section title formatting. Chapter titles are two lines, one saying “CHAPTER N”, letterspaced all caps, and the next with the title of the chapter, letterspaced all caps, with 13pt leading before and 13pt leading after. Section headers are formatted letterspaced small caps, with the section number without a period (i.e. “1 SECTION”), 13pt leading before and after. Subsections are italic u&lc with 6pt leading before and 7pt after. I define a “parasep” command to insert a three-asterisk text separator, and a “run-in header” command to put a run-in paragraph header.
This is my set of commands for tocloft to configure the table of contents. I only include chapters (that’s the tocdepth command), remove the dots as separators, and I do NOT right-align the page numbers. See the PDF file for how it turns out.
This is the only code that needs to come after the beginning of the proper document. Set the “frenchspacing” command to disable extra spacing after periods at the end of sentences. This is an old, antequated typesetting convention, and shouldn’t be used in modern documents. Then we set the actual font size, and away we go!
The only other thing that one might find interesting is the custom bibliography style I produced for this. It’s based loosely on the Journal of Symbolic Logic bibliography format, and I updated it to set a three-em dash on repeated authors, and standardize things a little better across quite a few document types.