diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx | 244 |
1 files changed, 124 insertions, 120 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx index bba0907bbd8..87b30d0ce25 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx @@ -37,7 +37,7 @@ % %<*driver|package> \RequirePackage{l3names} -\GetIdInfo$Id: xgalley.dtx 3253 2012-01-28 14:59:55Z joseph $ +\GetIdInfo$Id: xgalley.dtx 3879 2012-07-01 09:17:47Z joseph $ {L3 Experimental galley} %</driver|package> %<*driver> @@ -758,6 +758,10 @@ % \begin{macrocode} %<*package> % \end{macrocode} +% +% \begin{macrocode} +%<@@=galley> +% \end{macrocode} % % \begin{macrocode} \ProvidesExplPackage @@ -767,11 +771,11 @@ % % \subsection{Variables} % -% \begin{variable}{\l_galley_tmpa_clist, \l_galley_tmpb_clist} +% \begin{variable}{\l_@@_tmpa_clist, \l_@@_tmpb_clist} % Scratch space. % \begin{macrocode} -\clist_new:N \l_galley_tmpa_clist -\clist_new:N \l_galley_tmpb_clist +\clist_new:N \l_@@_tmpa_clist +\clist_new:N \l_@@_tmpb_clist % \end{macrocode} % \end{variable} % @@ -799,26 +803,26 @@ } % \end{macrocode} % -% \begin{variable}{\l_galley_left_margin_dim, \l_galley_right_margin_dim} -% In the \texttt{absolute} template, the two margin values are relative -% to the edges of the galley. This means that any existing offset or -% line-length adjustment are ignored. +% \begin{variable}{\l_@@_left_margin_dim, \l_@@_right_margin_dim} +% In the \texttt{absolute} template, the two margin values are relative +% to the edges of the galley. This means that any existing offset or +% line-length adjustment are ignored. % \begin{macrocode} %<*package> -\cs_new_eq:NN \l_galley_left_margin_dim \leftmargin +\cs_new_eq:NN \l_@@_left_margin_dim \leftmargin %</package> %<*package> -\cs_new_eq:NN \l_galley_right_margin_dim \rightmargin +\cs_new_eq:NN \l_@@_right_margin_dim \rightmargin %</package> \DeclareTemplateCode { measure } { absolute } { 0 } { - left-margin = \l_galley_left_margin_dim , - right-margin = \l_galley_right_margin_dim + left-margin = \l_@@_left_margin_dim , + right-margin = \l_@@_right_margin_dim } { \AssignTemplateKeys - \galley_margins_set_absolute:nn \l_galley_left_margin_dim - \l_galley_right_margin_dim + \galley_margins_set_absolute:nn \l_@@_left_margin_dim + \l_@@_right_margin_dim } % \end{macrocode} % On the other hand, the \texttt{relative} template works relative to @@ -826,13 +830,13 @@ % \begin{macrocode} \DeclareTemplateCode { measure } { relative } { 0 } { - left-margin = \l_galley_left_margin_dim , - right-margin = \l_galley_right_margin_dim + left-margin = \l_@@_left_margin_dim , + right-margin = \l_@@_right_margin_dim } { \AssignTemplateKeys - \galley_margins_set_relative:nn \l_galley_left_margin_dim - \l_galley_right_margin_dim + \galley_margins_set_relative:nn \l_@@_left_margin_dim + \l_@@_right_margin_dim } % \end{macrocode} % \end{variable} @@ -866,66 +870,66 @@ lines : integer = 2 } % \end{macrocode} -% \begin{variable}{\l_galley_parshape_indent_dim} -% \begin{variable}{\l_galley_parshape_on_left_bool} -% \begin{variable}{\l_galley_parshape_lines_int} -% Both of the templates are implemented as special cases of the more -% general function defined earlier. +% \begin{variable}{\l_@@_parshape_indent_dim} +% \begin{variable}{\l_@@_parshape_on_left_bool} +% \begin{variable}{\l_@@_parshape_lines_int} +% Both of the templates are implemented as special cases of the more +% general function defined earlier. % \begin{macrocode} \DeclareTemplateCode { parshape } { hang } { 0 } { - indent = \l_galley_parshape_indent_dim , - on-left-side = \l_galley_parshape_on_left_bool , - lines = \l_galley_parshape_lines_int + indent = \l_@@_parshape_indent_dim , + on-left-side = \l_@@_parshape_on_left_bool , + lines = \l_@@_parshape_lines_int } { \AssignTemplateKeys - \bool_if:NTF \l_galley_parshape_on_left_bool + \bool_if:NTF \l_@@_parshape_on_left_bool { \galley_parshape_single_par:nVVN - \l_galley_parshape_lines_int - \l_galley_parshape_indent_dim + \l_@@_parshape_lines_int + \l_@@_parshape_indent_dim \c_zero_dim \c_false_bool } { \galley_parshape_single_par:nVVN - \l_galley_parshape_lines_int + \l_@@_parshape_lines_int \c_zero_dim - \l_galley_parshape_indent_dim + \l_@@_parshape_indent_dim \c_false_bool } } \DeclareTemplateCode { parshape } { initial } { 0 } { - indent = \l_galley_parshape_indent_dim , - on-left-side = \l_galley_parshape_on_left_bool , - lines = \l_galley_parshape_lines_int + indent = \l_@@_parshape_indent_dim , + on-left-side = \l_@@_parshape_on_left_bool , + lines = \l_@@_parshape_lines_int } { \AssignTemplateKeys - \clist_clear:N \l_galley_tmpa_clist - \clist_clear:N \l_galley_tmpb_clist - \prg_replicate:nn { \l_galley_parshape_lines_int } + \clist_clear:N \l_@@_tmpa_clist + \clist_clear:N \l_@@_tmpb_clist + \prg_replicate:nn { \l_@@_parshape_lines_int } { - \clist_put_right:Nn \l_galley_tmpa_clist - { \l_galley_parshape_indent_dim } - \clist_put_right:Nn \l_galley_tmpb_clist + \clist_put_right:Nn \l_@@_tmpa_clist + { \l_@@_parshape_indent_dim } + \clist_put_right:Nn \l_@@_tmpb_clist { \c_zero_dim } } - \bool_if:NTF \l_galley_parshape_on_left_bool + \bool_if:NTF \l_@@_parshape_on_left_bool { \galley_parshape_single_par:nVVN \c_zero - \l_galley_tmpa_clist - \l_galley_tmpb_clist + \l_@@_tmpa_clist + \l_@@_tmpb_clist \c_true_bool } { \galley_parshape_single_par:nVVN \c_zero - \l_galley_tmpb_clist - \l_galley_tmpa_clist + \l_@@_tmpb_clist + \l_@@_tmpa_clist \c_true_bool } } @@ -1012,12 +1016,12 @@ \tex_defaulthyphenchar:D 45 \scan_stop: % \end{macrocode} % -% \begin{variable}{\l_galley_justification_other_tl} +% \begin{variable}{\l_@@_justification_other_tl} % Used for the reset system for justification: using this token list means % that there is no need to remove anything from % \cs{g_galley_restore_running_tl}. % \begin{macrocode} -\tl_new:N \l_galley_justification_other_tl +\tl_new:N \l_@@_justification_other_tl % \end{macrocode} % \end{variable} % @@ -1068,7 +1072,7 @@ } { \AssignTemplateKeys - \tl_clear:N \l_galley_justification_other_tl + \tl_clear:N \l_@@_justification_other_tl \galley_set_interword_spacing: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 } @@ -1092,7 +1096,7 @@ stretch-last-line = \l_galley_par_stretch_last_bool } { - \tl_put_left:Nx \l_galley_justification_other_tl + \tl_put_left:Nx \l_@@_justification_other_tl { \skip_set:Nn \exp_not:N \l_galley_par_end_skip { \skip_use:N \l_galley_par_end_skip } @@ -1115,7 +1119,7 @@ { \skip_use:N \l_galley_line_right_skip } } \tl_gput_right:Nn \g_galley_restore_running_tl - { \l_galley_justification_other_tl } + { \l_@@_justification_other_tl } \AssignTemplateKeys \galley_set_interword_spacing:N \l_galley_fixed_spacing_bool \bool_if:NTF \l_galley_par_stretch_last_bool @@ -1191,7 +1195,7 @@ } % \end{macrocode} % -% \begin{macro}{\galley_justification_first:, \galley_justification_other:} +% \begin{macro}{\@@_justification_first:, \@@_justification_other:} % A second form of justification template is the case where the first % paragraph is different from all of the others. This is set up by % getting the justification to reset itself after the first paragraph. @@ -1205,16 +1209,16 @@ } \DeclareTemplateCode { justification } { compound } { 0 } { - first-paragraph = \galley_justification_first: , - other-paragraphs = \galley_justification_other: + first-paragraph = \@@_justification_first: , + other-paragraphs = \@@_justification_other: } { \AssignTemplateKeys - \galley_justification_first: - \tl_set:Nn \l_galley_justification_other_tl - { \galley_justification_other: } + \@@_justification_first: + \tl_set:Nn \l_@@_justification_other_tl + { \@@_justification_other: } \tl_gput_right:Nn \g_galley_restore_running_tl - { \l_galley_justification_other_tl } + { \l_@@_justification_other_tl } } % \end{macrocode} % \end{macro} @@ -1251,15 +1255,15 @@ \DeclareTemplateCode{ line-breaking } { std } { 0 } { badness = \l_galley_linebreak_badness_int , - binop-penalty = \l_galley_binop_penalty_int , + binop-penalty = \l_@@_binop_penalty_int , double-hyphen-demerits = \l_galley_double_hyphen_demerits_int , emergency-stretch = \l_galley_emergency_stretch_skip , final-hyphen-demerits = \l_galley_final_hyphen_demerits_int , fuzz = \l_galley_linebreak_fuzz_dim , - line-penalty = \l_galley_linebreak_penalty_int , + line-penalty = \l_@@_linebreak_penalty_int , mismatch-demerits = \l_galley_mismatch_demerits_int , pretolerance = \l_galley_linebreak_pretolerance_int , - relation-penalty = \l_galley_relation_penalty_int , + relation-penalty = \l_@@_relation_penalty_int , tolerance = \l_galley_linebreak_tolerance_int } { \AssignTemplateKeys } @@ -1278,11 +1282,11 @@ % % \begin{variable} % { -% \l_galley_club_penalty_int , -% \l_galley_display_club_penalty_int , -% \l_galley_display_widow_penalty_int , -% \l_galley_interline_penalty_int , -% \l_galley_widow_penalty_int +% \l_@@_club_penalty_int , +% \l_@@_display_club_penalty_int , +% \l_@@_display_widow_penalty_int , +% \l_@@_interline_penalty_int , +% \l_@@_widow_penalty_int % } % The second object here sets up how \TeX{} acts to break paragraphs at % page boundaries. As with the \texttt{line-breaking} object, there is not @@ -1307,23 +1311,23 @@ \DeclareTemplateCode { paragraph-breaking } { std } { 0 } { badness = \l_galley_parbreak_badness_int , - broken-penalty = \l_galley_broken_penalty_int , - club-penalty = \l_galley_club_penalty_int , - display-club-penalty = \l_galley_display_club_penalty_int , - display-widow-penalty = \l_galley_display_widow_penalty_int , + broken-penalty = \l_@@_broken_penalty_int , + club-penalty = \l_@@_club_penalty_int , + display-club-penalty = \l_@@_display_club_penalty_int , + display-widow-penalty = \l_@@_display_widow_penalty_int , fuzz = \l_galley_parbreak_fuzz_dim , - interline-penalty = \l_galley_interline_penalty_int , - post-display-penalty = \l_galley_post_display_penalty_int , - pre-display-penalty = \l_galley_pre_display_penalty_int , - widow-penalty = \l_galley_widow_penalty_int + interline-penalty = \l_@@_interline_penalty_int , + post-display-penalty = \l_@@_post_display_penalty_int , + pre-display-penalty = \l_@@_pre_display_penalty_int , + widow-penalty = \l_@@_widow_penalty_int } { \AssignTemplateKeys - \galley_set_club_penalties:V \l_galley_club_penalty_int - \galley_set_display_club_penalties:V \l_galley_display_club_penalty_int - \galley_set_display_widow_penalties:V \l_galley_display_widow_penalty_int - \galley_set_interline_penalty:n \l_galley_interline_penalty_int - \galley_set_widow_penalties:V \l_galley_widow_penalty_int + \galley_set_club_penalties:V \l_@@_club_penalty_int + \galley_set_display_club_penalties:V \l_@@_display_club_penalty_int + \galley_set_display_widow_penalties:V \l_@@_display_widow_penalty_int + \galley_set_interline_penalty:n \l_@@_interline_penalty_int + \galley_set_widow_penalties:V \l_@@_widow_penalty_int } % \end{macrocode} % \end{variable} @@ -1351,18 +1355,18 @@ % \end{macrocode} % \begin{variable} % { -% \l_galley_parbreak_badness_tl , -% \l_galley_broken_penalty_tl , -% \l_galley_club_penalties_tl , -% \l_galley_display_club_penalties_tl , -% \l_galley_display_widow_penalties_tl , -% \l_galley_parbreak_fuzz_tl , -% \l_galley_interline_penalty_tl , -% \l_galley_post_display_penalty_tl , -% \l_galley_pre_display_penalty_tl , -% \l_galley_widow_penalties_tl , -% \c_galley_parbreak_multi_seq , -% \c_galley_parbreak_single_seq +% \l_@@_parbreak_badness_tl , +% \l_@@_broken_penalty_tl , +% \l_@@_club_penalties_tl , +% \l_@@_display_club_penalties_tl , +% \l_@@_display_widow_penalties_tl , +% \l_@@_parbreak_fuzz_tl , +% \l_@@_interline_penalty_tl , +% \l_@@_post_display_penalty_tl , +% \l_@@_pre_display_penalty_tl , +% \l_@@_widow_penalties_tl , +% \c_@@_parbreak_multi_seq , +% \c_@@_parbreak_single_seq % } % There is also a version of this code which applies only to one % paragraph. This is done by storing the input in token list variables @@ -1383,16 +1387,16 @@ } \DeclareTemplateCode { paragraph-breaking } { single } { 0 } { - badness = \l_galley_parbreak_badness_tl , - broken-penalty = \l_galley_broken_penalty_tl , - club-penalty = \l_galley_club_penalties_tl , - display-club-penalty = \l_galley_display_club_penalties_tl , - display-widow-penalty = \l_galley_display_widow_penalties_tl , - fuzz = \l_galley_parbreak_fuzz_tl , - interline-penalty = \l_galley_interline_penalty_tl , - post-display-penalty = \l_galley_post_display_penalty_tl , - pre-display-penalty = \l_galley_pre_display_penalty_tl , - widow-penalty = \l_galley_widow_penalties_tl + badness = \l_@@_parbreak_badness_tl , + broken-penalty = \l_@@_broken_penalty_tl , + club-penalty = \l_@@_club_penalties_tl , + display-club-penalty = \l_@@_display_club_penalties_tl , + display-widow-penalty = \l_@@_display_widow_penalties_tl , + fuzz = \l_@@_parbreak_fuzz_tl , + interline-penalty = \l_@@_interline_penalty_tl , + post-display-penalty = \l_@@_post_display_penalty_tl , + pre-display-penalty = \l_@@_pre_display_penalty_tl , + widow-penalty = \l_@@_widow_penalties_tl } { \AssignTemplateKeys @@ -1400,30 +1404,30 @@ % The fuzz and interline penalties are handled explicitly as they have % particular requirements. % \begin{macrocode} - \tl_if_empty:NF \l_galley_interline_penalty_tl + \tl_if_empty:NF \l_@@_interline_penalty_tl { \tl_gput_right:Nx \g_galley_par_after_hook_tl { - \int_set:Nn \exp_not:N \l_galley_interline_penalty_int + \int_set:Nn \exp_not:N \l_@@_interline_penalty_int { \galley_interline_penalty: } } - \int_set:Nn \l_galley_interline_penalty_int - { \l_galley_interline_penalty_tl } + \int_set:Nn \l_@@_interline_penalty_int + { \l_@@_interline_penalty_tl } } - \tl_if_empty:NF \l_galley_parbreak_fuzz_tl + \tl_if_empty:NF \l_@@_parbreak_fuzz_tl { \tl_gput_right:Nx \g_galley_par_after_hook_tl { \dim_set:Nn \exp_not:N \l_galley_parbreak_fuzz_dim { \dim_use:N \l_galley_parbreak_fuzz_dim } } - \dim_set:Nn \l_galley_parbreak_fuzz_dim { \l_galley_parbreak_fuzz_tl } + \dim_set:Nn \l_galley_parbreak_fuzz_dim { \l_@@_parbreak_fuzz_tl } } % \end{macrocode} % For the single integer penalties, a simple check is needed to save the % value. % \begin{macrocode} - \seq_map_inline:Nn \c_galley_parbreak_single_seq + \seq_map_inline:Nn \c_@@_parbreak_single_seq { \tl_if_empty:cF { l_galley_ ##1 _tl } { @@ -1440,30 +1444,30 @@ % A bit more complex for the array penalties. Although the interface here % does not expose the arrays, it is necessary to correctly save them. % \begin{macrocode} - \seq_map_inline:Nn \c_galley_parbreak_multi_seq + \seq_map_inline:Nn \c_@@_parbreak_multi_seq { \tl_if_empty:cF { l_galley_ ##1 _tl } { - \use:c { galley_save_ ##1 :N } \l_galley_tmpa_clist + \use:c { galley_save_ ##1 :N } \l_@@_tmpa_clist \tl_gput_right:Nx \g_galley_par_after_hook_tl { \exp_not:c { galley_set_ ##1 :n } - { \exp_not:o \l_galley_tmpa_clist } + { \exp_not:o \l_@@_tmpa_clist } } \use:c { galley_set_ ##1 :v } { l_galley_ ##1 _tl } } } } -\seq_new:N \c_galley_parbreak_multi_seq -\seq_gput_right:Nn \c_galley_parbreak_multi_seq { club_penalties } -\seq_gput_right:Nn \c_galley_parbreak_multi_seq { display_club_penalties } -\seq_gput_right:Nn \c_galley_parbreak_multi_seq { display_widow_penalties } -\seq_gput_right:Nn \c_galley_parbreak_multi_seq { widow_penalties } -\seq_new:N \c_galley_parbreak_single_seq -\seq_gput_right:Nn \c_galley_parbreak_single_seq { parbreak_badness } -\seq_gput_right:Nn \c_galley_parbreak_single_seq { broken_penalty } -\seq_gput_right:Nn \c_galley_parbreak_single_seq { post_display_penalty } -\seq_gput_right:Nn \c_galley_parbreak_single_seq { pre_display_penalty } +\seq_new:N \c_@@_parbreak_multi_seq +\seq_gput_right:Nn \c_@@_parbreak_multi_seq { club_penalties } +\seq_gput_right:Nn \c_@@_parbreak_multi_seq { display_club_penalties } +\seq_gput_right:Nn \c_@@_parbreak_multi_seq { display_widow_penalties } +\seq_gput_right:Nn \c_@@_parbreak_multi_seq { widow_penalties } +\seq_new:N \c_@@_parbreak_single_seq +\seq_gput_right:Nn \c_@@_parbreak_single_seq { parbreak_badness } +\seq_gput_right:Nn \c_@@_parbreak_single_seq { broken_penalty } +\seq_gput_right:Nn \c_@@_parbreak_single_seq { post_display_penalty } +\seq_gput_right:Nn \c_@@_parbreak_single_seq { pre_display_penalty } % \end{macrocode} % \end{variable} % \begin{macrocode} |