> 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/da/latex-sporgsmal/01-how-can-i-typeset-text-in-cyrillic-e.g.-in-russian.md).

# Hvordan kan jeg sætte tekst på kyrillisk (f.eks. på russisk)?

## Introduktion

For at sætte kyrillisk tekst op i Overleaf skal du indlæse nogle ekstra pakker—de nøjagtige pakker afhænger af den kompilator, du bruger: pdfLaTeX, XeLaTeX, LuaLaTeX eller LaTeX (dvs. DVI til PDF).

## Sætning af kyrillisk med pdfLaTeX eller LaTeX

Hvis du bruger pdfLaTeX eller LaTeX som din kompilator, så vil følgende virke:

```latex
\documentclass{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[main=english,russian]{babel}
\begin{document}
Dette er engelsk, og dette er russisk: \textcyrillic{Здравствуй, мир!}
\end{document}
```

[Åbn dette `pdfLaTeX` eksempel i 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)

Dette eksempel giver følgende output:

![Russiske kyrilliske tegn sat op i LaTeX](/files/c9105f2d5fba1592484771074f142968e380151f)

## Sætning af kyrillisk med XeLaTeX eller LuaLaTeX

XeLaTeX- og LuaLaTeX-kompilatorerne har indbygget understøttelse af UTF-8-kodet tekst, så der er ingen grund til at bruge `\inputenc` -pakken (`\usepackage[utf8]{inputenc}`). Siden 2018 har der heller ikke været behov for at bruge `\usepackage[utf8]{inputenc}` med pdfLaTeX heller—se [udgaven fra april 2018 af LaTeX News](https://www.latex-project.org/news/2018/04/10/issue28-of-latex2e-news-released/) og Overleaf-blogindlægget [*TeX Live-opgradering—september 2019*](https://www.overleaf.com/blog/tex-live-upgrade-september-2019).

For XeLaTeX eller LuaLaTeX kan [`polyglossia` pakken](https://ctan.org/pkg/polyglossia?lang=en) være nyttigt, især hvis du vil vælge en brugerdefineret skrifttype.

```latex
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{russian}
\newfontfamily{\russianfont}[Script=Cyrillic]{CMU Serif}
\begin{document}
Dette er engelsk, og dette er russisk: \textrussian{Здравствуй, мир!}
\end{document}
```

[Åbn dette LuaLaTeX-eksempel i 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)

Dette LuaLaTeX-eksempel giver følgende output:

![aly=Kyrillisk tekst sat med LuaLaTeX](/files/55a317ff03e6c1ea3d5a576abc0d552e10229e6a)

## TIP: Sådan skifter du LaTeX-kompilatorer

Bemærk, at du kan skifte kompilatoren til XeLaTeX eller LuaLaTeX ved at klikke på **Menu** knappen øverst til venstre og ændre **Kompilator** indstillingen—den følgende korte video viser dig, hvordan du gør det.

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

## Nogle relaterede Overleaf-artikler

* [Russisk](/latex/da/sprog/14-russian.md)
* [Understøttelse af internationale sprog](/latex/da/sprog/03-international-language-support.md)
* [Fler-sproget satsning på Overleaf med polyglossia og fontspec](/latex/da/sprog/01-multilingual-typesetting-on-overleaf-using-polyglossia-and-fontspec.md)
* [Brug af skrifttyper med XeLaTeX](/latex/da/skrifttyper/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/da/latex-sporgsmal/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.
