diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl index aca1d097d12..23ffc872d38 100644 --- a/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl +++ b/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl @@ -40,13 +40,13 @@ % \definepagebreak[forsure][yes,+4] \newconditional\c_page_breaks_enabled \settrue\c_page_breaks_enabled -\newcount \c_page_breaks_prevpage +\newinteger \c_page_breaks_prevpage \newtoks\everybeforepagebreak \newtoks\everyafterpagebreak -\let\page_breaks_current_option \empty -\let\page_breaks_current_options\empty +\lettonothing\page_breaks_current_option +\lettonothing\page_breaks_current_options \installcorenamespace{pagebreakmethod} \installcorenamespace{pagebreaks} @@ -90,6 +90,7 @@ % disable reset after shipout \global\pageornamentstate\plustwo \fi + % maybe \ifcstok{#1}\emptytoks \ifparameter#1\or \page_breaks_handle{#1}% \else % so, no pagebreak when \pagebreak[] ! ! ! @@ -287,8 +288,8 @@ \newtoks\everyaftercolumnbreak \newtoks\everysynchronizecolumn -\let\page_breaks_columns_current_option \empty -\let\page_breaks_columns_current_options\empty +\lettonothing\page_breaks_columns_current_option +\lettonothing\page_breaks_columns_current_options \def\page_breaks_columns_handle#1% {\edef\page_breaks_columns_current_options{#1}% @@ -341,8 +342,8 @@ %D Test page breaks. -% \newdimen \d_page_tests_test -% \newconstant\c_page_tests_mode +% \newdimension\d_page_tests_test +% \newconstant \c_page_tests_mode \newconstant\testpagemethod % old \newconstant\testpagetrigger % old @@ -369,7 +370,7 @@ \relax} \permanent\tolerant\protected\def\checkpage[#1]#*[#2]% - {\relax % needed before \if + {\relax % look ahead prevention \endgraf \triggerpagebuilder \relax @@ -465,14 +466,17 @@ \definepagechecker[\s!unknown:2][\s!unknown:0][\c!method=2] \definepagechecker[\s!unknown:3][\s!unknown:0][\c!method=3] -\permanent\tolerant\protected\def\testpage [#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:1][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % -\permanent\tolerant\protected\def\testpageonly[#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:2][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % no penalties added to the mvl -\permanent\tolerant\protected\def\testpagesync[#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:3][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % force sync +% the \relax prevents premature expansion in case of lookahead + +\permanent\tolerant\protected\def\testpage [#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:1][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % +\permanent\tolerant\protected\def\testpageonly[#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:2][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % no penalties added to the mvl +\permanent\tolerant\protected\def\testpagesync[#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:3][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % force sync %D Test column breaks. \permanent\tolerant\protected\def\testcolumn[#1]#*[#2]% - {\ifdefined\page_otr_command_test_column + {\relax % look ahead prevention + \ifdefined\page_otr_command_test_column \ifparameter#2\or \page_otr_command_test_column[#1][#2]% \else |