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.mkiv29
1 files changed, 17 insertions, 12 deletions
diff --git a/tex/context/base/mkiv/strc-pag.mkiv b/tex/context/base/mkiv/strc-pag.mkiv
index d56f0de54..01361e2c5 100644
--- a/tex/context/base/mkiv/strc-pag.mkiv
+++ b/tex/context/base/mkiv/strc-pag.mkiv
@@ -152,7 +152,7 @@
\setupsubpagenumber
[\c!way=\v!by\v!part,
- \c!state=\v!stop]
+ \c!state=\v!start] % was stop but start looks better in logging
% Counters
@@ -263,7 +263,7 @@
\def\currentpage{\the\realpageno}% rather useless
\appendtoks
- \ifnum\realpageno>\lastpage \globallet\lastpage\lastrealpage \fi
+ \ifnum\realpageno>\lastpage \glet\lastpage\lastrealpage \fi
\to \everyinitializepagecounters
% States:
@@ -309,6 +309,8 @@
% some day ifsinglesided and ifdoublesided will become obsolete
+\newtoks\everysidedswitch
+
\appendtoks
\singlesidedfalse \setfalse\layoutisdoublesided
\doublesidedfalse \setfalse\layoutissinglesided
@@ -317,13 +319,7 @@
\processallactionsinset[\directpagenumberingparameter\c!alternative]
[ \v!singlesided=>\setsystemmode\v!singlesided\singlesidedtrue\settrue\layoutissinglesided,
\v!doublesided=>\setsystemmode\v!doublesided\doublesidedtrue\settrue\layoutisdoublesided]%
- \ifdefined\trackingmarginnotestrue
- \ifdoublesided
- \trackingmarginnotestrue
- \else
- \trackingmarginnotesfalse
- \fi
- \fi
+ \the\everysidedswitch
\pageduplexmode
\ifsinglesided
\ifdoublesided\plustwo\else\zerocount\fi
@@ -334,6 +330,16 @@
\strc_pagenumbers_set_location
\to \everysetuppagenumbering
+\appendtoks
+ \ifdefined\trackingmarginnotestrue
+ \ifdoublesided
+ \trackingmarginnotestrue
+ \else
+ \trackingmarginnotesfalse
+ \fi
+ \fi
+\to \everysidedswitch
+
\ifdefined \page_backgrounds_recalculate \else
\let\page_backgrounds_recalculate\relax
\fi
@@ -401,11 +407,10 @@
\unexpanded\def\strc_pagenumbers_check_state_change#1#2%
{\edef\m_strc_pagenumbers_state_new{\namedcounterparameter#1\c!state}%
\ifx\m_strc_pagenumbers_state_new\m_strc_pagenumbers_state_old \else
- \doifelse\m_strc_pagenumbers_state_new\v!start
- {#2\plustwo}%
- {#2\zerocount}%
+ #2\ifx\m_strc_pagenumbers_state_new\v!start\plustwo\else\zerocount\fi
\fi}
+
\appendtoks % todo: set state: none, start, stop, reset
\strc_pagenumbers_check_state_change\s!realpage\c_strc_pagenumbers_state_realpage
\to \everysetuprealpagenumber