hometypography › latex

The Beauty of LaTeX

Fork me on GitHub
Latest update
image 4 July 2011 Code and examples uploaded to GitHub.
Creative Common Attribution-ShareAlike License

[latex fonts screenshot]There are several reasons why one should prefer LaTeX to a WYSIWYG word processor like Microsoft Word: portability, lightness, security are just a few of them (not to mention that LaTeX is free). There is still a further reason that definitely convinced me to abandon MS Word when I wrote my dissertation: you will never be able to produce professionally typeset and well-structured documents using most WYSIWYG word processors. LaTeX is a free typesetting system that allows you to focus on content without bothering about the layout: the software takes care of the actual typesetting, structuring and page formatting, producing documents of astonishing elegance. The software I use to write in LaTeX on a Mac compiles documents in PDF format (but exporting to other formats such as RTF or HTML is also possible). It supports unicode and all the advanced typographic features of OpenType and AAT fonts, like Adobe Garamond Pro and Hoefler Text. It allows fine-tuned control on a number of typesetting options, although just using the default configuration results in documents with high typographic quality. In what follows I review some examples, comparing how fonts are rendered in MS Word and in LaTeX.

Breaking news
May 20, 2009 Microsoft is expected to add support for OpenType features in Microsoft Word 2010, shipping in 2010.

See also
[latex] Typesetting an academic CV in LaTeX. 6 templates to compile a cv using XƎTeX and expert fonts.

[latex tools] LaTeX on Mac OS X: my open source LaTeX toolbox for Mac OS.

[latex] Accessing OpenType features in XeTeX: how to control expert font features via fontspec.
  1. Kerning
  2. Real Small Caps & Titling Caps
  3. Common ligatures
  4. Rare and ancient ligatures
  5. Glyph variants
  6. Transparency
  7. Line breaks, justification and hyphenation
  8. Getting expert fonts
  9. Links
  10. Acknowledgments
  11. Technical notes


1. Kerning

Kerning is the process of selectively adjusting the spacing between letters pairs to improve the overall appearance of text. Examples of letter pairs that need kerning treatment are AV, AY, PA, and AT. These letter pairs often look awkward together, and need to either be moved closer together, or further apart manually. Professional typesetting systems and fonts allow fine-grained adjustments for such letter pairs. Popular word processors either lack support for kerning tables or disable kerning by default (this is the case with both Microsoft Word for Mac OS v.X and 2008) [Thanks to Mark Dancer and Nicholas Shera for pointing this out].

MS Word (wrong default kerning for the "Ta" letter pair):
[example of inappropriate kerning in MS Word]
[Adobe Garamond Pro, 48pt] pdf doc

LaTeX (correct kerning for the "Ta" letter pair):
[example of correct kerning in LaTeX]
[Adobe Garamond Pro, 48pt] pdf tex


2. Real small caps and titling caps

Most word processors create fake small capitals by adjusting the size of capitals. Professional fonts contain different sets of glyphs for small capitals and full-size capitals that any serious typesetting system should be able to use in the appropriate context. In particular, real small capitals are more than resized versions of uppercase capitals: they have a relatively heavier stroke and are designed to be visually compatible with lowercase characters of the same typeface. Some OpenType fonts have special “titling” alternates that are designed for all-uppercase type set at large sizes and have a lighter stroke.

MS Word (fake small caps):
[example of fake small caps in MS Word]
[Adobe Garamond Pro, 48pt] pdf doc

LaTeX (real small caps):
[example of correct use of real small caps in LaTeX]
[Adobe Garamond Pro, 48pt] pdf tex

LaTeX (regular vs titling caps):
[example of titling alternates in LaTeX]
[Adobe Garamond Pro, 120pt] pdf tex


3. Common ligatures

A good typesetting programme should always use contextual intelligence and substitution tables to determine whether ligatures are needed. Common ligatures are essential to professionally typeset text.

MS Word (common ligature errors):
[example of common ligatures in MS Word]
[Hoefler Text, 48pt] pdf doc

LaTeX (correct use of ligatures):
[example of common ligatures in LaTeX]
[Hoefler Text, 48pt] pdf tex


4. Rare and ancient ligatures

