ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Bruce Horrocks <ntg@scorecrow.com>
To: ntg-context mailing list <ntg-context@ntg.nl>
Subject: [NTG-context] Re: How can a macro check how many items are in a list?
Date: Tue, 5 Nov 2024 18:21:25 +0000	[thread overview]
Message-ID: <EDE4EECA-6F59-4BCA-BFEF-C2A43AE66874@scorecrow.com> (raw)
In-Reply-To: <9ce0b651-44c8-4c34-beec-5da7de645d53@freedom.nl>


On 4 Nov 2024, at 17:52, Hans Hagen via ntg-context <ntg-context@ntg

> And then for Bruce to come up with the singular / plural variant for

Thanks Hans.

A “pluraliser” for item/item, entry/entries etc is overkill given that only one person has requested the feature so far and, mainly, I have no idea how a multi-lingual version might work. :-)

In English texts it is quite common to write “item(s)” when it is not certain how many are being referred to. This works quite nicely in Context:

  \def\item(s){\if\upcomingnofitems 1{item}\else{items}\fi}

which allows:

  This list has \upcomingnofitems\ \item(s)

in the source.

So I’m going to suggest that we leave it for individual users to do what’s simplest for them. I’ll add something to the wiki when this comes out in the next release.

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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
___________________________________________________________________________________

      reply	other threads:[~2024-11-05 18:23 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 ` [NTG-context] " Joel via ntg-context
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 [this message]

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=EDE4EECA-6F59-4BCA-BFEF-C2A43AE66874@scorecrow.com \
    --to=ntg@scorecrow.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).