[Tex/LaTex] Why is babel loading all these languages

babel

The following document:

\documentclass{article}
\usepackage[english]{babel}
\begin{document}
Something
\end{document}

Produces the following .log file:

Running `LaTeX' on `mwe' with ``pdflatex  -interaction=nonstopmode "\input" mwe.tex''
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ancientgreek, ibycus, basque, catalan, danish, dutch, ukenglish, usenglishmax, french, galician, monogreek, greek, italian, latin, spanish, loaded.
(./mwe.tex (/usr/local/texlive/2011/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2011/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2011/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/texlive/2011/texmf-dist/tex/generic/babel/english.ldf
(/usr/local/texlive/2011/texmf-dist/tex/generic/babel/babel.def))) (./mwe.aux)
[1{/home/seamus/.texlive2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./mwe.aux) )</usr/local/texlive/2011/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on mwe.pdf (1 page, 12356 bytes).
Transcript written on mwe.log.

LaTeX finished at Thu Jan 19 13:00:40

Note that before babel.sty is loaded (around line 9) babel has already loaded patterns for, among others, ancientgreek,ibycus,basque,catalan… It looks like somehow, babel is being loaded even before the document class is read. Note that commenting out babel doesn't actually change the behaviour in any way.

What is going on, and how do I stop babel loading all these unnecessary patterns?

Best Answer

The message here is perhaps slightly misleading. What is actually happening is that you are using a format with those hyphenation patterns built in. Usually, this is really nothing to be concerned about.

To understand why so many hyphenation patterns are loaded, a bit of background is needed. TeX was designed such that hyphenation patterns can only be loaded when creating a format. This remains true with pdfTeX and XeTeX (but not LuaTeX: see later). It used to be the case that formats were built using only the hyphenation patterns required by a user. However, that makes using a 'new' language awkward, as you need to enable the patterns and then rebuild the formats. With increases in computer power and memory size, it is now possible to load all of the hyphenation patterns, and so have a 'universal' hyphenation format.

In terms of removing the patterns, this depends on the TeX system in use. With MiKTeX, there are a series of tick-boxes in the GUI for building formats which will alter this. TeX Live I am afraid I am not sure about. (MiKTeX moved only more recently to loading all patterns, so I know where the settings are from having to enable more patterns!)

With LuaTeX, life is different as it can dynamically load hyphenation patterns, and indeed it turns out to be better not to load all of them in a format. Thus only a minimal set (US English, no-hyphenation and a 'dummy') are built in.

Related Question