> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/fonts/02-font-typefaces.md).

# Font typefaces

## Introduction

By default, LaTeX typesets documents using the $$\text{Computer Modern}$$ typeface family but you can use LaTeX packages to use different fonts according to your needs or preferences.

## Changing the default document fonts

For example, by adding `\usepackage{tgbonum}` to the document preamble, LaTeX will use the TEX Gyre Bonum font family to typeset your document:

```latex
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tgbonum}

\begin{document}
This document is a sample document to test font
families and font typefaces.

This text uses a different font typeface
\end{document}
```

[Open this example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Change+LaTeX+fonts\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5BT1%5D%7Bfontenc%7D%0A%5Cusepackage%7Btgbonum%7D%0A%0A%5Cbegin%7Bdocument%7D%0AThis+document+is+a+sample+document+to+test+font+%0Afamilies+and+font+typefaces.%0A%0AThis+text+uses+a+different+font+typeface%0A%5Cend%7Bdocument%7D)

The following image shows the output produced by the example above:

![FontTypefacesEx1OLV2.png](/files/1za9NmUeRRI3G4kWlveH)

## Changing default font typeface

The font can also be changed for a specific element in the document.

```latex
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tgbonum}

\begin{document}
This document is a sample document to
test font families and font typefaces.

{\fontfamily{qcr}\selectfont
This text uses a different font typeface
}
\end{document}
```

[Open this example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Change+LaTeX+fonts\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5BT1%5D%7Bfontenc%7D%0A%5Cusepackage%7Btgbonum%7D%0A%0A%5Cbegin%7Bdocument%7D%0AThis+document+is+a+sample+document+to+%0Atest+font+families+and+font+typefaces.%0A%0A%7B%5Cfontfamily%7Bqcr%7D%5Cselectfont%0AThis+text+uses+a+different+font+typeface%0A%7D%0A%5Cend%7Bdocument%7D)

The following image shows the output produced by the example above:

![FontTypefacesEx2.png](/files/yNVSYwX0fBdUW6K06U5J)

The command `\fontfamily{qcr}\selectfont` will set the *TeX gyre cursor* font typeface, whose fontcode is `qcr`, for the text inside the braces. A lot more LaTeX font typefaces are available, see the [reference guide](#reference-guide).

The popular LaTeX font typefaces are originated from four families:

* *Computer Modern* (default in standard LaTeX classes): CM Roman, CM Sans Serif, CM Typewriter
* *Latin Modern*: LM Roman, LM Sans Serif, LM Typewriter, LM Dunhill
* *Post Script Fonts*: Times, Utopia/Fourier, Palatino, Bookman, Helvetica, Courier
* *TeX Gyre*

## Reference guide

**Roman, Sans Serif and Typewriter typefaces**

| Font                         | "font package name"  | "font code" | Example                                           |
| ---------------------------- | -------------------- | ----------- | ------------------------------------------------- |
| Computer Modern Roman        |                      | `cmr`       | ![Typeface-cmr.png](/files/YOFrZ2ze5dRD7Mpes49R)  |
| Latin Modern Roman           | `lmodern`            | `lmr`       | ![Typeface-lmr.png](/files/BSM3XhcHKBPkGRud03WY)  |
| Latin Modern Dunhill         | `lmodern`            | `lmdh`      | ![Typeface-lmdh.png](/files/kyD6l3ZeF282hPdvrOL1) |
| TeX Gyre Termes              | `tgtermes`           | `qtm`       | ![Typeface-qtm.png](/files/u2X4u13qcYJ2aGeeWjLJ)  |
| TeX Gyre Pagella             | `tgpagella`          | `qpl`       | ![Typeface-qpl.png](/files/bTGcrFvGwTEhf2uyycsS)  |
| TeX Gyre Bonum               | `tgbonum`            | `qbk`       | ![Typeface-qbk.png](/files/qIKTN3R6ksqqtbRHtGA8)  |
| TeX Gyre Schola              | `tgschola`           | `qcs`       | ![Typeface-qsc.png](/files/d42CcKVBuduMd8dZRC7K)  |
| Times                        | `mathptmx`           | `ptm`       | ![Typeface-ptm.png](/files/XnDSuNcSnl2kAzc9Kzzv)  |
| Utopia / Fourier             | `utopia` / `fourier` | `put`       | ![Typeface-put.png](/files/LohMKADMGdIIcSlqruxV)  |
| Palatino                     | `palatino`           | `ppl`       | ![Typeface-ppl.png](/files/Uvb3LMID88NBbu0SwmRT)  |
| Bookman                      | `bookman`            | `pbk`       | ![Typeface-pbk.png](/files/PMvlZHE7MyBTu0KapnON)  |
| Charter                      | `charter`            | `bch`       | ![Typeface-bch.png](/files/qLDElN4XsqEs1NxhMBVB)  |
| Computer Modern Sans Serif   |                      | `cmss`      | ![Typeface-cmss.png](/files/30oEpCRmnqewnwMAC170) |
| Latin Modern Sans Serif      | `lmodern`            | `lmss`      | ![Typeface-lmss.png](/files/dvJ7bXFHPyZWc71aatBG) |
| TeX Gyre Adventor            | `tgadventor`         | `qag`       | ![Typeface-qag.png](/files/M0xc96S5IGMUvqkNxGzI)  |
| TeX Gyre Heros               | `tgheros`            | `qhv`       | ![Typeface-qhv.png](/files/tgKaddDUMq4HA1l5x4KE)  |
| Helvetica                    | `helvet`             | `phv`       | ![Typeface-phv.png](/files/T2OXVyUpKo0bgQerfMLU)  |
| Computer Modern Typewriter   |                      | `cmtt`      | ![Typeface-cmtt.png](/files/MATKIFEQL22HCT7xT7Qs) |
| Latin Modern Sans Typewriter | `lmodern`            | `lmtt`      | ![Typeface-lmtt.png](/files/4HJQN5jA4zdD7fZlLYnU) |
| TeX Gyre Cursor              | `tgcursor`           | `qcr`       | ![Typeface-qcr.png](/files/x0oddwwHUeNJjmctCy0L)  |
| Courier                      | `courier`            | `pcr`       | ![Typeface-pcr.png](/files/4FD48dxp3isYJJ50GOiA)  |

See also [The LaTeX Font Catalogue](https://tug.org/FontCatalogue/), though note that not all fonts listed in the catalogue are distributed with a license that allows them to be distributed as part of TeX Live, and therefore not all those fonts are available on Overleaf.

## Further reading

For more information see:

* [The LaTeX Font Catalogue](https://tug.org/FontCatalogue/).
* [Bold, italics and underlining](/latex/latex-basics/03-bold-italics-and-underlining.md)
* [Font sizes, families, and styles](/latex/fonts/01-font-sizes-families-and-styles.md)
* [Supporting modern fonts with XeLaTeX](/latex/fonts/03-xelatex.md)
* [Paragraph formatting](/latex/formatting/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [Line breaks and blank spaces](/latex/formatting/05-line-breaks-and-blank-spaces.md)
* [Multiple columns](/latex/formatting/09-multiple-columns.md)
* [Single sided and double sided documents](/latex/formatting/08-single-sided-and-double-sided-documents.md)
* [Management in a large project](/latex/document-structure/07-management-in-a-large-project.md)
* [Multi-file LaTeX projects](/latex/document-structure/08-multi-file-latex-projects.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/fonts/02-font-typefaces.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
