[Dev-luatex] Comments in \directlua

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


Hello,

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

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

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)
end}

So Lua comment should not be used inside \directlua. TeX comments of
course
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.


Jonathan



More information about the dev-luatex mailing list