![](https://secure.gravatar.com/avatar/565476157eb3895a9c928ffce26d988d.jpg?s=120&d=mm&r=g)
31 Jan
2008
31 Jan
'08
5:07 a.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