summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-pag.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/strc-pag.lua')
-rw-r--r--tex/context/base/strc-pag.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/tex/context/base/strc-pag.lua b/tex/context/base/strc-pag.lua
index 460d4ff00..bce965546 100644
--- a/tex/context/base/strc-pag.lua
+++ b/tex/context/base/strc-pag.lua
@@ -69,6 +69,9 @@ function pages.save(prefixdata,numberdata)
end
end
+-- We can set the pagenumber but as it only get incremented in the page
+-- builder we have to make sure it starts at least at 1.
+
function counters.specials.userpage()
local r = texcount.realpageno
if r > 0 then
@@ -78,7 +81,16 @@ function counters.specials.userpage()
if trace_pages then
report_pages("forcing pagenumber of realpage %s to %s",r,t.number)
end
+ return
+ end
+ end
+ local u = texcount.userpageno
+ if u == 0 then
+ if trace_pages then
+ report_pages("forcing pagenumber of realpage %s to %s (probably a bug)",r,1)
end
+ counters.setvalue("userpage",1)
+ texcount.userpageno = 1
end
end