summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv42
1 files changed, 33 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv
index 3b473343afe..6f2b56f8285 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ins.mkiv
@@ -1,6 +1,6 @@
%D \module
-%D [ file=core-ins,
-%D version=2002.04.16,
+%D [ file=page-ins,
+%D version=2002.04.16, % was core-ins
%D title=\CONTEXT\ Insertion Macros,
%D subtitle=Insertions,
%D author=Hans Hagen,
@@ -38,6 +38,26 @@
%c!factor=\plusthousand,
\c!location=\v!page]
+\newconstant\insertionmigrationmode
+
+\def\page_inserts_check_anchoring
+ {\edef\p_anchoring{\namedinsertionparameter\empty\c!anchoring}%
+ \insertionmigrationmode\ifx\p_anchoring\v!auto\plusone\else\zerocount\fi
+ \clf_setinsertmigration{\p_anchoring}}
+
+\appendtoks
+ \ifx\currentinsertionparent\empty
+ \page_inserts_check_anchoring
+ \fi
+\to \everysetupinsertion
+
+\setupinsertion
+ [\c!anchoring=\v!none]
+
+\appendtoks
+ \page_inserts_check_anchoring
+\to \everystarttext % or \everyjob
+
\newcount\currentinsertionnumber % This is a count and not a macro !
\newtoks\t_page_inserts_list
@@ -63,7 +83,9 @@
% \floatingpenalty\zerocount
\appendtoks
- \page_inserts_synchronize_registers
+ \ifx\currentinsertionparent\empty \else
+ \page_inserts_synchronize_registers
+ \fi
\to \everysetupinsertion
\unexpanded\def\page_inserts_process#1% beware, this adapts currentinsertion !
@@ -131,12 +153,14 @@
\to \everydefineinsertion
\appendtoks
- \clf_setupinsertion
- {\currentinsertion}
- {%
- location {\insertionparameter\c!location}%
- }%
- \relax
+ \ifx\currentinsertionparent\empty \else
+ \clf_setupinsertion
+ {\currentinsertion}
+ {%
+ location {\insertionparameter\c!location}%
+ }%
+ \relax
+ \fi
\to \everysetupinsertion
\unexpanded\def\page_inserts_set_location#1#2% fast one