The TeX FAQ

Frequently Asked Question List for TeX

Usage

Using a new language with Babel

Babel is capable of working with a large range of languages, and a new user often wants to use a language that her TeX installation is not set up to employ. Simply asking Babel to use the language, with the command

  \usepackage[catalan]{babel}

provokes the warning message

Package babel Warning: No hyphenation patterns were loaded for
(babel)                the language `Catalan'
(babel)                I will use the patterns loaded for \language=0 instead.

The problem is that your TeX system doesn’t know how to hyphenate Catalan text: you need to tell it how before Babel can do its work properly. To do this, for LaTeX installations, one needs to change language.dat (which is part of the Babel installation); it will contain a line

%catalan         cahyphen.tex

which, if you remove the comment marker, is supposed to instruct LaTeX to load Catalan hyphenation patterns when you tell it to build a new format.

Unfortunately, in many Babel distributions, the line just isn’t right — you need to check the name of the file containing the patterns you’re going to use. As you can see, in the author’s system, the name is supposed to be cahyphen.tex; however the file actually present on the system is cahyph.tex — fortunately, the error should prove little more than an inconvenience (most of the files are in better distributions anyway, but an elusive one may be found on CTAN; if you have to retrieve a new file, ensure that it’s correctly installed, for which see installing a new package).

Finally, you need to regenerate the formats used (in fact, most users of Babel are using it in their LaTeX documents, so regenerating the LaTeX-related formats will ordinarily be enough; however, the author always generates the lot, regardless).

Caveat: It is (just) possible that your TeX system may run out of “pattern memory” while generating the new format. Most TeX implementations have fixed-size arrays for storing the details of hyphenation patterns, but although their size is adjustable in most modern distributions, actually changing the size is a fiddle. If you do find you’ve run out of memory, it may be worth scanning the list of languages in your language.dat to see whether any could reasonably be removed.

FAQ ID: Q-newlang
Tags: hyphenation