ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Clearest way to call a {\command } in Lua?
@ 2016-07-23 13:25 Lukáš Procházka
  2016-07-23 16:24 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Lukáš Procházka @ 2016-07-23 13:25 UTC (permalink / raw)
  To: ConTeXt

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
----

Best regards,

Lukas


-- 
Ing. Lukáš Procházka | mailto:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Clearest way to call a {\command } in Lua?
  2016-07-23 13:25 Clearest way to call a {\command } in Lua? Lukáš Procházka
@ 2016-07-23 16:24 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2016-07-23 16:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 738 bytes --]

> Lukáš Procházka <mailto:LPr@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

[-- Attachment #1.2: Type: text/html, Size: 1800 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-23 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-23 13:25 Clearest way to call a {\command } in Lua? Lukáš Procházka
2016-07-23 16:24 ` Wolfgang Schuster

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).