> 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/otazky-k-latexu/01-how-can-i-typeset-text-in-cyrillic-e.g.-in-russian.md).

# Jak mohu sázet text v cyrilici (např. v ruštině)?

## Úvod

Pro sazbu cyrilického textu na Overleafu budete muset načíst několik dalších balíčků — konkrétní balíčky budou záviset na kompilátoru, který používáte: pdfLaTeX, XeLaTeX, LuaLaTeX nebo LaTeX (tj. DVI do PDF).

## Sazba cyrilice v pdfLaTeXu nebo LaTeXu

Pokud jako kompilátor používáte pdfLaTeX nebo LaTeX, bude fungovat následující:

```latex
\documentclass{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[main=english,russian]{babel}
\begin{document}
Toto je angličtina a toto je ruština: \textcyrillic{Здравствуй, мир!}
\end{document}
```

[Otevřete tento `pdfLaTeX` příklad v Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Typesetting+Cyrillic+text\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5BT2A%2CT1%5D%7Bfontenc%7D%0A%5Cusepackage%5Bmain%3Denglish%2Crussian%5D%7Bbabel%7D%0A%5Cbegin%7Bdocument%7D%0AThis+is+English+and+this+is+Russian%3A+%5Ctextcyrillic%7B%D0%97%D0%B4%D1%80%D0%B0%D0%B2%D1%81%D1%82%D0%B2%D1%83%D0%B9%2C+%D0%BC%D0%B8%D1%80%21%7D%0A%5Cend%7Bdocument%7D)

Tento příklad vytvoří následující výstup:

![Ruská cyrilice vysázená v LaTeXu](/files/50cd738dc322fc31173213d3f25db670660816a0)

## Sazba cyrilice v XeLaTeXu nebo LuaLaTeXu

Kompilátory XeLaTeX a LuaLaTeX mají vestavěnou podporu pro text kódovaný v UTF-8, takže není třeba používat `\inputenc` balíček (`\usepackage[utf8]{inputenc}`). Od roku 2018 už není třeba používat `\usepackage[utf8]{inputenc}` s pdfLaTeXem také — viz [dubnové číslo LaTeX News](https://www.latex-project.org/news/2018/04/10/issue28-of-latex2e-news-released/) a příspěvek na blogu Overleafu [*Aktualizace TeX Live — září 2019*](https://www.overleaf.com/blog/tex-live-upgrade-september-2019).

Pro XeLaTeX nebo LuaLaTeX může být [`polyglossia` accents](https://ctan.org/pkg/polyglossia?lang=en) užitečný, zejména pokud chcete zvolit vlastní písmo.

```latex
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{russian}
\newfontfamily{\russianfont}[Script=Cyrillic]{CMU Serif}
\begin{document}
Toto je angličtina a toto je ruština: \textrussian{Здравствуй, мир!}
\end{document}
```

[Otevřete tento příklad v LuaLaTeXu v Overleaf.](https://www.overleaf.com/docs?engine=lualatex\&snip_name=Cyrillc+text+typeset+with+LuaTeX\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bpolyglossia%7D%0A%5Csetmainlanguage%7Benglish%7D%0A%5Csetotherlanguage%7Brussian%7D%0A%5Cnewfontfamily%7B%5Crussianfont%7D%5BScript%3DCyrillic%5D%7BCMU+Serif%7D%0A%5Cbegin%7Bdocument%7D%0AThis+is+English+and+this+is+Russian%3A+%5Ctextrussian%7B%D0%97%D0%B4%D1%80%D0%B0%D0%B2%D1%81%D1%82%D0%B2%D1%83%D0%B9%2C+%D0%BC%D0%B8%D1%80%21%7D%0A%5Cend%7Bdocument%7D)

Tento příklad v LuaLaTeXu vytvoří následující výstup:

![aly=Text v cyrilici vysázený pomocí LuaLaTeXu](/files/2586c29f9937fca06bce54abdd28b02dc997769d)

## TIP: Jak přepínat kompilátory LaTeXu

Všimněte si, že kompilátor můžete přepnout na XeLaTeX nebo LuaLaTeX kliknutím na **Menu** tlačítko v levém horním rohu a změnou **Kompilátor** nastavení — následující krátké video vám ukáže, jak na to.

{% embed url="<https://www.filepicker.io/api/file/ikMVZIu9S6SurOfUPO34>" %}

## Některé související články na Overleafu

* [Ruština](/latex/cs/jazyky/14-russian.md)
* [Podpora mezinárodních jazyků](/latex/cs/jazyky/03-international-language-support.md)
* [Vícejazyčná sazba v Overleaf pomocí polyglossia a fontspec](/latex/cs/jazyky/01-multilingual-typesetting-on-overleaf-using-polyglossia-and-fontspec.md)
* [Používání písem s XeLaTeXem](/latex/cs/pisma/03-xelatex.md)


---

# 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/otazky-k-latexu/01-how-can-i-typeset-text-in-cyrillic-e.g.-in-russian.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.
