[luatex] Cyrillic in \directlua0

Manuel Pégourié-Gonnard mpg at elzevir.fr
Sat Mar 27 17:59:07 CET 2010

Taco Hoekwater a écrit :
> Out of curiosity: this example looks like it is using a Unicode-encoded
> font and 'normal' luatex input encoding (=UTF-8). Is someone able and
> willing to explain what the original post was supposed to (and failed)
> do?
Well, I'm not in Shiva's mind, but let me try. Currently, the situation wrt
encodings in LaTeX is as follows:

1. you can use the "natural" (=UTF-8) input encoding with Unicode fonts. Such
fonts can be loaded using luaotfload and fontenc/EU2, or the experimental
version of fontspec which should take care of everything.

2. OR, if you want/need to use a font in a legacy encoding such as T2A, then,
surprisingly, you need to load luainputenc even if your source is in UTF-8 (and
of course it also supports more input encodings). Its purpose is to transcode
from the input encoding (here, UTF-8) to the internal encoding of LaTeX (LICR)
by making quite a lot of characters active. Then, the normal fontenc translates
from LICR to the font's legacy encoding.

The output observed is the expansion of the LICR macro representation of the
string when the current output (font) encoding is T2A.

Option 2 is kinda dirty because of the active characters. Another way to support
legacy font encodings (if that is really needed) would be to build a virtual
Unicode font on the fly so that luainputenc isn't needed any more (or could
avoid using active characters). I intend to give it a try some day, but who
knows when...


More information about the luatex mailing list