> 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/41-step-5-latex-font-weights-and-named-instances-of-variable-fonts.md).

# Step 5: LaTeX font weights and named instances of 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)

In this step, we demonstrate two ways to set a value for the weight of a variable font, using the medium-weight as a starting point. We introduce named instances of variable fonts and explore how they can relate to LaTeX’s standard font weights.

Make sure you open the tutorial project configured in Step 4.

## Two ways to set the value of a design axis

Google’s type tester pages provide two methods for setting the value of a variable font’s design axis: using a slider or a drop-down list of names and values. The [tester page for Noto Serif](https://fonts.google.com/noto/specimen/Noto+Serif/tester) provides a weight-axis slider ranging from 100 to 900, together with a list of named instances representing different font weights.

![Image showing two ways to set a design axis vales: using a slider or named instances](/files/XXcHuJboN09u57ZVlWhE)

### What is an “instance” of a variable font?

An *instance* of a variable font is a particular set of axis values used to create one of the many possible style variations. Giving a name to a set of axis values defines a named instance. Data for named instances is stored within variable font files.

## LaTeX’s names for font weights

As noted in Step 2, LaTeX defines nine standard font weights, each has a short identifier and a longer descriptive name:

|                             |                       |
| --------------------------- | --------------------- |
| **LaTeX weight identifier** | **LaTeX weight name** |
| ul                          | Ultra-light           |
| el                          | Extra-light           |
| l                           | Light                 |
| sl                          | Semi-light            |
| m                           | Medium (normal)       |
| sb                          | Semi-bold             |
| b                           | Bold                  |
| eb                          | Extra-bold            |
| ub                          | Ultra-bold            |

Noto Serif’s weight axis values range from 100 to 900, conveniently providing nine named-instance values in increments of 100. Each named instance can be matched to one of LaTeX’s nine standard weights, as summarized in the following table.

|                    |                                   |                |                 |
| ------------------ | --------------------------------- | -------------- | --------------- |
| **LaTeX weights**  | **Variable font named instances** |                |                 |
| *LaTeX identifier* | *Name*                            | *Weight value* | *Instance name* |
| ul                 | Ultra-light                       | 100            | Thin            |
| el                 | Extra-light                       | 200            | ExtraLight      |
| l                  | Light                             | 300            | Light           |
| sl                 | Semi-light                        | 400            | Regular         |
| m                  | Medium (regular)                  | 500            | Medium          |
| sb                 | Semi-bold                         | 600            | SemiBold        |
| b                  | Bold                              | 700            | Bold            |
| eb                 | Extra-bold                        | 800            | ExtraBold       |
| ub                 | Ultra-bold                        | 900            | Black           |

## Selecting a value for LaTeX’s “medium” (regular) weight

In LaTeX, “medium” and “regular” weight mean the same thing: the font weight used for the bulk of your document’s text. This contrasts with Noto Serif’s named instances where Regular weight is 400 and Medium weight is 500. It’s up to us which value is selected for LaTeX’s medium weight. We’ll try 400, but if it doesn’t work (look nice), then we can easily switch to a different value—typographic control, that’s the advantage of variable fonts.

### Setting a value for the medium-weight variable font

Before adding bold fonts, we should set a value for the LaTeX medium (regular) weight of the Noto Serif font used in our project.

fontspec provides two features to set a value for the weight axis:

* Weight = ⟨value⟩ sets the weight axis to any supported ⟨value⟩
* Instance = ⟨named instance⟩ sets the weight as defined by the ⟨named instance⟩ setting

### Setting the medium weight to 400

To set the medium weight to 400, edit the current project’s \setmainfont command to be the following

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}[
Weight=400,
% Or we can replace Weight=400 with
% Instance=Regular,
ItalicFont=NotoSerif-Italic-VariableFont-wdth-wght.ttf
]
```

The italic font will also have a weight axis value of 400.

If, after recompiling the document, you don’t like the typeset result, you can try the following:

* use a different value for the Weight axis
* experiment with font size and line spacing using the `\fontsize` command; for example, try writing

```
\fontsize{9}{11}\selectfont
```

immediately after `\begin{document}`

## In the next Step

In the next step we configure the variable fonts to provide bold and bold-italic fonts.


---

# 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/41-step-5-latex-font-weights-and-named-instances-of-variable-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.
