From: Andres Conrado Montoya <andresconrado@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Using \commalistsentence in combination with \processcommacommand... I'm going mad?
Date: Tue, 16 Sep 2025 23:18:06 -0500 [thread overview]
Message-ID: <CAGhDZhBtphi8UBOY3Oz+7XdoJZO2PHf-s+PMrkS=VeL964MPmw@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2662 bytes --]
Hi list. This is probably the wrong thing to do. However, it's what I have
been trying:
% MWE %%%%%%%%%%%%%%%%%%%%%%
% Registro de autores
\definenamespace[autores][
type=module,
name=autor,
command=yes,
parent=autores,
]
\define[1]\AutorNombreApellido{\edef\currentautor{#1}{%
\doifsomething{\autorparameter{nombres}}{\autorparameter{nombres}\space}%
\doifsomething{\autorparameter{apellidos}}{\autorparameter{apellidos},}%
}}
\define[1]\ListaAutores{{\AutorNombreApellido{#1}}\space}
\define\autoresListaH{\processcommacommand[\documentvariable{autores}]\ListaAutores}
\defineautor[autores][rol={autor}]
\defineautor[andi][autores][nombres={Andrés Conrado}, apellidos={Montoya
Acosta}]
\defineautor[soni][autores][nombres={Sonia Amparo}, apellidos={Rodríguez
Rodríguez}]
\defineautor[sofi][autores][nombres={Sofía}, apellidos={Parra Albarracín}]
\startdocument[autores={andi,soni,sofi}]
\commalistsentence[\documentvariable{autores}][{;\space},{\space\letterampersand\space}]
\blank[big]
\commalistsentence[\autoresListaH][{;\space},{\space\letterampersand\space}]
\stopdocument
%%%%%%%%%%%%%%%%%%%%%%%%%
As you may see, I'm trying to process a list of authors, based on the
examples in https://wiki.contextgarden.net/Command/startdocument and
https://wiki.contextgarden.net/Command/commalistsentence. But this is
getting convoluted and I'm convinced there must be an obvious simpler
solution I can't seem to find.
- The output comes out `Andrés Conrado Montoya Acosta, Sonia Amparo
Rodríguez Rodríguez, Sofía Parra Albarracín,`
- I want `Andrés Conrado Montoya Acosta; Sonia Amparo Rodríguez Rodríguez &
Sofía Parra Albarracín` as the first line in the output: `andi; soni & sofi`
I think I am doing something wrong, because probably it's possible to set
up the \processcommacommand to act in the same way as the
\commandlistsentence? (I'm guessing this is what I want) But I can't seem
to find how.
Also consulted:
-
https://wiki.contextgarden.net/ConTeXt_and_Lua_programming/Tutorials/System_Macros/Action_Processing
-
https://wiki.contextgarden.net/ConTeXt_and_Lua_programming/Tutorials/System_Macros/Comma_Separated_Lists
Something there should help but I'm not really sure what. Any clue would be
greatly appreciated. Thank you very much.
--
Andrés Conrado Montoya
andresconrado@gmail.com
http://sesentaycuatro.com
----------------------------------------
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.
[-- Attachment #1.2: Type: text/html, Size: 3654 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2025-09-17 4:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 4:18 Andres Conrado Montoya [this message]
2025-09-17 7:28 ` [NTG-context] " Hans Hagen via ntg-context
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGhDZhBtphi8UBOY3Oz+7XdoJZO2PHf-s+PMrkS=VeL964MPmw@mail.gmail.com' \
--to=andresconrado@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).