[Dev-luatex] Comments in \directlua

Jonathan Sauer Jonathan.Sauer at silverstroke.com
Thu Aug 9 11:03:57 CEST 2007


while experimenting with \directlua, I noticed that Lua comments ('--')
do not work as one would expect, i.e.:

function hello()
	-- Just say hello
	tex.print("Hello world)

This results in the error message "end expected at <eof>".

Why? Because TeX (most of the time) converts line endings into spaces,
to above code is a single line as far as Lua is concerned:

\directlua{function hello() -- Just say hello tex.print("Hello world)

So Lua comment should not be used inside \directlua. TeX comments of
do work.

This behaviour is puzzling at first, but then just as expected. Still, I
think a note describing this should be in the manual.


More information about the dev-luatex mailing list