On 29 Jan 2024, at 19:15, Wolfgang Schuster
Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:
Am 26.01.24 um 23:46 schrieb jbf:
I wonder if someone can point me in the right direction for a separate TOC which needs to be in chronological order at the back of the book (i.e. not in page number order, although I need the page numbers to show up in the TOC. There is the normal TOC at the front of the book, according to chapter titles.
I have succeeded in defining a separate TOC to place at the back, but have not succeeded in the chronological order! Here is what I have done:
\definelist[chron][criterium=all,alternative=c]
At the back of the book:
\placelist[chron][criterium=all]
Then at an appropriate point after each \startchapter I have placed (as an example):
\writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}
This gives me my list, but in page number order. How do I get the date (e.g. 29 April 2017) to be the ordering factor in the list. I assume it will be something to do with criterium, but am clueless at the moment on how to indicate this. I don’t know if it works this way (the wizards will know a way), but for special needs I’m (ab)using indexes: just add something like \index[2017-04-29]{Speech, Panama City} to your chapter command and setup the index at will.
Lists have a sort option but this is no use here because you can't use the title to have a chronological sorted list.
\starttext
\placelist[section][order=title]
\section{Hans}
\section{Peter}
\section{Anton}
\stoptext
Using the register mechanism as you suggest seems to be the best option in this case.
The order= mechanism doesn't seem to work for \definelist lists as opposed to the built-in ones, viz: \definelist[chron] \starttext \placelist[section][order=title] \section{Hans} \writetolist[chron]{}{Hans} \section{Peter} \writetolist[chron]{}{Peter} \section{Anton} \writetolist[chron]{}{Anton} \placelist[chron][criterium=all,order=title] \stoptext — Bruce Horrocks Hampshire, UK