summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv107
1 files changed, 24 insertions, 83 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
index 4066a1f38c8..4e5115a7d36 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
@@ -35,7 +35,6 @@
\c!label=,
\c!coupling=,
\c!ownnumber=,
- % \c!interaction=\v!list,
\c!sectionseparatorset=\s!default,
\c!sectionconversionset=\s!default,
\c!sectionstopper=,
@@ -54,10 +53,6 @@
\def\m_strc_references_prefix_yes{+}
\def\m_strc_references_prefix_nop{-}
-\let\currentstructurereferenceprefix\empty
-
-\installglobalmacrostack\currentstructurereferenceprefix
-
\def\strc_sectioning_set_reference_prefix
{\ifx\currentstructurereferenceprefix\empty
% nothing
@@ -69,7 +64,7 @@
\else
\setupglobalreferenceprefix[\currentstructurereferenceprefix]%
\fi\fi\fi
- \glet\currentstructurereferenceprefix\referenceprefix}
+ \let\currentstructurereferenceprefix\referenceprefix}
% why xdef ?
@@ -113,10 +108,9 @@
\def\strc_sectioning_autobookmark#1%
{\begingroup
- % \settrialtypesetting
\the\everypreroll
\nodestostring\tempstring{#1}%
- \glet\currentstructurebookmark\tempstring
+ \globallet\currentstructurebookmark\tempstring
\endgroup}
% zeros:
@@ -156,9 +150,9 @@
\strc_sectioning_autobookmark\currentstructuretitle
\fi \fi \fi
\ifx\currentstructurelist\empty
- \glet\currentstructurelist\currentstructuretitle
+ \globallet\currentstructurelist\currentstructuretitle
\fi
- \glet\currentstructurecoding\s!xml
+ \globallet\currentstructurecoding\s!xml
\else
\ifx\currentstructureexpansion\v!yes
\xdef\currentstructuretitle {\structureparameter\c!title}%
@@ -185,9 +179,9 @@
\fi \fi
\fi
\ifx\currentstructurelist\empty
- \glet\currentstructurelist\currentstructuretitle
+ \globallet\currentstructurelist\currentstructuretitle
\fi
- \glet\currentstructurecoding\s!tex
+ \globallet\currentstructurecoding\s!tex
\fi
\setnextinternalreference
\storeinternalreference\currentstructurename{\the\locationcount}%
@@ -255,7 +249,7 @@
userdata {\detokenize{#3}}% will be converted to table at the lua end
\relax
\xdef\currentstructurelistnumber{\clf_currentsectiontolist}%
- % \currentstructuresynchronize has to be called someplace, since it introduces a node
+ % \currentstructuresynchronize has to be called someplace, since it introduces a node
\setstructuresynchronization\currentstructurelistnumber
\endgroup}
@@ -346,9 +340,6 @@
\installcommandhandler \??head {head} \??head
-\installmacrostack\currenthead
-\installmacrostack\currentheadparent
-
\setuphead [%
%\c!after=,
%\c!align=,
@@ -488,18 +479,16 @@
\to \everysetuphead
\unexpanded\def\doredefinehead#1#2% called at lua end
- {\push_macro_currenthead
- \push_macro_currentheadparent
+ {\pushmacro\currenthead
+ \pushmacro\currentheadparent
\edef\currenthead{#1}%
\edef\currentheadparent{#2}%
\the\everyredefinehead\relax
- \pop_macro_currentheadparent
- \pop_macro_currenthead}
+ \popmacro\currentheadparent
+ \popmacro\currenthead}
\let\currentnamedsection\empty
-\installmacrostack\currentnamedsection
-
\unexpanded\def\startnamedsection
{\dotripleempty\strc_sectioning_start_named_section}
@@ -588,7 +577,7 @@
\fi}
\def\strc_sectioning_setup_indeed[#1][#2][#3]%
- {\push_macro_currenthead
+ {\pushmacro\currenthead
\ifthirdargument
\edef\currenthead{#1#2}% % not used at any more in mkiv (sets now)
\setupcurrenthead[#3]%
@@ -596,7 +585,7 @@
\edef\currenthead{#1}%
\setupcurrenthead[#2]%
\fi
- \pop_macro_currenthead}
+ \popmacro\currenthead}
% we share the parameters as sections are roots of heads so eventually we can
% consider \definesection -> \definehead with one argument
@@ -649,8 +638,7 @@
{\strc_sectioning_handle{#1}{\c!reference={#2},\c!title={#3}}{}} % name ref nr title --
\unexpanded\def\strc_sectioning_start_named_section[#1][#2][#3]% for the moment no grouping, too annoying with page breaks
- {\push_macro_currentnamedsection
- \push_macro_currentstructurereferenceprefix
+ {\pushmacro\currentnamedsection
\edef\currentnamedsection{#1}%
\setfalse\currentstructureown
%\globalpushmacro\currenthead % this does not work out well
@@ -671,8 +659,7 @@
\headparameter\c!aftersection
\the\everyafterhead
\resetsystemmode\currenthead
- \pop_macro_currentstructurereferenceprefix
- \pop_macro_currentnamedsection} % new, also here now
+ \popmacro\currentnamedsection} % new, also here now
\let\dostarthead\strc_sectioning_start % used at lua end
\let\dostophead \strc_sectioning_stop % used at lua end
@@ -768,25 +755,15 @@
\setfalse\headshownumber
\fi}
-% Beware, we do need some node for anchoring marks and normally a zwnj will
-% do but it interferes so we deal with it at the \LUA\ end.
-
\newtoks\everyheadsynchronization
-% \appendtoks
-% \currentstructuresynchronize
-% \to \everyheadsynchronization
-
-\let\currentstructuresynchronize\donothing
-
\appendtoks
\currentstructuresynchronize
- \glet\currentstructuresynchronize\donothing
\to \everyheadsynchronization
\unexpanded\def\theheadsynchonization
- {% no, interferes: \signalcharacter
- \the\everyheadsynchronization}
+ {\the\everyheadsynchronization
+ \currentstructuresynchronize}
% BEWARE: \marking[section]{my text} does not work as we use list indices instead
% so we need a 'keep track of raw set option' (or maybe a funny internal prefix)
@@ -825,17 +802,6 @@
\let\currentheadlevel \!!zerocount
\let\currentheadcounter \!!zerocount
-\let\strc_show_used\relax
-
-\installtextracker
- {structures.showused}
- {\let\strc_show_used\clf_showstructure}
- {\let\strc_show_used\relax}
-
-\appendtoks
- \strc_show_used
-\to \everystoptext
-
\unexpanded\def\placeheadtext {\dosingleempty\strc_sectioning_place_head_text } % use with care
\unexpanded\def\placeheadnumber{\dosingleempty\strc_sectioning_place_head_number} % use with care
@@ -876,9 +842,6 @@
\ifdefined\triggerautostructurelevel \else \let\triggerautostructurelevel\relax \fi
-\newtoks\everybeforesectionheadhandle
-\newtoks\everyaftersectionheadhandle
-
\def\strc_sectioning_handle#1#2#3% name data userdata (we can move #1 to the caller)
{\xdef\currenthead {#1}%
\xdef\currentheadcoupling{\sectionheadcoupling\currenthead}%
@@ -892,7 +855,7 @@
\strc_sectioning_initialize_placement
\strc_sectioning_initialize_number
%
- \the\everybeforesectionheadhandle
+ \flushingcolumnfloatsfalse
%
% todo: also mark (for header)
%
@@ -978,9 +941,7 @@
\strc_sectioning_after_nop
\fi\fi
\fi
- %
- \the\everyaftersectionheadhandle
- %
+ \flushingcolumnfloatstrue
\setfalse\c_strc_sectioning_ignore_page
% ignorespaces prevents spaces creeping in when after=\dontleavehmode
\dostarttagged\t!sectioncontent\empty
@@ -1022,8 +983,8 @@
\unexpanded\def\strc_rendering_place_head_section % see hidden below
{\global\setbox\b_sectioning_delayed\hpack\bgroup
\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
- \hpack\headreferenceattributes{}% also does the mark
- \theheadsynchonization
+ \hpack\headreferenceattributes{}%
+ \currentstructuresynchronize
\egroup}
\unexpanded\def\strc_rendering_place_head_hidden % maybe trialtypesetting check
@@ -1033,7 +994,7 @@
{\noexpand\letgvalue{\??hiddenheadsync\currenthead}\relax
\noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
\hpack\headreferenceattributes{}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference
- \theheadsynchonization}} % and it's a node anyway
+ \currentstructuresynchronize}} % and it's a node anyway
\def\synchronizehead #1{\csname\??hiddenheadsync#1\endcsname}
\def\theheadreferenceattributes#1{\csname\??hiddenheadattr#1\endcsname}
@@ -1042,26 +1003,6 @@
\unexpanded\def\placerawheadtext [#1]{\getspecificstructuretitle{\thenamedheadlevel{#1}}}
\unexpanded\def\placerawheadnumber[#1]{\getfullstructurenumber{\thenamedheadlevel{#1}}}
-\unexpanded\def\repeathead[#1]%
- {\begingroup
- \setupinteraction[\c!state=\v!stop]%
- \def\currenthead{#1}
- \strc_sectioning_initialize_placement
- \strc_sectioning_initialize_number
- \dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs \relax
- \def\getheadtitle {\getmarking[#1]}
- \def\getheadnumber{\getmarking[#1\v!number]}
- \strc_sectioning_before_yes
- \ifconditional\headshownumber
- \strc_rendering_place_head_number_and_text
- \else
- \strc_rendering_place_head_text
- \fi
- \dostoptagged
- \strc_sectioning_after_yes
- \endgroup}
-
% \setuphead[chapter][placehead=hidden]
% \chapter {test}
%
@@ -1213,7 +1154,7 @@
\else
\strc_sectioning_check_layout
\fi
- \glet\previoushead\currenthead}
+ \globallet\previoushead\currenthead}
\def\strc_sectioning_handle_page_yes
{\ifconditional\c_strc_sectioning_ignore_page
@@ -1237,7 +1178,7 @@
\fi
\global\c_strc_sectioning_preceding_level\currentheadlevel
\fi
- \glet\previoushead\currenthead}
+ \globallet\previoushead\currenthead}
\unexpanded\def\strc_sectioning_prevent_page_break#1% see strc-con
{\ifconditional\c_strc_sectioning_auto_break