> 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/languages/03-international-language-support.md).

# International language support

## Introduction

If you are a non-English speaker, you can load the [`babel` package](https://ctan.org/pkg/babel?lang=en) which enables LaTeX to typeset in many different languages. Another option for multilingual typesetting is the [`polyglossia` package](https://ctan.org/pkg/polyglossia?lang=en) which uses LuaLaTeX and XeLaTeX—readers interested to know more can read the Overleaf article [Multilingual typesetting on Overleaf using polyglossia and fontspec](/latex/languages/01-multilingual-typesetting-on-overleaf-using-polyglossia-and-fontspec.md).

We will start with a simple `babel` package example that typesets a document in Spanish:

```latex
\documentclass{article}
\usepackage[spanish]{babel}
\begin{document}

\tableofcontents

\vspace{2cm} %Add a 2cm space

\begin{abstract}
Este es un breve resumen del contenido del
documento escrito en español.
\end{abstract}

\section{Sección Introductoria}
Esta es la primera sección, podemos agregar
algunos elementos adicionales y todo será
escrito correctamente. Más aún, si una palabra
es demaciado larga y tiene que ser truncada,
babel tratará de truncarla correctamente
dependiendo del idioma.

\section{Sección con teoremas}
Esta sección es para ver que pasa con los comandos
que definen texto
\end{document}
```

[Open this example in Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Spanish+language+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bspanish%5D%7Bbabel%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Ctableofcontents%0A%0A%5Cvspace%7B2cm%7D+%25Add+a+2cm+space%0A%0A%5Cbegin%7Babstract%7D%0AEste+es+un+breve+resumen+del+contenido+del+%0Adocumento+escrito+en+espa%C3%B1ol.%0A%5Cend%7Babstract%7D%0A%0A%5Csection%7BSecci%C3%B3n+Introductoria%7D%0AEsta+es+la+primera+secci%C3%B3n%2C+podemos+agregar+%0Aalgunos+elementos+adicionales+y+todo+ser%C3%A1+%0Aescrito+correctamente.+M%C3%A1s+a%C3%BAn%2C+si+una+palabra+%0Aes+demaciado+larga+y+tiene+que+ser+truncada%2C+%0Ababel+tratar%C3%A1+de+truncarla+correctamente+%0Adependiendo+del+idioma.%0A%0A%5Csection%7BSecci%C3%B3n+con+teoremas%7D%0AEsta+secci%C3%B3n+es+para+ver+que+pasa+con+los+comandos+%0Aque+definen+texto%0A%5Cend%7Bdocument%7D)

This example produces the following output:

![Example typesetting in Spanish](/files/037X9efbJh04Kn4GhWwV)

The `babel` package not only makes it possible to typeset Spanish language text but also changes the language used to typeset elements; for example, instead of "abstract" and "Contents" the Spanish words "resumen" and "Índice" are used.

## Input encoding

Prior to 2018, LaTeX’s handling of input files [encoded in UTF-8](/latex/in-depth-articles/51-unicode-utf-8-and-multilingual-text-an-introduction.md#so2c-what-is-utf-83f) required users to add the line

```latex
\usepackage[utf8]{inputenc}
```

to their document preamble. With the [release of TeX Live 2018](https://www.overleaf.com/blog/tex-live-upgrade-september-2019), LaTeX was enhanced to adopt UTF-8 as its default text encoding, removing the need to add `\usepackage[utf8]{inputenc}`—as demonstrated by examples in this article.

* **Note**: If you can’t input some letters of national alphabets directly from the keyboard, you can use LaTeX alternative commands for accents and special characters. See the [reference guide](#reference-guide).

## Font encoding

To ensure LaTeX can typeset your document you need to use fonts which have the character shapes required to typeset the language(s) being used. In addition, when using pdfLaTeX the `fontenc` package may still be required to ensure that input characters are correctly mapped to the appropriate output character shape (glyph) in the fonts being used:

```latex
 \usepackage[encoding]{fontenc}
```

where `encoding` is a comma-separated list of encodings reflecting the languages being used. The default LaTeX font encoding is `OT1`, but it contains only the 128 characters. The `T1` encoding contains letters and punctuation characters for most European languages using the Latin script. For languages using Cyrillic script you can use T2A, T2B, T2C, or X2 font encodings.

Users needing support for advanced multi-language typesetting should consider switching from pdfLaTeX to LuaLaTeX or XeLaTeX.

## Babel

The [`babel` package](https://ctan.org/pkg/babel?lang=en) presented in the [introduction](#introduction) allows the use of characters from a range of languages and also translates some elements within the document. `babel` also automatically activates the appropriate hyphenation rules for the language you choose.

You can activate the babel package by adding the following command to the preamble:

```latex
\usepackage[language]{babel}
```

Change the `language` to the name of the language you need. You can see a list of the languages available in the [babel package documentation](http://texdoc.net/pkg/babel), under section 1.27 *Languages supported by babel with ldf files*.

## Using more than one language in a document

The babel package enables typesetting multiple languages in the same document:

```latex
\documentclass{article}
\usepackage[T1, T2A]{fontenc}% T2A for Cyrillic font encoding
\usepackage[english, russian]{babel}
\begin{document}

\begin{abstract}
Это вводный абзац в начале документа.
\end{abstract}

 Этот текст будет на русском языке. Это демонстрация того, что символы кириллицы
 в сгенерированном документе (Compile to PDF) отображаются правильно.
 Для этого Вы должны установить нужный  язык (russian)
и необходимую кодировку шрифта (T2A).

\selectlanguage{english}
This text will be in English. The elements within this
block of text will also be set in the right language.

\begin{abstract}
A brief description of the main subject to be
explained in the entire document.
\end{abstract}

\selectlanguage{russian}

Кириллические символы также могут быть использованы в математическом режиме.

\begin{equation}
  S_\textup{ис} = S_{123}
\end{equation}
\end{document}
```

[Open this example in Overleaf.](<https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Multi-language+example+with+babel\&snip=\documentclass{article}&#xA;\usepackage\[T1,+T2A]{fontenc}%+T2A+for+Cyrillic+font+encoding&#xA;\usepackage\[english,+russian]{babel}&#xA;\begin{document}&#xA;&#xA;\begin{abstract}&#xA;Это+вводный+абзац+в+начале+документа.&#xA;\end{abstract}&#xA;&#xA;+Этот+текст+будет+на+русском+языке.+Это+демонстрация+того,+что+символы+кириллицы&#xA;+в+сгенерированном+документе+(Compile+to+PDF)+отображаются+правильно.&#xA;+Для+этого+Вы+должны+установить+нужный++язык+(russian)+&#xA;и+необходимую+кодировку+шрифта+(T2A).&#xA;&#xA;\selectlanguage{english}&#xA;This+text+will+be+in+English.+The+elements+within+this+&#xA;block+of+text+will+also+be+set+in+the+right+language.&#xA;&#xA;\begin{abstract}&#xA;A+brief+description+of+the+main+subject+to+be+&#xA;explained+in+the+entire+document.&#xA;\end{abstract}&#xA;&#xA;\selectlanguage{russian}&#xA;&#xA;Кириллические+символы+также+могут+быть+использованы+в+математическом+режиме.&#xA;+&#xA;\begin{equation}&#xA;++S_\textup{ис}+=+S_{123}&#xA;\end{equation}&#xA;\end{document}>)

This example produces the following output:

![Multi-language example typeset with babel](/files/j2CI5YiklC5AMnGtPPSO)

Note how the `fontenc` and `babel` packages are each passed two parameters:

* two encodings for `fontenc`: `T1` for Latin-script languages and `T2A` for Cyrillic languages.
* two languages for `babel`: `english` and `russian`. When using this syntax the last language in the option list will be active (i.e. Russian), and you can use the command `\selectlanguage{english}` at any point to change the active language.

## Right-to-Left writing

### Arabic language

LaTeX users wishing to typeset languages such as Arabic or Hebrew should use either LuaLaTeX or XeLaTeX. However, if the use of pdfLaTeX is unavoidable you can typeset Arabic using the `arabtex` package, which is further discussed and demonstrated in an [Overleaf article on Arabic typesetting](/latex/languages/05-arabic.md). Here, we’ll give an example without repeating material contained in the [article dedicated to Arabic](/latex/languages/05-arabic.md).

* **Note**: Possibly due to the age of the package, `arabtex` depends on `\usepackage[utf8]{inputenc}` and will not work without it.

```latex
\documentclass[11pt,a4paper]{report}
\usepackage{arabtex}
\usepackage[utf8]{inputenc}
\usepackage[LFE,LAE]{fontenc}
\usepackage[arabic]{babel}
\title{
\Huge\textsc{اللغة العربية}
}
\author{سالم البوزيدي}
\begin{document}
\maketitle
\tableofcontents
\chapter{علوم الحاسوب}
\section{تاريخ}
\begin{otherlanguage}{arabic}
يعود تاريخ علوم الحاسوب إلى اختراع أول حاسوب رقمي حديث. فقبل العشرينات من القرن العشرين، كان مصطلح حاسوب \textLR{Computer} يشير إلى أي أداة بشرية تقوم بعملية الحسابات. ما هي القضايا أو الأشياء التي يمكن لآلة أن تحسبها باتباع قائمة من التعليمات مع ورقة وقلم، دون تحديد للزمن اللازم ودون أي مهارات أو بصيرة (ذكاء)؟ وكان أحد دوافع هذه الدراسات هو تطوير آلات حاسبة \textLR{computing machines} يمكنها إتمام الأعمال الروتينية والعرضة للخطأ البشري عند إجراء حسابات بشرية.
خلال الأربعينات، مع تطوير آلات حاسبة أكثر قوة وقدرة حسابية، تتطور مصطلح حاسوب ليشير إلى الآلات بدلا من الأشخاص الذين يقومون بالحسابات. وأصبح من الواضح أن الحواسيب يمكنها أن تقوم بأكثر من مجرد عمليات حسابية وبالتالي انتقلوا لدراسة تحسيب أو التحسيب بشكل عام. بدأت المعلوماتية وعلوم الحاسب تأخذ استقلالها كفرع أكاديمي مستقل في الستينات، مع إيجاد أوائل أقسام علوم الحاسب في الجامعات وبدأت الجامعات تعطي إجازات في هذه العلوم [1].
\end{otherlanguage}
\begin{thebibliography}{99}
   [1]
    من ويكيبيديا، الموسوعة الحرة
\end{thebibliography}
\end{document}
```

[Open this example in Overleaf.](<https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+typesetting+Arabic\&snip=\documentclass\[11pt,a4paper]{report}&#xA;\usepackage{arabtex}&#xA;\usepackage\[utf8]{inputenc}&#xA;\usepackage\[LFE,LAE]{fontenc}&#xA;\usepackage\[arabic]{babel}&#xA;\title{&#xA;\Huge\textsc{اللغة+العربية}&#xA;}&#xA;\author{سالم+البوزيدي}&#xA;\begin{document}&#xA;\maketitle&#xA;\tableofcontents&#xA;\chapter{علوم+الحاسوب}&#xA;\section{تاريخ}&#xA;\begin{otherlanguage}{arabic}&#xA;يعود+تاريخ+علوم+الحاسوب+إلى+اختراع+أول+حاسوب+رقمي+حديث.+فقبل+العشرينات+من+القرن+العشرين،+كان+مصطلح+حاسوب+\textLR{Computer}+يشير+إلى+أي+أداة+بشرية+تقوم+بعملية+الحسابات.+ما+هي+القضايا+أو+الأشياء+التي+يمكن+لآلة+أن+تحسبها+باتباع+قائمة+من+التعليمات+مع+ورقة+وقلم،+دون+تحديد+للزمن+اللازم+ودون+أي+مهارات+أو+بصيرة+(ذكاء)؟+وكان+أحد+دوافع+هذه+الدراسات+هو+تطوير+آلات+حاسبة+\textLR{computing+machines}+يمكنها+إتمام+الأعمال+الروتينية+والعرضة+للخطأ+البشري+عند+إجراء+حسابات+بشرية.&#xA;خلال+الأربعينات،+مع+تطوير+آلات+حاسبة+أكثر+قوة+وقدرة+حسابية،+تتطور+مصطلح+حاسوب+ليشير+إلى+الآلات+بدلا+من+الأشخاص+الذين+يقومون+بالحسابات.+وأصبح+من+الواضح+أن+الحواسيب+يمكنها+أن+تقوم+بأكثر+من+مجرد+عمليات+حسابية+وبالتالي+انتقلوا+لدراسة+تحسيب+أو+التحسيب+بشكل+عام.+بدأت+المعلوماتية+وعلوم+الحاسب+تأخذ+استقلالها+كفرع+أكاديمي+مستقل+في+الستينات،+مع+إيجاد+أوائل+أقسام+علوم+الحاسب+في+الجامعات+وبدأت+الجامعات+تعطي+إجازات+في+هذه+العلوم+\[1].+&#xA;\end{otherlanguage}&#xA;\begin{thebibliography}{99}&#xA;+++\[1]&#xA;++++من+ويكيبيديا،+الموسوعة+الحرة&#xA;\end{thebibliography}&#xA;\end{document}>)

This example produces the following output:

![Example of Arabic typesetting using arabtex](/files/p1xEFyZOOdkltfNCAK3I)

## Examples of Supported Languages

* [Arabic](/latex/languages/05-arabic.md)
* [Chinese](/latex/languages/06-chinese.md)
* [French](/latex/languages/07-french.md)
* [German](/latex/languages/08-german.md)
* [Greek](/latex/languages/09-greek.md)
* [Italian](/latex/languages/10-italian.md)
* [Japanese](/latex/languages/11-japanese.md)
* [Korean](/latex/languages/12-korean.md)
* [Portuguese](/latex/languages/13-portuguese.md)
* [Russian](/latex/languages/14-russian.md)
* [Spanish](/latex/languages/15-spanish.md)

## Reference guide

**Accents and special characters**

If you can't input some letters of national alphabets directly from the keyboard, you can use LaTeX commands for accents and special characters.

| LaTeX command (universal) | Output |
| ------------------------- | ------ |
| ``<br>\`{o}<br>``         | ò      |
| `<br>\'{o}<br>`           | ó      |
| `<br>\^{o}<br>`           | ô      |
| `<br>\"{o}<br>`           | ö      |
| `<br>\H{o}<br>`           | ő      |
| `<br>\~{o}<br>`           | õ      |
| `<br>\c{c}<br>`           | ç      |
| `<br>\k{a}<br>`           | ą      |
| `<br>\={o}<br>`           | ō      |
| `<br>\b{o}<br>`           | o      |
| `<br>\.{o}<br>`           | ȯ      |
| `<br>\d{u}<br>`           | ụ     |
| `<br>\r{a}<br>`           | å      |
| `<br>\u{o}<br>`           | ŏ      |
| `<br>\v{s}<br>`           | š      |
| `<br>\t{oo}<br>`          | o͡o    |

| LaTeX command  | Output |
| -------------- | ------ |
| `<br>\aa<br>`  | å      |
| `<br>\AA<br>`  | Å      |
| `<br>\ae<br>`  | æ      |
| `<br>\AE<br>`  | Æ      |
| `<br>\l<br>`   | ł      |
| `<br>\L<br>`   | Ł      |
| `<br>\o<br>`   | ø      |
| `<br>\O<br>`   | Ø      |
| `<br>\i<br>`   | ı      |
| `<br>\j<br>`   |       |
| ``<br>!`<br>`` | ¡      |
| ``<br>?`<br>`` | ¿      |

## Further reading

For more information see

* [Supporting modern fonts with XƎLaTeX](/latex/fonts/03-xelatex.md)
* [Typesetting quotations and quotation marks](/latex/languages/04-typesetting-quotations.md)
* [Arabic](/latex/languages/05-arabic.md)
* [Chinese](/latex/languages/06-chinese.md)
* [French](/latex/languages/07-french.md)
* [German](/latex/languages/08-german.md)
* [Greek](/latex/languages/09-greek.md)
* [Italian](/latex/languages/10-italian.md)
* [Japanese](/latex/languages/11-japanese.md)
* [Korean](/latex/languages/12-korean.md)
* [Portuguese](/latex/languages/13-portuguese.md)
* [Russian](/latex/languages/14-russian.md)
* [Spanish](/latex/languages/15-spanish.md)
* [The not so short introduction to LaTeX2ε](http://www.ctan.org/tex-archive/info/lshort/)
* [LaTeX/Internationalization on WikiBooks](http://en.wikibooks.org/wiki/LaTeX/Internationalization)
* [LaTeX/Special\_Characters on WikiBooks](http://en.wikibooks.org/wiki/LaTeX/Special_Characters)


---

# 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/languages/03-international-language-support.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.
