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

# Крок 4: Як налаштувати курсивний змінний шрифт за допомогою fontspec

[Вступ](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [Крок 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [Крок 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [Крок 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [Крок 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [Крок 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [Крок 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [Крок 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [Крок 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [Приклади та проєкти](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)

У цьому кроці ми налаштуємо курсивний змінний шрифт, щоб виправити одне з трьох попереджень про «невизначену форму».

## Підсумок попереджень про «невизначену форму» в нашому проєкті

Наразі LaTeX попереджає, що в нашому проєкті бракує трьох форм шрифтів:

![Зображення, що показує попередження LaTeX про відсутні шрифти.](/files/9db782fd2325c1914ac8dbede2fa9147f28647e3)

Вони підсумовані в таблиці нижче, але пам’ятайте, що m вилучається з ідентифікатора серії *окрім* де *обидві* ширина та насиченість — m (medium). У цій статті ми покажемо, як виправити друге попередження, додавши шрифт із середньою насиченістю, середньою шириною та курсивною формою.

| **Номер попередження** | **Опис попередження**                                                                | **Ідентифікатор серії** | **Насиченість** | **Ширина** | **Форма** |
| ---------------------- | ------------------------------------------------------------------------------------ | ----------------------- | --------------- | ---------- | --------- |
| 1                      | **b**стара насиченість, **m**шрифт середньої ширини в **n**нормальній (прямій) формі | b                       | b               | m          | n         |
| 2                      | **m**середня насиченість, **m**шрифт середньої ширини в **кур**сивна форма           | m                       | m               | m          | кур       |
| 3                      | **b**стара насиченість, **m**шрифт середньої ширини в **кур**сивна форма             | b                       | b               | m          | кур       |

## Два файли шрифтів для Noto Serif

Дизайн прямих і курсивних стилів шрифту (гарнітур) часто надто різниться, щоб забезпечити плавний перехід між ними через вісь дизайну у змінному шрифті. Прямі та курсивні форми потребують окремого файлу шрифту, щоб зберегти унікальні характеристики їхнього дизайну. У результаті навчальний проєкт Overleaf містить такі файли для Noto Serif:

* для прямої форми: `NotoSerif-VariableFont-wdth-wght.ttf`
* для курсивної форми: `NotoSerif-Italic-VariableFont-wdth-wght.ttf`

## Як додати курсивний шрифт Noto Serif

Наш основний текстовий шрифт документа, Noto Serif, налаштовано за допомогою fontspec `\setmainfont` команди:

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

Нагадуємо, `\setmainfont` має загальну форму

```
\setmainfont{⟨шрифт⟩}[⟨атрибути шрифту⟩]
```

Ми можемо використати необов’язковий `⟨атрибути шрифту⟩` щоб увімкнути курсивну форму для основного шрифту документа за допомогою fontspec `ItalicFont` ключа.

### Налаштування змінного курсивного шрифту

Виконайте такі кроки, щоб активувати (налаштувати) курсивний змінний шрифт Noto Serif.

1. Переконайтеся, що відкрили навчальний проєкт, налаштований на Кроці 3.
2. Замініть цей рядок

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

наступним

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

6. Перекомпілюйте й зверніть увагу на такі моменти.

* Тепер є два попередження про невизначену форму, на одне менше, ніж раніше:

![Зображення, що показує попередження LaTeX про відсутні шрифти.](/files/2581bea3d67979e7134d38cf5827d0d63faa636e)

Ці попередження спричинені відсутністю жирних шрифтів для нормальної (n) та курсивної (it) форм шрифту.

* Наступне попередження більше не з’являється:

``Форма шрифту `TU/NotoSerif-VariableFont-wdth-wght.ttf(0)/m/it' не визначена``

* Курсивний текст знову з’явився у набраному документі, оскільки тепер LaTeX має доступ до курсивного шрифту сімейства `NotoSerif-VariableFont-wdth-wght.ttf(0)` .

## У наступному кроці

На Кроці 5 ми дізнаємося про змінні насиченості шрифтів, готуючись до Кроку 6, де ми завершуємо початкове налаштування наших змінних шрифтів.


---

# 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/uk/dokladni-statti/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.
