direclua vs. luacode*
up vote
1
down vote
favorite
If I compile the following code with LuaLaTeX I get the word "RED" as output. The call of token.set_macro inside of luacode* seems to be noneffective. listfiles documentclass{minimal} usepackage{luacode} newcommand*foo{RED} iftrue begin{luacode*} token.set_macro('foo', 'GREEN') end{luacode*} else directlua{token.set_macro('foo', 'GREEN')} fi begin{document} foo end{document} After changing iftrue to iffalse I get "GREEN". Can anyone explain this behavior? Many thanks.
luatex luacode directlua
share | improve this question
asked 41 mins ago
...