[luatex] Behaviour of pdf.print changed?

Arno Trautmann Arno.Trautmann at gmx.de
Tue May 21 23:33:29 CEST 2013


Hi all,

the following code is written after an article by Paul Isambert in the 
TUGboat some time ago. The article was about drawing in LuaTeX using 
direct pdf commands in the following way:

function pdf_print (...)
   for _, str in ipairs({...}) do
     pdf.print(str .. " ")
   end
   pdf.print("\\string\n")
end

function line (p1,p2)
   pdf_print(p1,p2,"l")
end

Until yesterday, I used the line

   pdf.print("\string\n")

with a single backslash in front of the "string". This still works with 
a TeX Live 2012 system with LuaTeX 0.70.2. However, with the latest TL 
pretest and LuaTeX 0.77.0 (rev 4635), this results in

./placeat.sty:21: LuaTeX error ./placeat.lua:19: invalid escape sequence 
near '\
s'
stack traceback:
	[C]: in function 'dofile'
	[string "\directlua "]:1: in main chunk.
l.21 ...ctlua{dofile(kpse.find_file("placeat.lua"))}

Now, I have to use the line like above with two backslashes:

   pdf.print("\\string\n")

which also seems to work with 0.70.2. Which behaviour is correct? 
Unfortunately I don't really understand what the code does, so I cannot 
guess how it should behave …

cheers
Arno


More information about the luatex mailing list