From: Joel via ntg-context <ntg-context@ntg.nl>
To: Mailing List for ConTeXt Users <ntg-context@ntg.nl>
Cc: Joel <uaru99@yahoo.com>
Subject: [NTG-context] How can a macro check how many items are in a list?
Date: Sat, 2 Nov 2024 20:02:05 +0000 (UTC) [thread overview]
Message-ID: <692582251.5119511.1730577725919@mail.yahoo.com> (raw)
In-Reply-To: <692582251.5119511.1730577725919.ref@mail.yahoo.com>
[-- Attachment #1.1: Type: text/plain, Size: 735 bytes --]
Suppose I have a macro like this:
\define[1]\thisismylist{
This list has n items.
\startitemize #1\stopitemize
}
And in the document it might have this:
\thisismylist{\item cat\item dog\item tree
}
How can I make n display three, as there are three items?
"This list has 3 items:
1. cat2. dog3. tree
I will use this as a means to check if the description before a list needs a plural or not:
Read the prompts below:
- Do you think cats should be banned from university dormitories?- Should public schools provide free breakfast?
And that way, if there is only one prompt, it changes the instructions to be:
Read the prompt below:
- Do you think cats should be banned from university dormitories?
--Joel
[-- Attachment #1.2: Type: text/html, Size: 2599 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 parent reply other threads:[~2024-11-02 20:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <692582251.5119511.1730577725919.ref@mail.yahoo.com>
2024-11-02 20:02 ` Joel via ntg-context [this message]
2024-11-03 7:19 ` [NTG-context] " Wolfgang Schuster
2024-11-03 11:04 ` vm via ntg-context
2024-11-03 16:53 ` Bruce Horrocks
2024-11-04 17:52 ` Hans Hagen via ntg-context
2024-11-05 18:21 ` Bruce Horrocks
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=692582251.5119511.1730577725919@mail.yahoo.com \
--to=ntg-context@ntg.nl \
--cc=uaru99@yahoo.com \
/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).