[NTG-context] Clearest way to call a {\command } in Lua?

Wolfgang Schuster schuster.wolfgang at gmail.com
Sat Jul 23 18:24:13 CEST 2016


> Lukáš Procházka <mailto:LPr at pontex.cz>
> 23. Juli 2016 um 15:25
> Hello,
>
> what is the clearest way to call a {\command ...} (i.e. a command 
> which is to be wrapped in curly braces, like \em, \bf etc.) in Lua?
>
> Let's have:
>
> ----
> bla {\em haha} bla
> ----
>
> Should be the Lua transcription be:
>
> ----
> bla
> \ctxlua{context(false, context.delayed.em("haha"))} % <--- The 
> clearest ("nicest") way?
> bla
> ----
Try not to use them because there is \bold{…} etc. or even better 
\style[style=bold]{…}.

\starttext

\startluacode

     context.bold("Bold text!")
     context.space()
     context.style( { style = "em" }, "Emphasized text!")

\stopluacode

\stoptext

Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20160723/0fb9f166/attachment.html>


More information about the ntg-context mailing list