From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113508 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andres Conrado Montoya via ntg-context Newsgroups: gmane.comp.tex.context Subject: Macro for a comma separated list of authors Date: Wed, 24 Nov 2021 19:09:29 -0500 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6534224660448515207==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35583"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andres Conrado Montoya To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 25 01:10:49 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 1mq2Lh-00095w-Ir for gctc-ntg-context-518@m.gmane-mx.org; Thu, 25 Nov 2021 01:10:49 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7DF4428724B; Thu, 25 Nov 2021 01:10: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 dIx32TilOh0y; Thu, 25 Nov 2021 01:10:12 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3FC9E289551; Thu, 25 Nov 2021 01:10:12 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7F1462893C3 for ; Thu, 25 Nov 2021 01:10:10 +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 kHGKtz0p8Tpm for ; Thu, 25 Nov 2021 01:10:08 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.210.51; helo=mail-ot1-f51.google.com; envelope-from=andresconrado@gmail.com; receiver= Original-Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (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 F2DBB28724B for ; Thu, 25 Nov 2021 01:10:07 +0100 (CET) Original-Received: by mail-ot1-f51.google.com with SMTP id w6-20020a9d77c6000000b0055e804fa524so6842489otl.3 for ; Wed, 24 Nov 2021 16:10:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=TXz+CAZZMSgcdQMYm+x9E7kxHP+8tvUBQtfrWA8C11Q=; b=JicX5XppfGu7OPOgeWLu6YlswjqUDWTwAbigXMEvZWzxEuCCFFy/sTgxfUa6nzYN8l NK00+cKobCtlv+FeZcLun9/2eiI1NlNyWR2YoXBq0OsGAd1WjuVc4d2pHpsXY7xxj1YC aMwd248GZjpeKG2m6CS0vREqmHNgCo1CkpUTfETtuQ2cMYyaSNNI8S3sH/5jHhJl6yPy z88v5TPFueuy35Ze+j4fUmZedmJmzoYziqQO2wnG5uts4Q5lvzTfacX0kUgEDN5+BY57 BHkBQ9VMV/EL7OgMVSGsFCvYpVvsJ+H1SnNETC+olENmOCU7puy9P8+LKDs/bvb+p5h5 iW1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=TXz+CAZZMSgcdQMYm+x9E7kxHP+8tvUBQtfrWA8C11Q=; b=MuFPWLqNpjvscsxTYaEgSoxqSAdxYTXhKoSBJQTEAHvJsdfkDBmmC5l0WO3qHZe6UD 8TSVUZPPMsF6op8VKnVLZF8Sh72g/3ECMPybNmGNs+jZQ9wgJORzQKtEtEHVkLdkFJD9 4/0v0WPFL+Eh1UGWH7ZXNJoPS+j77YziNRMw7VZE8faRUsIZ9m7miSA7/ADpPOiR9Mka Z8LmwsST0my9a2eksx3IrHtsnKQQes+eaeklWRAxAEXlsNCKelhx72YOz00JwUNo0Jje ueAQGJRPxAuqvEw9V+OQ4bIwKm2S2tnS2tg0bwnSCxpu3B7Uv4WPYTnHYlQZcMrGMSPU Pxpw== X-Gm-Message-State: AOAM533rJbsnUtIYQS2BH34IYO6zvc8afLlDEK4jnX4ArWuu3QiIUlU1 Ia7v7oNv84Cn3w7SNjoDrriE7qRfqMerl+cTsKF7Xl3KE7WCoQ== X-Google-Smtp-Source: ABdhPJzi4R0wQxk94d1YZA4uPr4If2yiO+3qnN2+yKzvn/T9VLftpcH3WgFNQvtne/cdZHbeUQK/g3DHjUHDUdIoYaw= X-Received: by 2002:a05:6830:34a0:: with SMTP id c32mr18041485otu.379.1637799005477; Wed, 24 Nov 2021 16:10:05 -0800 (PST) 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:113508 Archived-At: --===============6534224660448515207== Content-Type: multipart/alternative; boundary="000000000000ef619d05d191cbad" --000000000000ef619d05d191cbad Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 the last one differently. This produces: %%%%%% 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: autores. %%%%%% However, what I'm trying to get is: %%%%%% 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: au= tores. %%%%%% Which is very close to what I need, except the ";" just before the "&". So 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? --=20 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 utiliz= ar, no por los fines que proclamamos. ---------------------------------------- =E2=80=9CYou develop an instant global consciousness, a people orientation,= 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 look so petty. You want to grab a politician by the scruff of the neck and drag him a quarter of a million miles out and say, =E2=80=98Look at that, you so= n of a bitch.=E2=80=99=E2=80=9D =E2=80=94 Apollo 14 astronaut Edgar Mitchell --000000000000ef619d05d191cbad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm trying to produce a document with=C2=A0several aut= hors, using macros for comma separated lists. My MWE is as follows:=C2=A0
%%%%%%%%%%%%%%%%%%%%%%
\def\autores{%
=C2=A0= {Luis David G=C3=B3mez-M=C3=A9ndez, Ph.=E2=80=89D.},
=C2=A0 {Adriana de= l 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.}%
}<= br>
\def\lastAutor{Fidson Juarismy Vesga-P=C3=A9rez, Ph.=E2=80=89D}
<= br>\def\autorParaLista#1{#1;\space}
\def\listaAutores{\processcommacomma= nd[\autores]\autorParaLista & \lastAutor: autores.}

\starttext
\listaAutores

\stoptext
%%%%%%%%%%%%%%%%%%%%%%%
<= div>
So far, no luck trying to extract the last item from a c= omma separated list. That's the reason I created a "\lastAutor&quo= t; macro, so I can treat the last one differently.=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-Rub= iano, Ph.D.; Adriana Matiz-Villamil, M. Sc.; & Fidson Juarismy Vesga-P= =C3=A9rez, Ph.D: autores.
%%%%%%

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

%%%%%%
Luis David G=C3=B3= mez-M=C3=A9ndez, Ph.D.; Adriana del Pilar Pulido-Villamar=C3=ADn, M. Sc.; R= ubiela Casta=C3=B1eda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.; Ad= riana Matiz-Villamil, M. Sc. & Fidson Juarismy Vesga-P=C3=A9rez, Ph.D: = autores.
%%%%%%

Whi= ch is very close to what I need, except the ";" just before the &= quot;&". So the question is: is=C2=A0it possible to do this in a m= ore effective or simpler, or better way, and write a macro that outputs som= ething like "Author1; Author2; Author3 & Author4: authors.", = given a comma separated list of authors?=C2=A0

--
<= div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature= ">
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

--000000000000ef619d05d191cbad-- --===============6534224660448515207== 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== --===============6534224660448515207==--