ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez <oinos@gmx.es>
To: ntg-context@ntg.nl
Subject: Re: two additional pagenumber series
Date: Wed, 29 Apr 2020 19:20:47 +0200	[thread overview]
Message-ID: <5f38b45f-11ca-07e1-06b3-febd7e74a134@gmx.es> (raw)
In-Reply-To: <8ad8e5bb-f2d8-940f-3ab9-d322e007326e@gmail.com>

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
___________________________________________________________________________________

  reply	other threads:[~2020-04-29 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 12:00 Pablo Rodriguez
2020-04-29 13:32 ` Wolfgang Schuster
2020-04-29 17:20   ` Pablo Rodriguez [this message]
2020-04-29 13:36 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f38b45f-11ca-07e1-06b3-febd7e74a134@gmx.es \
    --to=oinos@gmx.es \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).