XƎTeX in conjunction with professional fonts gives the possibility to exploit the whole set of rare ligatures and decorations, that are automatically added to the text.

MS Word (text with no ligature):
[text without rare ligatures in MS Word]
[Adobe Minion Pro, 24pt] pdf doc

LaTeX (text with rare and old-style ligatures):
[example of rare ligatures in LaTeX]
[Adobe Minion Pro, 24pt] pdf tex

[example of rare ligatures in LaTeX]
[Hoefler Text, 24pt] pdf tex

[example of rare ligatures in LaTeX]
[Skia, 24pt] pdf tex


5. Glyph variants

Expert fonts often include variants or alternate shapes for alphabetic characters and numbers. XƎTeX with the fontspec package offers the possibility to access and select variants on single characters or for a whole text block.

LaTeX (example of font variants):
[example of font variants in LaTeX]
[Zapfino, 25pt] pdf tex


6. Transparency

The fonstpec package allows you to set font transparency in your XƎTeX source.

LaTeX (alpha transparency)
[example of alpha transparency in LaTeX]
[Hoefler Text Italic, 48+pt] pdf tex


7. Line breaks, justification and hyphenation

Readability results not only from a good selection of typefaces, but also from a correct distribution of characters and whitespace per line. To attain this goal, most WYSIWYG word processors use relatively dumb justification/hyphenation procedures (i.e. algorithms that establish the position for line breaks by processing text line by line). LaTeX uses an advanced algorithm, based on seminal work by Donald Knuth and Michael F. Plass and enhanced by Frank Liang in 1983 for his PhD dissertation, which considers paragraphs as `wholes´ in order to decide where to add line breaks. The algorithm uses language-specific patterns in order to decide the preferred position for hyphenation. The engine then selects line breaks so as to make paragraphs look as good as possible. Information that is taken into account for calculating optimal line breaks includes the number of consecutive lines ending with hyphens, word tightness on each line, the change of tightness between consecutive lines. Further development has enabled the LaTeX engine to allow certain characters to stick into the margin, thus generating an optically straight margin - i.e., a margin that looks straight without being geometrically so. LaTeX's hyphenation settings can be fine-tuned by expert users.

Advanced hyphenation/justification in LaTeX:
[example of advanced hyphenation/justification in LaTeX]
[Hoefler Text, 10pt] pdf tex


8. Getting expert fonts

XƎTeX gives the best results with expert fonts such as those based on OpenType technology but works with standard TrueType fonts as well. Zillions of expert fonts can be purchased online from digital foundries, but Mac OS comes bundled with a number of excellent fonts with expert features (e.g. Hoefler Text, Optima, Skia, Apple Chancery, Zapfino). More free OpenType fonts are available on the net. Check out for example the Gentium, Charis SIL and Doulos SIL fonts from SIL, Cardo by David J. Perry, the free fonts designed by Jos Buivenga (the creator of Fontin), this collection of professional quality fonts selected by Vitaly Friedman or the amazing Font Squirrel.


9. Typesetting with LaTeX: selected links

10. Acknowledgments

Many of the examples in this article are based on the documentation of the fontspec package by Will Robertson, who deserves most of the credits for making expert font features in XƎTeX so easy to use. Thanks to all those who helped improve this article with valuable feedback: Bastien Guerry, Nicholas Shera, Mark Dancer, Olaf 'Rhialto' Seibert, David Crossland, Tiago Tresoldi, Ehud Kaplan, Henri Langenhoven.

11. Technical notes

These examples were created on a Mac, partly on Mac OS 10.3.9, Microsoft Word v.X and TeXShop 1.35, partly on Mac OS 10.5.3 with Word:Mac 2008 and TeXShop 2.x, the XƎTeX engine with the fontspec package, and using the following fonts: Adobe Garamond Pro, Adobe Minion Pro (commercial fonts), Hoefler Text, Skia, Zapfino (fonts bundled with Mac OS X). This article, the PDF samples and TeX sources are licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. A backlink is sufficient for attribution. All materials used in this article can be obtained via GitHub. The TeX, LaTeX and XƎTeX logos on this page are rendered via a nifty XHTML and CSS hack by Edward O'Connor. [ COinS metadata ]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki