Closed fpantigny closed 6 months ago
I don't think this is specific to lineno
.
\directlua
expands its argument in TeX before feeding to Lua, so the \\
is being interpreted as a TeX command, rather than an escaped \
. Any package that modifies \\
in any way (including lineno
) is probably going to break this usage.
Instead you probably want to write \directlua{tex.print("\textbackslash LaTeX")}
to get a literal backslash passed to Lua.
When I try to compile the following MWE with LuaLaTeX, I have an error :
invalid escape sequence near '"\p'
When
lineno
is not loaded, I have the expected output.I think that the reason is that
\\
is not protected whenlineno
has been loaded. If I add\robustify\\
(with\robustify
ofetoolbox
) it works.