From: "śrīrāma via ntg-context" <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
A A <amine.aboufirass@gmail.com>
Cc: śrīrāma <citturs@gmail.com>
Subject: Re: Proper formatting of itemized bullets in ConTeXt
Date: Tue, 12 Apr 2022 20:13:47 +0530 [thread overview]
Message-ID: <5557166.DvuYhMxLoT@sreeramtplt> (raw)
In-Reply-To: <CAMwawgMyvNpRbk_Q83qN65f+19BFB7uo=QmST-+-WPkM=FfXOQ@mail.gmail.com>
On 4/12/22 1:57 PM A A via ntg-context wrote:
> Dear All,
>
> Is there a straightforward way of setting up the itemize command such that
> every first letter is capitalized, regardless of whether I do so in the
> source file?
>
> Also, is there a way to insert a comma at the end of each item except for
> the last, and then a full stop at the end of the last item like follows?
>
> - First item,
> - Second item,
> - Third item,
> - Last item.
If this is just for unnumbered lists, then the following should suffice:
%%% start example
\defineitemgroup
[pitemize]
[command=\Word]
\define\citem{%
\incrementnumber[itemgroup:pitemize]%
\sym{\symbol[\currentitemgroupsymbol]}%
\groupedcommand{}{,}%
}
\define\pitem{%
\incrementnumber[itemgroup:pitemize]%
\sym{\symbol[\currentitemgroupsymbol]}%
\groupedcommand{}{.}%
}
\starttext
\startpitemize
\citem {first item}
\citem {second item}
\citem {third item}
\pitem {fourth item}
\stoppitemize
\stoptext
%%% stop example
For numbered lists, more work is required I think. For example, you might need something like
\unprotect
\define\citem{%
\incrementnumber[itemgroup:pitemize]%
\sym{%
\itemgroupparameter\c!left%
\getnumber[itemgroup:pitemize]%
\itemgroupparameter\c!stopper%
\itemgroupparameter\c!right
}%
\groupedcommand{}{,}%
}
\define\pitem{%
\incrementnumber[itemgroup:pitemize]%
\sym{%
\itemgroupparameter\c!left%
\getnumber[itemgroup:pitemize]%
\itemgroupparameter\c!stopper%
\itemgroupparameter\c!right
}%
\groupedcommand{}{.}%
}
\protect
but this still does not provide for the various possible conversion sets and other features of \setupitemgroup. See strc-itm.mklx for hints.
Sreeram
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2022-04-12 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 8:27 A A via ntg-context
2022-04-12 14:43 ` śrīrāma via ntg-context [this message]
2022-04-13 2:07 ` śrīrāma via ntg-context
2022-04-13 2:09 ` śrīrāma 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=5557166.DvuYhMxLoT@sreeramtplt \
--to=ntg-context@ntg.nl \
--cc=amine.aboufirass@gmail.com \
--cc=citturs@gmail.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).