> 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/in-depth-articles/38-step-2-an-introduction-to-latex-fonts.md).

# Step 2: An introduction to LaTeX fonts

[Introduction](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [Step 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [Step 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [Step 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [Step 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [Step 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [Step 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [Step 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [Step 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [Examples and projects](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)

This step introduces LaTeX’s default fonts and summarizes the font-selection scheme LaTeX uses to classify font properties and define “font shapes.” Topics discussed in this article will be referenced throughout the rest of the tutorial. Taking a few minutes to read this page will help you to make the most of the tutorial series.

### LaTeX’s default document text fonts

LaTeX uses three sets of fonts to typeset the text of any document. Those font sets are also known as *document font families*; each family comprises a suite of fonts that share common design characteristics:

* **main text family**: fonts used for the main document text, typically using a [serif design](https://en.wikipedia.org/wiki/Serif).
* [**sans serif**](https://en.wikipedia.org/wiki/Sans-serif) **family**: fonts often used to typeset section headings and other prominent text.
* [**monospaced**](https://en.wikipedia.org/wiki/Monospaced_font) **family**: fonts typically used for typesetting computer code and similar content.

By default, LaTeX uses font families from the [Computer Moder](https://en.wikipedia.org/wiki/Computer_Modern)n series (for pdfLaTeX) or the [Latin Modern](https://tug.org/FontCatalogue/latinmodernroman/) series (for XeLaTeX and LuaLaTeX).

### How LaTeX classifies (organizes) its fonts

There is a huge choice of fonts for typesetting text, with a rich diversity of designs created to meet specific typographical objectives. To navigate this variety, any flexible and logical font-selection process needs a well-structured system for organizing and classifying fonts based on their design features. LaTeX addresses this challenge using its New Font Selection Scheme, now called NFSS2, which classifies each text font according to five parameters: *encoding*, *family*, *series*, *shape*, and *size*.

Here is a summary of those five parameters.

* **Encoding**: The mapping between integer (character code) values stored in a text file and the characters they are intended to represent. LuaLaTeX and variable fonts use the Unicode encoding, which LaTeX denotes by “TU.”
* **Family**: The name given to a suite of fonts with a shared design. We will explore font families when configuring variable fonts with fontspec.
* **Series**: A series value identifies the font’s weight (boldness) and width (compression). Each LaTeX font series value is defined as a `⟨weight⟩⟨width⟩` combination taken from the following table, *except* that m is dropped unless both weight and width are medium, in which case a single `m` is used.

The following table lists LaTeX's standard width and weight identifiers.

|                    |                 |                    |                 |                                            |
| ------------------ | --------------- | ------------------ | --------------- | ------------------------------------------ |
| **Weight**         | **Width**       |                    |                 |                                            |
| *LaTeX identifier* | *Name*          | *LaTeX identifier* | *Name*          | *Percentage of “normal” width*<sup>†</sup> |
| ul                 | Ultra-light     | uc                 | Ultra-condensed | 50%                                        |
| el                 | Extra-light     | ec                 | Extra-condensed | 62.5%                                      |
| l                  | Light           | c                  | Condensed       | 75%                                        |
| sl                 | Semi-light      | sc                 | Semi-condensed  | 87.5%                                      |
| m                  | Medium (normal) | m                  | Medium          | 100%                                       |
| sb                 | Semi-bold       | sx                 | Semi-expanded   | 112.5%                                     |
| b                  | Bold            | x                  | Expanded        | 125%                                       |
| eb                 | Extra-bold      | ex                 | Extra-expanded  | 150%                                       |
| ub                 | Ultra-bold      | ux                 | Ultra-expanded  | 200%                                       |

<sup>†</sup>As suggested in the official LaTeX documentation (see `[fntguide.pdf](https://ctan.org/pkg/fntguide?lang=en)`).

Here are some examples of font series:

* **m**: medium weight and medium width.
* **b**: bold weight and medium width—it “should” be written **bm** but the **m** (for medium width) is dropped.
* **c**: medium weight, condensed width—it “should” be written **mc** but the **m** (for medium weight) is dropped.
* **sb**: semi-bold weight, medium width—it “should” be written **sbm** but the **m** (for medium width) is dropped.
* **bx**: combines the weight **b** (bold) and width **x** (expanded). It is used to select the bold-expanded font of the current font family (if such a font exists).
* **sbc**: combines the weight **sb** (semi-bold) and width **c** (condensed). It is used to select the semi-bold-condensed font of the current font family (if such a font exists).
* **Shape**: This parameter selects font forms (shapes) such as italic, slanted, small caps, and swash caps. LaTeX defines a set of standard shapes:

|                      |                                       |
| -------------------- | ------------------------------------- |
| **Shape identifier** | **Shape name**                        |
| n                    | Normal shape (upright)                |
| it                   | Italic shape                          |
| sl                   | Slanted (oblique) shape               |
| sw                   | Swash letter shape                    |
| ui                   | Upright italic shape (rare/curiosity) |
| sc                   | Small caps shape                      |
| scit                 | Italic small caps shape               |
| scsl                 | Slanted small caps shape              |

* **Size**: the size at which the font is being used. LaTeX has several predefined size commands such as `\tiny`, `\small`, `\normalsize`, `\large`, `\Large`, etc. You can also define a specific font size using `\fontsize{size}{baselineskip}` where `size` is the font size and `baselineskip` is the line spacing.

### (Optional reading) special series and shapes

This section can be skipped on the first reading. Overleaf has created a [project which demonstrates these special series and shapes](https://www.overleaf.com/1941895198cqjzyhzvxhwz#794ae2) (see section 6 of the typeset document).

#### Series identifiers: m? and ?m

Recalling that each series identifier is defined as a `⟨weight⟩⟨width⟩` pair, LaTeX provides two additional identifiers for use when selecting font weights and widths:

* `m?` means select medium weight, but leave the current width setting unchanged.
* `?m` means leave the current weight unchanged but select medium width.

#### “Virtual” shapes

LaTeX supports two so-called “virtual” shapes. The term “virtual” reflects they are only intended as parameters for the `\fontshape` command to apply—these shapes don’t exist as actual fonts.

| **Virtual shape identifier** | **Action**                               | **Command**     | **Declaration** | **Notes**                                                                                                                                                                                 |
| ---------------------------- | ---------------------------------------- | --------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `up`                         | Return to the upright shape.             | `\textup{...}`  | `\upshape`      | It changes the shape to upright but small caps shape is preserved. E.g., up changes the `scit` shape to `sc`. Oddity: If the current shape is `sc` then up changes to normal shape (`n`). |
| `ucl`                        | Return to upper/lower case letter shape. | `\textulc{...}` | `\uclshape`     | Changes the font shape to upper/lower case but does not make changes to italics, slanted or swash shapes.                                                                                 |

## In the next Step

Step 3 shows how to replace LaTeX’s default fonts with variable fonts.

[Introduction](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [Step 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [Step 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [Step 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [Step 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [Step 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [Step 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [Step 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [Step 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [Examples and projects](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)


---

# 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/in-depth-articles/38-step-2-an-introduction-to-latex-fonts.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.
