From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113509 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio via ntg-context" Newsgroups: gmane.comp.tex.context Subject: Re: Macro for a comma separated list of authors Date: Wed, 24 Nov 2021 21:51:01 -0500 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8545997031522700404==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7565"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Jairo A. del Rio" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 25 03:51:37 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 1mq4rI-0001mN-A7 for gctc-ntg-context-518@m.gmane-mx.org; Thu, 25 Nov 2021 03:51:36 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id EE16F28956A; Thu, 25 Nov 2021 03:51:17 +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 PQ6UHeAKiqux; Thu, 25 Nov 2021 03:51:16 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 94E2128959D; Thu, 25 Nov 2021 03:51:16 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4122728956A for ; Thu, 25 Nov 2021 03:51:15 +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 0LmCOxMxXEHv for ; Thu, 25 Nov 2021 03:51:14 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.41; helo=mail-wm1-f41.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 E1DAB282AD3 for ; Thu, 25 Nov 2021 03:51:13 +0100 (CET) Original-Received: by mail-wm1-f41.google.com with SMTP id j140-20020a1c2392000000b003399ae48f58so7096143wmj.5 for ; Wed, 24 Nov 2021 18:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=JEGgIN1aZ/OuwiJVfiVPmrOn6beltPv450/iFHGRd6g=; b=gXwWhQXEmtuB16cPWnin1PvRLHRTjJuqP2/UQlI3dg0qVno884+PW5tYLgHZ0z9fy5 aMQpeU9RWLuInprX4tYXlM3iDULp+koFMwPTFWIrd1byk+VwKSL6b4K0IEPHoB4Qh7RY CPfSJzxag2/mBVAZYT9iv611lnY5f6EmDAdfYROA3pn1MHvmpZOwPoOciOC/IzWbC/Zm 7O6ub1ncE9P00RfgL8FVCcMDkP95qzo2CmPgPdj+gURD1+FAhe8OR7URwAWe42PiuU7W DFkYZg+M2/o/vO4jqnQbKeUHSBEwfPO9yp3tulFJ4CT9IPjQuOwS4+5zUgOQ5HtsxGUP MRPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=JEGgIN1aZ/OuwiJVfiVPmrOn6beltPv450/iFHGRd6g=; b=yTKhmWu8bIXO0Qd2As7Dnu27LCsZBtrbU1hXWlSGVbIKMQvPFnwS6TFm0tM9nd0TAC 6fEBQldXlVK829LAcRDbuJY0tumBHRfUefmHpw1q38b0XXGslUsUI8WlUqxhVAR1Sa71 K22APzxQDBj4yJHGxXelmwtvmJdUWDSllR4nwoF66CnDNOb2beGlw0maXr6/1gScpncR p8zQh1nUUuHQECizKAsDhphKzHYMwgxxykls1msoxIqNThbYlzIa2jBmSqRLIgD3SDz2 3Rn0Ty6TOvQ5iSl+wzSMaXCf2f/zfP1USv+avN3STdqO/r95qP5RI4qxaPVVmXoYVKPR zjEg== X-Gm-Message-State: AOAM5309pGA0hHtMBpB/X4GDIHdV3DNjSB18xKPXTQPbSd8iBf5y2sH0 n1XJuNCamYWQMgrTB0u8nBVJjqBnx6PolB4/U5mtRsBcneQbZQ== X-Google-Smtp-Source: ABdhPJyXHYefRCdWdMNDfVQ2T8X4cpDgJf1nBgfJW88j/+JmkEdWGUJevNh7k05VvI/LiDeKmsq6faR3SMSTkHLvxOc= X-Received: by 2002:a05:600c:3b8f:: with SMTP id n15mr3066553wms.180.1637808673099; Wed, 24 Nov 2021 18:51:13 -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:113509 Archived-At: --===============8545997031522700404== Content-Type: multipart/alternative; boundary="0000000000002b958c05d1940c7c" --0000000000002b958c05d1940c7c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hola. Maybe you need \commalistsentence? \def\Autores{% {Luis David G=C3=B3mez-M=C3=A9ndez, Ph. D.}, {Adriana del Pilar Pulido-Villamar=C3=ADn, M. Sc.}, {Rubiela Casta=C3=B1eda-Salazar, M. Sc.}, {Juan Carlos Ulloa-Rubiano, Ph. D.}, {Adriana Matiz-Villamil, M. Sc.}, {Fidson Juarismy Vesga-P=C3=A9rez, Ph. D}% } \starttext \commalistsentence[\Autores][{;\space},{\space\letterampersand\space}] \stoptext Check lang-lab.mkxl for other goodies and examples. Best regards, Jairo El mi=C3=A9, 24 de nov. de 2021 a la(s) 19:10, Andres Conrado Montoya via ntg-context (ntg-context@ntg.nl) escribi=C3=B3: > I'm trying to produce a document with several authors, using macros for > comma separated lists. My MWE is as follows: > > %%%%%%%%%%%%%%%%%%%%%% > \def\autores{% > {Luis David G=C3=B3mez-M=C3=A9ndez, Ph. D.}, > {Adriana del Pilar Pulido-Villamar=C3=ADn, M. Sc.}, > {Rubiela Casta=C3=B1eda-Salazar, M. Sc.}, > {Juan Carlos Ulloa-Rubiano, Ph. D.}, > {Adriana Matiz-Villamil, M. Sc.}% > } > > \def\lastAutor{Fidson Juarismy Vesga-P=C3=A9rez, Ph. D} > > \def\autorParaLista#1{#1;\space} > \def\listaAutores{\processcommacommand[\autores]\autorParaLista & > \lastAutor: autores.} > > \starttext > > \listaAutores > > \stoptext > %%%%%%%%%%%%%%%%%%%%%%% > > So far, no luck trying to extract the last item from a comma separated > list. That's the reason I created a "\lastAutor" macro, so I can treat th= e > last one differently. > > This produces: > > %%%%%% > Luis David G=C3=B3mez-M=C3=A9ndez, Ph.D.; Adriana del Pilar Pulido-Villam= ar=C3=ADn, M. > Sc.; Rubiela Casta=C3=B1eda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, P= h.D.; > Adriana Matiz-Villamil, M. Sc.; & Fidson Juarismy Vesga-P=C3=A9rez, Ph.D: > autores. > %%%%%% > > However, what I'm trying to get is: > > %%%%%% > Luis David G=C3=B3mez-M=C3=A9ndez, Ph.D.; Adriana del Pilar Pulido-Villam= ar=C3=ADn, M. > Sc.; Rubiela Casta=C3=B1eda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, P= h.D.; > Adriana Matiz-Villamil, M. Sc. & Fidson Juarismy Vesga-P=C3=A9rez, Ph.D: = autores. > %%%%%% > > Which is very close to what I need, except the ";" just before the "&". S= o > the question is: is it possible to do this in a more effective or simpler= , > or better way, and write a macro that outputs something like "Author1; > Author2; Author3 & Author4: authors.", given a comma separated list of > authors? > > -- > Andr=C3=A9s Conrado Montoya > Andi K=C3=BA > andresconrado@gmail.com > http://sesentaycuatro.com > http://messier87.com > http://chiquitico.org > ---------------------------------------- > Los fines no justifican los medios, porque la medida verdadera de nuestro > car=C3=A1cter est=C3=A1 dada por los medios que estamos dispuestos a util= izar, no por > los fines que proclamamos. > ---------------------------------------- > > =E2=80=9CYou develop an instant global consciousness, a people orientatio= n, an > intense dissatisfaction with the state of the world, and a compulsion to = do > something about it. From out there on the moon, international politics lo= ok > so petty. You want to grab a politician by the scruff of the neck and dra= g > him a quarter of a million miles out and say, =E2=80=98Look at that, you = son of a > bitch.=E2=80=99=E2=80=9D =E2=80=94 Apollo 14 astronaut Edgar Mitchell > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --0000000000002b958c05d1940c7c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hola.

