fontenc package (LaTeX2e unofficial reference manual (November 2018))

Next: Font styles, Up: Fonts [Contents][Index]

### 4.1 `fontenc` package

Synopsis:

    \usepackage[font_encoding]{fontenc}

or

    \usepackage[font_encoding1, font_encoding2, ...]{fontenc}

Specify the font encodings. A font encoding is a mapping of the character codes to the font glyphs that are used to typeset your output.

This package only applies if you use the `pdflatex` engine (see TeX engines). If you use the `xelatex` or `lualatex` engine then instead use the `fontspec` package.

TeX’s original font family, Computer Modern, has a limited character set. For instance, to make common accented characters you must use `\accent` (see \accent) but this disables hyphenation. TeX users have agreed on a number of standards to access the larger sets of characters provided by modern fonts. If you are using `pdflatex` then this in the preamble

    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}  % Optional: encoding of input file

gives you support for the most widespread European languages, including French, German, Italian, Polish, and others. In particular, if you have words with accented letters then LaTeX will hyphenate them and your output can be copied and pasted. (The optional second line allows you to directly enter accented characters into your source file.)

If you are using an encoding such as `T1` and the characters appear blurry or do not magnify well then your fonts may be bitmapped, sometimes called raster or Type 3. You want vector fonts. Use a package such as `lmodern` or `cm-super` to get a font that extends LaTeX’s default using vector fonts.

For each font_encoding given as an option but not already declared, this package loads the encoding definition files, named `font_encodingenc.def`. It also sets `\encodingdefault` to be the last encoding in the option list.

These are the common values for font_encoding.

`OT1`

  The original encoding for TeX. Limited to mostly English characters.

`OMS, OML`

  Math symbols and math letters encoding.

`T1`

  TeX text extended. Sometimes called the Cork encoding for the Users Group meeting where it was developed. Gives access to most European accented characters. The most common option for this package.

`TS1`

  Text Companion encoding.

LaTeX’s default is to load `OML`, `T1`, `OT1`, and then `OMS`, and set the default to `OT1`.

Even if you do not use accented letters, you may need to specify a font encoding if your font requires it.

If you use `T1` encoded fonts other than the default Computer Modern family then you may need to load the package that selects your fonts before loading `fontenc`, to prevent the system from loading any `T1` encoded fonts from the default.

The LaTeX team reserve encoding names starting with: ‘`T`’ for the standard text encodings with 256 characters, ‘`TS`’ for symbols that extend the corresponding T encodings, ‘`X`’ for test encodings, ‘`M`’ for standard math encodings with 256 characters, ‘`A`’ for special applications, ‘`OT`’ for standard text encodings with 128 characters, and ‘`OM`’ for standard math encodings with 128 characters (‘`O`’ stands for ‘`obsolete`’).

This package provides a number of commands, detailed below. Many of them are encoding-specific, so if you have defined a command that works for one encoding but the current encoding is different then the command is not in effect.

Unofficial LaTeX2e reference manual