From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91981 Path: news.gmane.org!not-for-mail From: Joas Yannick Newsgroups: gmane.comp.tex.context Subject: User-Defined Commands With Key-Value Options Date: Sun, 19 Jul 2015 13:24:45 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0343705234==" X-Trace: ger.gmane.org 1437305133 779 80.91.229.3 (19 Jul 2015 11:25:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jul 2015 11:25:33 +0000 (UTC) To: "ntg-context@ntg.nl" Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 19 13:25:22 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZGmif-0005xW-95 for gctc-ntg-context-518@m.gmane.org; Sun, 19 Jul 2015 13:25:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4A38610230 for ; Sun, 19 Jul 2015 13:25:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lgXSVRTUybHR for ; Sun, 19 Jul 2015 13:25:19 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id C032610236 for ; Sun, 19 Jul 2015 13:24:53 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D4BC8101FA for ; Sun, 19 Jul 2015 13:24:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id y-SxCWlLCMRR for ; Sun, 19 Jul 2015 13:24:48 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 98667101F9 for ; Sun, 19 Jul 2015 13:24:48 +0200 (CEST) Original-Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) by filter4-ams.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t6JBOknW017931 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 19 Jul 2015 13:24:47 +0200 Original-Received: by iggf3 with SMTP id f3so64363001igg.1 for ; Sun, 19 Jul 2015 04:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=xayiU793nEhLhdBUzdP3qGNteAjprTVE7QCPewqkEPs=; b=eiZGyv9qUDG9gsFcWQRWhjEaqi/Wgw/It17RZ+6ctvrw+HtWk+0AiOQCJaxGk1ka2u QhsaunM8h0aWg+nfmtpPh8I0FcwOwS4h7MX1DLxL6j0ocrTmDG3bYhBrXchc8rfCusoK ImFWIKS4IOP907Oqwnv3lgNIASCUSmrI6kIW+xfOnARUBIPCCVvd+LsPMILOYiNctC9a OV95rhelRBAfFtkYoRGmSyFhQwJkecHZ4yEDjrWD6XZwmT6dw8GVJez5LtS05pPjtYBK d1eieIxWhKMCBSpJhOAKhdm58ngUHAq2m/uZR9TUEMreoevxbt8iV393Wp+/3ov/tHy5 BRfg== X-Received: by 10.107.169.10 with SMTP id s10mr27770862ioe.138.1437305085653; Sun, 19 Jul 2015 04:24:45 -0700 (PDT) Original-Received: by 10.64.126.137 with HTTP; Sun, 19 Jul 2015 04:24:45 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4001:c05::232; country=US; region=Iowa; city=Council Bluffs; latitude=41.2619; longitude=-95.8608; http://maps.google.com/maps?q=41.2619,-95.8608&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01OSboLTf - d1b738a3d4e0 - 20150719 (trained as not-spam) Received-SPF: pass (filter4-ams.mf.surf.net: domain of joasyannick@gmail.com designates 2607:f8b0:4001:c05::232 as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2607:f8b0:4001:c05::232; envelope-from=; helo=mail-ig0-x232.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) 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:91981 Archived-At: --===============0343705234== Content-Type: multipart/alternative; boundary=001a11425bd0107bfd051b38abbf --001a11425bd0107bfd051b38abbf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dear everyone, I am currently typesetting the old (published in 1707) French Bible of David Martin using ConTeXt MkIV. The source code looks like this: \startproduct martin1707 \startproject bibles % Page layout, fonts, language, etc. \startbiblebook[number=3D{1}, name=3D{Gen=C3=A9=C5=BFe}, abbreviation= =3D{Gen.}, title=3D{Le premier livre de Moy=C5=BFe dit la Gen=C3=A9=C5=BFe}] \startbiblechapter[number=3D{1}] \startbibleverse[number=3D{1}] Au commencement Dieu cr=C3=A9a les cieux & la terre. \stopbibleverse \stopbiblechapter \stopbiblebook \startbiblebook[number=3D{45}, name=3D{Romains}, abbreviation=3D{Rom.}, title=3D{Epi=C5=BFtre de =C5=BFaint Paul apo=C5=BFtre aux romains}] \startbiblechapter[number=3D{12}] \startbibleverse[number=3D{1}] Je vous exhorte donc, \bibleaddition{mes} fr=C3=A9res, par = les compa=C5=BF=C5=BFions de Dieu, que vous pr=C3=A9=C5=BFentie= z vos corps en =C5=BFacrifice vivant, =C5=BFaint, agr=C3=A9able =C3=A0 Dieu, \bibleadditi= on{qui e=C5=BFt} v=C3=B4tre rai=C5=BFonnable =C5=BFervice. \stopbibleverse \startbibleverse[number=3D{2}] Et ne vous conformez point =C3=A0 ce pr=C3=A9=C5=BFent =C5= =BFiecle, mais =C5=BFoyez transformez par le renouvellement de v=C3=B4tre entendement= , afin que vous =C3=A9prouviez quelle e=C5=BFt la volont=C3=A9 de Dieu= , bonne, & agr=C3=A9able, & parfaite. \stopbibleverse \stopbiblechapter \stopbiblebook \stopproduct As you may know, all the Bibles are divided into books, and each book into chapters, and each chapter into verses. The purpose of \startbiblebook, \startbiblechapter, and \startbibleverse is to control the formatting thereof respectively (as \startsection, \startsubsection, etc., control the formatting of sections, subsections, etc.) Now, as you see. these commands are user-defined commands with key-value options. My goal is to define the way they do the formatting with Lua. But I do not know how to do. I know a bit about programming, so learning Lua is not a problem. Thanking you in advance, All the best, Yours faithfully. --001a11425bd0107bfd051b38abbf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj48ZGl2PjxkaXY+PGRpdj48ZGl2PjxkaXY+PGRpdj48ZGl2Pjxk aXY+PGRpdj48ZGl2PjxkaXY+RGVhciBldmVyeW9uZSw8YnI+PGJyPjwvZGl2PkkgYW0gY3VycmVu dGx5IHR5cGVzZXR0aW5nIHRoZSBvbGQgKHB1Ymxpc2hlZCBpbiAxNzA3KSBGcmVuY2ggQmlibGUg b2YgRGF2aWQgTWFydGluIHVzaW5nPGJyPjwvZGl2PkNvblRlWHQgTWtJVi4gVGhlIHNvdXJjZSBj b2RlIGxvb2tzIGxpa2UgdGhpczo8YnI+PGJyPlxzdGFydHByb2R1Y3QgbWFydGluMTcwNzxicj48 L2Rpdj48ZGl2PsKgwqDCoCBc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ycyBmYWl0 aGZ1bGx5Ljxicj48L2Rpdj4NCg== --001a11425bd0107bfd051b38abbf-- --===============0343705234== 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= --===============0343705234==--