[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”
> instead
> 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:

\definehead[intro][chapter]
\definehead[back][chapter]
\definehead[appendix][chapter]
\definehead[summary][section]


\setuplist[chapter][alternative=interactive,command=\ChapterToc]
\setuplist[section][headnumber=no]
\setuplist[summary][headnumber=no]
\setuplist[appendix][headnumber=no,style=bold,textcommand=\AppendixToc]
\setuplist[back][headnumber=no,style=bold,textcommand=\BackToc]


Entries for appendix chapter and back chapter get printed correctyly but
they don't have chapter number, only normal chapters have that.

Still puzzled by this...

Rob



More information about the ntg-context mailing list