diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx | 145 |
1 files changed, 68 insertions, 77 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx index 3d46c309a72..d528151f656 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx @@ -1,7 +1,7 @@ % \iffalse % %% File: l3galley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach -%% (C) 2010-2016 The LaTeX3 Project +%% (C) 2010-2017 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -24,8 +24,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2017/02/10] -%<package>\@ifpackagelater{expl3}{2017/02/10} +\RequirePackage{expl3}[2017/03/07] +%<package>\@ifpackagelater{expl3}{2017/03/07} %<package> {} %<package> {% %<package> \PackageError{l3galley}{Support package l3kernel too old} @@ -37,7 +37,7 @@ %<package> }% %<package> \endinput %<package> } -\GetIdInfo$Id: l3galley.dtx 6878 2017-02-10 07:40:59Z joseph $ +\GetIdInfo$Id: l3galley.dtx 6984 2017-03-07 20:53:23Z joseph $ {L3 Experimental galley code} %</driver|package> %<*driver> @@ -263,7 +263,7 @@ % is retained for the rest of the paragraph. % For example, % \begin{verbatim} -% \galley_parshape_set_multi_par:nnnN { 1 } +% \galley_parshape_set_multi:nnnN { 1 } % { 2 pt , 4 pt , 6 pt } { 2 pt , 4 pt , 6 pt } \c_true_bool % \end{verbatim} % would create a paragraph shape in which the first line is the full @@ -964,6 +964,13 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\c_@@_max_penalty_int} +% \enquote{Infinite} penalty. +% \begin{macrocode} +\int_const:Nn \c_@@_max_penalty_int { 10000 } +% \end{macrocode} +% \end{variable} +% % \subsection{Independent galley levels} % % As well as the main vertical list, independent galleys are required @@ -1227,7 +1234,7 @@ % \cs{tex_parskip:D}, which will leave an unwanted break-point here % otherwise. % \begin{macrocode} - \tex_penalty:D \c_ten_thousand + \tex_penalty:D \c_@@_max_penalty_int } % \end{macrocode} % Once a cutout has been set, properly tidying up needs some work. The @@ -1251,11 +1258,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_par_update_cutout: { - \bool_if:nF - { - \seq_if_empty_p:N \g_@@_cutout_left_seq - && \seq_if_empty_p:N \g_@@_cutout_right_seq - } + \bool_lazy_and:nnF + { \seq_if_empty_p:N \g_@@_cutout_left_seq } + { \seq_if_empty_p:N \g_@@_cutout_right_seq } { \prg_replicate:nn \tex_prevgraf:D { @@ -1266,11 +1271,9 @@ } \int_compare:nNnT \l_@@_group_level_int = \etex_currentgrouplevel:D { - \bool_if:nT - { - \seq_if_empty_p:N \g_@@_cutout_left_seq - && \seq_if_empty_p:N \g_@@_cutout_right_seq - } + \bool_lazy_and:nnT + { \seq_if_empty_p:N \g_@@_cutout_left_seq } + { \seq_if_empty_p:N \g_@@_cutout_right_seq } { \bool_gset_false:N \g_@@_cutout_active_bool } } } @@ -1581,7 +1584,7 @@ \tl_if_empty:NTF \g_@@_interpar_penalty_user_tl { \bool_if:NTF \g_galley_no_break_next_bool - { \tex_penalty:D \c_ten_thousand } + { \tex_penalty:D \c_@@_max_penalty_int } { \tex_penalty:D \l_galley_interpar_penalty_int } } { @@ -1833,15 +1836,13 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_parshape_set_margins: { - \bool_if:nTF - { - \dim_compare_p:nNn \l_galley_total_left_margin_dim = \c_zero_dim - && \dim_compare_p:nNn \l_galley_total_right_margin_dim = \c_zero_dim - } - { \tex_parshape:D \c_zero } + \bool_lazy_and:nnTF + { \dim_compare_p:nNn \l_galley_total_left_margin_dim = \c_zero_dim } + { \dim_compare_p:nNn \l_galley_total_right_margin_dim = \c_zero_dim } + { \tex_parshape:D 0 \exp_stop_f: } { \tex_parshape:D - \c_one + 1 \exp_stop_f: \l_galley_total_left_margin_dim \l_galley_text_width_dim } @@ -1855,11 +1856,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_parshape_set_indents: { - \bool_if:nF - { - \seq_if_empty_p:N \l_@@_parshape_left_indent_seq - && \seq_if_empty_p:N \l_@@_parshape_right_indent_seq - } + \bool_lazy_and:nnF + { \seq_if_empty_p:N \l_@@_parshape_left_indent_seq } + { \seq_if_empty_p:N \l_@@_parshape_right_indent_seq } { \@@_parshape_set_indents:NN \l_@@_parshape_left_indent_seq @@ -1896,11 +1895,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_parshape_set_cutouts: { - \bool_if:nF - { - \seq_if_empty_p:N \g_@@_cutout_left_seq - && \seq_if_empty_p:N \g_@@_cutout_right_seq - } + \bool_lazy_and:nnF + { \seq_if_empty_p:N \g_@@_cutout_left_seq } + { \seq_if_empty_p:N \g_@@_cutout_right_seq } { \@@_parshape_set_cutouts:n { left } \@@_parshape_set_cutouts:n { right } @@ -1909,7 +1906,7 @@ \seq_count:N \l_@@_cutout_left_indent_seq - \seq_count:N \l_@@_cutout_right_indent_seq } - \int_compare:nNnTF \l_@@_tmp_int > \c_zero + \int_compare:nNnTF \l_@@_tmp_int > 0 { \@@_parshape_set_cutouts:N \l_@@_cutout_right_indent_seq } { \@@_parshape_set_cutouts:N \l_@@_cutout_left_indent_seq } \@@_parshape_set_indents:NN @@ -1943,9 +1940,9 @@ { \seq_count:N \g_@@_tmpa_seq - \seq_count:N \g_@@_tmpb_seq - + \c_one + + 1 } - \int_compare:nNnT \l_@@_tmp_int > \c_zero + \int_compare:nNnT \l_@@_tmp_int > 0 { \prg_replicate:nn { \l_@@_tmp_int } @@ -2102,10 +2099,10 @@ { \bool_if:NTF #1 { % TODO Hook for font changes required! - \dim_compare:nNnTF { \tex_fontdimen:D \c_three \tex_font:D } + \dim_compare:nNnTF { \tex_fontdimen:D 3 \tex_font:D } = \c_zero_dim { \tex_spaceskip:D \c_zero_dim } - { \tex_spaceskip:D \tex_fontdimen:D \c_two \tex_font:D } + { \tex_spaceskip:D \tex_fontdimen:D 2 \tex_font:D } } { \tex_spaceskip:D \c_zero_dim } } @@ -2172,12 +2169,12 @@ { \tex_unskip:D \bool_if:NF #1 - { \tex_vadjust:D { \tex_penalty:D \c_ten_thousand } } + { \tex_vadjust:D { \tex_penalty:D \c_@@_max_penalty_int } } \dim_compare:nNnF {#2} = \c_zero_dim { \tex_vadjust:D { \skip_vertical:n {#2} } } - \tex_penalty:D \c_ten_thousand + \tex_penalty:D \c_@@_max_penalty_int \tex_hfil:D - \tex_penalty:D -\c_ten_thousand + \tex_penalty:D - \c_@@_max_penalty_int } } % \end{macrocode} @@ -2236,17 +2233,17 @@ \cs_new_protected:Npn \galley_display_widow_penalties_set:n #1 { \etex_displaywidowpenalties:D - \__int_eval:w \clist_count:n {#1} + \c_one \__int_eval_end: + \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end: \clist_map_function:nN {#1} \@@_set_aux:n - \c_zero + 0 \exp_stop_f: } \cs_generate_variant:Nn \galley_display_widow_penalties_set:n { V , v } \cs_new_protected:Npn \galley_widow_penalties_set:n #1 { \etex_widowpenalties:D - \__int_eval:w \clist_count:n {#1} + \c_one \__int_eval_end: + \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end: \clist_map_function:nN {#1} \@@_set_aux:n - \c_zero + 0 \exp_stop_f: } \cs_generate_variant:Nn \galley_widow_penalties_set:n { V , v } \cs_new:Npn \@@_set_aux:n #1 { \int_eval:n {#1} ~ } @@ -2295,9 +2292,9 @@ \cs_new_protected:Npn \galley_display_club_penalties_set:n #1 { \etex_clubpenalties:D - \__int_eval:w \clist_count:n {#1} + \c_one \__int_eval_end: + \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end: \clist_map_function:nN {#1} \@@_set_aux:n - \c_zero + 0 \exp_stop_f: \@@_calc_interline_penalties: } \cs_generate_variant:Nn \galley_display_club_penalties_set:n { V , v } @@ -2320,9 +2317,9 @@ % \begin{macrocode} \cs_new_protected:Npn \galley_interline_penalty_set:n #1 { - \int_compare:nNnTF { \etex_interlinepenalties:D \c_zero } = \c_zero + \int_compare:nNnTF { \etex_interlinepenalties:D 0 } = 0 { - \etex_interlinepenalties:D \c_one \__int_eval:w #1 \__int_eval_end: + \etex_interlinepenalties:D 1 = \__int_eval:w #1 \__int_eval_end: \@@_calc_interline_penalties: } { @@ -2330,7 +2327,7 @@ { \__int_eval:w \etex_interlinepenalties:D ##1 - - \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero + - \etex_interlinepenalties:D \etex_interlinepenalties:D 0 + #1 \__int_eval_end: } @@ -2341,11 +2338,11 @@ \cs_new_protected:Npn \@@_set_interline_penalty:nn #1#2 { \etex_interlinepenalties:D - \etex_interlinepenalties:D \c_zero - \int_step_function:nnnN \c_one \c_one {#1} + \etex_interlinepenalties:D 0 \exp_stop_f: + \int_step_function:nnnN { 1 } { 1 } {#1} \@@_set_interline_penalty_auxi:n - \int_step_function:nnnN { #1 + \c_one } \c_one - { \etex_interlinepenalties:D \c_zero - \c_one } + \int_step_function:nnnN { #1 + 1 } { 1 } + { \etex_interlinepenalties:D 0 - 1 } \@@_set_interline_penalty_auxii:n \__int_eval:w #2 \__int_eval_end: } @@ -2376,17 +2373,11 @@ \exp_args:Nff \@@_calc_interline_penalties:nn { \int_max:nn - { - \clist_count:N \l_galley_club_penalties_clist - + \c_one - } + { \clist_count:N \l_galley_club_penalties_clist + 1 } { \int_max:nn - { - \clist_count:N \l_galley_line_penalties_clist - + \c_one - } - { \etex_clubpenalties:D \c_zero } + { \clist_count:N \l_galley_line_penalties_clist + 1 } + { \etex_clubpenalties:D 0 } } } { \clist_count:N \l_galley_line_penalties_clist } @@ -2400,11 +2391,11 @@ \cs_new_protected:Npn \@@_calc_interline_penalties:nn #1#2 { \etex_interlinepenalties:D #1 ~ - \int_step_function:nnnN \c_one \c_one {#2} + \int_step_function:nnnN { 1 } { 1 } {#2} \@@_calc_interline_penalties_auxi:n - \int_step_function:nnnN { #2 + \c_one } \c_one { #1 - \c_one } + \int_step_function:nnnN { #2 + 1 } { 1 } { #1 - 1 } \@@_calc_interline_penalties_auxii:n - \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero + \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f: } \cs_new:Npn \@@_calc_interline_penalties_auxi:n #1 { @@ -2417,7 +2408,7 @@ \cs_new:Npn \@@_calc_interline_penalties_auxii:n #1 { \__int_eval:w - \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero + \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f: + 0 \clist_item:Nn \l_galley_club_penalties_clist {#1} - \etex_clubpenalties:D #1 ~ \__int_eval_end: @@ -2457,8 +2448,8 @@ { \clist_set:Nx #1 { - \int_step_function:nnnN \c_one \c_one - { \etex_clubpenalties:D \c_zero - \c_one } + \int_step_function:nnnN { 1 } { 1 } + { \etex_clubpenalties:D 0 - 1 } \@@_save_display_club_penalties:n } } @@ -2468,8 +2459,8 @@ { \clist_set:Nx #1 { - \int_step_function:nnnN \c_one \c_one - { \etex_displaywidowpenalties:D \c_zero - \c_one } + \int_step_function:nnnN { 1 } { 1 } + { \etex_displaywidowpenalties:D 0 - 1 } \@@_save_display_widow_penalties:n } } @@ -2482,8 +2473,8 @@ { \clist_set:Nx #1 { - \int_step_function:nnnN \c_one \c_one - { \etex_widowpenalties:D \c_zero - \c_one } + \int_step_function:nnnN { 1 } { 1 } + { \etex_widowpenalties:D 0 - 1 } \@@_save_widow_penalties:n } } @@ -2495,7 +2486,7 @@ % last value in the primitive array. % \begin{macrocode} \cs_new_protected:Npn \galley_interline_penalty: - { \__int_value:w \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero } + { \__int_value:w \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f: } % \end{macrocode} % \end{macro} % \end{macro} @@ -2523,7 +2514,7 @@ { \mode_if_vertical:T { - \int_compare:nNnT \@dbltopnum = { - \c_one } + \int_compare:nNnT \@dbltopnum = { -1 } { \dim_compare:nNnT \tex_pagetotal:D < \topskip { \tex_hbox:D { } } @@ -2643,7 +2634,7 @@ \leavevmode \setbox \@tempboxa = \hbox { {#1} } \galley_parshape_set_single:nnnN - \c_one + { 1 } { \box_wd:N \@tempboxa } \c_zero_dim \c_false_bool |