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

# キリル文字（例: ロシア語）をどう組版すればよいですか？

## はじめに

Overleaf でキリル文字のテキストを組版するには、いくつかの追加パッケージを読み込む必要があります。必要なパッケージは、使用しているコンパイラ、つまり pdfLaTeX、XeLaTeX、LuaLaTeX、または LaTeX（つまり DVI から PDF）によって異なります。

## pdfLaTeX または LaTeX でキリル文字を組版する

コンパイラとして pdfLaTeX または LaTeX を使用している場合、次の方法で動作します。

```latex
\documentclass{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[main=english,russian]{babel}
\begin{document}
これは英語で、これはロシア語です: \textcyrillic{Здравствуй, мир!}
\end{document}
```

[これを開く `pdfLaTeX` 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)

この例では、次の出力が生成されます:

![LaTeX で組版されたロシア語キリル文字](/files/dae02ff4c4897f4607018ff3e89a835f82a7d536)

## XeLaTeX または LuaLaTeX でキリル文字を組版する

XeLaTeX と LuaLaTeX のコンパイラには UTF-8 エンコードされたテキストの組み込みサポートがあるため、 `\inputenc` パッケージ（`\usepackage[utf8]{inputenc}`）を使う必要はありません。2018年以降は `\usepackage[utf8]{inputenc}` pdfLaTeX でも使う必要はなくなっています— [LaTeX News の2018年4月号](https://www.latex-project.org/news/2018/04/10/issue28-of-latex2e-news-released/) および Overleaf のブログ記事 [*TeX Live のアップグレード—2019年9月*](https://www.overleaf.com/blog/tex-live-upgrade-september-2019).

XeLaTeX または LuaLaTeX では [`polyglossia` パッケージ](https://ctan.org/pkg/polyglossia?lang=en) が役立つかもしれません。特に、独自のフォントを選びたい場合に有用です。

```latex
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{russian}
\newfontfamily{\russianfont}[Script=Cyrillic]{CMU Serif}
\begin{document}
これは英語で、これはロシア語です: \textrussian{Здравствуй, мир!}
\end{document}
```

[この LuaLaTeX の例を 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)

この LuaLaTeX の例では、次の出力が生成されます。

![aly=LuaLaTeX で組版されたキリル文字テキスト](/files/b42487ecbf85f7a13c93e84261bfefa2523c3ea0)

## ヒント: LaTeX コンパイラを切り替える方法

左上の **メニュー** ボタンをクリックし、 **コンパイラ** 設定を変更することで、コンパイラを XeLaTeX または LuaLaTeX に切り替えられることに注意してください。以下の短い動画でその方法を示しています。

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

## 関連する Overleaf 記事

* [ロシア語](/latex/ja/yan-yu/14-russian.md)
* [国際言語サポート](/latex/ja/yan-yu/03-international-language-support.md)
* [polyglossia と fontspec を使った Overleaf での多言語組版](/latex/ja/yan-yu/01-multilingual-typesetting-on-overleaf-using-polyglossia-and-fontspec.md)
* [XeLaTeX でフォントを使う](/latex/ja/fonto/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/ja/latexnisuru/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.
