[NTG-context] two additional pagenumber series

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Wed Apr 29 15:32:01 CEST 2020

Pablo Rodriguez schrieb am 29.04.2020 um 14:00:
> Dear list,
> for one of the documents I share with others, I need to add five
> pagenumber series.
> I’m already using realpage, userpage and subpage. I have just tried to
> use \definecounter, but it doesn’t work.
>      \setuppapersize[A9]
>      \definecounter[ncounter]
>          [way=bychapter]
>      \starttext
>      \rawcountervalue[ncounter]\page
>      \incrementcounter[ncounter][1]
>      \page
>      \lastcountervalue[ncounter]
>      \chapter{}
>      \lastcountervalue[ncounter]
>      \stoptext
> I don’t know how to link any page increment to the defined counter.
> Although method is page, this seems to be related to a different issue.
> My question is: how could I get new pagenumber series using \definecounter?

While I think there are better solutions to your problem (e.g. adding 
the section number as prefix) you can increment a counter with each page.

The hard part is to find a hook for this because AFAIK there is no 
simple key to do this (e.g. \setuppaper[setups=...]). What you have to 
do in this case is to append the counter settings to a token register 
which is called when ConTeXt has finished a page.

\definecounter [section:chapter] [way=bychapter]
\definecounter [section:section] [way=bysection]

\to \everybeforepagebody

   \NC Pagenumber \EQ \pagenumber                       \NC\NR
   \NC Chapter    \EQ \rawcountervalue[section:chapter] \NC\NR
   \NC Section    \EQ \rawcountervalue[section:section] \NC\NR




   {\chapter{Chapter \convertnumber{word}{#1}}
      {\section{Section \convertnumber{word}{##1}}



More information about the ntg-context mailing list