From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95558 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Clearest way to call a {\command } in Lua? Date: Sat, 23 Jul 2016 18:24:13 +0200 Message-ID: <57939A2D.2080606@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5781831986411382237==" X-Trace: ger.gmane.org 1469291106 28341 80.91.229.3 (23 Jul 2016 16:25:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 16:25:06 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Jul 23 18:24:52 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQzjN-0002nQ-FU for gctc-ntg-context-518@m.gmane.org; Sat, 23 Jul 2016 18:24:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8CEA412CCD; Sat, 23 Jul 2016 18:24:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wpWc65igOllh; Sat, 23 Jul 2016 18:24:28 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id C9A6E12CDA; Sat, 23 Jul 2016 18:24:28 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4ECB812CD4 for ; Sat, 23 Jul 2016 18:24:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OgSWueNPba-f for ; Sat, 23 Jul 2016 18:24:27 +0200 (CEST) Original-Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 2F21512CCD for ; Sat, 23 Jul 2016 18:24:17 +0200 (CEST) Original-Received: by mail-wm0-f47.google.com with SMTP id f65so89078365wmi.0 for ; Sat, 23 Jul 2016 09:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=w7mCkqL125VkR5rftJz8p4+i+SF7m5KuvwX6VVFuGiI=; b=jyt/M2tJj9QJUdARmHZ2JVUoB5aIjRx+b5jB3bSzB/R96a7YM5Pk6ggVqsdr34zj9q QUC7es+uvn9SmuloTMNbmksSnIz77uJUBVNA13+kryMn4jRMjS+BZm13rKFLjquH3rUm SC1SG1+S/3pJj3iFXOBz6+R/hubL87X1gnoJXeTmws5gkL5BwPSabV6hho2kU4FT3zWT 3+SWmYM3nJSSshCRwBCjBaV2iojeFaVwK2b7zNIgoZVDI8CxO4zuEi3hO2MP8PVkKquF g/pB7Wis0Fq2DgCT4Gfwpa+21FwgWAlif+ZyRaBwPIWOD2JtjqXSTNRYaOHgbXNwpONQ AK+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=w7mCkqL125VkR5rftJz8p4+i+SF7m5KuvwX6VVFuGiI=; b=UALQriUYfWj0LcikRH9AwPRlUaWq/M56gwpDnaR9RIWQPwuGfAJANxajOvCld//Jmh xHlajDWP0yGE2LTnBSdR+VS9qKNHw7uEWD1fA2JP5+Tz21H7KK6hkWvrxiF94AJ6jTlK oH05eulaZWDh0JFiSEVZLMTDDA6SWMdLwmef4OOLB/x4/0C1ejDqmpv+eTRL7GbdcjGB nSULZiPBHP+Dt7Q2kCzLjUwecz80V9Q0cpfMZLwB2fl9dTEw064mcADpU1Bj/zg31Xyo SVf1pK41DtldFiB2Ul/YLshCf9ems3K5Lwb5OHQo4N8bSFDMki4z1s5BBewe5YYgc39w 8MJQ== X-Gm-Message-State: AEkoouvP0LIz/tbwq79olAH5uTnKmSMqSzkENW/5YUJ4/DCStQq7t7Isa5JgyxRQae+LAA== X-Received: by 10.194.110.229 with SMTP id id5mr7812718wjb.23.1469291056462; Sat, 23 Jul 2016 09:24:16 -0700 (PDT) Original-Received: from keima.localdomain (x2f2a0ab.dyn.telefonica.de. [2.242.160.171]) by smtp.gmail.com with ESMTPSA id g184sm18177308wme.15.2016.07.23.09.24.15 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 23 Jul 2016 09:24:15 -0700 (PDT) User-Agent: Postbox 4.0.8 (Macintosh/20151105) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:95558 Archived-At: This is a multi-part message in MIME format. --===============5781831986411382237== Content-Type: multipart/alternative; boundary="------------060407060003070803070709" This is a multi-part message in MIME format. --------------060407060003070803070709 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Luk=C3=A1=C5=A1 Proch=C3=A1zka > 23. Juli 2016 um 15:25 > Hello, > > what is the clearest way to call a {\command ...} (i.e. a command=20 > 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=20 > clearest ("nicest") way? > bla > ---- Try not to use them because there is \bold{=E2=80=A6} etc. or even better= =20 \style[style=3Dbold]{=E2=80=A6}. \starttext \startluacode context.bold("Bold text!") context.space() context.style( { style =3D "em" }, "Emphasized text!") \stopluacode \stoptext Wolfgang --------------060407060003070803070709 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
23= .=20 Juli 2016 um 15:25
Hello,

what is the clearest way to call a {\command ...} (i.e. a command=20 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=20 clearest ("nicest") way?
bla
----
Try not to use them because there is \bold{=E2=80=A6} etc. or even better= =20 \style[style=3Dbold]{=E2=80=A6}.

\starttext

\startluacode

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

\stopluacode

\stoptext

Wolfgang
--------------060407060003070803070709-- --===============5781831986411382237== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============5781831986411382237==--