> 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/29-how-to-use-opentype-variable-fonts-with-latex.md).

# How to use OpenType variable fonts with LaTeX

[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 tutorial series, you’ll learn how to install, configure, and use OpenType variable fonts in LaTeX, with a focus on LuaLaTeX and the [fontspec package](https://ctan.org/pkg/fontspec?lang=en). Through a guided [Overleaf project](https://www.overleaf.com/8438931911svtqtnmfvsrp#28008d), you’ll follow step-by-step instructions that cover both practical techniques and essential background knowledge, ensuring you can confidently work with variable fonts in your LaTeX documents. Along the way, you will develop a broader understanding of LaTeX fonts, including how to resolve “undefined font shape” warnings by configuring appropriate variable fonts.

Variable fonts offer unmatched flexibility in LaTeX document design, enhancing text presentation and readability by allowing you to customize font attributes like weight and width. They also help resolve typesetting issues, such as fitting more text into a given amount of space. Please note that this series focuses exclusively on text fonts, as variable fonts for typesetting mathematics are not yet available.

### Tutorial contents

* Introduction to variable fonts (this article)
* [Step 1: Setting up an Overleaf project to use variable fonts](/latex/in-depth-articles/37-step-1-setting-up-an-overleaf-project-to-use-variable-fonts.md)
* [Step 2: An introduction to LaTeX fonts](/latex/in-depth-articles/38-step-2-an-introduction-to-latex-fonts.md)
* [Step 3: Replacing LaTeX’s default fonts with variable fonts](/latex/in-depth-articles/39-step-3-replacing-latex-s-default-fonts-with-variable-fonts.md)
* [Step 4: How to configure an italic variable font using fontspec](/latex/in-depth-articles/40-step-4-how-to-configure-an-italic-variable-font-using-fontspec.md)
* [Step 5: LaTeX font weights and named instances of variable fonts](/latex/in-depth-articles/41-step-5-latex-font-weights-and-named-instances-of-variable-fonts.md)
* [Step 6: Using variable fonts to add bold fonts to an Overleaf project](/latex/in-depth-articles/42-step-6-using-variable-fonts-to-add-bold-fonts-to-an-overleaf-project.md)
* [Step 7: Using Noto Sans and Roboto Mono variable fonts with LaTeX](/latex/in-depth-articles/43-step-7-using-noto-sans-and-roboto-mono-variable-fonts-with-latex.md)
* [Step 8: How to create a simple LaTeX package to configure your variable fonts](/latex/in-depth-articles/44-step-8-how-to-create-a-simple-latex-package-to-configure-your-variable-fonts.md)
* [5 Overleaf projects showing how to use variable fonts with LaTeX](/latex/in-depth-articles/35-overleaf-projects-showing-how-to-use-variable-fonts-with-latex.md)

### Introduction to variable fonts

For typographers, designers, and font enthusiasts, September 14, 2016, is a date to remember. On that day, Microsoft, [Google](https://opensource.googleblog.com/2016/09/introducing-opentype-font-variations.html), [Adobe](https://blog.typekit.com/2016/09/14/variable-fonts-a-new-kind-of-font-for-flexible-design/), and Apple [publicly announced](https://youtu.be/6kizDePhcFU?feature=shared\&t=250) a new font format called [OpenType Font Variations](https://medium.com/variable-fonts/https-medium-com-tiro-introducing-opentype-variable-fonts-12ba6cd2369), more commonly known as *OpenType variable fonts* or just *variable fonts*.

Traditionally, each font style, such as regular, bold, semi-bold, extra bold, condensed, bold-condensed, etc., needed a separate font file, but that is no longer necessary. OpenType variable fonts is an impressive technology that allows a single font file to produce multiple font styles by adjusting the value of built-in parameters known as *design axes*. This is demonstrated in the following video using Google’s [Noto Serif variable font](https://fonts.google.com/noto/specimen/Noto+Serif/tester).

{% embed url="<https://videos.ctfassets.net/nrgyaltdicpt/3OhDBHA95DciCRVRgrF4wp/18f8c3f6d15109bf307c48bde9d7c879/VariableFonts.mp4>" %}

Google’s Noto Serif has two design axes, width and weight, but other fonts may have one axis or several axes—for example, a variable font called [Recursive](https://fonts.google.com/specimen/Recursive/tester) has five axes and [some have even more](https://www.axis-praxis.org/specimens/decovar). A font’s developer decides the number of axes and their design effects.

### Some notes on design axes

This is what you need to know about design axes to use variable fonts with LaTeX (specifically fontspec and LuaLaTeX).

* Each design axis is identified by a short four-character “tag” and a longer, more descriptive, name.
* The OpenType variable font specification provides for [five registered (“standard”) axes](https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags):

|      |              |
| ---- | ------------ |
| Tag  | Name         |
| ital | Italic       |
| opsz | Optical size |
| slnt | Slant        |
| wdth | Width        |
| wght | Weight       |

* Starting with [version 2.9a](https://github.com/latex3/fontspec/releases/tag/v2.9a), the [fontspec package](https://ctan.org/pkg/fontspec?lang=en) can set the value of a standard axis using its name, such as `Weight=400`.
* Font creators are free to create and name additional design axes. fontspec provides features to set the value of any design axis using its four-character tag.
* Design axis values range from a minimum to a maximum using a step size determined by the font’s creator. To use a variable font with LaTeX (LuaLaTeX), you’ll need to know its axes and their minimum, maximum, and increment (step-size) values.
* Currently, variable fonts can only be used for your document’s text—there are no variable math fonts.
* Google maintains a [list of design axes](https://fonts.google.com/variablefonts#axis-definitions) currently used by fonts they provide, including the four-letter design tag, full name, and a definition of what the axis does.

### Variable fonts require LuaLaTeX and the fontspec package

As of August 2024, only the LuaLaTeX [compiler](/latex/knowledge-base/026-changing-compiler.md) supports OpenType variable fonts—pdfLaTeX and XeLaTeX do not.

Using OpenType fonts with LuaLaTeX requires the fontspec package, which provides user-level commands to access a lower-level and more technical font-loading system called [luaotfload](https://ctan.org/pkg/luaotfload?lang=en). Although it is quite possible to directly use luaotfload’s features, most people prefer the ease and convenience of fontspec.

[TeX Live 2024](https://www.overleaf.com/blog/tex-live-2024-is-now-available) includes fontspec version 2.9a, released on February 13, 2024, which adds extra features that make using variable fonts even easier.

### Where can I find and explore some variable fonts?

Visiting Google Fonts is an excellent place to start—especially the [page listing font families and their design axes](https://fonts.google.com/variablefonts). Once you identify a font of interest, navigate to its *Type tester* page and adjust its design axes using the controls provided.

The [Axis-Praxis website](https://www.axis-praxis.org) lets you experiment with numerous variable fonts, some demonstrating intriguing design possibilities—including [Decovar](https://www.axis-praxis.org/specimens/decovar), an experimental font with 12 design axes. You can also upload variable fonts to Axis-Praxis and test them using the platform’s automatically generated controls to vary the design axis values.

Another helpful site is <https://v-fonts.com/>, which describes its purpose as “A simple resource for finding and trying 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/29-how-to-use-opentype-variable-fonts-with-latex.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.
