ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Clearest way to call a {\command } in Lua?
Date: Sat, 23 Jul 2016 18:24:13 +0200	[thread overview]
Message-ID: <57939A2D.2080606@gmail.com> (raw)
In-Reply-To: <op.yk118z11f14xzu@lkzd-2013>


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

      reply	other threads:[~2016-07-23 16:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23 13:25 Lukáš Procházka
2016-07-23 16:24 ` Wolfgang Schuster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57939A2D.2080606@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).