> 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/40-step-4-how-to-configure-an-italic-variable-font-using-fontspec.md).

# Step 4: How to configure an italic variable font using fontspec

[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’ll configure an italic variable font to fix one of the three “undefined shape” warnings.

## Summary of our project's “undefined shape” warnings

LaTeX currently warns that three font shapes are missing from our project:

![Image showing LaTeX missing font warnings.](/files/C43MvzANxkYUyjudm6AY)

These are summarized in the table below but remember that m is dropped from the series identifier *except* where *both* width and weight are m (medium). In this article we’ll show how to fix the second warning by adding a font with medium weight, medium width and in the italic shape.

| **Warning number** | **Warning description**                                                  | **Series identifier** | **Weight** | **Width** | **Shape** |
| ------------------ | ------------------------------------------------------------------------ | --------------------- | ---------- | --------- | --------- |
| 1                  | **b**old weight, **m**edium width font in the **n**ormal (upright) shape | b                     | b          | m         | n         |
| 2                  | **m**edium weight, **m**edium width font in the **it**alic shape         | m                     | m          | m         | it        |
| 3                  | **b**old weight, **m**edium width font in the **it**alic shape           | b                     | b          | m         | it        |

## Two font files for Noto Serif

The design of upright and italic font styles (typefaces) are often too different to allow for a smooth transition between them via a design axis in a variable font. Upright and italic shapes each need a dedicated font file to preserve the unique characteristics of their design. As a result, the Overleaf tutorial project contains the following files for Noto Serif:

* for the upright shape: `NotoSerif-VariableFont-wdth-wght.ttf`
* for the italic shape: `NotoSerif-Italic-VariableFont-wdth-wght.ttf`

## How to add the Noto Serif italic font

Our main document text font, Noto Serif, is configured using fontspec’s `\setmainfont` command:

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}
```

As a reminder, `\setmainfont` has the general form

```
\setmainfont{⟨font⟩}[⟨font features⟩]
```

We can use the optional `⟨font features⟩` to enable an italic shape for the main document font using fontspec’s `ItalicFont` key.

### Configuring an italic variable font

Use the following steps to activate (configure) the Noto Serif italic variable font.

1. Make sure to open the tutorial project configured in Step 3.
2. Replace this line

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}
```

with the following

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}
[
ItalicFont=NotoSerif-Italic-VariableFont-wdth-wght.ttf
]
```

6. Recompile and note the following points.

* There are two undefined shape warnings, one less than before:

![Image showing LaTeX missing font warnings.](/files/VKayLbDjnl8oUAgeIhP5)

These warnings are caused by the lack of bold fonts for normal (n) and italic (it) font shapes.

* The following warning no longer appears:

``Font shape `TU/NotoSerif-VariableFont-wdth-wght.ttf(0)/m/it' undefined``

* Italic text has reappeared in the typeset document because LaTeX now has access to a medium weight, medium width (series) italic (shape) font in the `NotoSerif-VariableFont-wdth-wght.ttf(0)` family.

## In the next Step

In Step 5 we learn about variable font weights, getting ready for Step 6 where we finish the initial configuration of our variable 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/40-step-4-how-to-configure-an-italic-variable-font-using-fontspec.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.
