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
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
(which is part of the Babel installation); it will contain a line:
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).
It's possible to do the whole operation in one go, by using the
texconfig hyphen latex
which first enters an editor for you to edit
and then regenerates the format you specify (
latex in this case).
Otherwise, to regenerate all formats, do:
If you're willing to think through what you're doing (this is not for the faint-hearted), you can select a sequence of formats and for each one, run:
fmtutil --byfmt <formatname>
formatname is something like
fmtutil --byhyphen <hyphenfile>
hyphenfile is the file specifying hyphenation
to the format — usually
On a MiKTeX distribution earlier than v2.0, do:
or get a DOS window and run:
On a MiKTeX distribution v2.0 or later, the whole procedure can be done via the GUI. To select the new language, do:
Select your language from the list, press the
and then the
OK button. Then select the
tab and press the
Update Now button.
Otherwise, edit the
language.dat file (as outlined above),
and then run:
just as for a pre-v2.0 system.
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.
Source: Using a new language with Babel