The digital fonts have a long and intricate history. See Adobe Font Metrics for some more details.

Originally TeX was conceived to use its own font system, MetaFont, designed by D. Knuth. The default font family for TeX and friends is called Computer Modern. These high quality fonts are scalable, and have a wide range of typographical fine tuning capabilities.

Standard tex compilers will let you use other fonts. There are many different font types, such as PostScript Type1/Type3 fonts and bitmap fonts. Type1 are outline fonts (vector graphics) which are commonly used by pdftex. Bitmap fonts are raster graphics, and usually have very poor quality, which can easily be seen when zooming or printing a document. Type3 is a superset of Type1 and has more functionalities from Postscript, such as embedding raster graphics. In the TeX world, Type3 fonts are often used to embed bitmap fonts.

It should be noticed that fonts get generated the first time they are required, hence the long compilation time.

However, MetaFont is internally a quite complex font system, and the most popular font systems as of this day are Truetype font (ttf) and OpenType font (otf). With modern TeX compilers such as xetex and luatex it is possible to make use of such fonts in LaTeX documents. If you want/have to stick with the standard compilers, the aforementioned font types must first be converted and made available to LaTeX (e.g. converted to Type1 fonts). The external links section below has some useful resources.

In LaTeX, there are many ways to specify and control fonts. It is a very complex matter in typography.

There are many font families e.g. Computer Modern, Times, Arial and Courier. Those families can be grouped into three main categories: roman (rm) or serif, sans serif (sf) and monospace (tt) (see Typeface for more details). Each font family comes with the default design which falls into one of those categories; however, it is interchangeable among them. Computer Modern Roman is the default font family for LaTeX. Fonts in each family also have different properties (size, shape, weight, etc.). Families are meant to be consistent, so it is highly discouraged to change fonts individually rather than the whole family.

The three families are defined by their respective variables:

\rmdefault

\sfdefault

\ttdefault

The default family is contained in the \familydefault variable, and it is meant to have one of the three aforementioned variables as value. The default is defined like the following assignment:

\renewcommand*{\familydefault}{\sfdefault}

This will turn all the part of the document using the default font to the default sans serif, which is Computer Modern Sans Serif if you did not change the default font.

Changing font families usually works in two steps:

First specify which family you want to change (rm, sf or tt).

Second specify the new default family if it is not rm.

Mathematical fonts is a more complex matter. Fonts may come with a package that will take care of defining all three families plus the math fonts. You can do it by yourself, in which case you do not have to load any package.

Below is an example[1] that demonstrates how to change a specific family.

Do not overuse emphasis in your paragraphs. Emphasis should be reserved for only key terms or other particularly important concepts in a text, and bold text especially used minimally.

In order to add some emphasis to a word or a phrase, the simplest way is to use the \emph{text} command, which usually italicizes the text. Italics may be specified explicitly with \textit{text}.

I want to \emph{emphasize} a word.

Note that the \emph command is dynamic: if you emphasize a word which is already in an emphasized sentence, it will be reverted to the upright font.

\emph{In this emphasized sentence, there is an emphasized \emph{word} which looks upright.}

In this emphasized sentence, there is an emphasized word which looks upright.

Text may be emphasized more heavily through the use of boldface, particularly for keywords the reader may be trying to find when reading the text. As bold text is generally read before any other text in a paragraph or even on a page, it should be used sparingly. It may also be used in place of italics when using sans-serif typefaces to provide a greater contrast with unemphasized text. Bold text can be generated with the \textbf{text} command.

\textbf{Bold text} may be used to heavily emphasize very important words or phrases.

Bold text may be used to heavily emphasize very important words or phrases.

A character is a sequence of bytes, and should not be confused with its representation, the glyph, which is what the reader sees. So the character 'a' has different representations following the used font, for example the upright version, the italic version, various weights and heights, and so on.

Upon compilation, tex will have to choose the right font glyph for every character. This is what is called font encoding. The default LaTeX font encoding is OT1, the encoding of the original Computer Modern TeX text fonts. It contains only 128 characters, many from ASCII, but leaving out some others and including a number that are not in ASCII. When accented characters are required, TeX creates them by combining a normal character with an accent. While the resulting output looks perfect, this approach has some caveats.

