From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/109182 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio" Newsgroups: gmane.comp.tex.context Subject: Re: context.delayed as parameter of setuphead[before=...] Date: Mon, 2 Nov 2020 21:28:19 -0500 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6245019888033444462==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16989"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 03 03:28:51 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZm42-0004Hr-1P for gctc-ntg-context-518@m.gmane-mx.org; Tue, 03 Nov 2020 03:28:50 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 893351A9CFF; Tue, 3 Nov 2020 03:28:34 +0100 (CET) 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 wfMCSayssQUa; Tue, 3 Nov 2020 03:28:33 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 909741A9D01; Tue, 3 Nov 2020 03:28:33 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2C99B1A9CFF for ; Tue, 3 Nov 2020 03:28:32 +0100 (CET) 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 BoB-z46vN9CP for ; Tue, 3 Nov 2020 03:28:31 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.46; helo=mail-wm1-f46.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id F354D1A9CE5 for ; Tue, 3 Nov 2020 03:28:30 +0100 (CET) Original-Received: by mail-wm1-f46.google.com with SMTP id h22so11322311wmb.0 for ; Mon, 02 Nov 2020 18:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=z/ZM6iELjYoAItV69LAgprNrLx3ugcJt4T14MV8O1uY=; b=mAcYGV7po/ovNp9LtmrR4uo+6cbAjSFdXozZZaafQA8IzaX/1GRuaaXbaxCCFGzaDD ZPJFzVkdyuNmEbC9mzQM7SXEYh3VdvIf7jk4AinRSTBl0MXYWF5zzxe042dNUd6p0W0f eXamQIo4ddvY/thY3ly6k1eniAGzqlSwMAQLdOF2UYdYhj76Bdj50Y/NoVPosUtXfS7x Y5ofjaEIdwttZMtXZumHU1V+HqelgqIhkz5zpa6j1z3Jiz1MY5O591s3CP1Uz/S9fXtz 0YfmOv7j9Xmv217Vh/e6DTjueWUxBHIIyUUmu3hfe6ctkY1B68VBhVFQTgWYPRwBtd0j VWSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=z/ZM6iELjYoAItV69LAgprNrLx3ugcJt4T14MV8O1uY=; b=JyBkFBzit7XvTUpDCx6dgXrtnt8zTkNKZDYEUMEysiMlzru9tjNHahctnl121YyUfJ kC5OK5/uaV89C98xO1IXK/s5HDLh3FWQ88mA2wZOuj8pm7VYzvR0FF9ee3TEvoMkS+CY 4iJspF3TSJ68SJgzCQQuFT7qmD2PhfScVJNwltDzPrqOvz4V+MopktLPukNdZeAvdG4C 6yCy3Hdo6tYs8+/sROlUMh4C4nfcO1VxEwYgMavV8u6l7GyCxTBcvUuw61HHE0Q5kaQe vPHJnktXBdYCLprV5DjymtS9QYepakoP0asWXyxUFvIG2o1C4RiRLUpD4jOFyiEmqURf 0BAg== X-Gm-Message-State: AOAM532qnfBMEtRL1NMAwVAXfEE7KoqMa6c96Ja3ZpOIDPUU4eUR93ni uCrwtEp/XXU3KUZ6aRPmcfGlN6Lriz/gCGQzB888mneQV8r7sA== X-Google-Smtp-Source: ABdhPJxy7ks9jVJmJzqhz1/z4CCIe7APQSObTMaBr/45gfnFEWZ9f6WESJtFqA5vMbRJw0f8gQCchaFbSaxjtpZQxck= X-Received: by 2002:a1c:f612:: with SMTP id w18mr1006986wmc.11.1604370510431; Mon, 02 Nov 2020 18:28:30 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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.io gmane.comp.tex.context:109182 Archived-At: --===============6245019888033444462== Content-Type: multipart/alternative; boundary="0000000000005cc6dc05b32a9e08" --0000000000005cc6dc05b32a9e08 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On the Lua side, you'll have to pass strings so your example works, as tables like those in setuphead({somehead}, {somesettings}) are actual Lua tables and follow Lua, not TeX, rules (see e.g. Lua reference in https://www.lua.org/manual/5.4/ or, better, CLD manual in http://www.pragma-ade.nl/general/manuals/cld-mkiv.pdf): \starttext \startluacode --First example for m =3D 1, 3 do context.setuphead({'chapter'}, {before=3D'hello'}) context.startchapter({title=3D"I'm a chapter!"}) for i =3D 1, 3 do context.input("knuth") end context.stopchapter() end --Second example --We'll pass some strings to TeX local nice =3D "ConTeXt is love, ConTeXt is life" local somehead =3D 'chapter' local sometext =3D 'vallejo-trilce-es' context.setuphead({somehead}, {before=3Dnice}) context.startchapter({title=3Dsomehead}) context.input(sometext) context.stopchapter() \stopluacode \stoptext I hope examples help. Regards, Jairo :) El lun., 2 de nov. de 2020 a la(s) 21:09, Sylvain Hubert ( champignoom@gmail.com) escribi=C3=B3: > Dear List, > > I'm trying to mirror the context command > `\setuphead[chapter][before=3Dhello]` > into lua with delayed typesetting of 'hello', but > `\ctxlua{context.setuphead({'chapter'}, > {before=3Dcontext.delayed'hello'})}` > does not have any effect. Could anyone help me on this? Thanks! > > Best, > Sylvain > > _________________________________________________________________________= __________ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > _________________________________________________________________________= __________ > --0000000000005cc6dc05b32a9e08 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On the Lua sid= e, you'll have to pass strings so your example works, as tables like th= ose in setuphead({somehead}, {somesettings}) are actual Lua tables and foll= ow Lua, not TeX, rules (see e.g. Lua reference in https://www.lua.org/manual/5.4/ or, better, CLD manu= al in htt= p://www.pragma-ade.nl/general/manuals/cld-mkiv.pdf):


\starttext

\startluacode =

--First exampl= e

for m =3D 1, 3= do

context.se= tuphead({'chapter'}, {before=3D'hello'})

context.st= artchapter({title=3D"I'm a chapter!"})

for i =3D = 1, 3 do

contex= t.input("knuth")

end

context.st= opchapter()

end


--Second examp= le

--We'll pa= ss some strings to TeX

local nice =3D "ConTeXt is love, ConTeXt is life"=

local somehead= =3D 'chapter'

local sometext= =3D 'vallejo-trilce-es'


context.setuph= ead({somehead}, {before=3Dnice})

context.startc= hapter({title=3Dsomehead})

context.input(= sometext)

context.stopch= apter()

\stopluacode

\stoptext

<= p style=3D"margin:0px;text-indent:0px;white-space:pre-wrap">

I hope examples help.=

Regard= s,

Jairo :)



El lun., 2 de nov. de 2020 a la(s) 21:09, Sylvain Hubert (champignoom@gmail.com) escribi=C3=B3= :
Dear List,

I'm trying to mirror the co= ntext command
=C2=A0 `\setuphead[chapter][before=3Dhello]`
<= div>into lua with delayed typesetting of 'hello', but
=C2= =A0 `\ctxlua{context.setuphead({'chapter'}, {before=3Dcontext.delay= ed'hello'})}`
does not have any effect. Could anyone help= me on this? Thanks!

Best,
Sylvain
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--0000000000005cc6dc05b32a9e08-- --===============6245019888033444462== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============6245019888033444462==--