Maybe you need \commalis= tsentence?

\def\Autores{%
=C2=A0 {Luis David G=C3=B3mez-M=C3=A9nd= ez, Ph.=E2=80=89D.},
=C2=A0 {Adriana del Pilar Pulido-Villamar=C3=ADn, M= .=E2=80=89Sc.},
=C2=A0 {Rubiela Casta=C3=B1eda-Salazar, M.=E2=80=89Sc.},=
=C2=A0 {Juan Carlos Ulloa-Rubiano, Ph.=E2=80=89D.},
=C2=A0 {Adriana = Matiz-Villamil, M.=E2=80=89Sc.},
=C2=A0 {Fidson Juarismy Vesga-P=C3=A9re= z, Ph.=E2=80=89D}%
}
\starttext
\commalistsentence[\Autores][{;\sp= ace},{\space\letterampersand\space}]
\stoptext

Check l= ang-lab.mkxl for other goodies and examples.

Best r= egards,

Jairo

El mi=C3=A9, 24 de nov. de 2021 a la(s) 19:10= , Andres Conrado Montoya via ntg-context (ntg-context@ntg.nl) escribi=C3=B3:
I'm trying to produce a do= cument with=C2=A0several authors, using macros for comma separated lists. M= y MWE is as follows:=C2=A0

