summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/strc-pag.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/strc-pag.mkiv')
-rw-r--r--tex/context/base/mkiv/strc-pag.mkiv13
1 files changed, 13 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/strc-pag.mkiv b/tex/context/base/mkiv/strc-pag.mkiv
index bc4ec8888..0a55fb45f 100644
--- a/tex/context/base/mkiv/strc-pag.mkiv
+++ b/tex/context/base/mkiv/strc-pag.mkiv
@@ -237,6 +237,19 @@
\strc_pagenumbers_decrement_counters
\to \everygoodbye
+\newcount\c_strc_subpage_first_real \c_strc_subpage_first_real\plusone
+
+\appendtoks
+ \ifcase\subpageno\relax
+ \global\c_strc_subpage_first_real\realpageno
+ \or
+ \global\c_strc_subpage_first_real\realpageno
+ \fi
+\to \everybeforepagebody
+
+\def\therealsubpageno#1% new helper
+ {\the\numexpr\c_strc_subpage_first_real+#1+\minusone\relax}
+
% Equivalents (compatibility):
%
% todo: maybe leave lastpage etc lua calls