31 Jan
2008
31 Jan
'08
12:07 p.m.
Jonathan Sauer wrote:
Hello,
can \directlua be nested, i.e.
\directlua0{\directlua0{tex.print('foo()')}}
to call Lua function 'foo'?
\directlua is never called recursively, even though it sometimes looks like it is. The example above is syntactically wrong, but this works (ignoring \catcode issues): \directlua0{tex.print('\directlua0{foo()}')} however, executation is serialized. The output of tex.print is not seen until the end of the outer \directlua is reached. Luatex's tex engine actually sees something like this: \directlua0{}\directlua0{foo()} which is fine, as it does not recurse. Best wishes, Taco