[luatex] luatex's pause

Taco Hoekwater taco at elvenkind.com
Wed Apr 8 20:56:52 CEST 2009


Robin Fairbairns wrote:
> Karl Berry <karl at freefriends.org> wrote:
> 
>>     The problem are the hyphenation patterns:
>>
>> Glad you knew the answer, Heiko.
> 
> i'm impressed, let alone pleased ;-)
> 
>> If you or anyone can propose a better (pdf)lualatex.ini for TL'09 (such
>> that existing documents still work, of course), that would be great.
>> This is lualatex.ini (minus comments):
> 
> it seems to me that we (the latex team) need to think about babel in
> this world.  if we're going to re-create the environment that users have
> become used to, we need to hack at \language (or perhaps just babel
> \selectlanguage, etc) so that they load patterns on first call of a
> language.  anyone know what context is doing for this?

Context does something like this:


  \def\selectlanguage#1%
    {\language=\directlua{tex.sprint(languages.enable("#1"))}}


where languages.enable is a lua function that checks a private
lua table for an entry with name "#1". If it is present, then
the associated language id number is returned straightaway.

Otherwise it allocates a language id, loads patterns, load exceptions,
sets up left- and righthyphenmin,  etc. all via the lua functions in
the "lang" table (offered by luatex), caches the language id in the
private table, and then returns it.

tex.sprint() prints the returned language id number back to the TeX
end, so that the \language primitive will be happy.

Btw, loading bare patterns via the lua function lang.patterns()
is a bit faster than via \patterns. The internal functions expect
C strings, so the tokenization has to be undone again immediately.

Best wishes,
Taco


More information about the luatex mailing list