On 2/9/2025 2:47 PM, Bruce Horrocks wrote:


On 9 Feb 2025, at 12:00, Bruce Horrocks <n...@scorecrow.com> wrote:


Try this:

\def\doPageNumber#1{\the\numexpr -1 + #1\relax\ · #1}
\setupcombinedlist[content][list={chapter}]
\setuplist[chapter][pagecommand=\doPageNumber]

\starttext
\completecontent
\page
\doloopoverlist
  {one,two,three,four,five}
  {\chapter{Title \recursestring}
   \input tufte
   \page
  }
\stoptext


P.S. This works using ConTeXt ver: 2024.12.30 16:14 but fails using ConTeXt 
ver: 2025.02.07 20:46 (for me at least).

You've just been lucky then

\def\doPageNumber#1%
  {%\the\numexpr #1 - 1\relax\ · #1}% #1 is not a number
   %\the\numexpr \structurelistrealpagenumber - 1\relax\ · #1}
   \tointeger{\structurelistrealpagenumber - 1} · #1}

\setupcombinedlist[content][list={chapter}]

\setuphead
  [chapter]
  [expansion=yes]

\setuplist
  [chapter]
  [pagecommand=\doPageNumber]

\starttext
    \completecontent
    \page
    \doloopoverlist
      {one,two,three,four,five}
      {
        \chapter{Title \recursestring}
        \samplefile{tufte}
        \page
      }
\stoptext

#1 is a 'typeset number' so even if it expands (not always btw) to soem digit you get something but then if also some relax creeps in the \numexpr scanning stops prematurely

you also (likely) want that one, two etc in the list

Hans



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to