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

# Krok 4: Jak nakonfigurovat kurzívní proměnné písmo pomocí fontspec

[Úvod](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [Krok 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [Krok 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [Krok 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [Krok 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [Krok 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [Krok 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [Krok 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [Krok 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [Příklady a projekty](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)

V tomto kroku nakonfigurujeme kurzivní variabilní písmo, abychom opravili jedno ze tří upozornění na „nedefinovaný tvar“.

## Shrnutí upozornění na „nedefinovaný tvar“ v našem projektu

LaTeX v současnosti upozorňuje, že v našem projektu chybí tři tvary písma:

![Obrázek zobrazující upozornění LaTeXu na chybějící písma.](/files/679b229a5dc8e25026de52b05813989eafbf2aaf)

Ta jsou shrnuta v tabulce níže, ale pamatujte, že m je z identifikátoru série vypuštěno *kromě* kde *oba* šířka a váha jsou m (střední). V tomto článku ukážeme, jak opravit druhé upozornění přidáním písma se střední váhou, střední šířkou a kurzivním tvarem.

| **Číslo upozornění** | **Popis upozornění**                                                         | **Identifikátor série** | **Váha** | **Šířka** | **Tvar** |
| -------------------- | ---------------------------------------------------------------------------- | ----------------------- | -------- | --------- | -------- |
| 1                    | **b**stará váha, **m**písmo se střední šířkou **n**normální (vzpřímený) tvar | b                       | b        | m         | n        |
| 2                    | **m**střední váha, **m**písmo se střední šířkou **kurzivní**tvar             | m                       | m        | m         | kurzivní |
| 3                    | **b**stará váha, **m**písmo se střední šířkou **kurzivní**tvar               | b                       | b        | m         | kurzivní |

## Dva soubory písma pro Noto Serif

Návrh vzpřímených a kurzivních stylů písma (typografií) se často natolik liší, že mezi nimi nelze pomocí osy návrhu ve variabilním písmu dosáhnout plynulého přechodu. Vzpřímený a kurzivní tvar potřebují každý vlastní soubor písma, aby se zachovaly jedinečné vlastnosti jejich návrhu. Výsledkem je, že cvičný projekt Overleaf obsahuje pro Noto Serif následující soubory:

* pro vzpřímený tvar: `NotoSerif-VariableFont-wdth-wght.ttf`
* pro kurzivní tvar: `NotoSerif-Italic-VariableFont-wdth-wght.ttf`

## Jak přidat kurzivní písmo Noto Serif

Naše hlavní textové písmo dokumentu, Noto Serif, je nakonfigurováno pomocí fontspec `\setmainfont` příkazu:

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

Pro připomenutí, `\setmainfont` má obecný tvar

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

Můžeme použít volitelný `⟨font features⟩` k povolení kurzivního tvaru pro hlavní písmo dokumentu pomocí klíče fontspec `ItalicFont` klíče.

### Nastavení kurzivního variabilního písma

K aktivaci (nastavení) kurzivního variabilního písma Noto Serif použijte následující kroky.

1. Ujistěte se, že máte otevřený tutoriálový projekt nakonfigurovaný v kroku 3.
2. Nahraďte tento řádek

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

následujícím

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

6. Znovu sestavte a všimněte si následujících bodů.

* Jsou zde dvě upozornění na nedefinovaný tvar, o jedno méně než předtím:

![Obrázek zobrazující upozornění LaTeXu na chybějící písma.](/files/2021f7213ac9f92b1ab42a57ff9985989fe43dcb)

Tato upozornění jsou způsobena absencí tučných písem pro tvary písma normální (n) a kurzivní (it).

* Následující upozornění se již nezobrazuje:

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

* Kurzivní text se v sazbě dokumentu znovu objevil, protože LaTeX nyní má přístup k písmu se střední váhou, střední šířkou (série) a kurzivním (tvarem) v `NotoSerif-VariableFont-wdth-wght.ttf(0)` rodině.

## V dalším kroku

V kroku 5 se dozvíme o vahách variabilních písem a připravíme se na krok 6, kde dokončíme počáteční konfiguraci našich variabilních písem.


---

# 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/cs/clanky-do-hloubky/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.
