[luatex] token.expand: how to use it?
Eduardo Ochs
eduardoochs at gmail.com
Sun Oct 23 00:34:53 CEST 2022
Hi list,
how do I use the function token.expand, that is (very) briefly
mentioned here?
http://mirrors.ibiblio.org/CTAN/systems/doc/luatex/luatex.pdf#page=224
I've put this in a .tex file
\def\foo{FOO}
\def\bletch#1{BL#1ETCH}
and entered a Lua REPL. All the "print"s below give meaningful
results,
print(token.get_macro("foo"))
print(token.get_macro("bletch"))
print(token.get_meaning("foo"))
print(token.get_meaning("bletch"))
print(token.create("bletch"))
print(token.create("bletch").expandable)
and the last one says "true"... but I've tried to call token.expand
with several kinds of arguments, and in all cases I got this error,
! Undefined control sequence.
\repl ->\directlua { print(); run_repl2_now() }
where \repl is the tex macro that I use to run my Lua REPL...
Help please, and thanks in advance... =/
Eduardo Ochs
http://angg.twu.net/dednat6.html
More information about the luatex
mailing list.