[luatex] Verbatim printing of Lua strings

Dirk Laurie dirk.laurie at gmail.com
Sat Mar 14 10:57:36 CET 2015


I have a Lua script that produces a Lua string like this:

    str = [[
1. First line.
2. Second line.
]]

I wish to achieve the effect that

\begin{verbatim}
1. First line.
2. Second line.
\end{verbatim}

would have produced. My attempt has been to make the module
produce

    vstr = [[
\begin{verbatim}
1. First line.
2. Second line.
\end{verbatim}
]]

and code `\directlua{tex.print(vstr)}`. But the end-of-line is not respected.

I can't find the string `verbatim` in the LuaTeX manual. Under what word
should I search for a trick that can achieve what I need?


More information about the luatex mailing list