* two additional pagenumber series
@ 2020-04-29 12:00 Pablo Rodriguez
2020-04-29 13:32 ` Wolfgang Schuster
2020-04-29 13:36 ` Hans Hagen
0 siblings, 2 replies; 4+ messages in thread
From: Pablo Rodriguez @ 2020-04-29 12:00 UTC (permalink / raw)
To: mailing list for ConTeXt users
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?
Many thanks for your help,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: two additional pagenumber series
2020-04-29 12:00 two additional pagenumber series Pablo Rodriguez
@ 2020-04-29 13:32 ` Wolfgang Schuster
2020-04-29 17:20 ` Pablo Rodriguez
2020-04-29 13:36 ` Hans Hagen
1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2020-04-29 13:32 UTC (permalink / raw)
To: mailing list for ConTeXt users, Pablo Rodriguez
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]
\appendtoks
\incrementcounter[section:chapter]%
\incrementcounter[section:section]%
\to \everybeforepagebody
\startsetups[header:pagenumber]
\starttabulate[|l|rw(1em)|]
\NC Pagenumber \EQ \pagenumber \NC\NR
\NC Chapter \EQ \rawcountervalue[section:chapter] \NC\NR
\NC Section \EQ \rawcountervalue[section:section] \NC\NR
\stoptabulate
\stopsetups
\setupheadertexts[\directsetup{header:pagenumber}]
\starttext
%\dorecurse{10}{\samplefile{lorem}}
\dorecurse{5}
{\chapter{Chapter \convertnumber{word}{#1}}
\dorecurse{5}
{\section{Section \convertnumber{word}{##1}}
\dorecurse{\numexpr#1+##1\relax}{\samplefile{lorem}}}}
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: two additional pagenumber series
2020-04-29 12:00 two additional pagenumber series Pablo Rodriguez
2020-04-29 13:32 ` Wolfgang Schuster
@ 2020-04-29 13:36 ` Hans Hagen
1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2020-04-29 13:36 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 4/29/2020 2:00 PM, Pablo Rodriguez wrote:
> 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?
\setuppapersize[A8]
\setupheadertexts[]
\setupcounter[subpage][way=bychapter]
\starttext
\chapter{what}
\rawsubcountervalue[subpage][1]\page
\rawsubcountervalue[subpage][1]\page
\rawsubcountervalue[subpage][1]\page
\chapter{what}
\rawsubcountervalue[subpage][1]\page
\rawsubcountervalue[subpage][1]\page
\rawsubcountervalue[subpage][1]\page
\stoptext
-----------------------------------------------------------------
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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: two additional pagenumber series
2020-04-29 13:32 ` Wolfgang Schuster
@ 2020-04-29 17:20 ` Pablo Rodriguez
0 siblings, 0 replies; 4+ messages in thread
From: Pablo Rodriguez @ 2020-04-29 17:20 UTC (permalink / raw)
To: ntg-context
On 4/29/20 3:32 PM, Wolfgang Schuster wrote:
> 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.
>> [...]
>> 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.
Many thanks for your reply, Wolfgang.
The text structure is more complex. The document uses sections as
second-level chapters. I mean, they have a page break before.
It is a huge book, divided in parts, which contains units. Each unit
contains the standard explanation, different explanation approaches, and
other additional information in some units.
Each unit is a chapter. The explanation, the exercise sets and the
additional material are a section each. And both chapters and sections
need to be numbered as page/lastpage (for each).
> 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]
>
> \appendtoks
> \incrementcounter[section:chapter]%
> \incrementcounter[section:section]%
> \to \everybeforepagebody
It is clear to me now what makes it works.
Now I have to adapt this to the huge document.
Many thanks for your help again,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-29 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 12:00 two additional pagenumber series Pablo Rodriguez
2020-04-29 13:32 ` Wolfgang Schuster
2020-04-29 17:20 ` Pablo Rodriguez
2020-04-29 13:36 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).