> 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/42-step-6-using-variable-fonts-to-add-bold-fonts-to-an-overleaf-project.md).

# Step 6: Using variable fonts to add bold fonts to an Overleaf project

[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 Step 5, we set the medium weight of our document’s main text font, Noto Serif, using a weight-axis value of 400 for both upright and italic styles. In this step, we will show how to configure Noto Serif to provide bold fonts for both the normal (upright) and italic styles.

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

## Warnings about undefined bold fonts

After recompiling the current project, LaTeX issues these warnings:

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

These warnings are summarized in the table below. Remember that m is dropped from the series identifier *except* where *both* width and weight are m (medium).

| **Warning number** | **Warning description**                                      | **Series identifier** | **Weight** | **Width** | **Shape** |
| ------------------ | ------------------------------------------------------------ | --------------------- | ---------- | --------- | --------- |
| 1                  | bold weight, medium width font in the normal (upright) shape | b                     | b          | m         | n         |
| 2                  | bold weight, medium width font in the italic shape           | b                     | b          | m         | it        |

We’ll show how to fix these by configuring bold fonts for the upright (normal) and italic font shapes.

## Adding bold fonts using a variable font’s weight axis

Fonts for bold-upright and bold-italic text can be configured using fontspec’s `FontFace` key, which takes the form

```
FontFace = {⟨series⟩}{⟨shape⟩}{Font = ⟨font name⟩, ⟨features⟩}
```

where

* `⟨series⟩` is the LaTeX series identifier (link to section)
* `⟨shape⟩` is the LaTeX shape identifier (link to section)
* `⟨font name⟩` is the name of a font file or the name of a font
* `⟨features⟩` contains settings we'll use to configure our variable fonts, such as setting an appropriate value of the weight axis for the upright and italic variable fonts

Using a value suggested by Noto Serif’s named instances (LINK), we’ll use a weight-axis value of 600 to configure a bold font for normal (upright) and italic shapes.

### How to configure a bold, medium width, upright font

We'll use the `FontFace` key with the following settings

* `⟨series⟩` = b
* `⟨shape⟩` = n
* `⟨font name⟩` = NotoSerif-VariableFont-wdth-wght.ttf
* `⟨features⟩` = Weight=600

resulting in

```
FontFace = {b}{n}{Font=NotoSerif-VariableFont-wdth-wght.ttf,Weight=600}
```

### How to configure a bold, medium width, italic font

We'll use the `FontFace` key with the following settings

* `⟨series⟩` = b
* `⟨shape⟩` = it
* `⟨font name⟩` = NotoSerif-Italic-VariableFont-wdth-wght.ttf
* `⟨features⟩` = Weight=600

resulting in

```
FontFace = {b}{it}{Font=NotoSerif-Italic-VariableFont-wdth-wght.ttf,Weight=600}
```

## Putting it all together

Update the current project’s `\setmainfont` command to use the following configuration:

```latex
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}[
Weight=400,
ItalicFont = NotoSerif-Italic-VariableFont-wdth-wght.ttf,
FontFace = {b}{n}{Font = NotoSerif-VariableFont-wdth-wght.ttf,Weight=600},
FontFace = {b}{it}{Font = NotoSerif-Italic-VariableFont-wdth-wght.ttf,Weight=600}
]
```

Recompile the current project to see there are no more undefined-shape warnings.

## Bonus feature: small caps for free!

In this section we note a surprise bonus: fontspec automatically enables small caps for fonts which support them.

### What are small caps?

Small caps is a style of text using uppercase letters that are the same height as lowercase letters. They are used for stylistic purposes within text containing a lot of uppercase words, such as acronyms or keywords in technical text.

Paste the following LaTeX text into the current Overleaf project to typeset an example comparing text with and without small caps—make sure you paste it *after* `\begin{document}`. LaTeX’s `\textsc` command is used to typeset text in small caps.

```latex
Numerous sequences of UPPERCASE letters may make your TYPESET text
appear ``typographically UNSIGHTLY''. Its APPEARANCE can be improved by
using small caps, creating a refined, more ELEGANT look to the text.

\vskip10pt
Numerous sequences of \textsc{uppercase} letters may make your
\textsc{typeset} text appear ``typographically \textsc{unsightly}''.
Its \textsc{appearance} can be improved by using small caps,
creating a refined, more \textsc{elegant} look to the text.
```

This example produces the following output:

![Image comparing text typeset with and without small caps](/files/v85gEkK4GPGemZMAVuHq)

### Which variable fonts have enabled small caps?

fontspec automatically enables small caps for fonts that support them—all three of our variable fonts provide small caps. Paste the following LaTeX text into your document to typeset small caps using all three font families:

```latex
\begin{itemize}
\item main text family (Noto Serif): \textsc{small caps}
\item sans serif family (Noto Sans): {\sffamily \textsc{small caps}}
\item monospaced family (Roboto Mono): {\ttfamily \textsc{small caps}}
\end{itemize}
```

This example produces the following output:

![Image showing small caps typeset using 3 different variable fonts in LaTeX](/files/Za04kvwdDu3bkJBu73G3)

### What about bold and italic small caps?

Because we've configured bold and italic fonts for Noto Serif, we can typeset small caps in those styles. To typeset a range of small caps using Noto Serif, paste the following code into the latest Overleaf project:

```latex
\begin{itemize}
\item main text family (Noto Serif):
\begin{itemize}
    \item \textsc{regular small caps}
    \item \textit{\scshape italic small caps}
    \item \textbf{\scshape bold small caps}
    \item \textbf{\itshape\scshape bold italic small caps}
\end{itemize}
\end{itemize}
```

This produces the following output:

![Image showing bold and italic small caps typeset in LaTeX using variable fonts](/files/IhpYPPtuS4FcGWjELfH5)

## In the next Step

In the next Step we'll configure bold and italic fonts styles for the sans serif font family (Noto Sans) and the monospaced font family (Roboto Mono).


---

# 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/42-step-6-using-variable-fonts-to-add-bold-fonts-to-an-overleaf-project.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.
