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

# Paso 4: Cómo configurar una fuente variable en cursiva usando fontspec

[Introducción](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [Paso 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [Paso 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [Paso 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [Paso 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [Paso 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [Paso 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [Paso 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [Paso 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [Ejemplos y proyectos](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)

En este paso, configuraremos una fuente variable en cursiva para corregir una de las tres advertencias de «forma indefinida».

## Resumen de las advertencias de «forma indefinida» de nuestro proyecto

Actualmente, LaTeX advierte que faltan tres formas de fuente en nuestro proyecto:

![Imagen que muestra las advertencias de LaTeX sobre fuentes faltantes.](/files/7d9f7389f430e8e32aeb9d53399a43c6815fad5f)

Estas se resumen en la tabla siguiente, pero recuerda que m se omite del identificador de serie *excepto* donde *ambos* width y weight son m (medium). En este artículo mostraremos cómo corregir la segunda advertencia añadiendo una fuente con peso medio, anchura media y en la forma cursiva.

| **Número de advertencia** | **Descripción de la advertencia**                                                  | **Identificador de serie** | **Peso** | **Anchura** | **Forma** |
| ------------------------- | ---------------------------------------------------------------------------------- | -------------------------- | -------- | ----------- | --------- |
| 1                         | **b**peso antiguo, **m**fuente de anchura media en la **n**forma normal (vertical) | b                          | b        | m           | n         |
| 2                         | **m**peso medio, **m**fuente de anchura media en la **cur**siva                    | m                          | m        | m           | cur       |
| 3                         | **b**peso antiguo, **m**fuente de anchura media en la **cur**siva                  | b                          | b        | m           | cur       |

## Dos archivos de fuente para Noto Serif

El diseño de los estilos tipográficos de fuente recta e itálica suelen ser demasiado diferentes como para permitir una transición fluida entre ellos mediante un eje de diseño en una fuente variable. Las formas recta e itálica necesitan cada una un archivo de fuente dedicado para preservar las características únicas de su diseño. Como resultado, el proyecto de tutorial de Overleaf contiene los siguientes archivos para Noto Serif:

* para la forma recta: `NotoSerif-VariableFont-wdth-wght.ttf`
* para la forma cursiva: `NotoSerif-Italic-VariableFont-wdth-wght.ttf`

## Cómo añadir la fuente cursiva Noto Serif

Nuestra fuente principal del texto del documento, Noto Serif, se configura usando la `\setmainfont` comando:

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

Como recordatorio, `\setmainfont` tiene la forma general

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

Podemos usar la `⟨font features⟩` para habilitar una forma cursiva para la fuente principal del documento usando la `ItalicFont` opción.

### Configuración de una fuente variable en cursiva

Sigue los siguientes pasos para activar (configurar) la fuente variable en cursiva Noto Serif.

1. Asegúrate de abrir el proyecto del tutorial configurado en el Paso 3.
2. Reemplaza esta línea

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

por la siguiente

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

6. Vuelve a compilar y observa los siguientes puntos.

* Hay dos advertencias de forma indefinida, una menos que antes:

![Imagen que muestra las advertencias de LaTeX sobre fuentes faltantes.](/files/4ac908826ea1aeb00444914abb3d8306715532c7)

Estas advertencias se deben a la falta de fuentes en negrita para las formas de fuente normal (n) y cursiva (it).

* La siguiente advertencia ya no aparece:

``Forma de fuente `TU/NotoSerif-VariableFont-wdth-wght.ttf(0)/m/it' indefinida``

* El texto en cursiva ha reaparecido en el documento compuesto porque ahora LaTeX tiene acceso a una fuente de peso medio, anchura media (serie) y cursiva (forma) en la `NotoSerif-VariableFont-wdth-wght.ttf(0)` familia.

## En el siguiente paso

En el Paso 5 aprenderemos sobre los pesos de las fuentes variables, preparándonos para el Paso 6, donde terminaremos la configuración inicial de nuestras fuentes variables.


---

# 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/es/articulos-en-profundidad/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.
