From: Andres Conrado Montoya <andresconrado@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Better option for a macro with lots of arguments
Date: Tue, 22 Aug 2023 21:12:59 -0500 [thread overview]
Message-ID: <CAGhDZhAHMv5kZUYgncXKB0iHV-hv2=wQTwcg65CpOgy-dGXhhg@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2228 bytes --]
I have been using the following macro to add a bunch of sections to the
start of chapters in a book, it works but I think is kind of weak:
%%%%%%%%%%%%%%%%%%%
\define[7]\metadatos{
\startsection[title={Resumen}] #1 \stopsection
\startsection[title={Palabras clave}] #2 \stopsection
\start
\language[en]
\startsection[title={Abstract}] #3 \stopsection
\startsection[title={Keywords}] #4 \stopsection
\stop
\startsection[title={¿Cómo citar este capítulo? / How to cite this book?}]
\startsubsection[title={Apa}] #5 \stopsubsection
\startsubsection[title={Chicago}] #6 \stopsubsection
\startsubsection[title={MLA}] #7 \stopsubsection
\stopsection
}
\starttext
% Then I call the macro like this:
\metadatos{spanish abstract \input knuth}{some, comma, separated, keywords,
in, spanish}{english abstract \input knuth}{same, comma, separated,
keywords, in, english}{Apa citation style for this article}{Chicago
citation style for this article}{MLA citation style for this article}
\stoptext
%%%%%%%%%%%%%%%%%%%
I've been exploring different ways to do it better, but with not much luck,
I was thinking something based in key=value assignments? setups? datasets?
Not really sure, but If you know a better solution or point me in the
direction of something I can use to replace that macro, it would be greatly
appreciated.
--
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: 2851 bytes --]
[-- Attachment #2: Type: text/plain, Size: 495 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2023-08-23 2:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 2:12 Andres Conrado Montoya [this message]
2023-08-23 8:07 ` [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='CAGhDZhAHMv5kZUYgncXKB0iHV-hv2=wQTwcg65CpOgy-dGXhhg@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).