* newlines in return Lua string
@ 2019-06-15 14:37 Hans van der Meer
2019-06-15 18:28 ` Aditya Mahajan
0 siblings, 1 reply; 2+ messages in thread
From: Hans van der Meer @ 2019-06-15 14:37 UTC (permalink / raw)
To: NTG ConTeXt
[-- Attachment #1.1: Type: text/plain, Size: 430 bytes --]
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?
dr. Hans van der Meer
[-- Attachment #1.2: Type: text/html, Size: 1742 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: newlines in return Lua string
2019-06-15 14:37 newlines in return Lua string Hans van der Meer
@ 2019-06-15 18:28 ` Aditya Mahajan
0 siblings, 0 replies; 2+ messages in thread
From: Aditya Mahajan @ 2019-06-15 18:28 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-15 18:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-15 14:37 newlines in return Lua string Hans van der Meer
2019-06-15 18:28 ` Aditya Mahajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).