%%%%%%%%%%%%%%%%%%%%%%
<= div>\def\autores{%
=C2=A0 {Luis David G=C3=B3mez-M=C3=A9ndez, Ph.=E2=80= =89D.},
=C2=A0 {Adriana del Pilar Pulido-Villamar=C3=ADn, M.=E2=80=89Sc.= },
=C2=A0 {Rubiela Casta=C3=B1eda-Salazar, M.=E2=80=89Sc.},
=C2=A0 = {Juan Carlos Ulloa-Rubiano, Ph.=E2=80=89D.},
=C2=A0 {Adriana Matiz-Vill= amil, M.=E2=80=89Sc.}%
}

\def\lastAutor{Fidson Juarismy Vesga-P= =C3=A9rez, Ph.=E2=80=89D}

\def\autorParaLista#1{#1;\space}
\def\l= istaAutores{\processcommacommand[\autores]\autorParaLista & \lastAutor:= autores.}

\starttext

\listaAutores

\stoptext
= %%%%%%%%%%%%%%%%%%%%%%%

So far, no luck trying to = extract the last item from a comma separated list. That's the reason I = created a "\lastAutor" macro, so I can treat the last one differe= ntly.=C2=A0

This produces:=C2=A0

%%%%%%
Luis David G=C3=B3mez-M=C3=A9ndez, Ph.D.; Adriana = del Pilar Pulido-Villamar=C3=ADn, M. Sc.; Rubiela Casta=C3=B1eda-Salazar, M= . Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.; Adriana Matiz-Villamil, M. Sc.; &a= mp; Fidson Juarismy Vesga-P=C3=A9rez, Ph.D: autores.
%%%= %%%

However, what I'm trying to get is:=C2=A0
=

%%%%%%
Luis David G=C3=B3mez-M=C3=A9ndez= , Ph.D.; Adriana del Pilar Pulido-Villamar=C3=ADn, M. Sc.; Rubiela Casta=C3= =B1eda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.; Adriana Matiz-Vil= lamil, M. Sc. & Fidson Juarismy Vesga-P=C3=A9rez, Ph.D: autores.
%%%%%%

Which is very clos= e to what I need, except the ";" just before the "&"= ;. So the question is: is=C2=A0it possible to do this in a more effective o= r simpler, or better way, and write a macro that outputs something like &qu= ot;Author1; Author2; Author3 & Author4: authors.", given a comma s= eparated list of authors?=C2=A0

--
Andr=C3=A9s Conrado MontoyaAndi K=C3=BA
andresconrado@gmail.com
http://sesentaycuatro.com
http://chiquitico.org
----------------------------------------
Los fines no justifican l= os medios, porque la medida verdadera de nuestro car=C3=A1cter est=C3=A1 da= da por los medios que estamos dispuestos a utilizar, no por los fines que p= roclamamos.
----------------------------------------

=E2=80=9CYou = develop an instant global consciousness, a people orientation,=20 an intense dissatisfaction with the state of the world, and a compulsion to do something about it. From out there on the moon, international=20 politics look so petty. You want to grab a politician by the scruff of=20 the neck and drag him a quarter of a million miles out and say, =E2=80=98Lo= ok at that, you son of a bitch.=E2=80=99=E2=80=9D =E2=80=94 Apollo 14 astronaut = Edgar Mitchell

___________________________________________________________________________= ________
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
___________________________________________________________________________= ________
--0000000000002b958c05d1940c7c-- --===============8545997031522700404== 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== --===============8545997031522700404==--