[NTG-context] newlines in return Lua string

Aditya Mahajan adityam at umich.edu
Sat Jun 15 20:28:48 CEST 2019


On Sat, 15 Jun 2019, Hans van der Meer wrote:

> From 	\ctxlua{tex.print(hvdm.myluacall("\xmlatt{#1}{argument}"))}
> Lua returns a string containing newline characters '\n'.
>
> In ConTeXt this returned string is printed as one line, the embedded newlines are not honoured.
> I thought to replace with \crlf in this manner: string1 .. "\\crlf" .. string2 but the returned \crlf are not executed as such.
>
> How to force \crlf's in the executed return?

Hard to say without a minimal example, but how about:

\startluacode
context.startlines()
context(hvdm.myluacall("\xmlatt{#1}{argument}"))
context.stoplines()
\stopluacode

or

\startlines
\ctxlua{context(hvdm.myluacall("\xmlatt{#1}{argument}))}
\stoplines

Aditya


More information about the ntg-context mailing list