A document is not always just Japanese and English. French, German, Russian, Greek, Arabic — each has its own hyphenation, its own document strings (“Chapter” ↔ “Chapitre”), and its own typographic rules. LaTeX handles this through babel (all engines) or polyglossia (for Unicode engines), with bidi added for right-to-left scripts.
babel and polyglossia
babel (by Johannes Braams) is the classic, supporting pdfLaTeX, XeLaTeX, and LuaLaTeX alike. You declare languages as package options (the last is the main one), switch a block with \selectlanguage{...} and inline text with \foreignlanguage{lang}{...}. It enables the right hyphenation, translates document strings, and applies language-specific typography (such as French’s thin space before ; : ! ?). It is actively developed and the default choice even on Unicode engines.
% babel:最後の言語がメイン / last language is the main one
\usepackage[russian,french,english]{babel}
...
\foreignlanguage{french}{Bonjour !}polyglossia is the alternative aimed at XeLaTeX / LuaLaTeX, suited to system fonts and complex scripts. Declare languages with \setmainlanguage{...} / \setotherlanguage{...} (secondary languages must be explicit), and switch with a \text<lang> command such as \textarabic{...}.
Bidirectional text — RTL
Right-to-left scripts (RTL) like Arabic, Hebrew, and Persian are handled on Unicode engines. The bidi package (for XeTeX/LuaTeX) controls direction: \setRTL/\setRL for right-to-left paragraphs, \setLTR/\setLR for left-to-right. Under XeTeX, both babel and polyglossia rely on bidi, and mixed LR/RL spots need explicit markup. For serious bidirectional work, LuaLaTeX is recommended — babel on LuaTeX uses a Unicode algorithm that flips direction automatically and reverses layout such as tables and margins.
% XeTeX / LuaTeX
\usepackage{bidi}
\setRTL % 以降を右→左に / switch to right-to-leftPer-language support
babel/polyglossia cover many languages — French, German, Italian, Spanish, Portuguese, Russian, Greek, Arabic, Chinese, Korean, and more — each adding hyphenation, document strings, and the language’s conventions. Non-Latin scripts (Russian/Cyrillic, Greek, Arabic) need an appropriate font: easiest on XeLaTeX/LuaLaTeX with system fonts (fontspec); on pdfLaTeX, pair the right fontenc (T2A for Cyrillic, LGR for Greek). For CJK, see the dedicated pages.
- Most cases →
babel(all engines, actively developed). - Complex scripts / system fonts on XeLaTeX/LuaLaTeX →
polyglossiais fine too. - RTL (Arabic, Hebrew) →
LuaLaTeX+babel(automatic bidirectional handling). - Japanese / CJK → the dedicated routes (see “Japanese typesetting methods”, “CJK”).