Lukáš Procházka
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