Proper formatting of itemized bullets in ConTeXt
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. Thanks in advance. Amine
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
On 4/12/22 1:57 PM A A via ntg-context wrote:
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.
I revisited this today after the (frankly) subpar solution I presented yesterday. With the below example, we • neither lose the nice features of \setupitemgroup • nor do we need grouping of the items. The only 'price to pay' is to use \citem (comma item) and \pitem (period item) as required. %% start example \def\citem{\item\AfterPar{\hspace[-normal],}\GetPar} \def\pitem{\item\AfterPar{\hspace[-normal].}\GetPar} \defineitemgroup [pitemize] [command=\Word,numberconversion=words] \starttext \startpitemize[n] \citem first item \citem second item \citem third item \pitem fourth item \stoppitemize \stoptext %% stop example Best, Sreeram
On 4/13/22 7:37 AM śrīrāma wrote:
I revisited this today after the (frankly) subpar solution I presented yesterday. With the below example, we • neither lose the nice features of \setupitemgroup • nor do we need grouping of the items. The only 'price to pay' is to use \citem (comma item) and \pitem (period item) as required.
cleaned up the example – %% start example \def\citem{\item\AfterPar{\hspace[-normal],}\GetPar} \def\pitem{\item\AfterPar{\hspace[-normal].}\GetPar} \defineitemgroup [pitemize] [command=\Word] \starttext \startpitemize[n] \citem first item \citem second item \citem third item \pitem fourth item \stoppitemize \stoptext %% stop example Sreeram
participants (2)
-
A A
-
śrīrāma