babel
Provides comprehensive multilingual support and language-specific typographical rules for documents written in various TeX engines.
Overview
Enables seamless creation of multilingual documents by managing language-specific typography, hyphenation patterns, and cultural conventions. The package serves as a foundation for international document preparation.
- Supports over 300 languages worldwide, including non-Latin scripts and right-to-left writing systems.
- Allows dynamic switching between languages within the same document.
- Handles language-specific quotation marks, date formats, and other cultural conventions automatically.
- Compatible with multiple TeX engines including pdfLaTeX, XeLaTeX, and LuaLaTeX.
- Essential for academic publications, international documentation, and multilingual books.
- Integrates with other packages to provide comprehensive internationalization support.
Getting Started
To use babel
, include it in your document preamble with at least one language option:
\documentclass{article}
\usepackage[english]{babel}
For multiple languages (with the first being the default):
\documentclass{article}
\usepackage[french,spanish,english]{babel}
Babel works with pdfLaTeX, XeLaTeX, and LuaLaTeX. For languages with non-Latin scripts, XeLaTeX or LuaLaTeX may be required.
Examples
Basic multilingual document with English and Spanish sections.
\documentclass{article}
\usepackage[english,spanish]{babel}
\begin{document}
\selectlanguage{english}
This text is in English.
\selectlanguage{spanish}
Este texto está en español.
\end{document}
Document with language-specific hyphenation and date formatting.
\documentclass{article}
\usepackage[french,german,english]{babel}
\begin{document}
\selectlanguage{english}
Today is \today. Long words like internationalization are hyphenated.
\selectlanguage{french}
Aujourd'hui c'est \today. Les mots longs comme internationalisation sont correctement coupés.
\selectlanguage{german}
Heute ist \today. Lange Wörter wie Internationalisation werden richtig getrennt.
\end{document}