Possible Duplicate:
Print large macro block from Lua to TeX
I need to escape a string in Lua code in LuaLaTeX. I'm trying to print a string but LaTeX seems to hiccup on some special characters. I know I can call \luatexluaescapestring from inside text but I need an equivalent function in Lua that will either remove the offending characters or escape them properly.
[[ one\ntwo ]]) in this case (the literal char\nis already escaped). I'm not sure Lua has a built-in function for this (they explicitly recommend literal strings for escaping literal chars), but maybe a solution is to write a local function whichstring.sub's all the 14 literal chars and return a "clean" string.:)– Paulo Cereda Mar 29 '12 at 18:21_would not have had any problem. Next time, please provide a minimal example! – topskip Mar 30 '12 at 06:15