\define[1]\ChapterListNumber {\simplealignedbox{\listparameter{width}}{flushright}{#1}}
\setuplist[chapter][width=2em,distance=1em,numbercommand=\ChapterListNumber]
This now gives a toc looking the way I like. May I lay at your foot a plea for a change/additional parameter here? \setuplist[][itemalign=left/right] or something in that sense. For numbered chapters I consider an alignment as below most natural, although opinions may differ. 8 9 10 11 instead of 8 9 10 11 By the way, the \define[1] eludes me. Why this particular [1] there?
Why do you think lists use the itemgroup/itemize mechanism?
I didn’t think that exactly, but just tried it in despair and having the idea that toc items are set as an itemized list (it looks that way, isn’t it?).
Hans van der Meer
On 6 dec. 2013, at 20:36, Wolfgang Schuster
Am 06.12.2013 um 20:20 schrieb H. van der Meer
: Indeed, \setuplist[chapter][width=3em] makes the chapternumber set in a wider field.
But the alignment is as bad as it was: flushleft, i.e. the 1 of chapter 10 still aligns with the units from the lower chapters instead of aligning to the zero.
I looked up \setuplist in the command catalogue but cannot find a parameter to align this number, either to the right or to the left. It just seems to stick with the builtin default.
\define[1]\ChapterListNumber {\simplealignedbox{\listparameter{width}}{flushright}{#1}}
\setuplist[chapter][width=2em,distance=1em,numbercommand=\ChapterListNumber]
\starttext
\title{Table of contents}
\placecontent
\dorecurse{20}{\chapter{Chapter #1}}
\stoptext
I tried something like \setupitemgroup[chapter][][][itemalign=left (also tried right)] but to no avail. Wolfgang