It stops the automatic hyphenation from working inside words containing accented characters.

Besides, some of Latin letters could not be created by combining a normal character with an accent, to say nothing about letters of non-Latin alphabets, such as Greek or Cyrillic.

To overcome these shortcomings, several 8-bit CM-like font sets were created. Extended Cork (EC) fonts in T1 encoding contains letters and punctuation characters for most of the European languages based on Latin script. The LH font set contains letters necessary to typeset documents in languages using Cyrillic script. Because of the large number of Cyrillic glyphs, they are arranged into four font encodings—T2A, T2B, T2C, and X2. The CB bundle contains fonts in LGR encoding for the composition of Greek text. By using these fonts you can improve/enable hyphenation in non-English documents. Another advantage of using new CM-like fonts is that they provide fonts of CM families in all weights, shapes, and optically scaled font sizes.

All this is not possible with OT1; that's why you may want to change the font encoding of your document.

If you do not have a specific font encoding issue (e.g. writing English only), there is no need for T1. Sticking to the default font encoding is not a problem.

Note that changing the font encoding will have some requirements over the fonts being used. The default Computer Modern font does not support T1. You will need Computer Modern Super (cm-super) or Latin Modern (lmodern), which are Computer Modern-like fonts with T1 support. If you have none of these, it is quite frequent (depends on your TeX installation) that tex chooses a Type3 font such as the Type3 EC, which is a bitmap font. Bitmap fonts look rather ugly when zoomed or printed.

If after using T1 you find yourself with very low quality fonts, it is because there is no appropriate font installed on your system. Install either cm-super or lmodern. This is a very common error!

The fontenc package tells LaTeX what font encoding to use. Font encoding is set with:

\usepackage['encoding']{fontenc}

where encoding is the font encoding. It is possible to load several encodings simultaneously.

There is nothing to change in your document to use CM Super fonts (assuming they are installed), they will get loaded automatically if you use T1 encoding. For lmodern, you will need to load the package after the T1 encoding has been set:

\usepackage[T1]{fontenc}\usepackage{lmodern}

The package ae (almost European) is obsolete. It provided some workarounds for hyphenation of words with special characters. These are not necessary any more with fonts like lmodern. Using the ae package leads to text encoding problems in PDF files generated via pdflatex (e.g. text extraction and searching), besides typographic issues.

The commands in column two are not entirely equivalent to the commands in column one: They do not correct spacing after the selected font style has ended. The commands in column one are therefore in general recommended.

You may have noticed the absence of underline. This is because underlining is not recommended for typographic reasons (it weighs the text down). You should use emph instead. However underlining text provides a useful extra form of emphasis during the editing process, for example to draw attention to changes. Although underlining is available via the \underline{...} command, text underlined in this way will not break properly. This functionality has to be added with the ulem (underline emphasis) package. Stick \usepackage{ulem} in your preamble. By default, this overrides the \emph command with the underline rather than the italic style. It is unlikely that you wish this to be the desired effect, so it is better to stop ulem taking over \emph and simply call the underline command as and when it is needed.

To apply different font sizes, simply follow the commands on this table:

These commands change the size within a given scope, so for instance {\Large some words} will change the size of only some words, and does not affect the font in the rest of the document. It will work for most parts of the text.

{\Large\tableofcontents}

These commands cannot be used in math mode. However, part of a formula may be set in a different size by using an \mbox command containing the size command. The new size takes effect immediately after the size command; if an entire paragraph or unit is set in a certain size, the size command should include the blank line or the \end{...} which delimits the unit.

The default for \normalsize is 10 point (option 10pt), but it may differ for some Document Styles or their options. The actual size produced by these commands also depends on the Document Style and, in some styles, more than one of these size commands may produce the same actual size.

Note that the font size definitions are set by the document class. Depending on the document style the actual font size may differ from that listed above. And not every document class has unique sizes for all 10 size commands.

Note: the following table is mostly wrong. Until someone gets around to fixing it: use \makeatletter and \f@size to find out the font size.

Absolute Point Sizes, [10pt] being default

size

standard classes, proc

AMS classes, memoir

slides

beamer

[10pt]

[11pt]

[12pt]

[10pt]

[11pt]

[12pt]

[10pt]

