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.mkiv50
1 files changed, 37 insertions, 13 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 0e30d92fa03..8d326e30022 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv
@@ -145,6 +145,7 @@
\xdef\currentstructureshownumber {\structureparameter\c!number}%
\xdef\currentstructuresaveinlist {\structureparameter\c!saveinlist}%
\xdef\currentstructureincrementnumber{\structureparameter\c!incrementnumber}%
+ \xdef\currentstructureplaceholder {\structureparameter\c!placeholder}%
\ifx\currentstructureexpansion\s!xml
\xmlstartraw
\xdef\currentstructuretitle {\structureparameter\c!title}%
@@ -797,7 +798,7 @@
\glet\currentstructuresynchronize\donothing
\to \everyheadsynchronization
-\unexpanded\def\theheadsynchonization
+\unexpanded\def\theheadsynchronization
{% no, interferes: \signalcharacter
\the\everyheadsynchronization}
@@ -926,7 +927,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\let\getheadtitle\fullheadtitle
\ifconditional\headshownumber
\let\getheadnumber\fullheadnumber
@@ -940,7 +941,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\ifconditional\c_strc_sectioning_section
\strc_rendering_place_head_section
\else
@@ -952,7 +953,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\strc_rendering_place_head_empty % just flush 'm
\dostoptagged
\strc_sectioning_after_nop
@@ -963,7 +964,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\let\getheadtitle\fullheadtitle
\strc_rendering_place_head_text
\dostoptagged
@@ -971,7 +972,7 @@
\else\ifconditional\c_strc_sectioning_hidden
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\dostarttagged\t!sectioncaption\empty
\ifconditional\c_strc_sectioning_section
\strc_rendering_place_head_section
@@ -985,7 +986,7 @@
\strc_sectioning_register{#1}{#2}{#3}% after optional \page
\strc_sectioning_report
\dostarttagged\t!sectioncaption\empty
- \let\getheadsyncs\theheadsynchonization
+ \let\getheadsyncs\theheadsynchronization
\strc_rendering_place_head_empty % just flush 'm
\dostoptagged
\strc_sectioning_after_nop
@@ -997,12 +998,26 @@
\setfalse\c_strc_sectioning_ignore_page
% ignorespaces prevents spaces creeping in when after=\dontleavehmode
\dostarttagged\t!sectioncontent\empty
- \ifconditional\headisdisplay
- \ignorespaces
+ \ifx\currentstructureplaceholder\empty
+ \ifconditional\headisdisplay
+ \doubleexpandafter\ignorespaces
+ \else
+ \doubleexpandafter\ignorepars
+ \fi
\else
- \expandafter\GotoPar
+ \expandafter\strc_sectioning_placeholder
\fi}
+%D \starttyping
+%D \startsubject[placeholder=todo,title=one]
+%D whatever one
+%D \stopsubject
+%D \stoptyping
+
+\def\strc_sectioning_placeholder
+ {\placeholder[\currentstructureplaceholder]%
+ \gobblenested{\e!start\currenthead}{\e!stop\currenthead}{\e!stop\currenthead}}
+
% typesetting (the getters are public)
\unexpanded\def\strc_rendering_place_head_number_and_text
@@ -1029,14 +1044,14 @@
\def\strc_sectioning_delayed_flush
{\ifvoid\b_sectioning_delayed\else
- \smashboxed\b_sectioning_delayed
+ \smashedbox\b_sectioning_delayed
\fi}
\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
+ \theheadsynchronization
\egroup}
\unexpanded\def\strc_rendering_place_head_hidden % maybe trialtypesetting check
@@ -1046,7 +1061,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
+ \theheadsynchronization}} % and it's a node anyway
\def\synchronizehead #1{\csname\??hiddenheadsync#1\endcsname}
\def\theheadreferenceattributes#1{\csname\??hiddenheadattr#1\endcsname}
@@ -1283,6 +1298,14 @@
\fi
\glet\previoushead\currenthead}
+\def\strc_sectioning_depth_correction
+ {\ifvmode
+ \edef\p_depthcorrection{\headparameter\c!depthcorrection}%
+ \ifx\p_depthcorrection\v!strut
+ \prevdepth\strutdepth
+ \fi
+ \fi}
+
\def\strc_sectioning_after_yes
{\ifconditional\headisdisplay
\ifconditional\c_strc_sectioning_auto_break
@@ -1290,6 +1313,7 @@
\fi
\strc_sectioning_empty_correction
\headparameter\c!after
+ \strc_sectioning_depth_correction
\fi}
\unexpanded\def\strc_sectioning_prevent_page_break % see strc-con