I would like to pass an argument verbatim from LaTeX to lua including LaTeX commands and end of line characters. The example below takes care of the former issue, but not of the latter. Is there a way of addressing both issues simultaneously, perhaps by using \obeylines
to address the second problem? If so, how?
There is a solution to a similar question at In LuaLaTeX, how do I pass the content of an environment to Lua verbatim? but it still prints output in addition to passing the argument.
Thanks!
\documentclass[12pt]{article}
\usepackage{luacode}
\directlua{dofile("myluaprogram.lua")}
\newcommand{\myluaroutine}[1]
{\directlua{myluaroutine("\luatexluaescapestring{\detokenize{#1}}")}}
\begin{document}
\myluaroutine{
I
want
to
have every line
separate
in
lua
without
expanding
off
\latexcommands
}
\end{document}