[luatex] scanning for undefined command names

David Carlisle d.p.carlisle at gmail.com
Wed Oct 26 13:39:55 CEST 2016

This is following up a user query at


The following (plain) luatex logs


that is the input \UNDEFINED is scanned (and removed) as a token but
given the name as empty string not "UNDEFINED" .

It isn't exactly clear from the manual that this would be the case, is
that intentional? (and if so is there any way to get "UNDEFINED"
without scanning letter by letter and checking catcodes "by hand" ?


\directlua{texio.write_nl("[" .. token.scan_csname() .. "]")}\par
\directlua{texio.write_nl("[" .. token.get_next().csname .. "]")}\par
\directlua{texio.write_nl("[" .. token.scan_csname() .. "]")}\UNDEFINED
\directlua{texio.write_nl("[" .. token.get_next().csname .. "]")}\UNDEFINED


More information about the luatex mailing list