View on GitHub


The multilingual framework to localize LaTeX, LuaLaTeX, XeLaTeX

What’s new in babel 3.39


The first feature is another step in a revamping of the user interface, which will be one of the main tasks in the next versions. While ‘monolithic’ languages - those loaded as package or class options - are all what most users need and the recommended way to set up a monolingual document, the goal is to provide a sort of ‘service’ with a set of tools enabling users to create locales tailored to their own needs (the example below for transliterated Russian is a case in point).

Locale loading on the fly

Very often, multilingual documents consist of a main language with small pieces of text in other languages (words, idioms, etc.). For these cases, babel now does not require declaring the secondary languages explicitly, because the basic settings are loaded on the fly when the language is selected or the font set.

This is particularly useful when there are short texts of this kind coming from an external source whose contents are not known on beforehand (for example, titles in a bibliography). A trivial example is:

English. \foreignlanguage{russian}{Русский}.

Improvements in \babelposthyphenation (lua)

Now captured chars can be mapped in the replacements. For example, if the first capture reads ([ΐΰ]), the replacement could be {1|ΐΰ|ίύ}, which maps ΐ to ί, and ΰ to ύ - in other words, the diaeresis is removed.

Although the main purpose of this tool is non-standard hyphenation, it is a quite general tool which may actually be used for other transformations. [Note. See also \babelprehyphenation, introduced in a preliminary form in 3.44, which is a better solution in cases like this.] For example, to enter ž as zh and š as sh in a newly created locale for transliterated Russian:

  { string = {1|sz|šž} },

Another change is now \babelposthyphenation activates automatically this feature.

Assign specific chars to a locale (lua)

\babelcharproperty has been extended with a new property to add (or remove) a character (or a range of characters) from the default list used by onchar (namely, the script block). For example: