From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110554 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio" Newsgroups: gmane.comp.tex.context Subject: Re: Loop? Date: Fri, 12 Feb 2021 13:50:58 -0500 Message-ID: References: <20210212183905.GG6275@zombi.ugr.es> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8520649200624440120==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14460"; mail-complaints-to="usenet@ciao.gmane.io" To: Angel M Alganza , mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 12 19:55:23 2021 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 1lAdb9-0003eS-98 for gctc-ntg-context-518@m.gmane-mx.org; Fri, 12 Feb 2021 19:55:23 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CD66B28096C; Fri, 12 Feb 2021 19:51:14 +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 E3FoWCHYIocr; Fri, 12 Feb 2021 19:51:13 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E5F6E28097A; Fri, 12 Feb 2021 19:51:13 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BBDF428097A for ; Fri, 12 Feb 2021 19:51:12 +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 O3Sf-IFb-LJM for ; Fri, 12 Feb 2021 19:51:11 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.50; helo=mail-wm1-f50.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 ECC8A28096C for ; Fri, 12 Feb 2021 19:51:11 +0100 (CET) Original-Received: by mail-wm1-f50.google.com with SMTP id w4so525166wmi.4 for ; Fri, 12 Feb 2021 10:51:11 -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=sQlCcathmSjWIoLlmg/gBEMp9iUIWP1oOOPAtURjJto=; b=r2wkMtywP51Zr5W+1cDQcb6izwAZtjWIl6f2h6pxr38TZF19gePppwBTDnYzvGfovw 33C8wOPmSrhrjSNYSQhADFAWwaeWjcQPkTgmr0zgY9maZMG903t4tpv/+HGAEPz7mcxM 8fkPdsHGFBwNB6x3JPUJYw7eIxCcNOcrWoBVHkanBoNwLJnvSBtxdtpGjq9KA+PasBQM X8QGiav7HQ6QR7qJpdfDVgaykXpOksdhFauxgXHQS7yEW2+Ou0OTny6Tw2hMTpwOUo6F ssMtZCeculCdAVn9ethTYVm1X6lMhMmevGFNRK5auiQR8rxQwERtuG4jfuVpfQAywW9/ aVGA== 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=sQlCcathmSjWIoLlmg/gBEMp9iUIWP1oOOPAtURjJto=; b=JkykznQ0e3Dk3U0IgxDG6FtK0dJBaNA+9qbo26pfJzyTtynkwOB2YZDFfJXz/Y9nCa lQ2yXmgQzDUYLLrFJNUJoJ1e9kqBe8Ws8i1XCRQe+5kRKZWkTwAErC3OvJN9LTIxwlk1 PC7mbHC3DnKqBdygbKhPATGeiF5TV6u9xQyNPX3AqcFs6M1GLakJWgs86W8D7hjFjbtH iLj/OJQH13K8/by1ZvPt84QV948xRBsCY8l+VhL/UzIPfDgW7+/HGCuz7zTxfj0Zpxsw OEt4fP3XtitDvetwUcCOr/yhfNimPYwcZjrLL1lhBScuQMZcD9eVFy7CI1KNbxg+heDv 40XA== X-Gm-Message-State: AOAM530BlxgcO/w3neuvZrOOazeSMgMkjmmyRHONLVGN4qT7S6hjOlGS u7dSZUMVd3qQpqlCx81xZb8eFLWmqNSW8ZqTE6I= X-Google-Smtp-Source: ABdhPJxmcivvaRjVAIlF71GmzeA2oG259sqBM3amti2QY9k/xhe9ELTCTxYGLmeEU1RTZWC1dfhQ+ehBp+02DBpAFZw= X-Received: by 2002:a1c:7217:: with SMTP id n23mr3837279wmc.183.1613155871562; Fri, 12 Feb 2021 10:51:11 -0800 (PST) In-Reply-To: <20210212183905.GG6275@zombi.ugr.es> 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:110554 Archived-At: --===============8520649200624440120== Content-Type: multipart/alternative; boundary="000000000000b11e7005bb281eb7" --000000000000b11e7005bb281eb7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, =C3=81ngel. Like this? \def\mylist{Fulano,Mengano,Sutano} \def\mycommand#1{#1\blank{\red Something here}\blank} \starttext \processcommacommand[\mylist]\mycommand \stoptext There are better ways to deal with data in ConTeXt, but it's basically that way, I think. Jairo El vie, 12 de feb. de 2021 a la(s) 13:44, Angel M Alganza (ama@ugr.es) escribi=C3=B3: > Hello: > > I am trying to print a list of names always followed by the same info > (generated by a new command). At the moment, I have all the names > followed by the command like so: > > Person Number One > \mycommand > Person Number Two > \mycommand > Person Number Three > \mycommand > Person Number Four > \mycommand > Person Number Five > \mycommand > . > . > . > > I'd rather have the list of people stored somewhere (a list? an array?) > and loop through it and then inserting \mynewcommand at compilation > time. That way, when I need to replace the list of people with a new > one, I'd just do that instead of building the above structure again and > again. > > Is it possible to do that with just ConTeXt or would I need to resort to > Lua. I guess it should be possible both ways, but I haven't figure out > how to do it. Any pointer, please? > > Thank you so much in advance. > > Cheers, > =C3=81ngel > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --000000000000b11e7005bb281eb7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, =C3=81ngel. Like this?

\def\mylist{Fu= lano,Mengano,Sutano}

\def\mycommand= #1{#1\blank{\red Something here}\blank}

\starttext

\processcommac= ommand[\mylist]\mycommand

\stoptext
=

There = are better ways to deal with data in ConTeXt, but it's basically that w= ay, I think.

Jairo



El vie, 12 de feb. de 2021 a la(s) 13:44, Angel M Alganza= (ama@ugr.es) escribi=C3=B3:
Hello:

I am trying to print a list of names always followed by the same info
(generated by a new command).=C2=A0 At the moment, I have all the names
followed by the command like so:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Person Number One
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \mycommand
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Person Number Two
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \mycommand
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Person Number Three
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \mycommand
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Person Number Four
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \mycommand
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Person Number Five
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \mycommand
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .
=C2=A0 =C2=A0 =C2=A0 =C2=A0 .

I'd rather have the list of people stored somewhere (a list? an array?)=
and loop through it and then inserting \mynewcommand at compilation
time.=C2=A0 That way, when I need to replace the list of people with a new<= br> one, I'd just do that instead of building the above structure again and=
again.

Is it possible to do that with just ConTeXt or would I need to resort to Lua.=C2=A0 I guess it should be possible both ways, but I haven't figur= e out
how to do it.=C2=A0 Any pointer, please?

Thank you so much in advance.

Cheers,
=C3=81ngel
___________________________________________________________________________= ________
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
___________________________________________________________________________= ________
--000000000000b11e7005bb281eb7-- --===============8520649200624440120== 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== --===============8520649200624440120==--