From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110555 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:52:03 -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="===============5687274589195163061==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31867"; 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:59:17 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 1lAdev-0008Ah-B4 for gctc-ntg-context-518@m.gmane-mx.org; Fri, 12 Feb 2021 19:59:17 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1CA36280962; Fri, 12 Feb 2021 19:52:19 +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 4uI13_JejCns; Fri, 12 Feb 2021 19:52:18 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 37463280968; Fri, 12 Feb 2021 19:52:18 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8BF5B28096F for ; Fri, 12 Feb 2021 19:52:16 +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 hhKZx_MDlfby for ; Fri, 12 Feb 2021 19:52:15 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.44; helo=mail-wr1-f44.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 B370D280962 for ; Fri, 12 Feb 2021 19:52:15 +0100 (CET) Original-Received: by mail-wr1-f44.google.com with SMTP id n8so353263wrm.10 for ; Fri, 12 Feb 2021 10:52:15 -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=UtOotm1QxzyUy5YBYgbylfqjR8S+ELVGk1IhnpkkCBs=; b=NkkRCy/hT4CSnRiHm9sW3dKS3dC/5aNhFJpW+0Y57Lgvum2pWbibdkDS12kQKBlVEG dxWGs2gDsLd9AOLm8Ie6FxtiHwc/grmjaGJz9gVMzcLBpTh3h9KXGCkjxp71kj5rqgrW xHSWQYVxm8yNix4TLzvbaUNpO+B1mPAPzy7+zjNtdMk5dF4GwqYFx2ssFFFJFoVx2GvO 7WzAlda5c4nSCkHP0dD9kUo8i1fcO2wOX8PmYXjLDTluKPIgr9Z7hWxTUYLAa0W2Yq2w FOzMWQoapBThhd+gGYhRH1ndY1oHguHCJqLK8gwdOmPKyZ1pS08RNv5fVRT1rHKIfEDq tQXA== 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=UtOotm1QxzyUy5YBYgbylfqjR8S+ELVGk1IhnpkkCBs=; b=mtU++UNhaf0xgTToUtfLWmBaCn/5zmBZbhPYF2Uo2nMVHZi7gh/rq7FRoCWop0PuuE VpP7u/4L0cJlnizdw4F+Z/gEFb5mjLoTclQiDm4u4ZjHVpBXkrPUbFjCu7d+HFS8DI3l w5RTogRdm9gQwhPKNbQ7+2e1Dx8C4APdc33Xz8aGHvelvJw4ajphE5/0YuRZ8lcEAv9l K7RgITV9tirO9Hrw69EUyrkeLcZuKsFyngpksgFMj8KthQozVtjgqCaDFdLGMUjNJByC +9/6XOenH1VIwXZlEiD4AOUBeHs9Djo07VbfuvYNYpp4XvfY8AAGqrnkTwEGk0LMMknt d1zw== X-Gm-Message-State: AOAM530DnzVC18LhdrSGpBUVWtAPgOxR+SErLs7PDyMGVkC02+v/ukXl t/eKrLRnrWireskXD3h2ed1tfFq2m/RAZb6oGgytQcaFEEE= X-Google-Smtp-Source: ABdhPJylsy7E/8H/yCG0f9YvBr708+6ikneJ+4wiDMcZn1S9ZCgtAgOq/qeFim6Y5JvaaqLwgepoky7QcecxlsITaz8= X-Received: by 2002:adf:f285:: with SMTP id k5mr5044733wro.285.1613155935407; Fri, 12 Feb 2021 10:52:15 -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:110555 Archived-At: --===============5687274589195163061== Content-Type: multipart/alternative; boundary="0000000000007f51df05bb282285" --0000000000007f51df05bb282285 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oops, it's "zutano". Sorry for the typo. Jairo :) El vie, 12 de feb. de 2021 a la(s) 13:50, Jairo A. del Rio ( jairoadelrio6@gmail.com) escribi=C3=B3: > 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 t= o >> 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 >> >> ________________________________________________________________________= ___________ >> > --0000000000007f51df05bb282285 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Oops, it's "zutano". Sorry for the typo= .

Jairo :)

El vie, 12 de feb. de 2021 a la(s) 13:50, Jairo = A. del Rio (jairoadelrio6@gmail.= com) escribi=C3=B3:
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
___________________________________________________________________________= ________
--0000000000007f51df05bb282285-- --===============5687274589195163061== 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== --===============5687274589195163061==--