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.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/tex/context/base/strc-pag.lua b/tex/context/base/strc-pag.lua
index 460d4ff00..e154c4d26 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 th epagenumber 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,8 +81,15 @@ 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
+ report_pages("forcing pagenumber of realpage %s to %s (probably a bug)",r,1)
+ counter.setvalue("userpage",1)
+ texcount.userpageno = 1
+ end
end
local function convertnumber(str,n)