> On 30 Mar 2024, at 19:59, Alan Bowen <bowenala...@gmail.com> wrote: > > How can I get the last page number of a chapter for a list (ToC)? > > Outside of a list, I use \lastpagenumber. > But that does not work in a list such as the ToC. > > Any tips or pointers will be gladly received.
I'm not quite sure what you want to do with these numbers: something like printing out a contents page but instead of the start page of a chapter it shows the last page of the chapter? If so then try creating a custom list and use \writetolist immediately before each \stopchapter command? \definelist[LastPages][criterium=all] \starttext \completecontent \page \completelist[LastPages] \page \dorecurse{10}{ \startchapter[title={This is my chapter}] This is a chapter\par \dorecurse{6}{\input knuth } \input math-kontinuitet-sv \writetolist[LastPages]{3.}{\namedstructurevariable{chapter}{title}} \stopchapter } \stoptext But I can't get the number option of \writetolist to work - the "3." above is ignored. :-( — Bruce Horrocks Hampshire, UK ___________________________________________________________________________________ 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 ___________________________________________________________________________________