Csikos Bela schrieb am 15.10.2023 um 15:51:
Hello:
I would like to make a long numbered itemize list, where the numbers
increase up to three digits.
I would like the numbered labels aligned to the right and the widest
label's left side located at the left margin.
I tried the below code but the 3 digit labels' left sides go into the
left margin. How can I fix it?
Code:
\showframe
\starttext
\startitemize[n,broad][itemalign=flushright]
\dorecurse{250}{\item aaaa}
\stopitemize
\stoptext
You can use the width-key to set a value for the number, below is a
example for method
to calculate the width based on the number of items but I would use
fixed value
(e.g. width=2em) to let all items (independent of the entries) start on
the same position.
\defineexpandable\ItemWidth
{\ifnum\lastcountervalue[itemgroup:itemize]>99
\widthofstring{000.}%
\orelse\ifnum\lastcountervalue[itemgroup:itemize]>9
\widthofstring{00.}%
\else
\widthofstring{0.}%
\fi}
\showframe[text][text]
\starttext
\startitemize[n][width=\ItemWidth,itemalign=flushright]
\dorecurse{1}{\startitem xxx\stopitem}
\stopitemize
\page
\startitemize[n][width=\ItemWidth,itemalign=flushright]
\dorecurse{11}{\startitem xxx\stopitem}
\stopitemize
\page
\startitemize[n][width=\ItemWidth,itemalign=flushright]
\dorecurse{111}{\startitem xxx\stopitem}
\stopitemize
\stoptext
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________