Hello everybody,

I would like to have a document composed of TEXpages only, where each TEXpage contains one whole subsection or section. I have achieved that indeed, but I don't get to understand how the numbering of pages works in this case. I've tried to use \setcounter[userpage][\pagenumber+1]. Here is my document:

***

\setupinteraction[state=start]

\startsetups[myTEXpagesetup]
  \setupwhitespace[line]
  \setuptolerance[space]
\stopsetups

\setupfittingpage[TEXpage]
  [command=\texsetup{myTEXpagesetup},
   height=fit,
   width=210mm,
   offset=10mm]

\starttext

\startTEXpage
\startsection[title={My Section}]
\placecontent
\stopTEXpage

\setcounter[userpage][\pagenumber+1]

\startTEXpage
\startsubsection[title={My First Subsection}]
Contents
\stopsubsection
\stopTEXpage

\setcounter[userpage][\pagenumber+1]

\startTEXpage
\startsubsection[title={My Second Subsection}]
Contents
\stopsubsection
\stopTEXpage

\setcounter[userpage][\pagenumber+1]

\startTEXpage
\startsubsection[title={My Third Subsection}]
Contents
\stopsubsection
\stopTEXpage

\stopsection

\stoptext

***

The PDF browser numbers the pages correctly, and in this case they get numbers 1 to 4. But the generated list of contents in page 1 says that section "My Third Subsection" is in page 3 instead of 4, though the link correctly jumps to page 4. The (sub)section in the last TEXpage of the document gets always numbered as if it would be in the next to last TEXpage.

To make the list of contents look good, I may add one last empty TEXpage at the end of the document. But I'd still like to ask how, or if, it would be possible to make this use case work without that trick.

There's a pair more things:

When the document is composed of only one single TEXpage, then that page gets number 0 in the PDF browser, instead of number 1.

When I don't use \setcounter[userpage][\pagenumber+1] in between the TEXpages, they get numbers 1,1,1,2 in the PDF browser, while the list of contents says my subsections are in pages 1,1,0 (but the links jump always to the correct page).

Thank you for your help

Pep

p.s. As PDF browsers, I use Evince, Okular and Firefox's built-in PDF Viewer

p.p.s. I love ConTeXt :)