1. Introduction

LaTeX is a popular document preparation system that allows us to produce high-quality typeset documents with a wide range of formatting options. Furthermore, one key aspect of document formatting is our best font choice.

In this tutorial, we’ll explore how fonts work in LaTeX.

2. Overview of LaTeX Fonts

A font, in simple words, is a set of glyphs (characters) with a specific style, size, and weight. Moreover, a font family is a collection of fonts that share the same design characteristics, such as Times New Roman, Arial, or Helvetica.

LaTeX includes a default font family known as Computer Modern, designed by Donald Knuth, the creator of TeX (the system on which LaTeX is based). Besides, computer Modern includes several fonts, each with different sizes and styles, including Roman (serif), Sans-serif, and Typewriter (monospace).

We can change the font of a document in LaTeX to one of the following options:

  • Change the font family: This changes the entire document to a different font family
  • Change the font size: This changes the size of the text throughout the document
  • Change the font style: This changes the style of the text, such as italic, bold, or underlined

3. Changing the Font Family

To change the font family in a LaTeX document, we can use the \usepackage command.

For example, to change the font family to Times New Roman, we should add the following command to the preamble of our LaTeX document:

\usepackage{times}

This command loads the Times font family and changes the font of the entire document to Times New Roman:

Original Latex Times Latex

In addition, we should know that there are several other font packages available for LaTeX we can use, such as Arial, Helvetica, and Palatino. We can also choose to use non-standard fonts by loading the appropriate font package and using the font’s name in the document.

4. Changing the Font Size

We can change the font size in a LaTeX document by using one of the following:

  • \tiny
  • \scriptsize
  • \footnotesize
  • \small
  • \normalsize
  • \large
  • \Large
  • \LARGE
  • \huge
  • \Huge

These commands change the font size for the text that follows. For example, to change the font size to 12pt, we can add the following command to the preamble of our LaTeX document:

\documentclass[12pt]{article}

This command sets the default font size to 12pt for the entire document:

Original Latex Font Latex

5. Changing the Font Style

We can change the font style in a LaTeX document using one or a combination of the ones below:

  • \textbf{bold text}
  • \textit{italic text}
  • \texttt{typewriter text}
  • \underline{underlined text}

These commands change the font style for the text that follows. For example, to make text bold, we can use the \textbf command:

Edited Text: Welcome to \textbf{Baeldung}

This command makes the word Baeldung bold:

Original LatexBold Latex

6. Conclusion

Fonts are an important aspect of document formatting in LaTeX. Additionally, we can choose from various font families, sizes, and styles to create a unique and professional-looking document.

Using the commands and packages described in this article, we can easily change the font of our LaTeX document to meet our needs.

Comments are open for 30 days after publishing a post. For any issues past this date, use the Contact form on the site.