The lmodern package

Switches the document to Latin Modern, the vector version of the Computer Modern fonts with the full T1 character set.

Loading the package

\usepackage{lmodern}

With \usepackage[T1]{fontenc} alone, pdfLaTeX takes the EC fonts for Computer Modern. Depending on the installation these are vector fonts or bitmaps, and bitmaps look blurred in many PDF viewers. The EC fonts also exist only in fixed sizes: a request for 13.5pt is replaced by 14.4pt with a font warning.

Latin Modern follows the design of Computer Modern, is a vector font on every installation and is available in any size. The package has no commands. It changes the three default families (serif, sans serif, monospaced) and the math fonts.

LuaLaTeX and XeLaTeX use the OpenType version of Latin Modern as their default font, so the package is not needed there.

Main commands

\usepackage{lmodern}Switches the fonts. In pdfLaTeX documents the line stands next to \usepackage[T1]{fontenc}.
\usepackage[variablett]{lmodern}Uses the proportional typewriter font of the family for \texttt.
\usepackage[lighttt]{lmodern}Uses the light weight of the typewriter font as its normal weight.
\usepackage[nomath]{lmodern}Leaves the math fonts as they are.
\fontsize{13.5pt}{16pt}\selectfontAny font size works without a substitution warning.

Complete example

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
Latin Modern Roman, \textsf{Latin Modern Sans} and \texttt{Latin Modern Mono}.

{\fontsize{13.5pt}{16pt}\selectfont This line is set in 13.5\,pt, a size
that the EC fonts do not have.}

Umlauts are single characters: Größe, Übung, Äpfel.
\end{document}
Result
The compiled example

Open in the editor

Compiled with pdfLaTeX from TeX Live 2023.

Pitfalls

Related pages