[11pt]

[12pt]

\tiny

6.80565

7.33325

7.33325

7.33325

7.97224

8.50012

17.27505

5.31258

6.37509

6.37509

\scriptsize

7.97224

8.50012

8.50012

7.97224

8.50012

9.24994

20.73755

7.43760

8.50012

8.50012

\footnotesize

8.50012

9.24994

10.00002

8.50012

9.24994

10.00002

20.73755

8.50012

9.24994

10.00002

\small

9.24994

10.00002

10.95003

9.24994

10.00002

10.95003

20.73755

9.24994

10.00002

10.95003

\normalsize

10.00002

10.95003

11.74988

10.00002

10.95003

11.74988

24.88382

10.00002

10.95003

11.74988

\large

11.74988

11.74988

14.09984

10.95003

11.74988

14.09984

29.86258

11.74988

11.74988

14.09984

\Large

14.09984

14.09984

15.84985

11.74988

14.09984

15.84985

35.82510

14.09984

14.09984

16.24988

\LARGE

15.84985

15.84985

19.02350

14.09984

15.84985

19.02350

43.00012

16.24988

16.24988

19.50362

\huge

19.02350

19.02350

22.82086

15.84985

19.02350

22.82086

51.60014

19.50362

19.50362

23.39682

\Huge

22.82086

22.82086

22.82086

19.02350

22.82086

22.82086

51.60014

23.39682

23.39682

23.39682

As a technical note, points in TeX follow the standard American point size in which 1 pt is approximately 0.35136 mm. The standard point size used in most modern computer programs (known as the desktop publishing point or PostScript point) has 1 pt equal to approximately 0.3527 mm while the standard European point size (known as the Didot point) had 1 pt equal to approximately 0.37597151 mm (see: point (typography)).

For short, you can use the \usefont{<encoding>}{<family>}{<series>}{<shape>} command.

\usefont{T1}{cmr}{m}{n}% Computer Modern Roman (TeX default) in T1 encoding. May lead to bad text quality if you do not have cm-super installed.\usefont{T1}{phv}{m}{sc}% phv family (sans serif) medium small capitals.\usefont{T1}{ptm}{b}{it}% ptm family bold italic\usefont{U}{pzd}{m}{n}% ...

The \tiny...\Huge commands are often enough for most contents. These are fixed sizes however. In most document processors, you can usually choose any size for any font. This is because the characters actually get magnified. If it usually looks correct for medium sizes, it will look odd at extreme sizes because of an unbalanced thickness. In TeX it is possible to change the magnification of anything, but highly discouraged for the aforementioned reason. Changing the font size is made by changing the font file. Yes, there is a file for every size: cmr10 for Computer Modern Roman 10pt, cmr12 for Computer Modern Roman 12pt, etc. This ensure the characters are correctly balanced and remain readable at all defined sizes.

You may choose a particular font size with the \fontsize{<size>}{<line space>} command. Example:

{\fontsize{5cm}{1em}\selectfont This is big!}

If you are using the default Computer Modern font with OT1 encoding, you may get the following message:

If you use the XeTeX or LuaTeX engine and the fontspec package, you'll be able to use any font installed in the system effortlessly. XeTeX also allows using OpenType technology of modern fonts like specifying alternate glyphs and optical size variants. XeTeX also uses Unicode by default, which might be helpful for font issues.

To use the fonts, simply load the fontspec package and set the font:

\documentclass{article}

\usepackage{fontspec}\setmainfont{Arial}

\begin{document}
Lorem ipsum...\end{document}

Then compile the document with xelatex or lualatex. Note that you can only generate .pdf files, and that you need a sufficiently new TeX distribution (TeX Live 2009 should work for XeTeX and Tex Live 2010 for LuaTeX). Also you should not load the inputenc or fontenc package. Instead make sure that your document is encoded as UTF-8 and load fontspec, which will take care of the font encoding. To make your document support both pdflatex and xelatex/lualatex you can use the \ifxetex/ \ifluatex macro from the ifxetex/ ifluatex package. For example for xelatex

Font installation the shallow way"For one-off projects, you can cut corners with font installation (i.e. fontinst) and end up with a more manageable set of files and a cleaner TEX installation. This article shows how and why"