[luatex] Changing catcodes in \directlua

Taco Hoekwater taco at elvenkind.com
Tue Jul 6 09:18:34 CEST 2010


Hi,

On 07/06/2010 08:34 AM, Paul Isambert wrote:
>
> Now a note for our much admired LuaTeX developpers: experimenting with
> the engine to answer this post I found that
>
> \directlua{tex.print("a\noexpand\alpha b")}
>
> returns ``aXlpha b'' where ``X'' is whatever TeX renders the bell \a
> with (an uppercase upsilon for me). But what surprises me is the space
> before the ``b''. Where does it come from? I'd think ``\alpha'' when it
> was still a command would have gobbled it...?

That's because the tokens have to be converted back to a string for
use by lua, and that string that is fed into lua is "a\alpha b".
The byte sequence "\a" then becomes a single ^G via lua's string
escape mechanism.

Best wishes,
Taco


More information about the luatex mailing list