diff options
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.mkiv | 84 |
1 files changed, 69 insertions, 15 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..0e30d92fa03 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/strc-sec.mkiv @@ -430,6 +430,9 @@ }% \doifelselist\currenthead\donothing {\definelist[\currenthead][\c!prefix=\v!no]}% + % we can't do this now for backward compatibility reasons + % \doifelselist\currenthead\donothing + % {\normalexpanded{\definelist[\currenthead][\currentheadparent][\c!prefix=\v!no]}}% \else \normalexpanded {% \setheadparameter{\c!label}{\currenthead}% @@ -637,10 +640,20 @@ \triggerautostructurelevel \strc_sectioning_handle{#1}{\c!reference={#2},\c!ownnumber={#3},\c!title={#4}}{}} % name ref nr title -- +% \unexpanded\def\strc_sectioning_handle_nop_indeed[#1][#2]% for taco: [key=value] variant +% {\setfalse\currentstructureown +% \triggerautostructurelevel +% \doifelseassignment{#2}\strc_sectioning_handle_nop_indeed_yes\strc_sectioning_handle_nop_indeed_nop{#1}{#2}} + \unexpanded\def\strc_sectioning_handle_nop_indeed[#1][#2]% for taco: [key=value] variant {\setfalse\currentstructureown \triggerautostructurelevel - \doifelseassignment{#2}\strc_sectioning_handle_nop_indeed_yes\strc_sectioning_handle_nop_indeed_nop{#1}{#2}} + \ifcondition\validassignment{#2}% + \expandafter\strc_sectioning_handle_nop_indeed_yes + \else + \expandafter\strc_sectioning_handle_nop_indeed_nop + \fi + {#1}{#2}} \unexpanded\def\strc_sectioning_handle_nop_indeed_yes#1#2% {\strc_sectioning_handle{#1}{#2}{}} @@ -1143,16 +1156,6 @@ \prevdepth\strutdepth \fi} -\def\strc_sectioning_after_yes - {\ifconditional\headisdisplay - \ifconditional\c_strc_sectioning_auto_break - % \vspacing[\v!samepage-\currentheadlevel]% - \vspacing[\v!samepage]% - \fi - \strc_sectioning_empty_correction - \headparameter\c!after - \fi} - \def\strc_sectioning_after_nop {} @@ -1215,6 +1218,47 @@ \fi \glet\previoushead\currenthead} +% \def\strc_sectioning_handle_page_yes +% {\ifconditional\c_strc_sectioning_ignore_page +% \setfalse\c_strc_sectioning_ignore_page +% \else +% % beware, these numbers are not yet know here +% \strc_sectioning_handle_page_nop +% \edef\p_aligntitle{\headparameter\c!aligntitle}% +% \ifx\p_aligntitle\v!float +% \ifconditional\c_strc_sectioning_auto_break +% \vspacing[\v!samepage-\currentheadlevel]% +% \fi +% \headparameter\c!before\relax +% \indent +% \else +% \page_otr_command_flush_side_floats +% \ifconditional\c_strc_sectioning_auto_break +% \vspacing[\v!samepage-\currentheadlevel]% +% \fi +% \headparameter\c!before\relax +% \fi +% \global\c_strc_sectioning_preceding_level\currentheadlevel +% \fi +% \glet\previoushead\currenthead} +% +% \unexpanded\def\strc_sectioning_prevent_page_break% see strc-con +% {\ifconditional\c_strc_sectioning_auto_break +% \vspacing[\v!samepage-\the\numexpr\currentheadlevel+\plusone\relax]% +% \fi} +% +% \def\strc_sectioning_after_yes +% {\ifconditional\headisdisplay +% \ifconditional\c_strc_sectioning_auto_break +% % \vspacing[\v!samepage-\currentheadlevel]% +% \vspacing[\v!samepage]% +% \fi +% \strc_sectioning_empty_correction +% \headparameter\c!after +% \fi} + +% This works better in columns ... but also elsewhere? + \def\strc_sectioning_handle_page_yes {\ifconditional\c_strc_sectioning_ignore_page \setfalse\c_strc_sectioning_ignore_page @@ -1224,14 +1268,14 @@ \edef\p_aligntitle{\headparameter\c!aligntitle}% \ifx\p_aligntitle\v!float \ifconditional\c_strc_sectioning_auto_break - \vspacing[\v!samepage-\currentheadlevel]% + \spac_vspacing_same_page\currentheadlevel\zerocount \fi \headparameter\c!before\relax \indent \else \page_otr_command_flush_side_floats \ifconditional\c_strc_sectioning_auto_break - \vspacing[\v!samepage-\currentheadlevel]% + \spac_vspacing_same_page\currentheadlevel\zerocount \fi \headparameter\c!before\relax \fi @@ -1239,11 +1283,21 @@ \fi \glet\previoushead\currenthead} -\unexpanded\def\strc_sectioning_prevent_page_break#1% see strc-con +\def\strc_sectioning_after_yes + {\ifconditional\headisdisplay + \ifconditional\c_strc_sectioning_auto_break + \spac_vspacing_same_page\currentheadlevel\plusone + \fi + \strc_sectioning_empty_correction + \headparameter\c!after + \fi} + +\unexpanded\def\strc_sectioning_prevent_page_break % see strc-con {\ifconditional\c_strc_sectioning_auto_break - \vspacing[\v!samepage-\the\numexpr\currentheadlevel+\ifx#1\empty\plusone\else#1\fi\relax]% + \spac_vspacing_same_page\currentheadlevel\plustwo \fi} + % We do support negative numbers but it can have side effects that we won't catch: % % \chapter{some} \setupheadnumber[chapter][3] \chapter{more} |