Bruce Horrocks schrieb am 11.09.2024 um 00:35:
On 10 Sep 2024, at 19:47, Wolfgang Schuster
wrote: You can't use page counters in running text without problems because you're working against the way how TeX constructs pages.
The only reliable way are multipass solutions like the pagestate or reference mechanism. If commands such as \pagenumber and \userpagenumber don’t work reliably then maybe the commands should be removed? Just a thought.
They work without problems when you use them to show the pagenumber in the header/footer because these elements are added when the page is finished and the values don't change anymore. What doesn't works is to use them to print the number of the current page within running text because TeX collects more text than it can fit on a single page which can result in the number of the previous page when the text is moved to the next one. Wolfgang