* Macro for a comma separated list of authors
@ 2021-11-25 0:09 Andres Conrado Montoya via ntg-context
2021-11-25 2:51 ` Jairo A. del Rio via ntg-context
0 siblings, 1 reply; 3+ messages in thread
From: Andres Conrado Montoya via ntg-context @ 2021-11-25 0:09 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Andres Conrado Montoya
[-- Attachment #1.1: Type: text/plain, Size: 2502 bytes --]
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ómez-Méndez, Ph. D.},
{Adriana del Pilar Pulido-Villamarín, M. Sc.},
{Rubiela Castañeda-Salazar, M. Sc.},
{Juan Carlos Ulloa-Rubiano, Ph. D.},
{Adriana Matiz-Villamil, M. Sc.}%
}
\def\lastAutor{Fidson Juarismy Vesga-Pérez, 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ómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
Adriana Matiz-Villamil, M. Sc.; & Fidson Juarismy Vesga-Pérez, Ph.D:
autores.
%%%%%%
However, what I'm trying to get is:
%%%%%%
Luis David Gómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
Adriana Matiz-Villamil, M. Sc. & Fidson Juarismy Vesga-Pérez, Ph.D: autores.
%%%%%%
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?
--
Andrés Conrado Montoya
Andi Kú
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ácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.
----------------------------------------
“You 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, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
[-- Attachment #1.2: Type: text/html, Size: 3352 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Macro for a comma separated list of authors
2021-11-25 0:09 Macro for a comma separated list of authors Andres Conrado Montoya via ntg-context
@ 2021-11-25 2:51 ` Jairo A. del Rio via ntg-context
0 siblings, 0 replies; 3+ messages in thread
From: Jairo A. del Rio via ntg-context @ 2021-11-25 2:51 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Jairo A. del Rio
[-- Attachment #1.1: Type: text/plain, Size: 3773 bytes --]
Hola.
Maybe you need \commalistsentence?
\def\Autores{%
{Luis David Gómez-Méndez, Ph. D.},
{Adriana del Pilar Pulido-Villamarín, M. Sc.},
{Rubiela Castañeda-Salazar, M. Sc.},
{Juan Carlos Ulloa-Rubiano, Ph. D.},
{Adriana Matiz-Villamil, M. Sc.},
{Fidson Juarismy Vesga-Pérez, Ph. D}%
}
\starttext
\commalistsentence[\Autores][{;\space},{\space\letterampersand\space}]
\stoptext
Check lang-lab.mkxl for other goodies and examples.
Best regards,
Jairo
El mié, 24 de nov. de 2021 a la(s) 19:10, Andres Conrado Montoya via
ntg-context (ntg-context@ntg.nl) escribió:
> 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ómez-Méndez, Ph. D.},
> {Adriana del Pilar Pulido-Villamarín, M. Sc.},
> {Rubiela Castañeda-Salazar, M. Sc.},
> {Juan Carlos Ulloa-Rubiano, Ph. D.},
> {Adriana Matiz-Villamil, M. Sc.}%
> }
>
> \def\lastAutor{Fidson Juarismy Vesga-Pérez, 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ómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
> Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
> Adriana Matiz-Villamil, M. Sc.; & Fidson Juarismy Vesga-Pérez, Ph.D:
> autores.
> %%%%%%
>
> However, what I'm trying to get is:
>
> %%%%%%
> Luis David Gómez-Méndez, Ph.D.; Adriana del Pilar Pulido-Villamarín, M.
> Sc.; Rubiela Castañeda-Salazar, M. Sc.; Juan Carlos Ulloa-Rubiano, Ph.D.;
> Adriana Matiz-Villamil, M. Sc. & Fidson Juarismy Vesga-Pérez, Ph.D: autores.
> %%%%%%
>
> 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?
>
> --
> Andrés Conrado Montoya
> Andi Kú
> 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ácter está dada por los medios que estamos dispuestos a utilizar, no por
> los fines que proclamamos.
> ----------------------------------------
>
> “You 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, ‘Look at that, you son of a
> bitch.’” — 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
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 5254 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Macro for a comma separated list of authors
@ 2021-11-28 0:52 Andres Conrado Montoya via ntg-context
0 siblings, 0 replies; 3+ messages in thread
From: Andres Conrado Montoya via ntg-context @ 2021-11-28 0:52 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Andres Conrado Montoya
[-- Attachment #1.1: Type: text/plain, Size: 936 bytes --]
Gracias, Jairo! This works great. I will go ahead and document it on the
wiki, if that's Ok.
--
Andrés Conrado Montoya
Andi Kú
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ácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.
----------------------------------------
“You 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, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
[-- Attachment #1.2: Type: text/html, Size: 1400 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-28 0:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 0:09 Macro for a comma separated list of authors Andres Conrado Montoya via ntg-context
2021-11-25 2:51 ` Jairo A. del Rio via ntg-context
2021-11-28 0:52 Andres Conrado Montoya via ntg-context
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).