From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Alan Bowen <bowenalan03@gmail.com>
Subject: [NTG-context] Re: last page number for a list
Date: Wed, 3 Apr 2024 17:55:44 +0200 [thread overview]
Message-ID: <eab3e740-d153-452d-427f-d8374b2caf73@gmail.com> (raw)
In-Reply-To: <CAFMOkGUCGuiDS9+ZwTzEvjhs7A2jJ5Abhvsv8z-K+=BG3Qx7Ng@mail.gmail.com>
Alan Bowen schrieb am 30.03.2024 um 20:59:
> 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.
You can try this:
\definepagestate[alanpage]
\definecounter [alanindex]
\setuphead
[chapter]
[insidesection={\setpagestate[alanpage]},
aftersection={\setpagestate[alanpage]}]
\setuphead
[title]
[insidesection=,
aftersection=]
\define[1]\ChapterListPage
{\pagestaterealpage{alanpage}{\number\numexpr\incrementedcounter[alanindex]\relax}%
\thinspace --\thinspace
\pagestaterealpage{alanpage}{\number\numexpr\incrementedcounter[alanindex]\relax}}
\setuplist[chapter][pagecommand=\ChapterListPage]
\setuplist[chapter][pagecommand=\ChapterListPage]
\showgrid
\starttext
\completecontent
\startchapter [title=Knuth]
\dorecurse{12}{\samplefile{knuth}}
\stopchapter
\startchapter [title=Zapf]
\dorecurse{12}{\samplefile{zapf}}
\stopchapter
\stoptext
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________
prev parent reply other threads:[~2024-04-03 15:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-30 19:59 [NTG-context] " Alan Bowen
2024-04-03 10:55 ` [NTG-context] " Bruce Horrocks
2024-04-03 15:16 ` Alan Bowen
2024-04-03 15:55 ` Wolfgang Schuster [this message]
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=eab3e740-d153-452d-427f-d8374b2caf73@gmail.com \
--to=wolfgang.schuster.lists@gmail.com \
--cc=bowenalan03@gmail.com \
--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).