[luatex] Cyrillic in \directlua0

Manuel Pégourié-Gonnard mpg at elzevir.fr
Sat Mar 27 21:35:37 CET 2010


Taco Hoekwater a écrit :
> Manuel Pégourié-Gonnard wrote:
>>
>> The output observed is the expansion of the LICR macro representation
>> of the
>> string when the current output (font) encoding is T2A.
> 
> In that case,
> 
>   tex.print([[Здравствуй, Мир]])
> 
> maybe works (as using [[]] strings stopslua from interpreting
> backslash characters in the string as escape sequence starts).
> 
Unfortunately not, since the name of the control sequence aren't re-tokenized
properly: \T2A (aka \csname T2A\endcsname) is interpreted as \T 2A...

A possible solution (tested) is:

\directlua{
  \unexpanded{tex.print("Здравствуй, Мир")}
  }

That way, characters aren't expanded before being passed to Lua, so are
correctly printed back to TeX and tokenized. (This kind of problem wouldn't
happen if the Lua code were in a separate file, btw.)

Manuel.

PS: I had to first run a variant of the example under pdfTeX so that
larm1000.tfm got generated before I could succesfully compile it with LuaTeX. I
guess that tfm generation is disabled on purpose?


More information about the luatex mailing list