ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Alan Bowen <bowenalan03@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] start/end pages in ToC
Date: Tue, 26 Mar 2024 17:34:26 -0400	[thread overview]
Message-ID: <CAFMOkGUcnhbYoLpE1dcw1mQG6TpVmc5Kpa977eoAW0HvDo2uyQ@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2926 bytes --]

Our journal is currently in the process of moving to continuous publication
of items in a given volume as they are ready. This entails re-jigging the
ToC so that it now includes the start and end page numbers of each item. So
far, I have everything pretty much in the right place, but for the page
numbers I am getting only “??”. I am not sure why this is happening and
would be grateful if someone could tell me why or point me to
documentation that explains the problem and how to solve it.

Many thanks in advance.

My minimalish working example:

\definehead[SourceTitle][chapter]
\setuphead[SourceTitle][page=yes,
footer={ItemData}]

\definehead[StudyTitle][chapter]
\setuphead[StudyTitle][page=yes,
footer={ItemData}]

\definetext[ItemData][footer][
{\at[\Reference]–
\at[\namedstructureuservariable{}{authorInitials}endPage]}
]
\setuplist[SourceTitle][
state=start,
textcolor=black,
alternative=startendpages,
criterium=all,
headnumber=no,
interaction=page,
numberalign=flushright,
before={\blank[2.2ex, fixed]},
inbetween=\endgraf,
]

\setuplist[StudyTitle][
state=start,
textcolor=black,
alternative=startendpages,
criterium=all,
headnumber=no,
interaction=all,
numberalign=flushright,
before={\blank[2.2ex, fixed]},
inbetween=\endgraf,
]

\define\ToCEntry{%
\structurelistuservariable{author}\crlf
\structurelistuservariable{title}\hfill%
\at[\structurelistuservariable{reference}]–%
\at[\structurelistuservariable{authorInitials}endPage]
}

\definelistalternative[startendpages]
[renderingsetup=list:startendpages]

\startsetups[list:startendpages]
{\ToCEntry}
\vglue1pc
\stopsetups

\starttext

{\tfa\bf Contents}

\blank[line, fixed]
\WORD{Sources}
\blank[halfline, fixed]
\placelist[SourceTitle][criterium=all]

\blank[line, fixed]
\WORD{Studies}
\blank[halfline, fixed]
\placelist[StudyTitle][criterium=all]

\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSo01}
\startSourceTitle[reference={\Reference},
bookmark=Source01,
title={}][
title=Source01,
author=Author01,
authorInitials=ABC,
reference={\Reference},
]
\input knuth
\page
\dorecurse{25}{\input ward\par}
\reference[ABCendPage]{}
\stopSourceTitle
\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSo02}
\startSourceTitle[reference={\Reference},
bookmark=Source02,
title={}][
author=Author02,
title=Source02,
authorInitials=PQR,
reference={\Reference},
]

\input knuth
\page
\dorecurse{10}{\input ward\par}
\reference[PQRendPage]{}
\stopSourceTitle
\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSt01}
\startStudyTitle[reference={\Reference},
bookmark=Study01,
title={}][
author=Author03,
title=Study01,
authorInitials=XYZ,
reference={\Reference},
]
\input knuth
\blank[big]
\page
\dorecurse{15}{\input ward\par}
\reference[XYZendPage]{}
\stopStudyTitle
\page[makeup]
\stoptext

Alan

[-- Attachment #1.2: Type: text/html, Size: 4083 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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	other threads:[~2024-03-26 21:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAFMOkGUcnhbYoLpE1dcw1mQG6TpVmc5Kpa977eoAW0HvDo2uyQ@mail.gmail.com \
    --to=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).