From 6fca20c09474a7f6a3559af1c984243a83669f61 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 8 Mar 2017 23:01:35 +0000 Subject: l3 (8mar17) git-svn-id: svn://tug.org/texlive/trunk@43432 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/l3experimental/xgalley/l3galley.sty | 137 +++++++++------------ .../tex/latex/l3experimental/xgalley/xgalley.sty | 12 +- 2 files changed, 67 insertions(+), 82 deletions(-) (limited to 'Master/texmf-dist/tex/latex/l3experimental/xgalley') diff --git a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty index 31619c5f811..926e1dfb2ac 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty @@ -19,9 +19,9 @@ %% and all files in that bundle must be distributed together. %% %% File: l3galley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach -%% (C) 2010-2016 The LaTeX3 Project -\RequirePackage{expl3}[2017/02/10] -\@ifpackagelater{expl3}{2017/02/10} +%% (C) 2010-2017 The LaTeX3 Project +\RequirePackage{expl3}[2017/03/07] +\@ifpackagelater{expl3}{2017/03/07} {} {% \PackageError{l3galley}{Support package l3kernel too old} @@ -33,7 +33,7 @@ }% \endinput } -\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} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -85,6 +85,7 @@ \tl_new:N \l__galley_interpar_penalty_user_tl \tl_new:N \g__galley_interpar_vspace_user_tl \tl_new:N \l__galley_interpar_vspace_user_tl +\int_const:Nn \c__galley_max_penalty_int { 10000 } \int_new:N \l__galley_group_level_int \cs_new_protected:Npn \__galley_initialise_variables: { @@ -249,15 +250,13 @@ } \g_galley_par_reset_hook_tl \tl_gclear:N \g_galley_par_reset_hook_tl - \tex_penalty:D \c_ten_thousand + \tex_penalty:D \c__galley_max_penalty_int } \cs_new_protected:Npn \__galley_par_update_cutout: { - \bool_if:nF - { - \seq_if_empty_p:N \g__galley_cutout_left_seq - && \seq_if_empty_p:N \g__galley_cutout_right_seq - } + \bool_lazy_and:nnF + { \seq_if_empty_p:N \g__galley_cutout_left_seq } + { \seq_if_empty_p:N \g__galley_cutout_right_seq } { \prg_replicate:nn \tex_prevgraf:D { @@ -268,11 +267,9 @@ } \int_compare:nNnT \l__galley_group_level_int = \etex_currentgrouplevel:D { - \bool_if:nT - { - \seq_if_empty_p:N \g__galley_cutout_left_seq - && \seq_if_empty_p:N \g__galley_cutout_right_seq - } + \bool_lazy_and:nnT + { \seq_if_empty_p:N \g__galley_cutout_left_seq } + { \seq_if_empty_p:N \g__galley_cutout_right_seq } { \bool_gset_false:N \g__galley_cutout_active_bool } } } @@ -410,7 +407,7 @@ \tl_if_empty:NTF \g__galley_interpar_penalty_user_tl { \bool_if:NTF \g_galley_no_break_next_bool - { \tex_penalty:D \c_ten_thousand } + { \tex_penalty:D \c__galley_max_penalty_int } { \tex_penalty:D \l_galley_interpar_penalty_int } } { @@ -540,26 +537,22 @@ } \cs_new_protected:Npn \__galley_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 } } \cs_new_protected:Npn \__galley_parshape_set_indents: { - \bool_if:nF - { - \seq_if_empty_p:N \l__galley_parshape_left_indent_seq - && \seq_if_empty_p:N \l__galley_parshape_right_indent_seq - } + \bool_lazy_and:nnF + { \seq_if_empty_p:N \l__galley_parshape_left_indent_seq } + { \seq_if_empty_p:N \l__galley_parshape_right_indent_seq } { \__galley_parshape_set_indents:NN \l__galley_parshape_left_indent_seq @@ -584,11 +577,9 @@ } \cs_new_protected:Npn \__galley_parshape_set_cutouts: { - \bool_if:nF - { - \seq_if_empty_p:N \g__galley_cutout_left_seq - && \seq_if_empty_p:N \g__galley_cutout_right_seq - } + \bool_lazy_and:nnF + { \seq_if_empty_p:N \g__galley_cutout_left_seq } + { \seq_if_empty_p:N \g__galley_cutout_right_seq } { \__galley_parshape_set_cutouts:n { left } \__galley_parshape_set_cutouts:n { right } @@ -597,7 +588,7 @@ \seq_count:N \l__galley_cutout_left_indent_seq - \seq_count:N \l__galley_cutout_right_indent_seq } - \int_compare:nNnTF \l__galley_tmp_int > \c_zero + \int_compare:nNnTF \l__galley_tmp_int > 0 { \__galley_parshape_set_cutouts:N \l__galley_cutout_right_indent_seq } { \__galley_parshape_set_cutouts:N \l__galley_cutout_left_indent_seq } \__galley_parshape_set_indents:NN @@ -623,9 +614,9 @@ { \seq_count:N \g__galley_tmpa_seq - \seq_count:N \g__galley_tmpb_seq - + \c_one + + 1 } - \int_compare:nNnT \l__galley_tmp_int > \c_zero + \int_compare:nNnT \l__galley_tmp_int > 0 { \prg_replicate:nn { \l__galley_tmp_int } @@ -696,10 +687,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 } } @@ -723,12 +714,12 @@ { \tex_unskip:D \bool_if:NF #1 - { \tex_vadjust:D { \tex_penalty:D \c_ten_thousand } } + { \tex_vadjust:D { \tex_penalty:D \c__galley_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__galley_max_penalty_int \tex_hfil:D - \tex_penalty:D -\c_ten_thousand + \tex_penalty:D - \c__galley_max_penalty_int } } \cs_new_eq:NN \l_galley_broken_penalty_int \tex_brokenpenalty:D @@ -742,17 +733,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} \__galley_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} \__galley_set_aux:n - \c_zero + 0 \exp_stop_f: } \cs_generate_variant:Nn \galley_widow_penalties_set:n { V , v } \cs_new:Npn \__galley_set_aux:n #1 { \int_eval:n {#1} ~ } @@ -771,17 +762,17 @@ \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} \__galley_set_aux:n - \c_zero + 0 \exp_stop_f: \__galley_calc_interline_penalties: } \cs_generate_variant:Nn \galley_display_club_penalties_set:n { V , v } \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: \__galley_calc_interline_penalties: } { @@ -789,7 +780,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: } @@ -800,11 +791,11 @@ \cs_new_protected:Npn \__galley_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} \__galley_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 } \__galley_set_interline_penalty_auxii:n \__int_eval:w #2 \__int_eval_end: } @@ -816,17 +807,11 @@ \exp_args:Nff \__galley_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 } @@ -834,11 +819,11 @@ \cs_new_protected:Npn \__galley_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} \__galley_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 } \__galley_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 \__galley_calc_interline_penalties_auxi:n #1 { @@ -851,7 +836,7 @@ \cs_new:Npn \__galley_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: @@ -864,8 +849,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 } \__galley_save_display_club_penalties:n } } @@ -875,8 +860,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 } \__galley_save_display_widow_penalties:n } } @@ -889,22 +874,22 @@ { \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 } \__galley_save_widow_penalties:n } } \cs_new:Npn \__galley_save_widow_penalties:n #1 { \__int_value:w \etex_widowpenalties:D \__int_eval:w #1 \__int_eval_end: , } \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: } \__msg_kernel_new:nnn { galley } { no-line-to-end } { There's~no~line~here~to~end. } \cs_set:Npn \clearpage { \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 { } } @@ -961,7 +946,7 @@ \leavevmode \setbox \@tempboxa = \hbox { {#1} } \galley_parshape_set_single:nnnN - \c_one + { 1 } { \box_wd:N \@tempboxa } \c_zero_dim \c_false_bool diff --git a/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty b/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty index 598f757ad4f..44c68a9d000 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty @@ -19,9 +19,9 @@ %% and all files in that bundle must be distributed together. %% %% File: xgalley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach -%% (C) 2010-2012,2014,2106 The LaTeX3 Project +%% (C) 2010-2012,2014,2016-2017 The LaTeX3 Project \RequirePackage{xparse} -\GetIdInfo$Id: xgalley.dtx 6805 2016-12-28 22:15:52Z joseph $ +\GetIdInfo$Id: xgalley.dtx 6963 2017-02-20 02:29:02Z bruno $ {L3 Experimental galley} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -118,14 +118,14 @@ \bool_if:NTF \l__galley_parshape_on_left_bool { \galley_parshape_set_single:nVVN - \c_zero + { 0 } \l__galley_tmpa_clist \l__galley_tmpb_clist \c_true_bool } { \galley_parshape_set_single:nVVN - \c_zero + { 0 } \l__galley_tmpb_clist \l__galley_tmpa_clist \c_true_bool @@ -217,7 +217,7 @@ \tl_clear:N \l__galley_justification_other_tl \galley_interword_spacing_set:N \l_galley_fixed_spacing_bool \bool_if:NTF \l_galley_par_stretch_last_bool - { \int_set_eq:NN \l_galley_last_line_fit_int \c_one_thousand } + { \int_set:Nn \l_galley_last_line_fit_int { 1000 } } { \int_zero:N \l_galley_last_line_fit_int } \skip_set:Nn \@rightskip { \l_galley_line_right_skip } } @@ -259,7 +259,7 @@ \AssignTemplateKeys \galley_interword_spacing_set:N \l_galley_fixed_spacing_bool \bool_if:NTF \l_galley_par_stretch_last_bool - { \int_set_eq:NN \l_galley_last_line_fit_int \c_one_thousand } + { \int_set:Nn \l_galley_last_line_fit_int { 1000 } } { \int_zero:N \l_galley_last_line_fit_int } \skip_set:Nn \@rightskip { \l_galley_line_right_skip } } -- cgit v1.2.3