# [NTG-context] How to use \setuplist for formatting a chapter entry?

Rob Heusdens robheus at xs4all.nl
Tue Feb 3 12:15:57 CET 2015

>
> You have to write your own layout for the complete list entry. When you
> donât
> need hyperlinks for the list entries you can use âalternative=commandâ
> of âalternative=interactiveâ for \setuplist.
>
> \setupcombinedlist[content][list=chapter]
>
> \definefiller[ChapterFiller]
>
> \define[3]\ChapterListEntry
>   {\vbox{Hoofdstuk #1 â #2 \filler[ChapterFiller] #3}}
>
> \setuplist[chapter][alternative=interactive,command=\ChapterListEntry]
>
> \starttext
> \completecontent
> \dorecurse{5}{
> \chapter {Knuth} \input knuth
> \chapter {Zapf}  \input zapf}
> \stoptext
>
> Wolfgang
>

Hello Wolfgang,

The example works. However, if I do the same changes you made to my
example to my actual document, the result is different for some reason.

The chapter entry in the list (TOC) gets printed like:

"#1   #2 . . . . . . . . . . .  #3"

So the "Hoofdstuk" and " -- " element is not printed, and title is on a
fixed position. The entry IS interactive (printed green but not bold).

Here are my changes (replaced \ChapterToc for \ChapterListEntry)

\definefiller[ChapterFiller]

\define[3]\ChapterToc%
{\vbox{\bf Hoofdstuk #1 -- #2 \filler[ChapterFiller] #3}}

\setuplist[chapter][alternative=interactive,command=\ChapterToc]

And my list is defined like this:

\definecombinedlist[content][chapter,section,intro,summary,appendix,back]
\setupcombinedlist[content][level=4, alternative=c]

I don't understand why making the same changes you did to the example,
performed on my document, makes a difference.

Can other \setuplist  definitions have something to do with it?

Here are some other definitions I used:

\setuplist[chapter][alternative=interactive,command=\ChapterToc]