# [tex-hyphen] [tex-live] Bug in luatex-hyphen

Ulrike Fischer news3 at nililand.de
Mon Mar 12 09:31:59 CET 2012

Am Sun, 11 Mar 2012 19:42:25 +0100 schrieb Mojca Miklavec:

> thank you very much for this bug report. (We can move further
> discussion to tex-hyphen.)

>> There seems to be a problem with loading hyphenation patterns for Brazilian Portuguese when using babel with LuaLaTeX.  The following document fails miserably because (I think) 'brazilian' (or 'brazil') isn't set as a synonym for 'portuguese' (or 'portuges') in language.dat.lua

>> % !TEX TS-program = LuaLaTeX
>> \documentclass{article}
>> \usepackage[brazil]{babel}
>>
>> \begin{document}
>>
>> Documento de teste.
>>
>> \end{document}
>>
>> Since language.dat.lua is generated from language.dat and both are generated by tlmgr I'm posting this here.
>>
>>
>> The issue was reported here: http://tex.stackexchange.com/q/47605/2693
>
> Is this considered a bug in babel, a bug in hyphenation patterns
>
> It is trivial to add an extra entry to language.dat, language.def and
> language.dat.lua and I can do that, but I would like to also hear
> other's opinion.
>
> Since the given chunk of code seems to work fine in xelatex and
> pdflatex (without the need to add extra synonyms), I guess that this
> might be a problem in the lua code? I don't understand Babel well
> enough, but I assume that it does the following:
>     if brazil patterns are available
>         use brazil patterns
>     else
>         use portugues patterns as a fallback
>     end
> and lualatex chokes on trying to load brazil patterns that don't exist?

I get the problem in miktex too. I don't have "brazil" somewhere in
my language.dat-files. In this case babel sets up things so that
l at brazil points to the same "number" as l at portuges:

> \l at brazil=\char"D.
l.69 \show\l at brazil

> \l at portuges=\char"D.
l.70   \show\l at portuges

This is naturally fine for pdflatex which only needs the language
"\l at brazil".

But luatex has still to load the patterns and my guess is that it is
trying to find them by name and so fails.

> In my opinion it makes slightly more sense if babel/polyglossia is
> able to deal with synonyms properly and only load brazil patterns if
> different patterns are actually available.

Babel doesn't load brazil patterns, it only give the portuguese
patterns the additional name "\l at brazil".

Imho there are two possible solutions:

The luatex code could - if patterns can't be found - go through the
list of languages and try to find the one "\l at xxx" with the same
number as the actual "\l at yyy".

Or in the language.dat brazil could be added as synonym.

--
Ulrike Fischer