diff options
author | Karl Berry <karl@freefriends.org> | 2012-12-21 23:31:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-12-21 23:31:35 +0000 |
commit | 8bcf0c7ef3cd19666c206271cea9280846b5c7e6 (patch) | |
tree | ee538c7e2a14ad105a169fdd2e745356147577cc /Master | |
parent | ef0453041a9700a2d974c3c76e3398e40c4e4aeb (diff) |
l3 (21dec12)
git-svn-id: svn://tug.org/texlive/trunk@28608 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
73 files changed, 2066 insertions, 1541 deletions
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdf Binary files differindex 033c783432e..e76c8fc915d 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf Binary files differindex 2d5b4e43c46..951db575eb5 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf Binary files differindex 72c0a857eb1..44d306b2dc4 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf Binary files differindex b13c1a72869..cbfc130822e 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf Binary files differindex 99c5020a462..bc091420db4 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf Binary files differindex d64fdd774ee..95eb5e88b2d 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf Binary files differindex 4051a39e420..bd1b99ac1d0 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf Binary files differindex ca1384cad46..35924b0610d 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf b/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf Binary files differindex 08a5b5c8620..9c7873a883d 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf b/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf Binary files differindex 9e904d303a9..b6e7442ac3f 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf diff --git a/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf b/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf Binary files differindex 749b76057a8..75f98b13eac 100644 --- a/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf +++ b/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf diff --git a/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf b/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf Binary files differindex 13c1182e2af..820c38f6400 100644 --- a/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf +++ b/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf diff --git a/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf b/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf Binary files differindex b7d2bef0da6..0de151d8703 100644 --- a/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf +++ b/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf diff --git a/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf b/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf Binary files differindex c3e663b6943..0bd4285bf37 100644 --- a/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf +++ b/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf diff --git a/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf b/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf Binary files differindex ca65eefeffa..ec18c58a785 100644 --- a/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf +++ b/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf diff --git a/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf b/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf Binary files differindex 5a2a14514ac..8e6903f95a5 100644 --- a/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf +++ b/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf diff --git a/Master/texmf-dist/doc/latex/l3kernel/source3.pdf b/Master/texmf-dist/doc/latex/l3kernel/source3.pdf Binary files differindex 6197b1bd747..3821467a59e 100644 --- a/Master/texmf-dist/doc/latex/l3kernel/source3.pdf +++ b/Master/texmf-dist/doc/latex/l3kernel/source3.pdf diff --git a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf Binary files differindex c95a278b66e..68329876230 100644 --- a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf diff --git a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf Binary files differindex eb3bca4ddec..e29e940df36 100644 --- a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf diff --git a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf Binary files differindex e059c112234..edb43daa4a5 100644 --- a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf diff --git a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf Binary files differindex 62ab30ed6c2..f72208d5866 100644 --- a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf diff --git a/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx b/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx index 22c4e73d42e..1b3ac4d507a 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: l3sort.dtx 3991 2012-07-16 19:00:35Z joseph $ +\GetIdInfo$Id: l3sort.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Experimental sorting functions} %</driver|package> %<*driver> @@ -277,49 +277,49 @@ % \begin{macro}[EXP]{\tl_sort:nN} % \begin{macro}[EXP, aux] % { -% \@@_quick_i:nNn, \@@_quick_ii:wn, -% \@@_quick_iii:nnNnn, \@@_quick_iv:nnNnwn +% \@@_quick:nNn, \@@_quick:wn, +% \@@_quick:nnNnn, \@@_quick:nnNnwn % } -% The \cs{@@_quick_i:nNn} function sorts |#1| using the comparison +% The \cs{@@_quick:nNn} function sorts |#1| using the comparison % |#2|, then places its third argument (\meta{continuation}) before % the result. This essentially avoids the rather slow \cs{use:ff}. % First test if |#1| is blank: if it is, \cs{use_none:n} eats the -% break point, and \cs{@@_quick_ii:wn} removes all until the ending +% break point, and \cs{@@_quick:wn} removes all until the ending % break point, unbracing the \meta{continuation}. If it is not blank, -% \cs{@@_quick_ii:wn} simply removes the end of that test until the +% \cs{@@_quick:wn} simply removes the end of that test until the % break point. The third auxiliary plays the role of |\__sort:nnNnn| % above, with an end-test replaced by \cs{__prg_break:}, which skips % to the break point two lines later, unless |#5| is itself a break -% point. In that case, \cs{@@_quick_iv:nnNnwn} calls the first +% point. In that case, \cs{@@_quick:nnNnwn} calls the first % auxiliary, which sorts |#2| and places another call to itself before % the result. % \begin{macrocode} -\cs_new:Npn \tl_sort:nN #1#2 { \@@_quick_i:nNn {#1} #2 { } } -\cs_new:Npn \@@_quick_i:nNn #1#2 +\cs_new:Npn \tl_sort:nN #1#2 { \@@_quick:nNn {#1} #2 { } } +\cs_new:Npn \@@_quick:nNn #1#2 { - \exp_after:wN \@@_quick_ii:wn + \exp_after:wN \@@_quick:wn \use_none:n #1 \__prg_break_point: - \@@_quick_iii:nnNnn { } { } #2 + \@@_quick:nnNnn { } { } #2 #1 { \__prg_break_point: } \__prg_break_point: } -\cs_new:Npn \@@_quick_ii:wn #1 \__prg_break_point: #2 {#2} -\cs_new:Npn \@@_quick_iii:nnNnn #1#2#3#4#5 +\cs_new:Npn \@@_quick:wn #1 \__prg_break_point: #2 {#2} +\cs_new:Npn \@@_quick:nnNnn #1#2#3#4#5 { \__prg_break: #5 - \@@_quick_iv:nnNnwn {#1} {#2} + \@@_quick:nnNnwn {#1} {#2} \__prg_break_point: #3 {#4} {#5} - { \@@_quick_iii:nnNnn {#1} { #2 {#5} } } - { \@@_quick_iii:nnNnn { #1 {#5} } {#2} } + { \@@_quick:nnNnn {#1} { #2 {#5} } } + { \@@_quick:nnNnn { #1 {#5} } {#2} } #3 {#4} } -\cs_new:Npn \@@_quick_iv:nnNnwn +\cs_new:Npn \@@_quick:nnNnwn #1#2 \__prg_break_point: #3#4 #5 \__prg_break_point: #6 { - \@@_quick_i:nNn {#2} #3 - { \@@_quick_i:nNn {#1} #3 {#6} {#4} } + \@@_quick:nNn {#2} #3 + { \@@_quick:nNn {#1} #3 {#6} {#4} } } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx index ce26a6098ba..3d25a841a80 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: l3regex.dtx 4219 2012-09-09 13:28:51Z bruno $ +\GetIdInfo$Id: l3regex.dtx 4341 2012-11-27 08:39:42Z bruno $ {L3 Experimental regular expressions} %</driver|package> %<*driver> @@ -1398,7 +1398,7 @@ % number of hexadecimal digits), or not (allowing up to two % hexadecimal digits). We need to check for the end-of-string marker. % Eventually, call either \cs{@@_escape_x_loop:N} or -% \cs{@@_escape_x_ii:N}. +% \cs{@@_escape_x:N}. % \begin{macrocode} \cs_new:Npn \@@_escape_x_test:N #1 { @@ -1407,28 +1407,28 @@ \if_charcode:w \c_space_token #1 \exp_after:wN \@@_escape_x_test:N \else: - \exp_after:wN \@@_escape_x_test_ii:N + \exp_after:wN \@@_escape_x_test_two:N \exp_after:wN #1 \fi: } } -\cs_new:Npn \@@_escape_x_test_ii:N #1 +\cs_new:Npn \@@_escape_x_test_two:N #1 { \if_charcode:w \c_lbrace_str #1 \exp_after:wN \@@_escape_x_loop:N \else: \__str_hexadecimal_use:NTF #1 - { \exp_after:wN \@@_escape_x_ii:N } + { \exp_after:wN \@@_escape_x:N } { ; \exp_after:wN \@@_escape_loop:N \exp_after:wN #1 } \fi: } % \end{macrocode} % \end{macro} % -% \begin{macro}[aux]{\@@_escape_x_ii:N} +% \begin{macro}[aux]{\@@_escape_x:N} % This looks for the second digit in the unbraced case. % \begin{macrocode} -\cs_new:Npn \@@_escape_x_ii:N #1 +\cs_new:Npn \@@_escape_x:N #1 { \str_if_eq_x:nnTF {#1} { break } { ; } { @@ -2096,9 +2096,9 @@ % \begin{macro}[aux]+\@@_compile_quantifier_{:w+ ^^A} % \begin{macro}[aux] % { -% \@@_compile_quantifier_braced_i:w, -% \@@_compile_quantifier_braced_ii:w, -% \@@_compile_quantifier_braced_iii:w, +% \@@_compile_quantifier_braced_auxi:w, +% \@@_compile_quantifier_braced_auxii:w, +% \@@_compile_quantifier_braced_auxiii:w, % } % Three possible syntaxes: \texttt{\{\meta{int}\}}, % \texttt{\{\meta{int},\}}, or \texttt{\{\meta{int},\meta{int}\}}. Any @@ -2114,10 +2114,10 @@ \cs_new_protected:cpn { @@_compile_quantifier_ \c_lbrace_str :w } { \@@_get_digits:NTFw \l_@@_internal_a_int - { \@@_compile_quantifier_braced_i:w } + { \@@_compile_quantifier_braced_auxi:w } { \@@_compile_quantifier_abort:xNN { \c_lbrace_str } } } -\cs_new_protected:Npn \@@_compile_quantifier_braced_i:w #1#2 +\cs_new_protected:Npn \@@_compile_quantifier_braced_auxi:w #1#2 { \str_case_x:nnn { #1 #2 } { @@ -2129,8 +2129,8 @@ { \@@_compile_special:N , } { \@@_get_digits:NTFw \l_@@_internal_b_int - { \@@_compile_quantifier_braced_iii:w } - { \@@_compile_quantifier_braced_ii:w } + { \@@_compile_quantifier_braced_auxiii:w } + { \@@_compile_quantifier_braced_auxii:w } } } { @@ -2139,7 +2139,7 @@ #1 #2 } } -\cs_new_protected:Npn \@@_compile_quantifier_braced_ii:w #1#2 +\cs_new_protected:Npn \@@_compile_quantifier_braced_auxii:w #1#2 { \str_if_eq_x:nnTF { #1 #2 } { \@@_compile_special:N \c_rbrace_str } @@ -2153,7 +2153,7 @@ #1 #2 } } -\cs_new_protected:Npn \@@_compile_quantifier_braced_iii:w #1#2 +\cs_new_protected:Npn \@@_compile_quantifier_braced_auxiii:w #1#2 { \str_if_eq_x:nnTF { #1 #2 } { \@@_compile_special:N \c_rbrace_str } @@ -2495,7 +2495,7 @@ % \end{macro} % % \begin{macro}[aux] -% {\@@_compile_class:TFNN, \@@_compile_class_ii:NN} +% {\@@_compile_class:TFNN, \@@_compile_class:NN} % If the first character is |^|, then the class is negative (use % |#2|), otherwise it is positive (use |#1|). If the next character % is a right bracket, then it should be changed to a raw one. @@ -2506,14 +2506,14 @@ \str_if_eq:nnTF { #3 #4 } { \@@_compile_special:N ^ } { \__tl_build_one:n { #2 { \if_false: } \fi: } - \@@_compile_class_ii:NN + \@@_compile_class:NN } { \__tl_build_one:n { #1 { \if_false: } \fi: } - \@@_compile_class_ii:NN #3 #4 + \@@_compile_class:NN #3 #4 } } -\cs_new_protected:Npn \@@_compile_class_ii:NN #1#2 +\cs_new_protected:Npn \@@_compile_class:NN #1#2 { \token_if_eq_charcode:NNTF #2 ] { \@@_compile_raw:N #2 } diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx index 792cdcb105f..ea6c38e6564 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx @@ -227,13 +227,13 @@ % \begin{macro}[aux, EXP]{\@@_format_parse:n} % \begin{macro}[aux, EXP] % { -% \@@_format_parse_i:NN, -% \@@_format_parse_ii:nN, -% \@@_format_parse_iii:nN, -% \@@_format_parse_iv:nwN, -% \@@_format_parse_v:nN, -% \@@_format_parse_vi:nwN, -% \@@_format_parse_vii:nN, +% \@@_format_parse_auxi:NN, +% \@@_format_parse_auxii:nN, +% \@@_format_parse_auxiii:nN, +% \@@_format_parse_auxiv:nwN, +% \@@_format_parse_auxv:nN, +% \@@_format_parse_auxvi:nwN, +% \@@_format_parse_auxvii:nN, % \@@_format_parse_end:nwn, % } % The goal is to parse @@ -244,51 +244,51 @@ % \begin{macrocode} \cs_new:Npn \@@_format_parse:n #1 { - \exp_last_unbraced:Nf \@@_format_parse_i:NN + \exp_last_unbraced:Nf \@@_format_parse_auxi:NN \@@_to_other:n {#1} \s__stop \s__stop {#1} } -\cs_new:Npx \@@_format_parse_i:NN #1#2 +\cs_new:Npx \@@_format_parse_auxi:NN #1#2 { \exp_not:N \@@_if_contains_char:nNTF { < > = ^ } #2 - { \exp_not:N \@@_format_parse_iii:nN { #1 #2 } } + { \exp_not:N \@@_format_parse_auxiii:nN { #1 #2 } } { - \exp_not:N \@@_format_parse_ii:nN + \exp_not:N \@@_format_parse_auxii:nN { \c_catcode_other_space_tl } #1 #2 } } -\cs_new:Npn \@@_format_parse_ii:nN #1#2 +\cs_new:Npn \@@_format_parse_auxii:nN #1#2 { \@@_if_contains_char:nNTF { < > = ^ } #2 - { \@@_format_parse_iii:nN { #1 #2 } } - { \@@_format_parse_iii:nN { #1 ? } #2 } + { \@@_format_parse_auxiii:nN { #1 #2 } } + { \@@_format_parse_auxiii:nN { #1 ? } #2 } } -\cs_new:Npx \@@_format_parse_iii:nN #1#2 +\cs_new:Npx \@@_format_parse_auxiii:nN #1#2 { \exp_not:N \@@_if_contains_char:nNTF { + - \c_catcode_other_space_tl } #2 - { \exp_not:N \@@_format_parse_iv:nwN { #1 #2 } ; } - { \exp_not:N \@@_format_parse_iv:nwN { #1 ? } ; #2 } + { \exp_not:N \@@_format_parse_auxiv:nwN { #1 #2 } ; } + { \exp_not:N \@@_format_parse_auxiv:nwN { #1 ? } ; #2 } } -\cs_new:Npn \@@_format_parse_iv:nwN #1#2; #3 +\cs_new:Npn \@@_format_parse_auxiv:nwN #1#2; #3 { \@@_format_if_digit:NTF #3 - { \@@_format_parse_iv:nwN {#1} #2 #3 ; } - { \@@_format_parse_v:nN { #1 {#2} } #3 } + { \@@_format_parse_auxiv:nwN {#1} #2 #3 ; } + { \@@_format_parse_auxv:nN { #1 {#2} } #3 } } -\cs_new:Npn \@@_format_parse_v:nN #1#2 +\cs_new:Npn \@@_format_parse_auxv:nN #1#2 { \token_if_eq_charcode:NNTF . #2 - { \@@_format_parse_vi:nwN {#1} 0 ; } - { \@@_format_parse_vii:nN { #1 { } } #2 } + { \@@_format_parse_auxvi:nwN {#1} 0 ; } + { \@@_format_parse_auxvii:nN { #1 { } } #2 } } -\cs_new:Npn \@@_format_parse_vi:nwN #1#2; #3 +\cs_new:Npn \@@_format_parse_auxvi:nwN #1#2; #3 { \@@_format_if_digit:NTF #3 - { \@@_format_parse_vi:nwN {#1} #2 #3 ; } - { \@@_format_parse_vii:nN { #1 {#2} } #3 } + { \@@_format_parse_auxvi:nwN {#1} #2 #3 ; } + { \@@_format_parse_auxvii:nN { #1 {#2} } #3 } } -\cs_new:Npn \@@_format_parse_vii:nN #1#2 +\cs_new:Npn \@@_format_parse_auxvii:nN #1#2 { \token_if_eq_meaning:NNTF \s__stop #2 { \@@_format_parse_end:nwn { #1 ? } #2 } @@ -791,7 +791,7 @@ % \end{macro} % % \begin{macro}[aux, EXP]{\@@_format_fp_e:wn} -% \begin{macro}[aux, EXP]{\@@_format_fp_e_ii:wn} +% \begin{macro}[aux, EXP]{\@@_format_fp_e_aux:wn} % With the |e| type, first filter out special cases. In the normal % case, round to |#4+1| significant figures (one before the decimal % separator, |#4| after). @@ -810,12 +810,12 @@ {3} { nan } } { - \exp_last_unbraced:Nf \@@_format_fp_e_ii:wn + \exp_last_unbraced:Nf \@@_format_fp_e_aux:wn \@@_format_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 } {#4} } } - \cs_new:Npn \@@_format_fp_e_ii:wn + \cs_new:Npn \@@_format_fp_e_aux:wn \s__fp \__fp_chk:w #1#2 #3 #4#5#6#7 ; #8 { \@@_format_put:fw { \int_eval:n { #3 - 1 } } @@ -838,7 +838,7 @@ % \end{macro} % % \begin{macro}[aux, EXP]{\@@_format_fp_f:wn} -% \begin{macro}[aux, EXP]{\@@_format_fp_f_ii:wwn} +% \begin{macro}[aux, EXP]{\@@_format_fp_f_aux:wwwn} % With the |f| type, first filter out special cases. In the normal % case, round to |#4| (absolute) decimal places. % \begin{macrocode} @@ -851,14 +851,14 @@ {3} { nan } } { - \exp_last_unbraced:Nf \@@_format_fp_f_ii:wwwn + \exp_last_unbraced:Nf \@@_format_fp_f_aux:wwwn \fp_to_decimal:n { abs ( round ( \s__fp \__fp_chk:w #1#2#3 ; , #4 ) ) } . . ; {#4} } } -\cs_new:Npn \@@_format_fp_f_ii:wwwn #1 . #2 . #3 ; #4 +\cs_new:Npn \@@_format_fp_f_aux:wwwn #1 . #2 . #3 ; #4 { \use:nf { #1 . #2 } @@ -869,7 +869,7 @@ % \end{macro} % % \begin{macro}[aux, EXP]{\@@_format_fp_g:wn} -% \begin{macro}[aux, EXP]{\@@_format_fp_g_ii:wn} +% \begin{macro}[aux, EXP]{\@@_format_fp_g_aux:wn} % With the |g| type, first filter out special cases. In the normal % case, round to |#4| significant figures, then test the exponent: if % $-4\leq \meta{exponent} < \meta{precision}$, use the presentation @@ -889,13 +889,13 @@ {3} { nan } } { - \exp_last_unbraced:Nf \@@_format_fp_g_ii:wn + \exp_last_unbraced:Nf \@@_format_fp_g_aux:wn \@@_format_fp_round:wn \s__fp \__fp_chk:w #1#2 ; { \int_max:nn {1} {#3} } { \int_max:nn {1} {#3} } } } -\cs_new:Npn \@@_format_fp_g_ii:wn #1; #2 +\cs_new:Npn \@@_format_fp_g_aux:wn #1; #2 { \int_compare:nNnTF { \__fp_exponent:w #1; } < { -3 } { \fp_to_scientific:n } diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx index 7e8f00ef923..301682c64be 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: l3str.dtx 4119 2012-08-16 22:35:59Z bruno $ +\GetIdInfo$Id: l3str.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Experimental strings} %</driver|package> %<*driver> @@ -1031,8 +1031,8 @@ % \begin{macro}[EXP]{\str_tail:N} % \begin{macro}[EXP]{\str_tail:n} % \begin{macro}[EXP]{\str_tail_ignore_spaces:n} -% \begin{macro}[EXP,aux]{\@@_tail:w} -% \begin{macro}[EXP,aux]{\@@_tail_ii:w} +% \begin{macro}[EXP,aux]{\@@_tail_auxi:w} +% \begin{macro}[EXP,aux]{\@@_tail_auxii:w} % As when fetching the head of a string, the \texttt{_ignore_spaces} % variant is similar to \cs{tl_tail:n}. The more commonly used % \cs{str_tail:n} function is a little bit more convoluted: hitting @@ -1046,17 +1046,17 @@ \cs_new_nopar:Npn \str_tail:N { \exp_args:No \str_tail:n } \cs_set:Npn \str_tail:n #1 { - \exp_after:wN \@@_tail:w + \exp_after:wN \@@_tail_auxi:w \reverse_if:N \if_charcode:w \scan_stop: \tl_to_str:n {#1} X X \q_stop } -\cs_set:Npn \@@_tail:w #1 X #2 \q_stop { \fi: #1 } +\cs_set:Npn \@@_tail_auxi:w #1 X #2 \q_stop { \fi: #1 } \cs_new:Npn \str_tail_ignore_spaces:n #1 { - \exp_after:wN \@@_tail_ii:w + \exp_after:wN \@@_tail_auxii:w \tl_to_str:n {#1} X X \q_stop } -\cs_new:Npn \@@_tail_ii:w #1 #2 X #3 \q_stop { #2 } +\cs_new:Npn \@@_tail_auxii:w #1 #2 X #3 \q_stop { #2 } % \end{macrocode} % \end{macro} % \end{macro} @@ -1066,16 +1066,16 @@ % % \begin{macro}[EXP, int]{\@@_skip_c_zero:w} % \begin{macro}[EXP, aux]{\@@_skip_loop:wNNNNNNNN} -% \begin{macro}[EXP, aux]{\@@_skip_end:w, \@@_skip_end_ii:NNNNNNNN} +% \begin{macro}[EXP, aux]{\@@_skip_end:w, \@@_skip_end:NNNNNNNN} % Removes |max(#1,0)| characters from the input stream, and then % leaves \cs{c_zero}. This should be expanded using % \cs{tex_romannumeral:D}. We remove characters $8$ at a time until % there are at most $8$ to remove. Then we do a dirty trick: the % \cs{if_case:w} construction leaves between $0$ and $8$ times the % \cs{or:} control sequence, and those \cs{or:} become arguments of -% \cs{@@_skip_end_ii:NNNNNNNN}. If the number of characters to remove +% \cs{@@_skip_end:NNNNNNNN}. If the number of characters to remove % is $6$, say, then there are two \cs{or:} left, and the $8$ arguments -% of \cs{@@_skip_end_ii:NNNNNNNN} are the two \cs{or:}, and $6$ +% of \cs{@@_skip_end:NNNNNNNN} are the two \cs{or:}, and $6$ % characters from the input stream, exactly what we wanted to % remove. Then close the \cs{if_case:w} conditional with \cs{fi:}, and % stop the initial expansion with \cs{c_zero} (see places where @@ -1095,25 +1095,25 @@ { \exp_after:wN \@@_skip_c_zero:w \int_use:N \__int_eval:w #1 - \c_eight ; } \cs_new:Npn \@@_skip_end:w #1 ; { - \exp_after:wN \@@_skip_end_ii:NNNNNNNN + \exp_after:wN \@@_skip_end:NNNNNNNN \if_case:w \if_int_compare:w #1 > \c_zero #1 \else: 0 \fi: \exp_stop_f: \or: \or: \or: \or: \or: \or: \or: \or: } -\cs_new:Npn \@@_skip_end_ii:NNNNNNNN #1#2#3#4#5#6#7#8 { \fi: \c_zero } +\cs_new:Npn \@@_skip_end:NNNNNNNN #1#2#3#4#5#6#7#8 { \fi: \c_zero } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}[EXP,int]{\@@_collect_delimit_by_q_stop:w} -% \begin{macro}[EXP,aux]{\@@_collect_loop:wn, \@@_collect_loop_ii:wnNNNNNNN} +% \begin{macro}[EXP,aux]{\@@_collect_loop:wn, \@@_collect_loop:wnNNNNNNN} % \begin{macro}[EXP,aux] -% {\@@_collect_end:wn, \@@_collect_end_ii:nnnnnnnnw} Collects +% {\@@_collect_end:wn, \@@_collect_end:nnnnnnnnw} Collects % |max(#1,0)| characters, and removes everything else until % \cs{q_stop}. This is somewhat similar to \cs{@@_skip_c_zero:w}, but % this time we can only grab $7$ characters at a time. At the end, we % use an \cs{if_case:w} trick again, so that the $8$ first arguments -% of \cs{@@_collect_end_ii:nnnnnnnnw} are some \cs{or:}, followed by +% of \cs{@@_collect_end:nnnnnnnnw} are some \cs{or:}, followed by % an \cs{fi:}, followed by |#1| characters from the input % stream. Simply leaving this in the input stream will close the % conditional properly and the \cs{or:} disappear. @@ -1127,13 +1127,13 @@ \cs_new:Npn \@@_collect_loop:wn #1 ; { \if_int_compare:w #1 > \c_seven - \exp_after:wN \@@_collect_loop_ii:wnNNNNNNN + \exp_after:wN \@@_collect_loop:wnNNNNNNN \else: \exp_after:wN \@@_collect_end:wn \fi: #1 ; } -\cs_new:Npn \@@_collect_loop_ii:wnNNNNNNN #1; #2 #3#4#5#6#7#8#9 +\cs_new:Npn \@@_collect_loop:wnNNNNNNN #1; #2 #3#4#5#6#7#8#9 { \exp_after:wN \@@_collect_loop:wn \int_use:N \__int_eval:w #1 - \c_seven ; @@ -1141,11 +1141,11 @@ } \cs_new:Npn \@@_collect_end:wn #1 ; { - \exp_after:wN \@@_collect_end_ii:nnnnnnnnw + \exp_after:wN \@@_collect_end:nnnnnnnnw \if_case:w \if_int_compare:w #1 > \c_zero #1 \else: 0 \fi: \exp_stop_f: \or: \or: \or: \or: \or: \or: \fi: } -\cs_new:Npn \@@_collect_end_ii:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \q_stop +\cs_new:Npn \@@_collect_end:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \q_stop { #1#2#3#4#5#6#7#8 } % \end{macrocode} % \end{macro} @@ -1217,9 +1217,9 @@ % \begin{macro}[EXP,aux] % { % \@@_substr_unsafe:nnn, -% \@@_substr_i:nN, -% \@@_substr_ii:www, -% \@@_substr_iii:nnw, +% \@@_substr:nN, +% \@@_substr:www, +% \@@_substr:nnw, % \@@_substr_normalize_range:nn % } % Sanitize the string. Then evaluate the arguments, replacing them by @@ -1242,23 +1242,23 @@ { \exp_args:No \@@_substr_unsafe:nnn { \tl_to_str:n {#1} } } \cs_new:Npn \@@_substr_unsafe:nnn #1#2#3 { - \exp_after:wN \@@_substr_ii:www + \exp_after:wN \@@_substr:www \__int_value:w \@@_count_unsafe:n {#1} \exp_after:wN ; \int_use:N \__int_eval:w #2 + \c_zero \exp_after:wN ; \int_use:N \__int_eval:w - \exp_args:Nf \@@_substr_i:nN {#3} \c_max_int ; + \exp_args:Nf \@@_substr:nN {#3} \c_max_int ; { } #1 \q_stop } -\cs_new:Npn \@@_substr_i:nN #1 #2 +\cs_new:Npn \@@_substr:nN #1 #2 { \tl_if_empty:nTF {#1} {#2} {#1} } -\cs_new:Npn \@@_substr_ii:www #1; #2; #3; +\cs_new:Npn \@@_substr:www #1; #2; #3; { - \exp_args:Nf \@@_substr_iii:nnw + \exp_args:Nf \@@_substr:nnw { \@@_substr_normalize_range:nn {#2} {#1} } { \@@_substr_normalize_range:nn {#3} {#1} } } -\cs_new:Npn \@@_substr_iii:nnw #1#2 +\cs_new:Npn \@@_substr:nnw #1#2 { \exp_after:wN \@@_collect_delimit_by_q_stop:w \int_use:N \__int_eval:w #2 + \c_one - #1 \exp_after:wN ; @@ -1647,7 +1647,7 @@ % % \begin{macro}{\str_set_convert:Nnnn, \str_gset_convert:Nnnn} % \begin{macro}[TF]{\str_set_convert:Nnnn, \str_gset_convert:Nnnn} -% \begin{macro}[aux]{\@@_convert_i:nNNnnn} +% \begin{macro}[aux]{\@@_convert:nNNnnn} % The input string is stored in \cs{g_@@_result_tl}, then we: % unescape and decode; encode and escape; exit the group and store the % result in the user's variable. The various conversion functions all @@ -1655,14 +1655,14 @@ % functions by redefining \cs{@@_if_flag_error:nnx} locally. % \begin{macrocode} \cs_new_protected_nopar:Npn \str_set_convert:Nnnn - { \@@_convert_i:nNNnnn { } \tl_set_eq:NN } + { \@@_convert:nNNnnn { } \tl_set_eq:NN } \cs_new_protected_nopar:Npn \str_gset_convert:Nnnn - { \@@_convert_i:nNNnnn { } \tl_gset_eq:NN } + { \@@_convert:nNNnnn { } \tl_gset_eq:NN } \prg_new_protected_conditional:Npnn \str_set_convert:Nnnn #1#2#3#4 { T , F , TF } { \bool_gset_false:N \g_@@_error_bool - \@@_convert_i:nNNnnn + \@@_convert:nNNnnn { \cs_set_eq:NN \@@_if_flag_error:nnx \@@_if_flag_no_error:nnx } \tl_set_eq:NN #1 {#2} {#3} {#4} \bool_if:NTF \g_@@_error_bool \prg_return_false: \prg_return_true: @@ -1671,22 +1671,22 @@ \str_gset_convert:Nnnn #1#2#3#4 { T , F , TF } { \bool_gset_false:N \g_@@_error_bool - \@@_convert_i:nNNnnn + \@@_convert:nNNnnn { \cs_set_eq:NN \@@_if_flag_error:nnx \@@_if_flag_no_error:nnx } \tl_gset_eq:NN #1 {#2} {#3} {#4} \bool_if:NTF \g_@@_error_bool \prg_return_false: \prg_return_true: } -\cs_new_protected:Npn \@@_convert_i:nNNnnn #1#2#3#4#5#6 +\cs_new_protected:Npn \@@_convert:nNNnnn #1#2#3#4#5#6 { \group_begin: #1 \@@_gset_other:Nn \g_@@_result_tl {#4} - \exp_after:wN \@@_convert_ii:wwwnn + \exp_after:wN \@@_convert:wwwnn \tl_to_str:n {#5} /// \q_stop { decode } { unescape } \prg_do_nothing: \@@_convert_decode_: - \exp_after:wN \@@_convert_ii:wwwnn + \exp_after:wN \@@_convert:wwwnn \tl_to_str:n {#6} /// \q_stop { encode } { escape } \use_ii_i:nn @@ -1699,11 +1699,11 @@ % \end{macro} % \end{macro} % -% \begin{macro}[aux]{\@@_convert_ii:wwwnn} -% \begin{macro}[aux]{\@@_convert_iii:NNnNN} -% The task of \cs{@@_convert_ii:wwwnn} is to split +% \begin{macro}[aux]{\@@_convert:wwwnn} +% \begin{macro}[aux]{\@@_convert:NNnNN} +% The task of \cs{@@_convert:wwwnn} is to split % \meta{encoding}/\meta{escaping} pairs into their components, |#1| -% and |#2|. Calls to \cs{@@_convert_iv:nnn} ensure that the +% and |#2|. Calls to \cs{@@_convert:nnn} ensure that the % corresponding conversion functions are defined. The third auxiliary % does the main work. % \begin{itemize} @@ -1723,15 +1723,15 @@ % (native), then the escaping should be ignored, with an error if any % was given, and only the encoding, |#1|, should be performed. % \begin{macrocode} -\cs_new_protected:Npn \@@_convert_ii:wwwnn +\cs_new_protected:Npn \@@_convert:wwwnn #1 / #2 // #3 \q_stop #4#5 { - \@@_convert_iv:nnn {enc} {#4} {#1} - \@@_convert_iv:nnn {esc} {#5} {#2} - \exp_args:Ncc \@@_convert_iii:NNnNN + \@@_convert:nnn {enc} {#4} {#1} + \@@_convert:nnn {esc} {#5} {#2} + \exp_args:Ncc \@@_convert:NNnNN { @@_convert_#4_#1: } { @@_convert_#5_#2: } {#2} } -\cs_new_protected:Npn \@@_convert_iii:NNnNN #1#2#3#4#5 +\cs_new_protected:Npn \@@_convert:NNnNN #1#2#3#4#5 { \if_meaning:w #1 #5 \tl_if_empty:nF {#3} @@ -1745,15 +1745,15 @@ % \end{macro} % \end{macro} % -% \begin{macro}[aux]{\@@_convert_iv:nnn} -% \begin{macro}[aux]{\@@_convert_v:nnnn} -% The arguments of \cs{@@_convert_iv:nnn} are: \texttt{enc} or +% \begin{macro}[aux]{\@@_convert:nnn} +% \begin{macro}[aux]{\@@_convert:nnnn} +% The arguments of \cs{@@_convert:nnn} are: \texttt{enc} or % \texttt{esc}, used to build filenames, the type of the conversion % (unescape, decode, encode, escape), and the encoding or escaping % name. If the function is already defined, no need to do anything. % Otherwise, filter out all non-alphanumerics in the name, and % lowercase it. Feed that, and the same three arguments, to -% \cs{@@_convert_v:nnnn}. The task is then to make sure that the +% \cs{@@_convert:nnnn}. The task is then to make sure that the % conversion function |#3_#1| corresponding to the type |#3| and % filtered name |#1| is defined, then set our initial conversion % function |#3_#4| equal to that. @@ -1781,16 +1781,16 @@ % from the \cs{l_@@_internal_tl}-based function: we mustn't clobber % that different definition. % \begin{macrocode} -\cs_new_protected:Npn \@@_convert_iv:nnn #1#2#3 +\cs_new_protected:Npn \@@_convert:nnn #1#2#3 { \cs_if_exist:cF { @@_convert_#2_#3: } { - \exp_args:Nx \@@_convert_v:nnnn + \exp_args:Nx \@@_convert:nnnn { \@@_convert_lowercase_alphanum:n {#3} } {#1} {#2} {#3} } } -\cs_new_protected:Npn \@@_convert_v:nnnn #1#2#3#4 +\cs_new_protected:Npn \@@_convert:nnnn #1#2#3#4 { \cs_if_exist:cF { @@_convert_#3_#1: } { @@ -2317,8 +2317,8 @@ % \subsubsection{Unescape methods} % % \begin{macro}[int]{\@@_convert_unescape_hex:} -% \begin{macro}[aux, rEXP]{\@@_unescape_hex_i:N} -% \begin{macro}[aux, rEXP]{\@@_unescape_hex_ii:N} +% \begin{macro}[aux, rEXP]{\@@_unescape_hex_auxi:N} +% \begin{macro}[aux, rEXP]{\@@_unescape_hex_auxii:N} % Take chars two by two, and interpret each pair as the hexadecimal % code for a byte. Anything else than hexadecimal digits is ignored, % raising the flag. A string which contains an odd number of @@ -2334,7 +2334,7 @@ \tl_gset:Nx \g_@@_result_tl { \@@_output_byte:w " - \exp_last_unbraced:Nf \@@_unescape_hex_i:N + \exp_last_unbraced:Nf \@@_unescape_hex_auxi:N { \tl_to_str:N \g_@@_result_tl } 0 { ? 0 - \c_one \__prg_break: } \__prg_break_point: @@ -2343,27 +2343,27 @@ \@@_if_flag_error:nnx { str_error } { unescape-hex } { } \group_end: } -\cs_new:Npn \@@_unescape_hex_i:N #1 +\cs_new:Npn \@@_unescape_hex_auxi:N #1 { \use_none:n #1 \@@_hexadecimal_use:NTF #1 - { \@@_unescape_hex_ii:N } + { \@@_unescape_hex_auxii:N } { \flag_raise:n { str_error } - \@@_unescape_hex_i:N + \@@_unescape_hex_auxi:N } } -\cs_new:Npn \@@_unescape_hex_ii:N #1 +\cs_new:Npn \@@_unescape_hex_auxii:N #1 { \use_none:n #1 \@@_hexadecimal_use:NTF #1 { \@@_output_end: - \@@_output_byte:w " \@@_unescape_hex_i:N + \@@_output_byte:w " \@@_unescape_hex_auxi:N } { \flag_raise:n { str_error } - \@@_unescape_hex_ii:N + \@@_unescape_hex_auxii:N } } \__msg_kernel_new:nnnn { str } { unescape-hex } diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx index b6d28da057f..4ceef260a99 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx @@ -388,8 +388,8 @@ \group_begin: \group_align_safe_begin: \@@_setup:n {#1} - \@@_i:n {#1} - \@@_ii:n {#1} + \@@_a:n {#1} + \@@_b:n {#1} \group_align_safe_end: \group_end: } @@ -467,34 +467,34 @@ % \cs{str_tail:n} \Arg{token} is non-empty, because the % escape character is printable. % -% \begin{macro}[int]{\@@_i:n} +% \begin{macro}[int]{\@@_a:n} % We read tokens one by one using \tn{futurelet}. % While performing the loop, we keep track of the number of % true begin-group characters minus the number of % true end-group characters in \cs{l_@@_nesting_int}. % This reaches $-1$ when we read the closing brace. % \begin{macrocode} -\cs_new_protected:Npn \@@_i:n #1 +\cs_new_protected:Npn \@@_a:n #1 { \int_set:Nn \tex_escapechar:D { 92 } \int_zero:N \l_@@_normal_int \int_zero:N \l_@@_index_int \int_zero:N \l_@@_nesting_int - \if_false: { \fi: \@@_i_loop:w #1 } + \if_false: { \fi: \@@_a_loop:w #1 } \int_decr:N \l_@@_index_int } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_loop:w} +% \begin{macro}[int]{\@@_a_loop:w} % Read one character and check its type. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_loop:w - { \tex_futurelet:D \l_@@_token \@@_i_type:w } +\cs_new_protected_nopar:Npn \@@_a_loop:w + { \tex_futurelet:D \l_@@_token \@@_a_type:w } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_type:w} +% \begin{macro}[int]{\@@_a_type:w} % At this point, \cs{l_@@_token} holds the meaning % of the following token. We store in \cs{l_@@_type_int} % the meaning of the token ahead: @@ -511,7 +511,7 @@ % over \cs{l_@@_token} if it matches with one of the % character tokens (hence is not a primitive conditional). % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_type:w +\cs_new_protected_nopar:Npn \@@_a_type:w { \l_@@_type_int = \if_meaning:w \l_@@_token \c_space_token @@ -528,25 +528,25 @@ \fi: \fi: \if_case:w \l_@@_type_int - \exp_after:wN \@@_i_space:w - \or: \exp_after:wN \@@_i_bgroup:w - \or: \exp_after:wN \@@_i_safe:N - \else: \exp_after:wN \@@_i_egroup:w + \exp_after:wN \@@_a_space:w + \or: \exp_after:wN \@@_a_bgroup:w + \or: \exp_after:wN \@@_a_safe:N + \else: \exp_after:wN \@@_a_egroup:w \fi: } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_space:w} -% \begin{macro}[aux]{\@@_i_space_test:w} +% \begin{macro}[int]{\@@_a_space:w} +% \begin{macro}[aux]{\@@_a_space_test:w} % In this branch, the following token's meaning is a blank space. % Apply \tn{string} to that token: if it is a control sequence % the result starts with the escape character; otherwise it is % a true blank space, whose string representation is also a blank space. -% We test for that in \cs{@@_i_space_test:w}, +% We test for that in \cs{@@_a_space_test:w}, % after grabbing as \cs{l_@@_char_token} the first character % of the string representation. -% Also, since \cs{@@_i_store:} expects the special token to be +% Also, since \cs{@@_a_store:} expects the special token to be % stored in the relevant \tn{toks} register, we do that. The extra % \cs{exp_not:n} is unnecessary of course, but it makes the treatment % of all tokens more homogeneous. @@ -559,30 +559,30 @@ % so that the second pass does not need to test the meaning of tokens, % only strings. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_space:w +\cs_new_protected_nopar:Npn \@@_a_space:w { - \tex_afterassignment:D \@@_i_space_test:w + \tex_afterassignment:D \@@_a_space_test:w \exp_after:wN \cs_set_eq:NN \exp_after:wN \l_@@_char_token \token_to_str:N } -\cs_new_protected_nopar:Npn \@@_i_space_test:w +\cs_new_protected_nopar:Npn \@@_a_space_test:w { \if_meaning:w \l_@@_char_token \c_space_token \tex_toks:D \l_@@_index_int { \exp_not:n { ~ } } - \@@_i_store: + \@@_a_store: \else: \int_incr:N \l_@@_normal_int \fi: - \@@_i_loop:w + \@@_a_loop:w } % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}[int]{\@@_i_bgroup:w, \@@_i_egroup:w} -% \begin{macro}[aux]{\@@_i_group:nw} -% \begin{macro}[aux]{\@@_i_group_test:w} +% \begin{macro}[int]{\@@_a_bgroup:w, \@@_a_egroup:w} +% \begin{macro}[aux]{\@@_a_group:nw} +% \begin{macro}[aux]{\@@_a_group_test:w} % The token might be either a true character token with % catcode $1$ or $2$, or it could be a control sequence. % The only tricky case is if the character code happens @@ -598,40 +598,40 @@ \group_begin: \char_set_catcode_group_begin:N \^^@ \char_set_catcode_group_end:N \^^E - \cs_new_protected_nopar:Npn \@@_i_bgroup:w - { \@@_i_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } } + \cs_new_protected_nopar:Npn \@@_a_bgroup:w + { \@@_a_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } } \char_set_catcode_group_begin:N \^^B \char_set_catcode_group_end:N \^^@ - \cs_new_protected_nopar:Npn \@@_i_egroup:w - { \@@_i_group:nw { \if_false: ^^B \fi: ^^@ } } + \cs_new_protected_nopar:Npn \@@_a_egroup:w + { \@@_a_group:nw { \if_false: ^^B \fi: ^^@ } } \group_end: -\cs_new_protected:Npn \@@_i_group:nw #1 +\cs_new_protected:Npn \@@_a_group:nw #1 { \tex_lccode:D \c_zero = \@@_extract_charcode: \scan_stop: \tl_to_lowercase:n { \tex_toks:D \l_@@_index_int {#1} } \if_int_compare:w \tex_lccode:D \c_zero = \tex_escapechar:D \int_set:Nn \tex_escapechar:D { 139 - \tex_escapechar:D } \fi: - \tex_afterassignment:D \@@_i_group_test:w + \tex_afterassignment:D \@@_a_group_test:w \exp_after:wN \cs_set_eq:NN \exp_after:wN \l_@@_char_token \token_to_str:N } -\cs_new_protected_nopar:Npn \@@_i_group_test:w +\cs_new_protected_nopar:Npn \@@_a_group_test:w { \if_charcode:w \l_@@_token \l_@@_char_token - \@@_i_store: + \@@_a_store: \else: \int_incr:N \l_@@_normal_int \fi: - \@@_i_loop:w + \@@_a_loop:w } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % -% \begin{macro}[int]{\@@_i_store:} +% \begin{macro}[int]{\@@_a_store:} % This function is called each time we meet a special token; % at this point, the \tn{toks} register \cs{l_@@_index_int} % holds a token list which expands to the given special token. @@ -661,7 +661,7 @@ % Finally, we check whether we reached the last closing brace, in which % case we stop by disabling the looping function (locally). % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_store: +\cs_new_protected_nopar:Npn \@@_a_store: { \tex_advance:D \l_@@_nesting_int \l_@@_type_int \if_int_compare:w \tex_lccode:D \c_zero = \c_thirty_two @@ -672,14 +672,14 @@ \int_incr:N \l_@@_index_int \int_zero:N \l_@@_normal_int \if_int_compare:w \l_@@_nesting_int = \c_minus_one - \cs_set_eq:NN \@@_i_loop:w \scan_stop: + \cs_set_eq:NN \@@_a_loop:w \scan_stop: \fi: } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_safe:N} -% \begin{macro}[aux]{\@@_i_cs:ww} +% \begin{macro}[int]{\@@_a_safe:N} +% \begin{macro}[aux]{\@@_a_cs:ww} % This should be the simplest case: since the upcoming token is safe, % we can simply grab it in a second pass. However, other branches of % the code must pass their tokens through \tn{string}, hence we do it @@ -698,7 +698,7 @@ % all characters after the last space should be counted in the % following sequence of \enquote{normal} tokens. % \begin{macrocode} -\cs_new_protected:Npn \@@_i_safe:N #1 +\cs_new_protected:Npn \@@_a_safe:N #1 { \if_charcode:w \scan_stop: @@ -706,11 +706,11 @@ \scan_stop: \int_incr:N \l_@@_normal_int \else: - \@@_cs_space_count:NN \@@_i_cs:ww #1 + \@@_cs_space_count:NN \@@_a_cs:ww #1 \fi: - \@@_i_loop:w + \@@_a_loop:w } -\cs_new_protected:Npn \@@_i_cs:ww #1; #2; +\cs_new_protected:Npn \@@_a_cs:ww #1; #2; { \if_int_compare:w #1 > \c_zero \tex_skip:D \l_@@_index_int @@ -731,32 +731,32 @@ % All the necessary information is stored in \tn{skip} % and \tn{toks} registers. % -% \begin{macro}[int]{\@@_ii:n} -% \begin{macro}[int, EXP]{\@@_ii_loop:w} +% \begin{macro}[int]{\@@_b:n} +% \begin{macro}[int, EXP]{\@@_b_loop:w} % Start the loop with the index $0$. No need for an end-marker: % the loop will stop by itself when the last index is read. % We will repeatedly oscillate between reading long stretches % of normal tokens, and reading special tokens. % \begin{macrocode} -\cs_new_protected:Npn \@@_ii:n #1 +\cs_new_protected:Npn \@@_b:n #1 { \tl_gset:Nx \g_@@_result_tl { - \@@_ii_loop:w 0; #1 + \@@_b_loop:w 0; #1 \__prg_break_point: } } -\cs_new:Npn \@@_ii_loop:w #1; +\cs_new:Npn \@@_b_loop:w #1; { - \exp_after:wN \@@_ii_normals:ww + \exp_after:wN \@@_b_normals:ww \__int_value:w \tex_skip:D #1 ; #1 ; } % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_normals:ww} -% \begin{macro}[aux, EXP]{\@@_ii_normal:wwN} +% \begin{macro}[int, EXP]{\@@_b_normals:ww} +% \begin{macro}[aux, EXP]{\@@_b_normal:wwN} % The first argument is the number of normal tokens which remain % to be read, and the second argument is the index in the array % produced in the first step. @@ -768,23 +768,23 @@ % rather than \cs{exp_not:N} because |#3| could be \cs{s__tl}, % hence must be hidden behind braces in the result. % \begin{macrocode} -\cs_new:Npn \@@_ii_normals:ww #1; +\cs_new:Npn \@@_b_normals:ww #1; { \if_int_compare:w #1 = \c_zero - \@@_ii_special:w + \@@_b_special:w \fi: - \@@_ii_normal:wwN #1; + \@@_b_normal:wwN #1; } -\cs_new:Npn \@@_ii_normal:wwN #1; #2; #3 +\cs_new:Npn \@@_b_normal:wwN #1; #2; #3 { \exp_not:n { \exp_not:n { #3 } } \s__tl \if_charcode:w \scan_stop: \exp_after:wN \use_none:n \token_to_str:N #3 \prg_do_nothing: \scan_stop: - \exp_after:wN \@@_ii_char:Nww + \exp_after:wN \@@_b_char:Nww \else: - \exp_after:wN \@@_ii_cs:Nww + \exp_after:wN \@@_b_cs:Nww \fi: #3 #1; #2; } @@ -792,10 +792,10 @@ % \end{macro} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_char:Nww} +% \begin{macro}[int, EXP]{\@@_b_char:Nww} % If the normal token we grab is a character, leave % \meta{catcode} \meta{charcode} followed by \cs{s__tl} -% in the input stream, and call \cs{@@_ii_normals:ww} +% in the input stream, and call \cs{@@_b_normals:ww} % with its first argument decremented. % \begin{macrocode} \group_begin: @@ -805,7 +805,7 @@ \char_set_uccode:nn { `? } { `D } \tl_to_uppercase:n { - \cs_new:Npn \@@_ii_char:Nww #1 + \cs_new:Npn \@@_b_char:Nww #1 { \if_meaning:w #1 \c_undefined:D ? \else: \if_catcode:w #1 \c_catcode_other_token C \else: @@ -818,7 +818,7 @@ 6 \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \__int_value:w `#1 \s__tl - \exp_after:wN \@@_ii_normals:ww + \exp_after:wN \@@_b_normals:ww \int_use:N \__int_eval:w \c_minus_one + } } @@ -826,21 +826,21 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_cs:Nww} -% \begin{macro}[aux, EXP]{\@@_ii_cs_test:ww} +% \begin{macro}[int, EXP]{\@@_b_cs:Nww} +% \begin{macro}[aux, EXP]{\@@_b_cs_test:ww} % If the token we grab is a control sequence, leave % |0 -1| (as category code and character code) in the input stream, % followed by \cs{s__tl}, -% and call \cs{@@_ii_normals:ww} with updated arguments. +% and call \cs{@@_b_normals:ww} with updated arguments. % \begin{macrocode} -\cs_new:Npn \@@_ii_cs:Nww #1 +\cs_new:Npn \@@_b_cs:Nww #1 { 0 -1 \s__tl - \@@_cs_space_count:NN \@@_ii_cs_test:ww #1 + \@@_cs_space_count:NN \@@_b_cs_test:ww #1 } -\cs_new:Npn \@@_ii_cs_test:ww #1 ; #2 ; #3 ; #4 ; +\cs_new:Npn \@@_b_cs_test:ww #1 ; #2 ; #3 ; #4 ; { - \exp_after:wN \@@_ii_normals:ww + \exp_after:wN \@@_b_normals:ww \int_use:N \__int_eval:w \if_int_compare:w #1 = \c_zero #3 @@ -855,9 +855,9 @@ % \end{macro} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_special:w} -% \begin{macro}[aux, EXP]{\@@_ii_special_char:wN} -% \begin{macro}[aux, EXP]{\@@_ii_special_space:w} +% \begin{macro}[int, EXP]{\@@_b_special:w} +% \begin{macro}[aux, EXP]{\@@_b_special_char:wN} +% \begin{macro}[aux, EXP]{\@@_b_special_space:w} % Here, |#1| is the current index in the array built in the first pass. % Check now whether we reached the end (we shouldn't keep the trailing % end-group character that marked the end of the token list in the @@ -865,12 +865,12 @@ % Unpack the \tn{toks} register: when \texttt{x}-expanding again, % we will get the special token. % Then leave the category code in the input stream, followed by -% the character code, and call \cs{@@_ii_loop:w} with the next index. +% the character code, and call \cs{@@_b_loop:w} with the next index. % \begin{macrocode} \group_begin: \char_set_catcode_other:N A - \cs_new:Npn \@@_ii_special:w - \fi: \@@_ii_normal:wwN 0 ; #1 ; + \cs_new:Npn \@@_b_special:w + \fi: \@@_b_normal:wwN 0 ; #1 ; { \fi: \if_int_compare:w #1 = \l_@@_index_int @@ -884,23 +884,23 @@ \else: 2 \fi: \if_int_odd:w \etex_gluestretch:D \tex_skip:D #1 \exp_stop_f: - \exp_after:wN \@@_ii_special_char:wN \int_use:N + \exp_after:wN \@@_b_special_char:wN \int_use:N \else: - \exp_after:wN \@@_ii_special_space:w \int_use:N + \exp_after:wN \@@_b_special_space:w \int_use:N \fi: \__int_eval:w \c_one + #1 \exp_after:wN ; \token_to_str:N } \group_end: -\cs_new:Npn \@@_ii_special_char:wN #1 ; #2 +\cs_new:Npn \@@_b_special_char:wN #1 ; #2 { \__int_value:w `#2 \s__tl - \@@_ii_loop:w #1 ; + \@@_b_loop:w #1 ; } -\cs_new:Npn \@@_ii_special_space:w #1 ; ~ +\cs_new:Npn \@@_b_special_space:w #1 ; ~ { 32 \s__tl - \@@_ii_loop:w #1 ; + \@@_b_loop:w #1 ; } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx index 33d957e4b3f..e2407f043a7 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx @@ -37,7 +37,7 @@ % %<*driver|package> \RequirePackage{xparse} -\GetIdInfo$Id: l3galley.dtx 4155 2012-08-29 10:29:58Z joseph $ +\GetIdInfo$Id: l3galley.dtx 4388 2012-12-20 22:15:35Z joseph $ {L3 Experimental galley code} %</driver|package> %<*driver> @@ -150,7 +150,7 @@ % \cs{galley_level:} % \end{syntax} % Sets up a vertical box to contain a new galley level. The box should -% be \enquote{colour safe}, which is automatic for \LaTeX3 coffins but +% be \enquote{color safe}, which is automatic for \LaTeX3 coffins but % must be included manually (using \cs{color_group_begin:} and % \cs{color_group_end:}) in \enquote{raw} vertical boxes. % \end{function} @@ -210,21 +210,21 @@ % or template level. % \end{variable} % -% \begin{function}{\galley_set_user_penalty:n} +% \begin{function}{\galley_penalty_set_single:n} % \begin{syntax} -% \cs{galley_set_user_penalty:n} \Arg{penalty} +% \cs{galley_penalty_set_single:n} \Arg{penalty} % \end{syntax} % Sets the \meta{penalty} for a break between the current and next % paragraph on a one-off basis. This function is intended for user-level % adjustments to design, and takes precedent over both settings from -% \cs{galley_set_penalty:n} and from \cs{galley_no_break_next:}. +% \cs{l_galley_interpar_penalty_int} and from \cs{galley_no_break_next:}. % \end{function} % -% \begin{function}{\galley_set_user_vspace:n} +% \begin{function}{\galley_vspace_set_single:n} % \begin{syntax} -% \cs{galley_set_user_vspace:n} \Arg{space} +% \cs{galley_vspace_set_single:n} \Arg{space} % \end{syntax} -% Sets the \meta{space} f to be inserted between the current and next +% Sets the \meta{space} to be inserted between the current and next % paragraph on a one-off basis. This function is intended for user-level % adjustments to design, and otherwise is analogous to % \cs{galley_set_vspace:n}. @@ -234,14 +234,14 @@ % % \begin{function} % { -% \galley_parshape_multi_par:nnnN, -% \galley_parshape_multi_par:nVVN, -% \galley_parshape_single_par:nnnN, -% \galley_parshape_single_par:nVVN +% \galley_parshape_set_multi:nnnN, +% \galley_parshape_set_multi:nVVN, +% \galley_parshape_set_single:nnnN, +% \galley_parshape_set_single:nVVN % } % \begin{syntax} -% \cs{galley_parshape_multi_par:nnnN} \Arg{unaltered lines} \Arg{left indents} \Arg{right indents} \meta{resume flag} -% \cs{galley_parshape_single_par:nnnN} \Arg{unaltered lines} \Arg{left indents} \Arg{right indents} \meta{resume flag} +% \cs{galley_parshape_set_multi:nnnN} \Arg{unaltered lines} \Arg{left indents} \Arg{right indents} \meta{resume flag} +% \cs{galley_parshape_set_single:nnnN} \Arg{unaltered lines} \Arg{left indents} \Arg{right indents} \meta{resume flag} % \end{syntax} % Sets the current paragraph shape to create an arbitrary paragraph shape. % The paragraph shape is set such that there are \meta{unaltered lines} which @@ -270,22 +270,20 @@ % % \begin{function} % { -% \galley_parshape_fixed_lines:nnn, -% \galley_parshape_fixed_lines:nVV +% \galley_cutout_left:nn, +% \galley_cutout_right:nn % } % \begin{syntax} -% \cs{galley_parshape_fixed_lines:nnn} \Arg{unaltered lines} \Arg{left indents} \Arg{right indents} +% \cs{galley_cutout_left:nn} \Arg{unaltered lines} \Arg{indents} +% \cs{galley_cutout_right:nn} \Arg{unaltered lines} \Arg{indents} % \end{syntax} -% Sets the paragraph shape to create an arbitrary paragraph shape which will -% apply to an exact number of lines. -% The paragraph shape is set such that there are \meta{unaltered lines} which -% have width and indent as set by the measure. The \enquote{altered} lines -% are then defined by the comma-separated lists of \meta{left indents} and -% \meta{right indents}. These are both indents from the edge of the measure, -% and may be negative, and should both contain the same number of items. -% The altered lines will apply to one or more paragraphs, such that the -% entire indent specification is honoured before the standard measure -% resumes. +% Adds a cutout section to the active paragraph shape, leaving +% \meta{unaltered lines} unchanged and then applying the \meta{indents} +% (a comma list). The cutout will be places on the left or right as indicated +% by the function name, and will apply to exactly the number of lines +% specified (the total of the \meta{unaltered lines} and the number of +% entries in the \meta{indents} list). Several cutouts may be applied +% sequentially: these act in an additive sense. % \end{function} % % \subsection{Formatting inside the paragraph} @@ -311,29 +309,29 @@ % Determines how the inter-word stretch is set for the last line of a % paragraph when % \begin{enumerate} -% \item The value of \cs{l_galley_par_end_skip} contains an infinite -% (\texttt{fil}) component; -% \item The values of \cs{l_galley_line_left_skip} and +% \item the value of \cs{l_galley_par_end_skip} contains an infinite +% (\texttt{fil(l)}) component; +% \item the values of \cs{l_galley_line_left_skip} and % \cs{l_galley_line_right_skip} do \emph{not} contain an infinite -% (\texttt{fil}) component. +% (\texttt{fil(l)}) component. % \end{enumerate} % Under these circumstances, \cs{l_galley_last_line_fit_int} is active, and % applies as follows: % \begin{itemize} -% \item Set to $0$, the last line of the paragraph is set with +% \item when set to $0$, the last line of the paragraph is set with % the inter-word spacing at natural width; -% \item Set to a $1000$ (or above), the inter-word spacing in the last line -% is stretched by the same factor as that applied to the penultimate +% \item when set to a $1000$ (or above), the inter-word spacing in the last +% line is stretched by the same factor as that applied to the penultimate % line; -% \item Set to $n$ between these extremes, the inter-word spacing in the -% last line is stretched by $n/1000$ times the factor used for the +% \item when set to~$n$ between these extremes, the inter-word spacing in +% the last line is stretched by $n/1000$ times the factor used for the % penultimate line. % \end{itemize} % \end{variable} % -% \begin{function}{\galley_set_interword_spacing:N} +% \begin{function}{\galley_interword_spacing_set:N} % \begin{syntax} -% \cs{galley_set_interword_spacing:N} \meta{fixed spacing bool} +% \cs{galley_interword_spacing_set:N} \meta{fixed spacing bool} % \end{syntax} % Sets the inter-word spacing used based on the values supplied by the % current font. If the \meta{fixed spacing bool} flag is \texttt{true} then @@ -424,11 +422,11 @@ % % \begin{function}{\galley_break_line:Nn} % \begin{syntax} -% \cs{galley_break_line:Nn} \meta{boolean} \Arg{dim expr} +% \cs{galley_break_line:Nn} \meta{boolean} \Arg{dimexpr} % \end{syntax} % Breaks the current line, filling the remaining space with \texttt{fil} % glue. If the \meta{boolean} is \texttt{true} then a page break is possible -% after the broken line. Vertical space as given by the \meta{dim expr} will +% after the broken line. Vertical space as given by the \meta{dimexpr} will % be inserted between the broken line and the next line. % \end{function} % @@ -457,21 +455,21 @@ % % \begin{function} % { -% \galley_set_club_penalties:n, -% \galley_set_club_penalties:V, -% \galley_set_club_penalties:v, -% \galley_set_display_club_penalties:n, -% \galley_set_display_club_penalties:V, -% \galley_set_display_club_penalties:v, -% \galley_set_display_widow_penalties:n, -% \galley_set_display_widow_penalties:V, -% \galley_set_display_widow_penalties:v, -% \galley_set_widow_penalties:n, -% \galley_set_widow_penalties:V, -% \galley_set_widow_penalties:v +% \galley_club_penalties_set:n, +% \galley_club_penalties_set:V, +% \galley_club_penalties_set:v, +% \galley_display_club_penalties_set:n, +% \galley_display_club_penalties_set:V, +% \galley_display_club_penalties_set:v, +% \galley_display_widow_penalties_set:n, +% \galley_display_widow_penalties_set:V, +% \galley_display_widow_penalties_set:v, +% \galley_widow_penalties_set:n, +% \galley_widow_penalties_set:V, +% \galley_widow_penalties_set:v % } % \begin{syntax} -% \cs{galley_set_club_penalties:n} \Arg{penalty list} +% \cs{galley_club_penalties_set:n} \Arg{penalty list} % \end{syntax} % Set the penalties for breaking lines at the beginning and end of % (partial) paragraphs. In each case, the \meta{penalty list} is a @@ -491,9 +489,9 @@ % penalty or to any \enquote{special} line penalties. % \end{function} % -% \begin{function}{\galley_set_interline_penalty:n} +% \begin{function}{\galley_interline_penalty_set:n} % \begin{syntax} -% \cs{galley_set_interline_penalty:n} \Arg{penalty} +% \cs{galley_interline_penalty_set:n} \Arg{penalty} % \end{syntax} % Sets the standard interline penalty applied between lines of a paragraph. % This value is added to any (display) club or widow penalty in force. @@ -501,11 +499,11 @@ % % \begin{function} % { -% \galley_set_interline_penalties:n, -% \galley_set_interline_penalties:V +% \galley_interline_penalties_set:n, +% \galley_interline_penalties_set:V % } % \begin{syntax} -% \cs{galley_set_interline_penalties:n} \Arg{penalty list} +% \cs{galley_interline_penalties_set:n} \Arg{penalty list} % \end{syntax} % Sets \enquote{special} interline penalties to be used in place of % the standard value, specified as a comma-separated \meta{penalty list}. @@ -524,7 +522,7 @@ % \begin{syntax} % \cs{galley_save_club_penalties:N} \Arg{comma list} % \end{syntax} -% These functions save the current value of the appropriate to the +% These functions save the current value of the appropriate penalty to the % comma list specified, within the current \TeX{} group. % \end{function} % @@ -547,9 +545,10 @@ % Token list inserted at the end of every paragraph in horizontal mode. % \end{variable} % -% \begin{variable}{\g_galley_par_after_hook_tl} +% \begin{variable}{\g_galley_par_reset_hook_tl} % Token list inserted after each paragraph. This is used for resetting -% galley parameters, and is therefore cleared after use. +% galley parameters, and is therefore cleared after use. It is inserted +% in vertical mode and must not contain horizontal mode material. % \end{variable} % % \begin{variable}{\g_galley_whatsit_next_tl} @@ -562,21 +561,30 @@ % paragraph started. % \end{variable} % -% \section{Additional effects} +% \section{Paragraphs} +% +% \begin{function}{\galley_par:} +% \begin{syntax} +% \cs{galley_par:} +% \end{syntax} +% Finalises the material collected as the last paragraph, inserts tokens +% at the start of the new paragraph, setting paragraph shape and any +% special values as required. +% \end{function} % -% \begin{function}{\@@_end_par:n} +% \begin{function}{\galley_par:n} % \begin{syntax} -% \cs{@@_end_par:n} \Arg{tokens} +% \cs{galley_par:n} \Arg{tokens} % \end{syntax} % Adds the \meta{tokens} to the material collected for the last paragraph -% before finalising the last paragraph in the usual way. This function should +% before finalising it in the usual way. This function should % therefore be the \emph{first} non-expandable entry used when a function % needs to add tokens to the preceding paragraph. % \end{function} % -% \section{Internal variables} +% \section{Information variables} % -% Some of the internal variables for the galley mechanism may be of +% Some of the variables for the galley mechanism may be of % interest to the programmer. These should all be treated as read-only % values and accessed only through the defined interfaces described above. % @@ -683,6 +691,13 @@ % % Functions or settings which are needed by the galley but perhaps also % elsewhere. +% +% \begin{macro}{\seq_map_function:Nc} +% Used to allow a mapping to choose the outcome using a passed option. +% \begin{macrocode} +\cs_generate_variant:Nn \seq_map_function:NN { Nc } +% \end{macrocode} +% \end{macro} % % The default hyphenation character should be set and hyphenation should be % enabled. @@ -691,35 +706,45 @@ \tex_defaulthyphenchar:D 45 \scan_stop: %</initex> % \end{macrocode} +% +% \subsection{Scratch variables} +% +% \begin{variable}{\l_@@_tmp_int} +% \begin{variable}{\l_@@_tmpa_seq, \l_@@_tmpb_seq} +% \begin{variable}{\l_@@_tmpa_tl} +% Used for manipulating cutouts and paragraph shapes. +% \begin{macrocode} +\int_new:N \l_@@_tmp_int +\seq_new:N \l_@@_tmpa_seq +\seq_new:N \l_@@_tmpb_seq +\tl_new:N \l_@@_tmp_tl +% \end{macrocode} +% \end{variable} +% \end{variable} +% \end{variable} % % \subsection{Galley settings} % % Settings for application by the galley respect the usual \TeX{} grouping and % so are all local variables. % -% \begin{variable} -% { -% \l_@@_parshape_left_indent_clist, -% \l_@@_parshape_right_indent_clist -% } -% \begin{variable} -% { -% \l_@@_parshape_multipar_bool, -% \l_@@_parshape_resume_std_bool, -% \l_@@_parshape_fixed_lines_bool -% } -% Setting up paragraph shape interacts with setting up the measure. The only -% way to keep things flexible is to have a rather \enquote{rich} set of data -% available. +% \begin{variable}{\l_@@_parshape_multipar_bool} +% Indicates whether the paragraph shape in use applies to one paragraph +% only or to more than one. % \begin{macrocode} -\clist_new:N \l_@@_parshape_left_indent_clist -\clist_new:N \l_@@_parshape_right_indent_clist \bool_new:N \l_@@_parshape_multipar_bool -\bool_new:N \l_@@_parshape_resume_std_bool -\bool_new:N \l_@@_parshape_fixed_lines_bool -\int_new:N \l_galley_parshape_std_lines_int % \end{macrocode} % \end{variable} +% +% \begin{variable} +% {\l_@@_parshape_left_indent_seq, \l_@@_parshape_right_indent_seq} +% Used to convert user input comma lists into sequences for mapping, and also +% to keep the information on paragraph shape available for the case where a +% cutout is also active. +% \begin{macrocode} +\seq_new:N \l_@@_parshape_left_indent_seq +\seq_new:N \l_@@_parshape_right_indent_seq +% \end{macrocode} % \end{variable} % % \begin{variable}{\l_galley_text_width_dim} @@ -786,6 +811,21 @@ \bool_new:N \l_@@_begin_level_bool % \end{macrocode} % \end{variable} +% +% \begin{variable} +% { +% \g_@@_cutout_left_seq, \l_@@_cutout_left_seq, +% \g_@@_cutout_right_seq, \l_@@_cutout_right_seq +% } +% To apply cutouts across paragraphs, they need to be tracked. The +% information has to be global, so is handled here. +% \begin{macrocode} +\seq_new:N \g_@@_cutout_left_seq +\seq_new:N \l_@@_cutout_left_seq +\seq_new:N \g_@@_cutout_right_seq +\seq_new:N \l_@@_cutout_right_seq +% \end{macrocode} +% \end{variable} % % \begin{variable} % {\g_galley_omit_next_indent_bool, \l_@@_omit_next_indent_bool} @@ -801,15 +841,6 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_parshape_set_bool, \l_@@_parshape_set_bool} -% This is not a setting for paragraph shape, but rather a tracker for the -% galley system. -% \begin{macrocode} -\bool_new:N \g_@@_parshape_set_bool -\bool_new:N \l_@@_parshape_set_bool -% \end{macrocode} -% \end{variable} -% % \begin{variable}{\g_galley_no_break_next_bool, \l_@@_no_break_next_bool} % Dealing with the no-break flag is pretty much the same as the case % for the indent: this applies on a single paragraph basis. @@ -821,39 +852,46 @@ % % \begin{variable} % { -% \g_galley_par_begin_hook_tl, \l_@@_galley_par_begin_hook_tl, -% \g_galley_par_end_hook_tl, \l_@@_galley_par_end_hook_tl, +% \g_galley_par_begin_hook_tl, \l_@@_par_begin_hook_tl, +% \g_galley_par_end_hook_tl, \l_@@_par_end_hook_tl, % } % Hooks for user-level code: these are not used by the galley itself. % \begin{macrocode} \tl_new:N \g_galley_par_begin_hook_tl -\tl_new:N \l_@@_galley_par_begin_hook_tl +\tl_new:N \l_@@_par_begin_hook_tl \tl_new:N \g_galley_par_end_hook_tl -\tl_new:N \l_@@_galley_par_end_hook_tl +\tl_new:N \l_@@_par_end_hook_tl % \end{macrocode} % \end{variable} % % \begin{variable} -% {\g_galley_par_after_hook_tl, \l_@@_par_after_hook_tl} +% {\g_galley_par_reset_hook_tl, \l_@@_par_reset_hook_tl} % This one is used by the galley: it happens \enquote{after} the current % paragraph, and is used for reset purposes. % \begin{macrocode} -\tl_new:N \g_galley_par_after_hook_tl -\tl_new:N \l_@@_par_after_hook_tl +\tl_new:N \g_galley_par_reset_hook_tl +\tl_new:N \l_@@_par_reset_hook_tl % \end{macrocode} % \end{variable} % % \begin{variable} % {\g_galley_previous_par_lines_int, \l_@@_previous_par_lines_int} +% \begin{variable} +% {\g_@@_current_par_lines_int, \l_@@_current_par_lines_int} % The number of lines in the previous typeset paragraph. This is reset at % the start of the paragraph and \emph{added to} when each \cs{tex_par:D} % primitive is used: \LaTeX{} uses the primitive in places that do not end -% a (conceptual) paragraph. +% a (conceptual) paragraph. There is also a set of variables to deal with +% the current (conceptual) paragraph, so that the information can be +% build up correctly. % \begin{macrocode} \int_new:N \g_galley_previous_par_lines_int \int_new:N \l_@@_previous_par_lines_int +\int_new:N \g_@@_current_par_lines_int +\int_new:N \l_@@_current_par_lines_int % \end{macrocode} % \end{variable} +% \end{variable} % % \begin{variable}{\g_galley_restore_running_tl, \l_@@_restore_running_tl} % When a parameter is altered from the \enquote{running} value to a @@ -926,14 +964,16 @@ \cs_new_protected_nopar:Npn \@@_initialise_variables: { \bool_gset_true:N \g_@@_begin_level_bool + \seq_gclear:N \g_@@_cutout_left_seq + \seq_gclear:N \g_@@_cutout_right_seq \tl_gclear:N \g_@@_interpar_penalty_user_tl \tl_gclear:N \g_@@_interpar_vspace_user_tl \bool_gset_true:N \g_galley_omit_next_indent_bool \bool_gset_false:N \g_galley_no_break_next_bool \tl_gclear:N \g_galley_par_begin_hook_tl \tl_gclear:N \g_galley_par_end_hook_tl - \tl_gclear:N \g_galley_par_after_hook_tl - \bool_gset_false:N \g_@@_parshape_set_bool + \tl_gclear:N \g_galley_par_reset_hook_tl + \int_gzero:N \g_@@_current_par_lines_int \int_gzero:N \g_galley_previous_par_lines_int \tl_gclear:N \g_galley_restore_running_tl \tl_gclear:N \g_galley_whatsit_previous_tl @@ -963,6 +1003,10 @@ { \bool_set_eq:NN \l_@@_begin_level_bool \g_@@_begin_level_bool + \seq_set_eq:NN \l_@@_cutout_left_seq + \g_@@_cutout_left_seq + \seq_set_eq:NN \l_@@_cutout_right_seq + \g_@@_cutout_right_seq \tl_set_eq:NN \l_@@_interpar_penalty_user_tl \g_@@_interpar_penalty_user_tl \tl_set_eq:NN \l_@@_interpar_vspace_user_tl @@ -971,14 +1015,14 @@ \g_galley_omit_next_indent_bool \bool_set_eq:NN \l_@@_no_break_next_bool \g_galley_no_break_next_bool - \tl_set_eq:NN \l_@@_galley_par_begin_hook_tl + \tl_set_eq:NN \l_@@_par_begin_hook_tl \g_galley_par_begin_hook_tl - \tl_set_eq:NN \l_@@_galley_par_end_hook_tl + \tl_set_eq:NN \l_@@_par_end_hook_tl \g_galley_par_end_hook_tl - \tl_set_eq:NN \l_@@_par_after_hook_tl - \g_galley_par_after_hook_tl - \bool_set_eq:NN \l_@@_parshape_set_bool - \g_@@_parshape_set_bool + \tl_set_eq:NN \l_@@_par_reset_hook_tl + \g_galley_par_reset_hook_tl + \int_set_eq:NN \l_@@_current_par_lines_int + \g_@@_current_par_lines_int \int_set_eq:NN \l_@@_previous_par_lines_int \g_galley_previous_par_lines_int \tl_set_eq:NN \l_@@_restore_running_tl @@ -992,6 +1036,10 @@ { \bool_gset_eq:NN \g_@@_begin_level_bool \l_@@_begin_level_bool + \seq_gset_eq:NN \g_@@_cutout_left_seq + \l_@@_cutout_left_seq + \seq_gset_eq:NN \g_@@_cutout_right_seq + \l_@@_cutout_right_seq \tl_gset_eq:NN \g_@@_interpar_penalty_user_tl \l_@@_interpar_penalty_user_tl \tl_gset_eq:NN \g_@@_interpar_vspace_user_tl @@ -1001,13 +1049,13 @@ \bool_gset_eq:NN \g_galley_no_break_next_bool \l_@@_no_break_next_bool \tl_gset_eq:NN \g_galley_par_begin_hook_tl - \l_@@_galley_par_begin_hook_tl + \l_@@_par_begin_hook_tl \tl_gset_eq:NN \g_galley_par_end_hook_tl - \l_@@_galley_par_end_hook_tl - \tl_gset_eq:NN \g_galley_par_after_hook_tl - \l_@@_par_after_hook_tl - \bool_gset_eq:NN \g_@@_parshape_set_bool - \l_@@_parshape_set_bool + \l_@@_par_end_hook_tl + \tl_gset_eq:NN \g_galley_par_reset_hook_tl + \l_@@_par_reset_hook_tl + \int_gset_eq:NN \g_@@_current_par_lines_int + \l_@@_current_par_lines_int \int_gset_eq:NN \g_galley_previous_par_lines_int \l_@@_previous_par_lines_int \tl_gset_eq:NN \g_galley_restore_running_tl @@ -1040,7 +1088,7 @@ % instruction. As this code can be inserted automatically, at the point % of use only the start of a galley level needs to be marked up: the end % must come in a fixed location. All of this relies on the the -% \enquote{colour safe} group used inside a box. +% \enquote{color safe} group used inside a box. % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_level_end: { @@ -1061,60 +1109,67 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\@@_std_par:} -% \begin{macro}[aux]{\@@_std_par_aux_i:, \@@_std_par_aux_ii:} -% \begin{macro}[aux]{\@@_std_par_aux:N} +% \begin{macro}{\galley_par:} +% \begin{macro}[aux]{\@@_par_auxi:, \@@_par_auxii:} +% \begin{macro}[aux]{\@@_par_aux:N} % The idea here is to expand the next token in exactly the same way as \TeX{} % would do anyway. The \texttt{f}-type expansion will ignore any protection, % but will stop at a scan marker. Thus the code can test for an % \enquote{omit paragraph} marker. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_std_par: +\cs_new_protected_nopar:Npn \galley_par: { \s__par_omit - \exp_after:wN \@@_std_par_aux_i: \tex_romannumeral:D - `0 + \exp_after:wN \@@_par_auxi: \tex_romannumeral:D - `0 } -\cs_new_protected:Npn \@@_std_par_aux_i: +\cs_new_protected:Npn \@@_par_auxi: { \peek_meaning:NTF \s__par_omit - { \@@_std_par_aux:N } - { \@@_std_par_aux_ii: } + { \@@_par_aux:N } + { \@@_par_auxii: } } -\cs_new_protected:Npn \@@_std_par_aux:N #1 +\cs_new_protected:Npn \@@_par_aux:N #1 { \str_if_eq_x:nnF {#1} { \s__par_omit } { - \@@_std_par_aux_ii: + \@@_par_auxii: #1 } } % \end{macrocode} -% No marker, so really insert a paragraph. In vertical mode, +% No marker, so really insert a paragraph: the \cs{tex_par:D} is inside a +% group to preserve some dynamic settings (for example +% \cs{etex_interlinepenalties:D}). In vertical mode, that means just +% inserting the primitive. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_std_par_aux_ii: +\cs_new_protected_nopar:Npn \@@_par_auxii: { \mode_if_vertical:TF - { \tex_par:D } + { + \group_begin: + \tex_par:D + \group_end: + } % \end{macrocode} % In horizontal mode, the paragraph shape is set \enquote{just in time} -% before inserting \cs{tex_par:D}. The \cs{tex_par:D} is inside a -% group to preserve some dynamic settings (for example -% \cs{etex_interlinepenalties}). Once the +% before inserting \cs{tex_par:D}. Once the % paragraph has been typeset, the number of lines is \emph{added} to the % running total. It's possible that the conceptual paragraph contains % display-like material, and simply setting the number of lines equal to -% \cs{tex_prevgraf:D} would \enquote{loose} these. +% \cs{tex_prevgraf:D} would \enquote{lose} these. % \begin{macrocode} { \g_galley_par_end_hook_tl - \@@_set_measure_and_parshape: - \group_begin: + \group_begin: \tex_par:D \group_end: - \int_gadd:Nn \g_galley_previous_par_lines_int \tex_prevgraf:D + \int_gset:Nn \g_galley_previous_par_lines_int + { \tex_prevgraf:D + \g_@@_current_par_lines_int } + \@@_parshape_reset: + \int_gzero:N \g_@@_current_par_lines_int } - \g_galley_par_after_hook_tl - \tl_gclear:N \g_galley_par_after_hook_tl + \g_galley_par_reset_hook_tl + \tl_gclear:N \g_galley_par_reset_hook_tl % \end{macrocode} % The non-breaking penalty is needed here as within the \cs{tex_everypar:D} % hook there is an additional \cs{tex_par:D}. This leads to an extra @@ -1128,17 +1183,17 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_end_par:n} +% \begin{macro}{\galley_par:n} % Inserts tokens such that they are appended to the end of the last % paragraph, using the paragraph-omitting system. % \begin{macrocode} -\cs_new_protected:Npn \@@_end_par:n #1 +\cs_new_protected:Npn \galley_par:n #1 { \s__par_omit \bool_if:nF \g_@@_begin_level_bool { #1 - \@@_std_par: + \galley_par: } } % \end{macrocode} @@ -1148,7 +1203,7 @@ % The meaning of the token \cs{par} itself starts off as a standard % paragraph. % \begin{macrocode} -\cs_set_protected_nopar:Npn \par { \@@_std_par: } +\cs_set_protected_nopar:Npn \par { \galley_par: } % \end{macrocode} % \end{macro} % @@ -1158,7 +1213,7 @@ % so this will only be needed in package mode. % \begin{macrocode} %<*package> -\tl_set:Nn \@par { \@@_std_par: } +\tl_set:Nn \@par { \galley_par: } %</package> % \end{macrocode} % \end{macro} @@ -1257,7 +1312,7 @@ % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_display_par: { - \cs_set_eq:NN \par \@@_std_par: + \cs_set_eq:NN \par \galley_par: \mode_if_vertical:TF { \par @@ -1266,11 +1321,10 @@ \@@_display_vspace:N \l_galley_display_end_par_vspace_tl } { - \@@_set_measure_and_parshape: \group_begin: \tex_par:D \group_end: - \int_gadd:Nn \g_galley_previous_par_lines_int \tex_prevgraf:D + \int_gadd:Nn \g_@@_current_par_lines_int \tex_prevgraf:D \@@_display_penalty:N \l_galley_display_end_penalty_tl \@@_display_vspace:N \l_galley_display_end_vspace_tl } @@ -1363,7 +1417,6 @@ \tex_everypar:D { } \tex_noindent:D \group_end: - \int_gzero:N \g_galley_previous_par_lines_int \@@_insert_horizontal_items: \@@_restore_running_parameters: } @@ -1475,14 +1528,27 @@ % \end{macro} % % \subsection{Measure} +% +% \begin{variable}{\l_@@_total_left_margin_dim, \l_@@_total_right_margin_dim} +% Used to set the measure, first by providing a place to save the existing +% values, then allowing calculation of the difference between old and new +% settings. +% \begin{macrocode} +\dim_new:N \l_@@_total_left_margin_dim +\dim_new:N \l_@@_total_right_margin_dim +% \end{macrocode} +% \end{variable} % % \begin{macro} % {\galley_margins_set_absolute:nn, \galley_margins_set_relative:nn} +% \begin{macro}[aux]{\@@_save_margins:, \@@_set_measure:} +% \begin{macro}[aux, rEXP]{\@@_set_measure_aux:n} % Setting the measure is just a question of adjusting margins, either % in a relative or absolute sense. % \begin{macrocode} \cs_new_protected:Npn \galley_margins_set_absolute:nn #1#2 { + \@@_save_margins: \dim_set:Nn \l_galley_total_left_margin_dim {#1} \dim_set:Nn \l_galley_total_right_margin_dim {#2} \dim_set:Nn \l_galley_text_width_dim @@ -1491,9 +1557,11 @@ - \l_galley_total_left_margin_dim - \l_galley_total_right_margin_dim } + \@@_set_measure: } \cs_new_protected:Npn \galley_margins_set_relative:nn #1#2 { + \@@_save_margins: \dim_add:Nn \l_galley_total_left_margin_dim {#1} \dim_add:Nn \l_galley_total_right_margin_dim {#2} \dim_set:Nn \l_galley_text_width_dim @@ -1502,205 +1570,372 @@ - \l_galley_total_left_margin_dim - \l_galley_total_right_margin_dim } + \@@_set_measure: + } +% \end{macrocode} +% Saves the previous margin state so that it can be used for calculation +% during the update. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \@@_save_margins: + { + \dim_set_eq:NN \l_@@_total_left_margin_dim + \l_galley_total_left_margin_dim + \dim_set_eq:NN \l_@@_total_right_margin_dim + \l_galley_total_right_margin_dim + } +% \end{macrocode} +% Setting the measure first requires a quick test to see if there is any +% existing shape: if not, just use the values directly. Assuming we do need +% to allow for the existing shape, the idea is to preserve whatever shape +% has already been applied and adjust the edges. This can be done by +% iterating though the existing shape, recovering the values and applying +% the changes. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \@@_set_measure: + { + \int_compare:nNnTF \tex_parshape:D = \c_zero + { \@@_parshape_measure: } + { + \dim_sub:Nn \l_@@_total_left_margin_dim + \l_galley_total_left_margin_dim + \dim_sub:Nn \l_@@_total_right_margin_dim + \l_galley_total_right_margin_dim + \tex_parshape:D + \tex_parshape:D + \int_step_function:nnnN + \c_one \c_one \tex_parshape:D + \@@_set_measure_aux:n + } + } +\cs_new:Npn \@@_set_measure_aux:n #1 + { + \__dim_eval:w + \etex_parshapeindent:D #1 - \l_@@_total_left_margin_dim + \__dim_eval_end: + \__dim_eval:w + \etex_parshapelength:D #1 + + \l_@@_total_left_margin_dim + \l_@@_total_right_margin_dim + \__dim_eval_end: } % \end{macrocode} % \end{macro} -% +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_parshape_reset:} +% Test for paragraph shapes to be removed: a multi-step procedure! First, +% check to see if there is a shape at all. If there is, the second check +% looks for cutouts. If there are no cutouts to worry about, the final +% check is whether the current shape applies to one paragraph or on an +% ongoing sense. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \@@_parshape_reset: + { + \int_compare:nNnF \tex_parshape:D = \c_zero + { + \bool_if:nTF + { + \seq_if_empty_p:N \g_@@_cutout_left_seq + && \seq_if_empty_p:N \g_@@_cutout_right_seq + } + { + \bool_if:NF \l_@@_parshape_multipar_bool + { \@@_parshape_measure: } + } +% \end{macrocode} +% If there was a cutout active, the \enquote{done} part is removed from +% the tracking sequences. The \enquote{normal} paragraph shape is then +% reapplied before removing the cutout parts. This is done using separate +% loops as in general that is as easy as trying to work out all of the +% parts in advance (the same number of loops would still be needed). +% \begin{macrocode} + { + \prg_replicate:nn \g@@_previous_par_lines_int + { + \seq_gpop:NN \g_@@_cutout_left_seq \l_@@_tmp_tl + \seq_gpop:NN \g_@@_cutout_right_seq \l_@@_tmp_tl + } + \bool_if:NTF \l_@@_parshape_multipar_bool + { \@@_parshape_set: } + { \@@_parshape_measure: } + \@@_cutout_set:Nn \g_@@_cutout_left_seq { left } + \@@_cutout_set:Nn \g_@@_cutout_right_seq { right } + } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@@_parshape_measure:} +% Sets the parshape to the full measure at the current time: used in a few +% places, so worth spinning out. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \@@_parshape_measure: + { + \tex_parshape:D + \c_one + \l_galley_total_left_margin_dim + \l_galley_text_width_dim + } +% \end{macrocode} +% \end{macro} +% % \subsection{Paragraph shape} % % \begin{macro} % { -% \galley_parshape_fixed_lines:nnn, -% \galley_parshape_fixed_lines:nVV, -% \galley_parshape_multi_par:nnnN, -% \galley_parshape_multi_par:nVVN, -% \galley_parshape_single_par:nnnN, -% \galley_parshape_single_par:nVVN +% \galley_parshape_set_multi:nnnN, +% \galley_parshape_set_multi:nVVN, +% \galley_parshape_set_single:nnnN, +% \galley_parshape_set_single:nVVN % } -% Setting the paragraph shape is easy as most of the real work is done -% later. So this is just a case of saving the various pieces of data -% to the correct locations. +% Setting the paragraph shape is mainly a question of converting the input. +% First, though, a flag is set. % \begin{macrocode} -\cs_new_protected:Npn \galley_parshape_fixed_lines:nnn #1#2#3 +\cs_new_protected_nopar:Npn \galley_parshape_set_multi:nnnN { - \bool_gset_true:N \g_@@_parshape_set_bool - \bool_set_true:N \l_@@_parshape_fixed_lines_bool - \int_set:Nn \l_galley_parshape_std_lines_int {#1} - \clist_set:Nn \l_@@_parshape_left_indent_clist {#2} - \clist_set:Nn \l_@@_parshape_right_indent_clist {#3} - \bool_set_true:N \l_@@_parshape_resume_std_bool - } -\cs_new_protected:Npn \galley_parshape_multi_par:nnnN #1#2#3#4 - { - \bool_gset_true:N \g_@@_parshape_set_bool \bool_set_true:N \l_@@_parshape_multipar_bool - \bool_set_false:N \l_@@_parshape_fixed_lines_bool - \int_set:Nn \l_galley_parshape_std_lines_int {#1} - \clist_set:Nn \l_@@_parshape_left_indent_clist {#2} - \clist_set:Nn \l_@@_parshape_right_indent_clist {#3} - \bool_set_eq:NN \l_@@_parshape_resume_std_bool #4 + \@@_parshape_set:nnnN } -\cs_new_protected:Npn \galley_parshape_single_par:nnnN #1#2#3#4 +\cs_new_protected_nopar:Npn \galley_parshape_set_single:nnnN { - \bool_gset_true:N \g_@@_parshape_set_bool \bool_set_false:N \l_@@_parshape_multipar_bool - \bool_set_false:N \l_@@_parshape_fixed_lines_bool - \int_set:Nn \l_galley_parshape_std_lines_int {#1} - \clist_set:Nn \l_@@_parshape_left_indent_clist {#2} - \clist_set:Nn \l_@@_parshape_right_indent_clist {#3} - \bool_set_eq:NN \l_@@_parshape_resume_std_bool #4 + \@@_parshape_set:nnnN } -\cs_generate_variant:Nn \galley_parshape_fixed_lines:nnn { nVV } -\cs_generate_variant:Nn \galley_parshape_multi_par:nnnN { nVV } -\cs_generate_variant:Nn \galley_parshape_single_par:nnnN { nVV } +\cs_generate_variant:Nn \galley_parshape_set_multi:nnnN { nVV } +\cs_generate_variant:Nn \galley_parshape_set_single:nnnN { nVV } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_set_measure_and_parshape:} -% To set the paragraph shape for the current paragraph, there is a check to -% see if the measure alone should be used. If not, then the shape may be -% built by paragraph or based on the number of lines required. -% \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_measure_and_parshape: +% \begin{macro}[int]{\@@_parshape_set:nnnN} +% \begin{macro}[int]{\@@_parshape_set:} +% \begin{macro}[aux, rEXP]{\@@_parshape_set:nn} +% Setting the paragraph shape starts by converting the two input lists into +% sequences. The shape is then set using a mapping with allowance for the +% unaltered lines and the possibility of resuming the measure. The unaltered +% lines are added to the sequences as this information may be needed +% elsewhere (if a cutout is active), and this is the most convenient way to +% deal with it. Everything ends up stored in the two sequences for possible +% re-application if there are cutouts. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parshape_set:nnnN #1#2#3#4 { - \bool_if:NTF \g_@@_parshape_set_bool + \seq_set_from_clist:Nn \l_@@_parshape_left_indent_seq {#2} + \seq_set_from_clist:Nn \l_@@_parshape_right_indent_seq {#3} + \prg_replicate:nn {#1} { - \bool_if:NTF \l_@@_parshape_fixed_lines_bool - { - \int_compare:nNnTF \g_galley_previous_par_lines_int > \c_zero - { \@@_generate_parshape_lines: } - { \@@_generate_parshape: } - } - { - \bool_gset_eq:NN \g_@@_parshape_set_bool - \l_@@_parshape_multipar_bool - \@@_generate_parshape: - } + \seq_put_left:Nn \l_@@_parshape_left_indent_seq { 0 pt } + \seq_put_left:Nn \l_@@_parshape_right_indent_seq { 0 pt } } + \bool_if:NT #4 { - \tex_global:D \tex_parshape:D - \c_one - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim - } + \seq_put_right:Nn \l_@@_parshape_left_indent_seq { 0 pt } + \seq_put_right:Nn \l_@@_parshape_right_indent_seq { 0 pt } + } + \@@_parshape_set: } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\@@_generate_parshape:} -% \begin{macro}[aux]{\@@_set_parshape_map:nn, \@@_set_parshape_map:oo} -% \begin{macro}[aux]{\@@_set_parshape_map_aux:nw} -% For a shape to apply on a paragraph basis, the two user-supplied comma -% lists are taken and converted into left-side offsets and line lengths. -% This is all dependent on the current measure. -% \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_generate_parshape: +\cs_new_protected_nopar:Npn \@@_parshape_set: { - \tex_global:D \tex_parshape:D + \tex_parshape:D \__int_eval:w - \l_galley_parshape_std_lines_int + - \int_min:nn - { \clist_count:N \l_@@_parshape_left_indent_clist } - { \clist_count:N \l_@@_parshape_right_indent_clist } - \bool_if:NT \l_@@_parshape_resume_std_bool { + 1 } + \int_min:nn + { \seq_count:N \l_@@_parshape_left_indent_seq } + { \seq_count:N \l_@@_parshape_right_indent_seq } \__int_eval_end: - \prg_replicate:nn \l_galley_parshape_std_lines_int - { - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim - \c_space_tl - } - \@@_set_parshape_map:oo - \l_@@_parshape_left_indent_clist - \l_@@_parshape_right_indent_clist - \bool_if:NT \l_@@_parshape_resume_std_bool - { - \c_space_tl - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim - } + \seq_mapthread_function:NNN + \l_@@_parshape_left_indent_seq + \l_@@_parshape_right_indent_seq + \@@_parshape_set:nn } -\cs_new:Npn \@@_set_parshape_map:nn #1#2 - { \@@_set_parshape_map_aux:nw { } #1 , \q_mark #2 , \q_stop } -\cs_generate_variant:Nn \@@_set_parshape_map:nn { oo } -\cs_new:Npn \@@_set_parshape_map_aux:nw #1#2 , #3 \q_mark #4 , #5 \q_stop +\cs_new:Npn \@@_parshape_set:nn #1#2 { - \bool_if:nTF { \tl_if_empty_p:n {#3} || \tl_if_empty_p:n {#5} } + \__dim_eval:w \l_galley_total_left_margin_dim + ( #1 ) \__dim_eval_end: + \__dim_eval:w + \l_galley_text_width_dim - ( ( #1 ) + ( #2 ) ) + \__dim_eval_end: + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Cutouts} +% +% Cutouts are another way of looking at paragraph shapes, but apply to +% a fixed number of lines within a galley. As such, they require separate +% handling from the measure and shape. +% +% \begin{macro}{\galley_cutout_left:nn, \galley_cutout_right:nn} +% \begin{macro}[int]{\@@_cutout:nnn} +% \begin{macro}[aux]{\@@_cutout_store:nn} +% \begin{macro}[int]{\@@_cutout_set:Nn} +% \begin{macro}[aux]{\@@_cutout_left:n, \@@_cutout_right:n, \@@_cutout_end:n} +% Setting up cutouts on the two sides of the paragraph is more or less +% the same idea with one or two very specific points of difference. As such, +% the two interface functions both use the same implementation. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \galley_cutout_left:nn + { \@@_cutout:nnn { left } } +\cs_new_protected_nopar:Npn \galley_cutout_right:nn + { \@@_cutout:nnn { right } } +% \end{macrocode} +% The approach in the main function is first to construct a single sequence +% which contains details of all of the altered lines. This sequence is then +% used by \cs{@@_cutout_set:Nn}, which actually applies the cutout to the +% current paragraph shape. One that is done, information on the cutout just +% applied is merged with the global cutout store: this needs to allow for +% different cutout lengths. The best way to do that is to loop over whichever +% list is longer, build a new list of the result and the copy this back to +% the store. +% \begin{macrocode} +\cs_new_protected:Npn \@@_cutout:nnn #1#2#3 + { + \seq_set_from_clist:Nn \l_@@_tmpa_seq {#3} + \prg_replicate:nn {#2} + { \seq_put_left:Nn \l_@@_tmpa_seq { 0 pt } } + \@@_cutout_set:Nn \l_@@_tmpa_seq {#1} + \seq_clear:N \l_@@_tmpb_seq + \int_compare:nNnTF + { \seq_count:N \l_@@_tmpa_seq } > + { \seq_count:c { g_@@_cutout_ #1 _ seq } } { - #1 - \dim_eval:n { \l_galley_total_left_margin_dim + ( #2 ) } - \c_space_tl - \dim_eval:n { \l_galley_text_width_dim - ( ( #2 ) + ( #4 ) ) } + \seq_map_inline:Nn \l_@@_tmpa_seq + { + \@@_cutout_store:nn + { \seq_gpop:cNF { g_@@_cutout_ #1 _ seq } } + {##1} + } } { - \@@_set_parshape_map_aux:nw - { - #1 - \dim_eval:n { \l_galley_total_left_margin_dim + ( #2 ) } - \c_space_tl - \dim_eval:n { \l_galley_text_width_dim - ( ( #2 ) + ( #4 ) ) } - \c_space_tl + \seq_map_inline:cn { g_@@_cutout_ #1 _ seq } + { + \@@_cutout_store:nn + { \seq_pop:NNF \l_@@_tmpa_seq } + {##1} } - #3 \q_mark #5 \q_stop } + \seq_gset_eq:cN { g_@@_cutout_ #1 _ seq } \l_@@_tmpb_seq + } +\cs_new_protected:Npn \@@_cutout_store:nn #1#2 + { + #1 \l_@@_tmp_tl + { \tl_set:Nn \l_@@_tmp_tl { 0 pt } } + \seq_put_right:Nx \l_@@_tmpb_seq + { \dim_eval:n { \l_@@_tmp_tl + #2 } } } % \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}[int]{\@@_generate_parshape_lines:} -% \begin{macro}[aux]{\@@_generate_parshape_lines:n} -% The idea here is to construct a paragraph shape based on the remaining -% lines from the shape in the previous paragraph. If the previous paragraph -% was sufficiently long, then life is \enquote{back to normal} and the -% standard shape is set. If a special shape is needed, this is recovered -% from the paragraph shape using the \eTeX{} primitives. +% Actually applying a cutout is done by using the sequence containing the +% cutout shape plus the current paragraph shape to construct a token list +% of the required indents and line lengths. That is done in a +% non-expansion way to allow for the two different kinds of mapping (to the +% sequence and to the parshape). At the end of the process, there is a need +% to allow for the last line of \tn{parshape}: depending on any existing +% shape and the length of the cutout, this might be the measure or a +% repeat of the last values in the shape. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_generate_parshape_lines: +\cs_new_protected:Npn \@@_cutout_set:Nn #1#2 { - \int_compare:nNnTF \tex_parshape:D > \g_galley_previous_par_lines_int + \int_zero:N \l_@@_tmp_int + \tl_clear:N \l_@@_tmp_tl + \seq_map_function:Nc #1 { _@@_cutout_ #2 :n } + \int_compare:nNnTF \tex_parshape:D > \l_@@_tmp_int { - \tex_global:D \tex_parshape:D - \__int_eval:w \tex_parshape:D - \g_galley_previous_par_lines_int - \__int_eval_end: - \int_step_function:nnnN - { \g_galley_previous_par_lines_int + \c_one } - \c_one \tex_parshape:D \@@_generate_parshape_lines:n + \int_step_function:nnnN + { \l_@@_tmp_int + \c_one } + \c_one + \tex_parshape:D + \@@_cutout_end:n } { - \bool_gset_false:N \g_@@_parshape_set_bool - \tex_global:D \tex_parshape:D - \c_one - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim + \int_incr:N \l_@@_tmp_int + \int_compare:nNnTF \tex_parshape:D = \c_zero + { + \tl_put_right:Nn \l_@@_tmp_tl + { \l@@_total_left_margin_dim \l@@_text_width_dim } + } + { + \tl_put_right:Nx \l_@@_tmp_tl + { + \dim_eval:n { \etex_parshapeindent:D \tex_parshape:D } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D \tex_parshape:D } + \c_space_tl + } + } + } + \tex_parshape:D + \l_@@_tmp_int + \l_@@_tmp_tl + } +% \end{macrocode} +% The only place where the position of the cutout matters is in working out +% the indent and line lengths. That's achieved using two separate auxiliaries +% and selection by name. +% \begin{macrocode} +\cs_new_protected:Npn \@@_cutout_left:n #1 + { + \int_incr:N \l_@@_tmp_int + \tl_put_right:Nx \l_@@_tmp_tl + { + \int_compare:nNnTF \l_@@_tmp_int > \tex_parshape:D + { + \dim_eval:n { \l@@_total_left_margin_dim + ( #1 ) } + \c_space_tl + \dim_eval:n { \l@@_text_width_dim - ( #1 ) } + \c_space_tl + } + { + \dim_eval:n { \etex_parshapeindent:D \l_@@_tmp_int + ( #1 ) } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D \l_@@_tmp_int - ( #1 ) } + \c_space_tl + } } } -\cs_new:Npn \@@_generate_parshape_lines:n #1 +\cs_new_protected:Npn \@@_cutout_right:n #1 { - \etex_parshapeindent:D #1 - ~ - \etex_parshapelength:D #1 + \int_incr:N \l_@@_tmp_int + \tl_put_right:Nx \l_@@_tmp_tl + { + \dim_eval:n { \etex_parshapeindent:D \l_@@_tmp_int } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D \l_@@_tmp_int - ( #1 ) } + \c_space_tl + } } % \end{macrocode} +% An auxiliary to \enquote{recycle} the paragraph shape which is already +% active \emph{if} the cutout is shorter. +% \begin{macrocode} +\cs_new_protected:Npn \@@_cutout_end:n #1 + { + \int_incr:N \l_@@_tmp_int + \tl_put_right:Nx \l_@@_tmp_tl + { + \dim_eval:n { \etex_parshapeindent:D #1 } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D #1 } + \c_space_tl + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} % \end{macro} % \end{macro} % % \subsection{Between paragraphs} % -% \begin{macro}{\galley_set_user_penalty:n, \galley_set_user_vspace:n} +% \begin{macro}{\galley_penalty_set_single:n, \galley_vspace_set_single:n} % User supplied penalties and spaces only apply for a single paragraph. % In both cases, the input values need to be checked for the correct % form but are stored as token lists. The \texttt{x}-type expansion % deals with this nicely. % \begin{macrocode} -\cs_new_protected:Npn \galley_set_user_penalty:n #1 +\cs_new_protected:Npn \galley_penalty_set_single:n #1 { \tl_gset:Nx \g_@@_interpar_penalty_user_tl { \int_eval:n {#1} } } -\cs_new_protected:Npn \galley_set_user_vspace:n #1 +\cs_new_protected:Npn \galley_vspace_set_single:n #1 { \tl_gset:Nx \g_@@_interpar_vspace_user_tl { \skip_eval:n {#1} } } % \end{macrocode} % \end{macro} @@ -1757,7 +1992,7 @@ % specified by the font designer and not to use arbitrary values % (\emph{cf.}~the approach in \emph{The \TeX{}book}, p.~101). % -% \begin{macro}{\galley_set_interword_spacing:N} +% \begin{macro}{\galley_interword_spacing_set:N} % The approach taken to setting a fixed space is to use the information % from the current font to set the spacing. This means that only % \cs{tex_spacefactor:D} needs to be set, while \cs{tex_xspacefactor:D} @@ -1769,7 +2004,7 @@ % (non-zero \cs{tex_fontdimen:D} \texttt{3}), then the \cs{teX_spaceskip:D} % is set to the fixed component from the font. % \begin{macrocode} -\cs_new_protected:Npn \galley_set_interword_spacing:N #1 +\cs_new_protected:Npn \galley_interword_spacing_set:N #1 { \bool_if:NTF #1 { % TODO Hook for font changes required! @@ -1832,7 +2067,7 @@ % Terminating a line early without a new paragraph requires a few steps. % First, any skips are removed, then any additional space to add is % places on the surrounding vertical list. Finally, the current line -% is ended, using a penalty to prevents an overful line ending |\\| giving +% is ended, using a penalty to prevents an overfull line ending |\\| giving % a totally-blank one in the output. The boolean argument is used to indicate % that a break is allowed after the blank line. % \begin{macrocode} @@ -1889,14 +2124,14 @@ % % \begin{macro} % { -% \galley_set_display_widow_penalties:n, -% \galley_set_display_widow_penalties:V, -% \galley_set_display_widow_penalties:v, -% \galley_set_widow_penalties:n, -% \galley_set_widow_penalties:V, -% \galley_set_widow_penalties:v +% \galley_display_widow_penalties_set:n, +% \galley_display_widow_penalties_set:V, +% \galley_display_widow_penalties_set:v, +% \galley_widow_penalties_set:n, +% \galley_widow_penalties_set:V, +% \galley_widow_penalties_set:v % } -% \begin{macro}[aux]{\galley_set_aux:n} +% \begin{macro}[aux]{\@@_set_aux:n} % By far the easiest penalties to deal with are those for widows. These % work exactly as the names imply, with the display version only used % immediately before display math, and the standard penalty used at the end @@ -1904,83 +2139,83 @@ % the correct form, and add a $0$ penalty at the end to nullify the effect of % repeating the last value. % \begin{macrocode} -\cs_new_protected:Npn \galley_set_display_widow_penalties:n #1 +\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: - \clist_map_function:nN {#1} \galley_set_aux:n + \clist_map_function:nN {#1} \@@_set_aux:n \c_zero } -\cs_generate_variant:Nn \galley_set_display_widow_penalties:n { V , v } -\cs_new_protected:Npn \galley_set_widow_penalties:n #1 +\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: - \clist_map_function:nN {#1} \galley_set_aux:n + \clist_map_function:nN {#1} \@@_set_aux:n \c_zero } -\cs_generate_variant:Nn \galley_set_widow_penalties:n { V , v } -\cs_new:Npn \galley_set_aux:n #1 { #1 ~ } +\cs_generate_variant:Nn \galley_widow_penalties_set:n { V , v } +\cs_new:Npn \@@_set_aux:n #1 { \int_eval:n {#1} ~ } % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro} % { -% \galley_set_club_penalties:n, -% \galley_set_club_penalties:V, -% \galley_set_club_penalties:v, -% \galley_set_interline_penalties:n, -% \galley_set_interline_penalties:V, -% \galley_set_interline_penalties:v +% \galley_club_penalties_set:n, +% \galley_club_penalties_set:V, +% \galley_club_penalties_set:v, +% \galley_interline_penalties_set:n, +% \galley_interline_penalties_set:V, +% \galley_interline_penalties_set:v % } % Setting club or special line penalties is easy, as these are handled % mainly by the interline set up function. The two concepts are essentially % the same, but having two takes makes some special effects easier to % carry out. % \begin{macrocode} -\cs_new_protected:Npn \galley_set_club_penalties:n #1 +\cs_new_protected:Npn \galley_club_penalties_set:n #1 { \clist_set:Nn \l_galley_club_penalties_clist {#1} \@@_calc_interline_penalties: } -\cs_generate_variant:Nn \galley_set_club_penalties:n { V , v } -\cs_new_protected:Npn \galley_set_interline_penalties:n #1 +\cs_generate_variant:Nn \galley_club_penalties_set:n { V , v } +\cs_new_protected:Npn \galley_interline_penalties_set:n #1 { \clist_set:Nn \l_galley_line_penalties_clist {#1} \@@_calc_interline_penalties: } -\cs_generate_variant:Nn \galley_set_interline_penalties:n { V , v } +\cs_generate_variant:Nn \galley_interline_penalties_set:n { V , v } % \end{macrocode} % \end{macro} % % \begin{macro} % { -% \galley_set_display_club_penalties:n, -% \galley_set_display_club_penalties:V, -% \galley_set_display_club_penalties:v +% \galley_display_club_penalties_set:n, +% \galley_display_club_penalties_set:V, +% \galley_display_club_penalties_set:v % } % Setting the display club penalties means first setting the primitive, % then recalculating the interline array to allow for these new values. % \begin{macrocode} -\cs_new_protected:Npn \galley_set_display_club_penalties:n #1 +\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: - \clist_map_function:nN {#1} \galley_set_aux:n + \clist_map_function:nN {#1} \@@_set_aux:n \c_zero \@@_calc_interline_penalties: } -\cs_generate_variant:Nn \galley_set_display_club_penalties:n { V , v } +\cs_generate_variant:Nn \galley_display_club_penalties_set:n { V , v } % \end{macrocode} % \end{macro} % -% \begin{macro}{\galley_set_interline_penalty:n} +% \begin{macro}{\galley_interline_penalty_set:n} % \begin{macro}[aux]{\@@_set_interline_penalty:nn} % \begin{macro}[aux] % { -% \@@_set_interline_penalty_i:n, -% \@@_set_interline_penalty_ii:n +% \@@_set_interline_penalty_auxi:n, +% \@@_set_interline_penalty_auxii:n % } % Dealing with the general interline penalty is handled in one shot. % The idea is that for lines with no special penalty, the old general @@ -1989,7 +2224,7 @@ % generic build system is invoked (in case the % \cs{etex_interlinepenalties:D} has accidentally been cleared). % \begin{macrocode} -\cs_new_protected:Npn \galley_set_interline_penalty:n #1 +\cs_new_protected:Npn \galley_interline_penalty_set:n #1 { \int_compare:nNnTF { \etex_interlinepenalties:D \c_zero } = \c_zero { @@ -1997,7 +2232,7 @@ \@@_calc_interline_penalties: } { - \cs_set:Npn \@@_set_interline_penalty_ii:n ##1 + \cs_set:Npn \@@_set_interline_penalty_auxii:n ##1 { \__int_eval:w \etex_interlinepenalties:D ##1 @@ -2014,15 +2249,15 @@ \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero \int_step_function:nnnN \c_one \c_one {#1} - \@@_set_interline_penalty_i:n + \@@_set_interline_penalty_auxi:n \int_step_function:nnnN { #1 + \c_one } \c_one { \etex_interlinepenalties:D \c_zero - \c_one } - \@@_set_interline_penalty_ii:n + \@@_set_interline_penalty_auxii:n \__int_eval:w #2 \__int_eval_end: } -\cs_new:Npn \@@_set_interline_penalty_i:n #1 +\cs_new:Npn \@@_set_interline_penalty_auxi:n #1 { \etex_interlinepenalties:D \__int_eval:w #1 \__int_eval_end: } -\cs_new:Npn \@@_set_interline_penalty_ii:n #1 { } +\cs_new:Npn \@@_set_interline_penalty_auxii:n #1 { } % \end{macrocode} % \end{macro} % \end{macro} @@ -2032,8 +2267,8 @@ % \begin{macro}[aux]{\@@_calc_interline_penalties:nn} % \begin{macro}[aux] % { -% \@@_calc_interline_penalties_i:n, -% \@@_calc_interline_penalties_ii:n +% \@@_calc_interline_penalties_auxi:n, +% \@@_calc_interline_penalties_auxii:n % } % The underlying interline penalty array has to deal with club penalties, % display club penalties and any special line penalties, and include @@ -2046,21 +2281,18 @@ { \exp_args:Nff \@@_calc_interline_penalties:nn { - \int_eval:n + \int_max:nn + { + \clist_count:N \l_galley_club_penalties_clist + + \c_one + } { \int_max:nn { - \clist_count:N \l_galley_club_penalties_clist + \clist_count:N \l_galley_line_penalties_clist + \c_one } - { - \int_max:nn - { - \clist_count:N \l_galley_line_penalties_clist - + \c_one - } - { \etex_clubpenalties:D \c_zero } - } + { \etex_clubpenalties:D \c_zero } } } { \clist_count:N \l_galley_line_penalties_clist } @@ -2075,12 +2307,12 @@ { \etex_interlinepenalties:D #1 ~ \int_step_function:nnnN \c_one \c_one {#2} - \@@_calc_interline_penalties_i:n + \@@_calc_interline_penalties_auxi:n \int_step_function:nnnN { #2 + \c_one } \c_one { #1 - \c_one } - \@@_calc_interline_penalties_ii:n + \@@_calc_interline_penalties_auxii:n \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero } -\cs_new:Npn \@@_calc_interline_penalties_i:n #1 +\cs_new:Npn \@@_calc_interline_penalties_auxi:n #1 { \__int_eval:w \clist_item:Nn \l_galley_line_penalties_clist {#1} @@ -2088,7 +2320,7 @@ - \etex_clubpenalties:D #1 ~ \__int_eval_end: } -\cs_new:Npn \@@_calc_interline_penalties_ii:n #1 +\cs_new:Npn \@@_calc_interline_penalties_auxii:n #1 { \__int_eval:w \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero @@ -2133,21 +2365,21 @@ { \int_step_function:nnnN \c_one \c_one { \etex_clubpenalties:D \c_zero - \c_one } - \galley_save_display_club_penalties:_aux:n + \@@_save_display_club_penalties:n } } -\cs_new:Npn \galley_save_display_club_penalties:_aux:n #1 - { \int_use:N \etex_clubpenaltes:D \__int_eval:w #1 \__int_eval_end: , } +\cs_new:Npn \@@_save_display_club_penalties:n #1 + { \int_use:N \etex_clubpenalties:D \__int_eval:w #1 \__int_eval_end: , } \cs_new_protected:Npn \galley_save_display_widow_penalties:N #1 { \clist_set:Nx #1 { \int_step_function:nnnN \c_one \c_one { \etex_displaywidowpenalties:D \c_zero - \c_one } - \galley_save_display_widow_penalties:_aux:n + \@@_save_display_widow_penalties:n } } -\cs_new:Npn \galley_save_display_widow_penalties:_aux:n #1 +\cs_new:Npn \@@_save_display_widow_penalties:n #1 { \int_use:N \etex_displaywidowpenalties:D \__int_eval:w #1 \__int_eval_end: , } \cs_new_protected:Npn \galley_save_widow_penalties:N #1 { @@ -2155,10 +2387,10 @@ { \int_step_function:nnnN \c_one \c_one { \etex_widowpenalties:D \c_zero - \c_one } - \galley_save_widow_penalties:_aux:n + \@@_save_widow_penalties:n } } -\cs_new:Npn \galley_save_widow_penalties:_aux:n #1 +\cs_new:Npn \@@_save_widow_penalties:n #1 { \int_use:N \etex_widowpenalties:D \__int_eval:w #1 \__int_eval_end: , } % \end{macrocode} % This one is not an array, but is stored in a primitive, so there is @@ -2204,7 +2436,7 @@ \tl_gput_right:Nn \g_galley_whatsit_next_tl { \iow_shipout:Nx \c_minus_one { } } \tex_vbox:D { } - \galley_set_user_penalty:n { -\@Mi } + \galley_penalty_set_single:n { -\@Mi } } % \end{macrocode} % \end{macro} @@ -2232,8 +2464,8 @@ \RenewDocumentCommand \vspace { s m } { \IfBooleanTF #1 - { \galley_set_user_vspace:n {#2} } - { \galley_set_user_vspace:n {#2} } + { \galley_vspace_set_single:n {#2} } + { \galley_vspace_set_single:n {#2} } } % \end{macrocode} % \end{macro} @@ -2262,7 +2494,7 @@ % \begin{macro}{\@@par} % The primitive is moved as otherwise the clever skipping code will fail. % \begin{macrocode} -\cs_set_eq:NN \@@par \@@_std_par: +\cs_set_eq:cN { @ @ par } \galley_par: % \end{macrocode} % \end{macro} % @@ -2274,14 +2506,14 @@ \bool_gset_true:N \g_galley_no_break_next_bool \if@afterindent \else - \bool_gset_true:N \galley_omit_next_indent_bool + \bool_gset_true:N \g_galley_omit_next_indent_bool \fi } % \end{macrocode} % \end{macro} % % \begin{macro}{\@hangfrom} -% The \cs{tex_handindent:D} primitive is no longer used, so the paragraph +% The \cs{tex_hangindent:D} primitive is no longer used, so the paragraph % shape is set in a different way. As a result, the label is part of the % same paragraph as the main body, hence the need to leave vertical mode. % \begin{macrocode} @@ -2290,7 +2522,7 @@ \bool_gset_true:N \g_galley_omit_next_indent_bool \leavevmode \setbox \@tempboxa = \hbox { {#1} } - \galley_parshape_single_par:nnnN + \galley_parshape_set_single:nnnN \c_one { \box_wd:N \@tempboxa } \c_zero_dim diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx index 9e0ecffb59a..d0086f4a3e3 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{expl3} -\GetIdInfo$Id: xgalley.dtx 4253 2012-11-01 21:01:54Z joseph $ +\GetIdInfo$Id: xgalley.dtx 4373 2012-12-17 16:41:59Z joseph $ {L3 Experimental galley} %</driver|package> %<*driver> @@ -872,14 +872,14 @@ \AssignTemplateKeys \bool_if:NTF \l_@@_parshape_on_left_bool { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \l_@@_parshape_lines_int \l_@@_parshape_indent_dim \c_zero_dim \c_false_bool } { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \l_@@_parshape_lines_int \c_zero_dim \l_@@_parshape_indent_dim @@ -905,14 +905,14 @@ } \bool_if:NTF \l_@@_parshape_on_left_bool { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \c_zero \l_@@_tmpa_clist \l_@@_tmpb_clist \c_true_bool } { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \c_zero \l_@@_tmpb_clist \l_@@_tmpa_clist @@ -1059,7 +1059,7 @@ { \AssignTemplateKeys \tl_clear:N \l_@@_justification_other_tl - \galley_set_interword_spacing:N \l_galley_fixed_spacing_bool + \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_zero:N \l_galley_last_line_fit_int } @@ -1089,7 +1089,7 @@ \bool_if:NTF \l_galley_fixed_spacing_bool { \bool_set_true:N \exp_not:N \l_galley_fixed_spacing_bool } { \bool_set_false:N \exp_not:N \l_galley_fixed_spacing_bool } - \galley_set_interword_spacing:N + \galley_interword_spacing_set:N \exp_not:N \l_galley_fixed_spacing_bool \dim_set:Nn \exp_not:N \l_galley_par_indent_dim { \dim_use:N \l_galley_par_indent_dim } @@ -1107,7 +1107,7 @@ \tl_gput_right:Nn \g_galley_restore_running_tl { \l_@@_justification_other_tl } \AssignTemplateKeys - \galley_set_interword_spacing:N \l_galley_fixed_spacing_bool + \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_zero:N \l_galley_last_line_fit_int } @@ -1159,8 +1159,8 @@ right-skip = 0 pt plus 2 em } % \end{macrocode} -% The \texttt{centering} instance is used to center material with minimal -% hyphenation +% The \texttt{center} instance is used to center material with minimal +% hyphenation. % \begin{macrocode} \DeclareInstance { justification } { center } { std } { @@ -1300,11 +1300,11 @@ } { \AssignTemplateKeys - \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 + \galley_club_penalties_set:V \l_@@_club_penalty_int + \galley_display_club_penalties_set:V \l_@@_display_club_penalty_int + \galley_display_widow_penalties_set:V \l_@@_display_widow_penalty_int + \galley_interline_penalty_set:n \l_@@_interline_penalty_int + \galley_widow_penalties_set:V \l_@@_widow_penalty_int } % \end{macrocode} % \end{variable} @@ -1383,7 +1383,7 @@ % \begin{macrocode} \tl_if_empty:NF \l_@@_interline_penalty_tl { - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \int_set:Nn \exp_not:N \l_@@_interline_penalty_int { \galley_interline_penalty: } @@ -1393,7 +1393,7 @@ } \tl_if_empty:NF \l_@@_parbreak_fuzz_tl { - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \dim_set:Nn \exp_not:N \l_galley_parbreak_fuzz_dim { \dim_use:N \l_galley_parbreak_fuzz_dim } @@ -1408,7 +1408,7 @@ { \tl_if_empty:cF { l_galley_ ##1 _tl } { - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \int_set:Nn \exp_not:c { l_galley_ ##1 _int } { \int_use:c { l_galley_ ##1 _int } } @@ -1426,7 +1426,7 @@ \tl_if_empty:cF { l_galley_ ##1 _tl } { \use:c { galley_save_ ##1 :N } \l_@@_tmpa_clist - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \exp_not:c { galley_set_ ##1 :n } { \exp_not:o \l_@@_tmpa_clist } diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 0b1c0fbef94..8ea41c4eb2d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -33,8 +33,8 @@ %% %% ----------------------------------------------------------------------- % -%<package>\RequirePackage{l3names}[2012/07/15] -%<package>\@ifpackagelater{l3names}{2012/07/15} +%<package>\RequirePackage{l3names}[2012/12/07] +%<package>\@ifpackagelater{l3names}{2012/12/07} %<package> {} %<package> {% %<package> \PackageError{expl3}{Mismatched LaTeX3 packages detected.} @@ -49,8 +49,8 @@ %<*driver|package> \def\ExplFileName{expl3} \def\ExplFileDescription{L3 Experimental code bundle wrapper} -\def\ExplFileDate{2012/11/21} -\def\ExplFileVersion{4332} +\def\ExplFileDate{2012/12/21} +\def\ExplFileVersion{4390} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -630,11 +630,15 @@ % This means that the contents of the register in question is used as the % argument, be it an integer, a length-type register, a token list variable % or similar. The value is passed to the function as a braced token list. +% Can be applied to variables which have a \cs{\meta{var}_use:N} function, +% and which therefore deliver a single \enquote{value}. % \item[v] Value of a register, constructed from a character string % used as a command name.\\ % This is a combination of |c| and |V| which first constructs a % control sequence from the argument and then passes the value of the % resulting register to the function. +% Can be applied to variables which have a \cs{\meta{var}_use:N} function, +% and which therefore deliver a single \enquote{value}. % \item[x] Fully-expanded token or braced token list.\\ % This means that the argument is expanded as in the replacement % text of an~\tn{edef}, and the expansion is passed to the function as @@ -913,8 +917,8 @@ % \cs_new:Npn \foo_bar:Nn #1#2 % { % \cs_if_exist:NTF #1 -% { \__foo_bar_aux_i:n {#2} } -% { \__foo_bar_aux_ii:nn {#2} { literal } } +% { \__foo_bar:n {#2} } +% { \__foo_bar:nn {#2} { literal } } % } % \end{verbatim} % where spaces are used around |{| and |}| except for isolated @@ -1029,9 +1033,14 @@ % % Load \pkg{etex} as otherwise we are likely to get into trouble % with registers. Some inserts are reserved also as these have to -% be from the standard pool. +% be from the standard pool. The \cs{relax} is here as +% \cs{reserveinserts} is outer. Most of the time this is fine, but +% some packages (for example \pkg{catoptions}) redefine \cs{RequirePackage} +% such that the trailing optional argument is tested for as a macro argument, +% which will then lead to an error! % \begin{macrocode} \RequirePackage{etex} +\relax \reserveinserts{32} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 6eb1fb6b8ee..733beefe452 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3basics.dtx 4306 2012-11-10 12:57:20Z joseph $ +\GetIdInfo$Id: l3basics.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Basic definitions} %</driver|package> %<*driver> @@ -2158,7 +2158,7 @@ % % \begin{macro}[EXP, int]{\__cs_split_function:NN} % \begin{macro}[aux, EXP] -% {\__cs_split_function_i:w, \__cs_split_function_ii:w} +% {\__cs_split_function_auxi:w, \__cs_split_function_auxii:w} % This function takes a function name and splits it into name with % the escape char removed and argument specification. In addition to % this, a third argument, a boolean \meta{true} or \meta{false} is @@ -2193,14 +2193,14 @@ \cs_set:Npn \__cs_split_function:NN #1 { \exp_after:wN \exp_after:wN - \exp_after:wN \__cs_split_function_i:w + \exp_after:wN \__cs_split_function_auxi:w \cs_to_str:N #1 \q_mark \c_true_bool @ \q_mark \c_false_bool \q_stop } - \cs_set:Npn \__cs_split_function_i:w #1 @ #2 \q_mark #3#4 \q_stop #5 - { \__cs_split_function_ii:w #5 #1 \q_mark \q_stop {#2} #3 } - \cs_set:Npn \__cs_split_function_ii:w #1#2 \q_mark #3 \q_stop + \cs_set:Npn \__cs_split_function_auxi:w #1 @ #2 \q_mark #3#4 \q_stop #5 + { \__cs_split_function_auxii:w #5 #1 \q_mark \q_stop {#2} #3 } + \cs_set:Npn \__cs_split_function_auxii:w #1#2 \q_mark #3 \q_stop { #1 {#2} } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index f37e6936f62..c6ccdfb12a9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3box.dtx 4259 2012-11-04 17:15:11Z joseph $ +\GetIdInfo$Id: l3box.dtx 4347 2012-12-08 09:11:29Z joseph $ {L3 Experimental boxes} %</driver|package> %<*driver> @@ -1081,7 +1081,7 @@ % \begin{macrocode} \cs_new_protected:Npn \hbox_to_wd:nn #1#2 { \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end: {#2} } -\cs_new_protected:Npn \hbox_to_zero:n #1 { \tex_hbox:D to \c_zero_skip {#1} } +\cs_new_protected:Npn \hbox_to_zero:n #1 { \tex_hbox:D to \c_zero_dim {#1} } % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index c86a1ebeef2..4aa22e27714 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3candidates.dtx 4298 2012-11-09 13:34:43Z joseph $ +\GetIdInfo$Id: l3candidates.dtx 4383 2012-12-20 15:10:48Z bruno $ {L3 Experimental additions to l3kernel} %</driver|package> %<*driver> @@ -803,7 +803,7 @@ % \meta{char} is again made active). % \end{function} % -% \begin{function}[TF]{\peek_N_type:} +% \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:} % \begin{syntax} % \cs{peek_N_type:TF} \Arg{true code} \Arg{false code} % \end{syntax} @@ -812,7 +812,8 @@ % if the next \meta{token} is either an explicit or implicit % begin-group or end-group token (with any character code), or % an explicit or implicit space character (with character code $32$ -% and category code $10$), and \meta{true} in all other cases. +% and category code $10$), or an outer token (never used in \LaTeX3) +% and \meta{true} in all other cases. % Note that a \meta{true} result ensures that the next \meta{token} is % a valid \texttt{N}-type argument. However, if the next \meta{token} % is for instance \cs{c_space_token}, the test will take the @@ -1629,14 +1630,14 @@ % % \begin{macro}[EXP]{\clist_use:Nnnn} % \begin{macro}[EXP, aux] -% {\@@_use:wwn, \@@_use_ii:nwwwwnwn, \@@_use_iii:nwwn} +% {\@@_use:wwn, \@@_use:nwwwwnwn, \@@_use:nwwn} % First check that the variable exists. Then count the items in the % comma list. If it has none, output nothing. If it has one item, % output that item, brace stripped (note that space-trimming has % already been done when the comma list was assigned). If it has two, % place the \meta{separator~between~two} in the middle. % -% Otherwise, \cs{@@_use_ii:nwwwwnwn} takes the following arguments; 1: +% Otherwise, \cs{@@_use:nwwwwnwn} takes the following arguments; 1: % a \meta{separator}, 2, 3, 4: three items from the comma list (or % quarks), 5: the rest of the comma list, 6: a \meta{continuation} % function (\texttt{use_ii} or \texttt{use_iii} with its @@ -1664,20 +1665,20 @@ { 2 } { \exp_after:wN \@@_use:wwn #1 , {#2} } } { - \exp_after:wN \@@_use_ii:nwwwwnwn + \exp_after:wN \@@_use:nwwwwnwn \exp_after:wN { \exp_after:wN } #1 , - \q_mark , { \@@_use_ii:nwwwwnwn {#3} } - \q_mark , { \@@_use_iii:nwwn {#4} } + \q_mark , { \@@_use:nwwwwnwn {#3} } + \q_mark , { \@@_use:nwwn {#4} } \q_stop { } } } { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} } } \cs_new:Npn \@@_use:wwn #1 , #2 , #3 { \exp_not:n { #1 #3 #2 } } -\cs_new:Npn \@@_use_ii:nwwwwnwn +\cs_new:Npn \@@_use:nwwwwnwn #1#2 , #3 , #4 , #5 \q_mark , #6#7 \q_stop #8 { #6 {#3} , {#4} , #5 \q_mark , {#6} #7 \q_stop { #8 #1 #2 } } -\cs_new:Npn \@@_use_iii:nwwn #1#2 , #3 \q_stop #4 +\cs_new:Npn \@@_use:nwwn #1#2 , #3 \q_stop #4 { \exp_not:n { #4 #1 #2 } } % \end{macrocode} % \end{macro} @@ -2526,7 +2527,7 @@ % % \begin{macro}[EXP]{\seq_use:Nnnn} % \begin{macro}[EXP, aux] -% {\@@_use:NnNnn, \@@_use_ii:nwwwwnwn, \@@_use_iii:nwwn} +% {\@@_use:NnNnn, \@@_use:nwwwwnwn, \@@_use:nwwn} % See \cs{clist_use:Nnnn} for a general explanation. The main % difference is that we use \cs{@@_item:n} as a delimiter rather than % commas. We also need to add \cs{@@_item:n} at various places. @@ -2542,10 +2543,10 @@ { 2 } { \exp_after:wN \@@_use:NnNnn #1 {#2} } } { - \exp_after:wN \@@_use_ii:nwwwwnwn + \exp_after:wN \@@_use:nwwwwnwn \exp_after:wN { \exp_after:wN } #1 \@@_item:n - \q_mark { \@@_use_ii:nwwwwnwn {#3} } - \q_mark { \@@_use_iii:nwwn {#4} } + \q_mark { \@@_use:nwwwwnwn {#3} } + \q_mark { \@@_use:nwwn {#4} } \q_stop { } } } @@ -2553,14 +2554,14 @@ } \cs_new:Npn \@@_use:NnNnn \@@_item:n #1 \@@_item:n #2#3 { \exp_not:n { #1 #3 #2 } } -\cs_new:Npn \@@_use_ii:nwwwwnwn +\cs_new:Npn \@@_use:nwwwwnwn #1 \@@_item:n #2 \@@_item:n #3 \@@_item:n #4#5 \q_mark #6#7 \q_stop #8 { #6 \@@_item:n {#3} \@@_item:n {#4} #5 \q_mark {#6} #7 \q_stop { #8 #1 #2 } } -\cs_new:Npn \@@_use_iii:nwwn #1 \@@_item:n #2 #3 \q_stop #4 +\cs_new:Npn \@@_use:nwwn #1 \@@_item:n #2 #3 \q_stop #4 { \exp_not:n { #4 #1 #2 } } % \end{macrocode} % \end{macro} @@ -2835,24 +2836,66 @@ % \end{macrocode} % % \begin{macro}[TF]{\peek_N_type:} -% \begin{macro}{\@@_execute_branches_N_type:} -% The next token is normal if it is neither a begin-group token, -% nor an end-group token, nor a charcode-$32$ space token. -% Note that implicit begin-group tokens, end-group tokens, and -% spaces are also recognized as non-\texttt{N}-type. -% Here, there is no \meta{search token}, so we feed a dummy -% \cs{scan_stop:} to the \cs{peek_token_generic::NN} functions. +% \begin{macro}[aux] +% {\@@_execute_branches_N_type:, \@@_N_type:w, \@@_N_type_aux:nnw} +% All tokens are \texttt{N}-type tokens, except in four cases: +% begin-group tokens, end-group tokens, space tokens with character +% code~$32$, and outer tokens. Since \cs{l_peek_token} might be +% outer, we cannot use the convenient \cs{bool_if:nTF} function, and +% must resort to the old trick of using \tn{ifodd} to expand a set of +% tests. The \texttt{false} branch of this test is taken if the token +% is one of the first three kinds of non-\texttt{N}-type tokens +% (explicit or implicit), thus we call \cs{@@_false:w}. In the +% \texttt{true} branch, we must detect outer tokens, without impacting +% performance too much for non-outer tokens. The first filter is to +% search for \texttt{outer} in the \tn{meaning} of \cs{l_peek_token}. +% If that is absent, \cs{use_none_delimit_by_q_stop:w} cleans up, and +% we call \cs{@@_true:w}. Otherwise, the token can be a non-outer +% macro or a primitive mark whose parameter or replacement text +% contains \texttt{outer}, it can be the primitive \tn{outer}, or it +% can be an outer token. Macros and marks would have \texttt{ma} in +% the part before the first occurrence of \texttt{outer}; the meaning +% of \tn{outer} has nothing after \texttt{outer}, contrarily to outer +% macros; and that covers all cases, calling \cs{@@_true:w} or +% \cs{@@_false:w} as appropriate. Here, there is no \meta{search +% token}, so we feed a dummy \cs{scan_stop:} to the +% \cs{@@_token_generic:NNTF} function. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_execute_branches_N_type: +\group_begin: + \char_set_catcode_other:N \O + \char_set_catcode_other:N \U + \char_set_catcode_other:N \T + \char_set_catcode_other:N \E + \char_set_catcode_other:N \R + \tl_to_lowercase:n + { + \cs_new_protected_nopar:Npn \@@_execute_branches_N_type: + { + \if_int_odd:w + \if_catcode:w \exp_not:N \l_peek_token { \c_two \fi: + \if_catcode:w \exp_not:N \l_peek_token } \c_two \fi: + \if_meaning:w \l_peek_token \c_space_token \c_two \fi: + \c_one + \exp_after:wN \@@_N_type:w + \token_to_meaning:N \l_peek_token + \q_mark \@@_N_type_aux:nnw + OUTER \q_mark \use_none_delimit_by_q_stop:w + \q_stop + \exp_after:wN \@@_true:w + \else: + \exp_after:wN \@@_false:w + \fi: + } + \cs_new_protected_nopar:Npn \@@_N_type:w #1 OUTER #2 \q_mark #3 + { #3 {#1} {#2} } + } +\group_end: +\cs_new_protected_nopar:Npn \@@_N_type_aux:nnw #1 #2 #3 \fi: { - \bool_if:nTF - { - \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token || - \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || - \token_if_eq_meaning_p:NN \l_peek_token \c_space_token - } - { \@@_false:w } + \fi: + \tl_if_in:noTF {#1} { \tl_to_str:n {ma} } { \@@_true:w } + { \tl_if_empty:nTF {#2} { \@@_true:w } { \@@_false:w } } } \cs_new_protected_nopar:Npn \peek_N_type:TF { \@@_token_generic:NNTF \@@_execute_branches_N_type: \scan_stop: } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index 0f76f18b72b..68c36d63a4a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -37,7 +37,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3clist.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3clist.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Comma separated lists} %</driver|package> %<*driver> @@ -729,8 +729,8 @@ % \end{macro} % % \begin{macro}[int,rEXP]{\@@_trim_spaces:n} -% \begin{macro}[aux]{\@@_trim_spaces_ii:nn} -% The first argument of \cs{@@_trim_spaces_ii:nn} is initially empty, +% \begin{macro}[aux]{\@@_trim_spaces:nn} +% The first argument of \cs{@@_trim_spaces:nn} is initially empty, % and later a comma, namely, as soon as we have added an item to the % resulting list. The auxiliary tests for the end of the list, % and also prevents empty arguments from finding their way into the @@ -739,22 +739,22 @@ \cs_new:Npn \@@_trim_spaces:n #1 { \@@_trim_spaces_generic:nw - { \@@_trim_spaces_ii:nn { } } + { \@@_trim_spaces:nn { } } \q_mark #1 , \q_recursion_tail, \q_recursion_stop } -\cs_new:Npn \@@_trim_spaces_ii:nn #1 #2 +\cs_new:Npn \@@_trim_spaces:nn #1 #2 { \quark_if_recursion_tail_stop:n {#2} \tl_if_empty:nTF {#2} { \@@_trim_spaces_generic:nw - { \@@_trim_spaces_ii:nn {#1} } \q_mark + { \@@_trim_spaces:nn {#1} } \q_mark } { #1 \exp_not:n {#2} \@@_trim_spaces_generic:nw - { \@@_trim_spaces_ii:nn { , } } \q_mark + { \@@_trim_spaces:nn { , } } \q_mark } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index c9e689f06ca..416fc76cacb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3file.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3file.dtx 4377 2012-12-20 11:13:29Z bruno $ {L3 File and I/O operations} %</driver|package> %<*driver> @@ -699,7 +699,6 @@ % % \begin{macro}{\file_input:n} % \begin{macro}[aux]{\@@_input:n \@@_input:V} -% \begin{macro}[aux, EXP]{\@@_input_aux:w} % \begin{macro}[aux]{\@@_input_aux:n, \@@_input_aux:o} % Loading a file is done in a safe way, checking first that the file % exists and loading only if it does. Push the file name on the @@ -718,12 +717,11 @@ } \cs_new_protected:Npn \@@_input:n #1 { - \quark_if_nil:oTF { \@@_input_aux:w #1 . \q_nil . \q_stop } - { \@@_input_aux:o { \tl_to_str:n { #1 .tex } } } + \tl_if_in:nnTF {#1} { . } { \@@_input_aux:n {#1} } + { \@@_input_aux:o { \tl_to_str:n { #1 . tex } } } } \cs_generate_variant:Nn \@@_input:n { V } -\cs_new:Npn \@@_input_aux:w #1 . #2 . #3 \q_stop { #2 } \cs_new_protected:Npn \@@_input_aux:n #1 { %<*initex> @@ -745,7 +743,6 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} % % \begin{macro}{\file_path_include:n} % \begin{macro}{\file_path_remove:n} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx index 9d023c21224..b368842dae3 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3final.dtx 3991 2012-07-16 19:00:35Z joseph $ +\GetIdInfo$Id: l3final.dtx 4364 2012-12-12 20:30:39Z joseph $ {L3 Experimental format finalisation} %</driver|package> %<*driver> @@ -103,6 +103,7 @@ \char_set_catcode_other:n { 58 } % colon \char_set_catcode_active:n { 126 } % tilde \tex_endlinechar:D = 13 \scan_stop: + \tex_newlinechar:D = 10 \scan_stop: \tex_dump:D } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index 53a6456c5ac..bacb6065b5a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -36,7 +36,7 @@ % %<*driver> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp-aux.dtx 4181 2012-08-31 17:33:08Z bruno $ +\GetIdInfo$Id: l3fp-aux.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Floating-point support functions} \documentclass[full]{l3doc} \begin{document} @@ -650,17 +650,17 @@ % % \begin{macro}[aux, EXP] % { -% \@@_decimate_i:Nnnnn, \@@_decimate_ii:Nnnnn, -% \@@_decimate_iii:Nnnnn, \@@_decimate_iv:Nnnnn, -% \@@_decimate_v:Nnnnn, \@@_decimate_vi:Nnnnn, -% \@@_decimate_vii:Nnnnn, \@@_decimate_viii:Nnnnn, -% \@@_decimate_ix:Nnnnn, \@@_decimate_x:Nnnnn, -% \@@_decimate_xi:Nnnnn, \@@_decimate_xii:Nnnnn, -% \@@_decimate_xiii:Nnnnn, \@@_decimate_xiv:Nnnnn, -% \@@_decimate_xv:Nnnnn, \@@_decimate_xvi:Nnnnn +% \\@@_decimate_auxi:Nnnnn, \\@@_decimate_auxii:Nnnnn, +% \\@@_decimate_auxiii:Nnnnn, \\@@_decimate_auxiv:Nnnnn, +% \\@@_decimate_auxv:Nnnnn, \\@@_decimate_auxvi:Nnnnn, +% \\@@_decimate_auxvii:Nnnnn, \\@@_decimate_auxviii:Nnnnn, +% \\@@_decimate_auxix:Nnnnn, \\@@_decimate_auxx:Nnnnn, +% \\@@_decimate_auxxi:Nnnnn, \\@@_decimate_auxxii:Nnnnn, +% \\@@_decimate_auxxiii:Nnnnn, \\@@_decimate_auxxiv:Nnnnn, +% \\@@_decimate_auxxv:Nnnnn, \\@@_decimate_auxxvi:Nnnnn % } % \begin{syntax} -% \cs{@@_decimate_i:Nnnnn} \meta{f_1} \Arg{X_1} \Arg{X_2} \Arg{X_3} \Arg{X_4} +% \cs{\@@_decimate_auxi:Nnnnn} \meta{f_1} \Arg{X_1} \Arg{X_2} \Arg{X_3} \Arg{X_4} % \end{syntax} % Shifting happens in two steps: compute the \meta{rounding} digit, % and repack digits into two blocks of $8$. The sixteen functions @@ -731,8 +731,8 @@ % structure. This is followed by some digits and a semicolon. % \begin{macrocode} \cs_new:Npn \@@_decimate_pack:nnnnnnnnnnw #1#2#3#4#5 - { \@@_decimate_pack_ii:nnnnnnw { #1#2#3#4#5 } } -\cs_new:Npn \@@_decimate_pack_ii:nnnnnnw #1 #2#3#4#5#6 + { \@@_decimate_pack:nnnnnnw { #1#2#3#4#5 } } +\cs_new:Npn \@@_decimate_pack:nnnnnnw #1 #2#3#4#5#6 { {#1} {#2#3#4#5#6} } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index 7bb9f89a507..10cf4d2d03b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -36,7 +36,7 @@ % %<*driver> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp-convert.dtx 4234 2012-09-26 09:43:31Z bruno $ +\GetIdInfo$Id: l3fp-convert.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Floating-point conversion} \documentclass[full]{l3doc} \begin{document} @@ -404,8 +404,8 @@ % { % \@@_from_dim_test:N, % \@@_from_dim:Nw, -% \@@_from_dim_ii:wNNnnnnnn, -% \@@_from_dim_iii:wnnnnwN, +% \@@_from_dim:wNNnnnnnn, +% \@@_from_dim:wnnnnwN, % } % The dimension expression (which can in fact be a glue expression) is % evaluated, converted to a number (\emph{i.e.}, expressed in scaled @@ -437,12 +437,12 @@ } \cs_new:Npn \@@_from_dim:Nw #1 #2; { - \@@_pack_twice_four:wNNNNNNNN \@@_from_dim_ii:wNNnnnnnn ; + \@@_pack_twice_four:wNNNNNNNN \@@_from_dim:wNNnnnnnn ; #2 000 0000 00 {10}987654321; #1 } -\cs_new:Npn \@@_from_dim_ii:wNNnnnnnn #1; #2#3#4#5#6#7#8#9 - { \@@_from_dim_iii:wnnnnwN #1 {#2#300} {0000} ; } -\cs_new:Npn \@@_from_dim_iii:wnnnnwN #1; #2#3#4#5#6; #7 +\cs_new:Npn \@@_from_dim:wNNnnnnnn #1; #2#3#4#5#6#7#8#9 + { \@@_from_dim:wnnnnwN #1 {#2#300} {0000} ; } +\cs_new:Npn \@@_from_dim:wnnnnwN #1; #2#3#4#5#6; #7 { \@@_mul_npos_o:Nww #7 \s_@@ \@@_chk:w 1 #7 {#5} #1 ; diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index b3952ea8aa5..9d5ff40b7ca 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -36,7 +36,7 @@ % %<*driver> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp-extended.dtx 4151 2012-08-28 11:51:52Z bruno $ +\GetIdInfo$Id: l3fp-extended.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Floating-point extended precision fixed-points} \documentclass[full]{l3doc} \begin{document} @@ -173,8 +173,8 @@ % \begin{macro}[int, EXP]{\@@_fixed_div_int:wwN} % \begin{macro}[aux, EXP] % { -% \@@_fixed_div_int_i:wnN, \@@_fixed_div_int_ii:wnn, -% \@@_fixed_div_int_iii:wnn, \@@_fixed_div_int_pack:Nw, +% \@@_fixed_div_int:wnN, \@@_fixed_div_int_auxi:wnn, +% \@@_fixed_div_int_auxii:wnn, \@@_fixed_div_int_pack:Nw, % \@@_fixed_div_int_after:Nw % } % \begin{syntax} @@ -208,7 +208,7 @@ % \cs{@@_fixed_div_int_pack:Nw} $9999 + Q_{4}$ \\ % \cs{@@_fixed_div_int_pack:Nw} $9999 + Q_{5}$ \\ % \cs{@@_fixed_div_int_pack:Nw} $9999$ \\ -% \cs{@@_fixed_div_int_iii:wnn} $Q_{6}$ |;| \Arg{n} \Arg{a_{6}} +% \cs{@@_fixed_div_int_auxii:wnn} $Q_{6}$ |;| \Arg{n} \Arg{a_{6}} % \end{quote} % where expansion is happening from the last line up. The % \texttt{iii} auxiliary adds $Q_{6} + 2 \simeq a_{6}/n + 1$ to the @@ -226,30 +226,30 @@ \exp_after:wN \@@_fixed_div_int_after:Nw \exp_after:wN #8 \int_use:N \__int_eval:w \c_minus_one - \@@_fixed_div_int_i:wnN - #1; {#7} \@@_fixed_div_int_ii:wnn - #2; {#7} \@@_fixed_div_int_ii:wnn - #3; {#7} \@@_fixed_div_int_ii:wnn - #4; {#7} \@@_fixed_div_int_ii:wnn - #5; {#7} \@@_fixed_div_int_ii:wnn - #6; {#7} \@@_fixed_div_int_iii:wnn ; + \@@_fixed_div_int:wnN + #1; {#7} \@@_fixed_div_int_auxi:wnn + #2; {#7} \@@_fixed_div_int_auxi:wnn + #3; {#7} \@@_fixed_div_int_auxi:wnn + #4; {#7} \@@_fixed_div_int_auxi:wnn + #5; {#7} \@@_fixed_div_int_auxi:wnn + #6; {#7} \@@_fixed_div_int_auxii:wnn ; } -\cs_new:Npn \@@_fixed_div_int_i:wnN #1; #2 #3 +\cs_new:Npn \@@_fixed_div_int:wnN #1; #2 #3 { \exp_after:wN #3 \int_use:N \__int_eval:w #1 / #2 - \c_one ; {#2} {#1} } -\cs_new:Npn \@@_fixed_div_int_ii:wnn #1; #2 #3 +\cs_new:Npn \@@_fixed_div_int_auxi:wnn #1; #2 #3 { + #1 \exp_after:wN \@@_fixed_div_int_pack:Nw \int_use:N \__int_eval:w 9999 - \exp_after:wN \@@_fixed_div_int_i:wnN + \exp_after:wN \@@_fixed_div_int:wnN \int_use:N \__int_eval:w #3 - #1*#2 \__int_eval_end: } -\cs_new:Npn \@@_fixed_div_int_iii:wnn #1; #2 #3 { + #1 + \c_two ; } +\cs_new:Npn \@@_fixed_div_int_auxii:wnn #1; #2 #3 { + #1 + \c_two ; } \cs_new:Npn \@@_fixed_div_int_pack:Nw #1 #2; { + #1; {#2} } \cs_new:Npn \@@_fixed_div_int_after:Nw #1 #2; { #1 {#2} } % \end{macrocode} @@ -261,8 +261,8 @@ % \begin{macro}[int, EXP]{\@@_fixed_add:wwn, \@@_fixed_sub:wwn} % \begin{macro}[aux, EXP] % { -% \@@_fixed_add_i:Nnnnnwnn, -% \@@_fixed_add_ii:nnNnnnwn, +% \@@_fixed_add:Nnnnnwnn, +% \@@_fixed_add:nnNnnnwn, % \@@_fixed_add_pack:NNNNNwn, % \@@_fixed_add_after:NNNNNwn % } @@ -283,17 +283,17 @@ % \meta{continuation} (|#8|, then |#7|) from the end of the argument % list to its start. % \begin{macrocode} -\cs_new_nopar:Npn \@@_fixed_add:wwn { \@@_fixed_add_i:Nnnnnwnn + } -\cs_new_nopar:Npn \@@_fixed_sub:wwn { \@@_fixed_add_i:Nnnnnwnn - } -\cs_new:Npn \@@_fixed_add_i:Nnnnnwnn #1 #2#3#4#5 #6; #7#8 +\cs_new_nopar:Npn \@@_fixed_add:wwn { \@@_fixed_add:Nnnnnwnn + } +\cs_new_nopar:Npn \@@_fixed_sub:wwn { \@@_fixed_add:Nnnnnwnn - } +\cs_new:Npn \@@_fixed_add:Nnnnnwnn #1 #2#3#4#5 #6; #7#8 { \exp_after:wN \@@_fixed_add_after:NNNNNwn \int_use:N \__int_eval:w 9 9999 9998 + #2#3 #1 #7#8 \exp_after:wN \@@_fixed_add_pack:NNNNNwn \int_use:N \__int_eval:w 1 9999 9998 + #4#5 - \@@_fixed_add_ii:nnNnnnwn #6 #1 + \@@_fixed_add:nnNnnnwn #6 #1 } -\cs_new:Npn \@@_fixed_add_ii:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8 +\cs_new:Npn \@@_fixed_add:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8 { #3 #4#5 \exp_after:wN \@@_fixed_add_pack:NNNNNwn @@ -310,7 +310,7 @@ % \subsection{Multiplying fixed points} % % \begin{macro}[int, EXP]{\@@_fixed_mul:wwn} -% \begin{macro}[aux, EXP]{\@@_fixed_mul_i:nnnnnnnwn} +% \begin{macro}[aux, EXP]{\@@_fixed_mul:nnnnnnnwn} % \begin{syntax} % \cs{@@_fixed_mul:wwn} \meta{a} |;| \meta{b} |;| \Arg{continuation} % \end{syntax} @@ -372,9 +372,9 @@ \int_use:N \__int_eval:w \c_@@_trailing_shift_int + #2*#9 + #3*#8 + #4*#7 + ( #3*#9 + #4*#8 - + \@@_fixed_mul_i:nnnnnnnwn #5 {#6}{#7} {#1}{#2} + + \@@_fixed_mul:nnnnnnnwn #5 {#6}{#7} {#1}{#2} } -\cs_new:Npn \@@_fixed_mul_i:nnnnnnnwn #1#2 #3#4 #5#6 #7#8 ; #9 +\cs_new:Npn \@@_fixed_mul:nnnnnnnwn #1#2 #3#4 #5#6 #7#8 ; #9 { #1*#4 + #2*#3 + #5*#8 + #6*#7 ) / \c_ten_thousand + #1*#3 + #5*#7 ; @@ -443,7 +443,7 @@ \int_use:N \__int_eval:w \c_@@_big_leading_shift_int \exp_after:wN \@@_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + #3 #4 - \@@_fixed_mul_add_i:Nwnnnwnnn + + \@@_fixed_mul_add:Nwnnnwnnn + + #5 #6 ; #2 ; #1 ; #2 ; + + #7 #8 ; {#9} ; } @@ -453,7 +453,7 @@ \int_use:N \__int_eval:w \c_@@_big_leading_shift_int \exp_after:wN \@@_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + #3 #4 - \@@_fixed_mul_add_i:Nwnnnwnnn - + \@@_fixed_mul_add:Nwnnnwnnn - + #5 #6 ; #2 ; #1 ; #2 ; - + #7 #8 ; {#9} ; } @@ -463,16 +463,16 @@ \int_use:N \__int_eval:w \c_@@_big_leading_shift_int \exp_after:wN \@@_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c_@@_big_middle_shift_int + 1 0000 0000 - \@@_fixed_mul_add_i:Nwnnnwnnn - + \@@_fixed_mul_add:Nwnnnwnnn - ; #2 ; #1 ; #2 ; - ; {#3} ; } % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP]{\@@_fixed_mul_add_i:Nwnnnwnnn} +% \begin{macro}[aux, EXP]{\@@_fixed_mul_add:Nwnnnwnnn} % \begin{syntax} -% \cs{@@_fixed_mul_add_i:Nwnnnwnnn} \meta{op} |+| \meta{c_3} \meta{c_4} |;| +% \cs{@@_fixed_mul_add:Nwnnnwnnn} \meta{op} |+| \meta{c_3} \meta{c_4} |;| % ~~\meta{b} |;| \meta{a} |;| \meta{b} |;| \meta{op} % ~~|+| \meta{c_5} \meta{c_6} |;| % \end{syntax} @@ -488,7 +488,7 @@ % we've read, but not \meta{b}, since there is another copy later in % the input stream. % \begin{macrocode} -\cs_new:Npn \@@_fixed_mul_add_i:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9 +\cs_new:Npn \@@_fixed_mul_add:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9 { #1 #7*#3 \exp_after:wN \@@_pack_big:NNNNNNwn @@ -499,14 +499,14 @@ #1 #7*#5 #1 #8*#4 #1 #9*#3 #2 \exp_after:wN \@@_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c_@@_big_middle_shift_int - #1 \@@_fixed_mul_add_ii:nnnnwnnnn {#7}{#8}{#9} + #1 \@@_fixed_mul_add:nnnnwnnnn {#7}{#8}{#9} } % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP]{\@@_fixed_mul_add_ii:nnnnwnnnn} +% \begin{macro}[aux, EXP]{\@@_fixed_mul_add:nnnnwnnnn} % \begin{syntax} -% \cs{@@_fixed_mul_add_ii:nnnnwnnnn} \meta{a} |;| \meta{b} |;| \meta{op} +% \cs{@@_fixed_mul_add:nnnnwnnnn} \meta{a} |;| \meta{b} |;| \meta{op} % ~~|+| \meta{c_5} \meta{c_6} |;| % \end{syntax} % Level $10^{-20}$ is $(a_{1} \cdot b_{4} + a_{2} \cdot b_{3} + a_{3} @@ -526,12 +526,12 @@ % To do all this, we keep $a_{1}$, $a_{5}$, $a_{6}$, and the % corresponding pieces of \meta{b}. % \begin{macrocode} -\cs_new:Npn \@@_fixed_mul_add_ii:nnnnwnnnn #1#2#3#4#5; #6#7#8#9 +\cs_new:Npn \@@_fixed_mul_add:nnnnwnnnn #1#2#3#4#5; #6#7#8#9 { ( #1*#9 + #2*#8 + #3*#7 + #4*#6 ) \exp_after:wN \@@_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c_@@_big_trailing_shift_int - \@@_fixed_mul_add_iii:nnnnwnnwN + \@@_fixed_mul_add:nnnnwnnwN { #6 + #4*#7 + #3*#8 + #2*#9 + #1 } { #7 + #4*#8 + #3*#9 + #2 } {#1} #5; @@ -540,9 +540,9 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP]{\@@_fixed_mul_add_iii:nnnnwnnwN} +% \begin{macro}[aux, EXP]{\@@_fixed_mul_add:nnnnwnnwN} % \begin{syntax} -% \cs{@@_fixed_mul_add_iii:nnnnwnnwN} \Arg{partial_1} \Arg{partial_2} +% \cs{@@_fixed_mul_add:nnnnwnnwN} \Arg{partial_1} \Arg{partial_2} % ~~\Arg{a_1} \Arg{a_5} \Arg{a_6} |;| \Arg{b_1} \Arg{b_5} \Arg{b_6} |;| % ~~\meta{op} |+| \meta{c_5} \meta{c_6} |;| % \end{syntax} @@ -556,7 +556,7 @@ % expected by the packing auxiliaries. See \pkg{l3fp-aux} for the % definition of the shifts and packing auxiliaries. % \begin{macrocode} -\cs_new:Npn \@@_fixed_mul_add_iii:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9 +\cs_new:Npn \@@_fixed_mul_add:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9 { #9 (#4* #1 *#7) #9 (#5*#6+#4* #2 *#7+#3*#8) / \c_ten_thousand @@ -701,18 +701,18 @@ #2 \c_two * \c_@@_max_exponent_int \use_i_ii:nnn \fi: - \@@_fixed_dtf_zeros_ii:ww + \@@_fixed_dtf_zeros_auxi:ww #1#3 0000 0000 0000 0000 0000 0000 ; } -\cs_new:Npn \@@_fixed_dtf_zeros_ii:ww +\cs_new:Npn \@@_fixed_dtf_zeros_auxi:ww { \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN \@@_pack_twice_four:wNNNNNNNN - \@@_fixed_dtf_zeros_iii:ww + \@@_fixed_dtf_zeros_auxii:ww ; } -\cs_new:Npn \@@_fixed_dtf_zeros_iii:ww #1; #2; #3 { #3 #1; } +\cs_new:Npn \@@_fixed_dtf_zeros_auxii:ww #1; #2; #3 { #3 #1; } % \end{macrocode} % \newcommand{\eTeXfrac}[2]{\left[\frac{#1}{#2}\right]} % We get @@ -799,19 +799,19 @@ % \begin{macrocode} \cs_new:Npn \@@_fixed_dtf_approx:n #1 { - \exp_after:wN \@@_fixed_dtf_approx_ii:wnn + \exp_after:wN \@@_fixed_dtf_approx:wnn \int_use:N \__int_eval:w 10 0000 0000 / ( #1 + \c_one ) ; {#1} } -\cs_new:Npn \@@_fixed_dtf_approx_ii:wnn #1; #2#3 +\cs_new:Npn \@@_fixed_dtf_approx:wnn #1; #2#3 { %<assert> \assert:n { \tl_count:n {#1} = 6 } - \exp_after:wN \@@_fixed_dtf_approx_iii:NNNNNw + \exp_after:wN \@@_fixed_dtf_approx:NNNNNw \int_use:N \__int_eval:w 10 0000 0000 - 1750 + #1000 + (10 0000 0000/#2-#1) * (1000-#3/10) ; {#2}{#3} } -\cs_new:Npn \@@_fixed_dtf_approx_iii:NNNNNw 1#1#2#3#4#5#6; #7; #8; +\cs_new:Npn \@@_fixed_dtf_approx:NNNNNw 1#1#2#3#4#5#6; #7; #8; { + \c_four % because of the line below "dtf_epsilon" here. \@@_fixed_mul:wwn {000#1}{#2#3#4#5}{#6}{0000}{0000}{0000} ; #7; @@ -824,14 +824,14 @@ { %<assert> \assert:n { #1 = 0000 } %<assert> \assert:n { #2 = 9999 } - \exp_after:wN \@@_fixed_dtf_epsilon_ii:NNNNNww + \exp_after:wN \@@_fixed_dtf_epsilon:NNNNNww \int_use:N \__int_eval:w 1 9999 9998 - #3#4 + \exp_after:wN \@@_fixed_dtf_epsilon_pack:NNNNNw \int_use:N \__int_eval:w 2 0000 0000 - #5#6 ; {0000} ; } \cs_new:Npn \@@_fixed_dtf_epsilon_pack:NNNNNw #1#2#3#4#5#6; { #1 ; {#2#3#4#5} {#6} } -\cs_new:Npn \@@_fixed_dtf_epsilon_ii:NNNNNww #1#2#3#4#5#6; #7; +\cs_new:Npn \@@_fixed_dtf_epsilon:NNNNNww #1#2#3#4#5#6; #7; { \@@_fixed_mul:wwn %^^A todo: optimize to use \@@_mul_significand. {0000} {#2#3#4#5} {#6} #7 ; diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index f32746b30e1..edbe34ee82c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -87,8 +87,8 @@ % \item \cs{@@_!_o:w} \meta{floating point} % \item \cs{@@_\string&_o:ww} \meta{floating point} \meta{floating point} % \item \cs{@@_\string|_o:ww} \meta{floating point} \meta{floating point} -% \item \cs{@@_ternary:NwwN}, \cs{@@_ternary_i:NwwN}, -% \cs{@@_ternary_ii:NwwN} have to be understood. +% \item \cs{@@_ternary:NwwN}, \cs{@@_ternary_auxi:NwwN}, +% \cs{@@_ternary_auxii:NwwN} have to be understood. % \end{itemize} % % \subsection{Existence test} @@ -369,9 +369,9 @@ { \if_meaning:w 3 #4 \if_meaning:w 3 #2 - \@@_minmax_i:ww + \@@_minmax_auxi:ww \else: - \@@_minmax_ii:ww + \@@_minmax_auxii:ww \fi: \else: \if_int_compare:w @@ -379,9 +379,9 @@ \s_@@ \@@_chk:w #4#5; \s_@@ \@@_chk:w #2#3; = #1 - \@@_minmax_ii:ww + \@@_minmax_auxii:ww \else: - \@@_minmax_i:ww + \@@_minmax_auxi:ww \fi: \fi: \@@_minmax_loop:Nww #1 @@ -391,12 +391,12 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP]{\@@_minmax_i:ww, \@@_minmax_ii:ww} +% \begin{macro}[aux, EXP]{\@@_minmax_auxi:ww, \@@_minmax_auxii:ww} % Keep the first/second number, and remove the other. % \begin{macrocode} -\cs_new:Npn \@@_minmax_i:ww #1 \fi: \fi: #2 \s_@@ #3 ; \s_@@ #4; +\cs_new:Npn \@@_minmax_auxi:ww #1 \fi: \fi: #2 \s_@@ #3 ; \s_@@ #4; { \fi: \fi: #2 \s_@@ #3 ; } -\cs_new:Npn \@@_minmax_ii:ww #1 \fi: \fi: #2 \s_@@ #3 ; +\cs_new:Npn \@@_minmax_auxii:ww #1 \fi: \fi: #2 \s_@@ #3 ; { \fi: \fi: #2 } % \end{macrocode} % \end{macro} @@ -460,7 +460,7 @@ % %^^A todo: understand and optimize. % \begin{macro}[int, EXP] -% {\@@_ternary:NwwN, \@@_ternary_i:NwwN, \@@_ternary_ii:NwwN} +% {\@@_ternary:NwwN, \@@_ternary_auxi:NwwN, \@@_ternary_auxii:NwwN} % \begin{macro}[aux, EXP] % { % \@@_ternary_loop_break:w, \@@_ternary_loop:Nw, @@ -480,7 +480,7 @@ \@@_ternary_loop:Nw #2 \s_@@ \@@_chk:w { \@@_ternary_loop_break:w } ; - \@@_ternary_break_point:n { \exp_after:wN \@@_ternary_i:NwwN } + \@@_ternary_break_point:n { \exp_after:wN \@@_ternary_auxi:NwwN } \exp_after:wN #1 \tex_romannumeral:D -`0 \@@_exp_after_array_f:w #3 \s_@@_stop @@ -502,7 +502,7 @@ \cs_new:Npn \@@_ternary_loop_break:w #1 \fi: #2 \@@_ternary_break_point:n #3 { \c_zero = \c_zero \fi: - \exp_after:wN \@@_ternary_ii:NwwN + \exp_after:wN \@@_ternary_auxii:NwwN } \cs_new:Npn \@@_ternary_loop:Nw \s_@@ \@@_chk:w #1#2; { @@ -512,7 +512,7 @@ \@@_ternary_loop:Nw } \cs_new:Npn \@@_ternary_map_break: #1 \@@_ternary_break_point:n #2 {#2} -\cs_new:Npn \@@_ternary_i:NwwN #1#2@#3@#4 +\cs_new:Npn \@@_ternary_auxi:NwwN #1#2@#3@#4 { \exp_after:wN \@@_parse_until_test:NwN \exp_after:wN #1 @@ -520,7 +520,7 @@ \@@_exp_after_array_f:w #2 \s_@@_stop #4 #1 } -\cs_new:Npn \@@_ternary_ii:NwwN #1#2@#3@#4 +\cs_new:Npn \@@_ternary_auxii:NwwN #1#2@#3@#4 { \exp_after:wN \@@_parse_until_test:NwN \exp_after:wN #1 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index c49e3248edd..cd67aa2b2c1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -36,7 +36,7 @@ % %<*driver> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp-parse.dtx 4187 2012-09-02 15:57:09Z bruno $ +\GetIdInfo$Id: l3fp-parse.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Floating-point expression parsing} \documentclass[full]{l3doc} \begin{document} @@ -1548,7 +1548,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, rEXP]{\@@_parse_exponent:N, \@@_parse_exponent_ii:N} +% \begin{macro}[aux, rEXP]{\@@_parse_exponent:N, \@@_parse_exponent_aux:N} % This function should be called within an \cs{__int_value:w} expansion % (or within an integer expression. It leaves digits of the exponent % behind it in the input stream, and terminates the expansion with a @@ -1562,14 +1562,14 @@ \cs_new:Npn \@@_parse_exponent:N #1 { \if:w e #1 - \exp_after:wN \@@_parse_exponent_ii:N + \exp_after:wN \@@_parse_exponent_aux:N \tex_romannumeral:D \else: 0 \@@_parse_return_semicolon:w #1 \fi: \@@_parse_expand:w } -\cs_new:Npn \@@_parse_exponent_ii:N #1 +\cs_new:Npn \@@_parse_exponent_aux:N #1 { \if_int_compare:w \if_catcode:w \tex_relax:D #1 \c_zero \else: `#1 \fi: > `9 \exp_stop_f: @@ -1789,7 +1789,7 @@ \cs_new:Npn \@@_parse_large_round_after:wNN #1 ; #2 #3 { \if:w . #3 - \exp_after:wN \@@_parse_large_round_after_ii:wN + \exp_after:wN \@@_parse_large_round_after_aux:wN \int_use:N \__int_eval:w #1 + \c_zero * \__int_eval:w \c_zero \exp_after:wN \@@_cfs_round_loop:N @@ -1802,7 +1802,7 @@ \exp_after:wN #3 \fi: } -\cs_new:Npn \@@_parse_large_round_after_ii:wN #1 ; #2 +\cs_new:Npn \@@_parse_large_round_after_aux:wN #1 ; #2 { + #2 \exp_after:wN ; @@ -2520,7 +2520,7 @@ \__msg_kernel_expandable_error:nnnn { kernel } { fp-missing } { ? } { ~for~?: } \exp_after:wN @ - \exp_after:wN \@@_ternary_ii:NwwN + \exp_after:wN \@@_ternary_auxii:NwwN \tex_romannumeral:D \@@_parse_until:Nw \c_two \exp_after:wN \@@_parse_expand:w diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index b485a0616c3..72a176191ad 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -318,9 +318,9 @@ % \begin{macro}[aux, EXP] % { % \@@_round_normal:NwNNnw , -% \@@_round_normal_ii:NnnwNNnn , +% \@@_round_normal:NnnwNNnn , % \@@_round_pack:Nw , -% \@@_round_normal_iii:NNwNnn , +% \@@_round_normal:NNwNnn , % \@@_round_normal_end:wwNnn , % \@@_round_special:NwwNnn , % \@@_round_special_aux:Nw @@ -348,11 +348,11 @@ \cs_new:Npn \@@_round_normal:NwNNnw #1#2 \s_@@ \@@_chk:w 1#3#4#5; { \@@_decimate:nNnnnn { \c_sixteen - #4 - #2 } - \@@_round_normal_ii:NnnwNNnn #5 #1 #3 {#4} {#2} + \@@_round_normal:NnnwNNnn #5 #1 #3 {#4} {#2} } -\cs_new:Npn \@@_round_normal_ii:NnnwNNnn #1#2#3#4; #5#6 +\cs_new:Npn \@@_round_normal:NnnwNNnn #1#2#3#4; #5#6 { - \exp_after:wN \@@_round_normal_iii:NNwNnn + \exp_after:wN \@@_round_normal:NNwNnn \int_use:N \__int_eval:w \if_int_compare:w #2 > \c_zero 1 \__int_value:w #2 @@ -372,7 +372,7 @@ } \cs_new:Npn \@@_round_pack:Nw #1 { \if_meaning:w 2 #1 + \c_one \fi: \__int_eval_end: } -\cs_new:Npn \@@_round_normal_iii:NNwNnn #1 #2 +\cs_new:Npn \@@_round_normal:NNwNnn #1 #2 { \if_meaning:w 0 #2 \exp_after:wN \@@_round_special:NwwNnn diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index 1f5874ca602..dc764e54ab1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -36,7 +36,7 @@ % %<*driver> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp-trig.dtx 4151 2012-08-28 11:51:52Z bruno $ +\GetIdInfo$Id: l3fp-trig.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Floating-point trigonometric functions} \documentclass[full]{l3doc} \begin{document} @@ -374,15 +374,15 @@ % % \begin{macro}[aux, rEXP] % { -% \@@_trig_large:ww, \@@_trig_large_i:www, -% \@@_trig_large_ii_o:wnnnn, \@@_trig_large_break:w +% \@@_trig_large:ww, \@@_trig_large:www, +% \@@_trig_large_o:wnnnn, \@@_trig_large_break:w % } % We shift the significand by one digit at a time, subtracting a multiple % of $2\pi$ at each step. We use a value of $2\pi$ rounded up, % consistent with the choice of \cs{c_pi_fp}. This is not quite % correct from an accuracy perspective, but has the nice property that % $\sin(180\mathrm{deg}) = 0$ exactly. The arguments of -% \cs{@@_trig_large_i:www} are a leading block of up to $5$ digits, +% \cs{@@_trig_large:www} are a leading block of up to $5$ digits, % three brace groups of $4$ digits each, and the exponent, decremented % at each step. The multiple of $2\pi$ to subtract is estimated as % $\lfloor |#1| / 6283\rfloor$ (the formula chosen always gives a @@ -393,19 +393,19 @@ % the reduction by $\pi/2$. % \begin{macrocode} \cs_new:Npn \@@_trig_large:ww #1; #2#3; - { \@@_trig_large_i:www #2; #3 ; #1; } -\cs_new:Npn \@@_trig_large_i:www #1; #2; #3; + { \@@_trig_large:www #2; #3 ; #1; } +\cs_new:Npn \@@_trig_large:www #1; #2; #3; { \if_meaning:w 0 #3 \@@_trig_large_break:w \fi: - \exp_after:wN \@@_trig_large_ii_o:wnnnn + \exp_after:wN \@@_trig_large_o:wnnnn \int_use:N \__int_eval:w ( #1 - 3141 ) / 6283 ; {#1} #2 \exp_after:wN ; \int_use:N \__int_eval:w \c_minus_one + #3; } -\cs_new:Npn \@@_trig_large_ii_o:wnnnn #1; #2#3#4#5 +\cs_new:Npn \@@_trig_large_o:wnnnn #1; #2#3#4#5 { - \exp_after:wN \@@_trig_large_i:www + \exp_after:wN \@@_trig_large:www \int_use:N \__int_eval:w \c_@@_leading_shift_int + #20 - #1*62831 \exp_after:wN \@@_pack:NNNNNw \int_use:N \__int_eval:w \c_@@_middle_shift_int + #30 - #1*8530 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 228c317ead3..1a405873659 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -35,7 +35,7 @@ % %<*package> \RequirePackage{l3bootstrap}[2012/07/15] -\GetIdInfo$Id: l3names.dtx 4230 2012-09-24 21:44:28Z joseph $ +\GetIdInfo$Id: l3names.dtx 4346 2012-12-07 13:46:13Z joseph $ {L3 Namespace for primitives} %</package> %<*driver> @@ -599,6 +599,17 @@ \__expl_primitive:NN \luatexversion \luatex_luatexversion:D \__expl_primitive:NN \savecatcodetable \luatex_savecatcodetable:D % \end{macrocode} +% Slightly more awkward are the directional primitives in \LuaTeX{}. These +% come from Omega \emph{via} Aleph, but we do not support those engines and +% so it seems most sensible to treat them as \LuaTeX{} primitives for prefix +% purposes. +% \begin{macrocode} + \__expl_primitive:NN \bodydir \luatex_bodydir:D + \__expl_primitive:NN \mathdir \luatex_mathdir:D + \__expl_primitive:NN \pagedir \luatex_pagedir:D + \__expl_primitive:NN \pardir \luatex_pardir:D + \__expl_primitive:NN \textdir \luatex_textdir:D +% \end{macrocode} % The job is done: close the group (using the primitive renamed!). % \begin{macrocode} \tex_endgroup:D @@ -621,6 +632,14 @@ \tex_let:D \luatex_initcatcodetable:D \luatexinitcatcodetable \tex_let:D \luatex_latelua:D \luatexlatelua \tex_let:D \luatex_savecatcodetable:D \luatexsavecatcodetable +% \end{macrocode} +% Which also covers those slightly odd ones. +% \begin{macrocode} +\tex_let:D \luatex_bodydir:D \luatexbodydir +\tex_let:D \luatex_mathdir:D \luatexmathdir +\tex_let:D \luatex_pagedir:D \luatexpagedir +\tex_let:D \luatex_pardir:D \luatexpardir +\tex_let:D \luatex_textdir:D \luatextextdir %</package> % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index c7fcb2a2790..54db54f0f58 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3prg.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3prg.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Control structures} %</driver|package> %<*driver> @@ -1124,17 +1124,17 @@ % \begin{macro}[aux]+\@@_|_1:w+ % \begin{macro}[aux] % { -% \@@_eval_skip_to_end:Nw, -% \@@_eval_skip_to_end_ii:Nw, -% \@@_eval_skip_to_end_iii:Nw +% \@@_eval_skip_to_end_auxi:Nw, +% \@@_eval_skip_to_end_auxii:Nw, +% \@@_eval_skip_to_end_auxiii:Nw % } % When the truth value has already been decided, we have to throw away % the remainder of the current group as we are doing minimal % evaluation. This is slightly tricky as there are no braces so we % have to play match the |()| manually. % \begin{macrocode} -\cs_new_nopar:cpn { @@_&_0:w } & { \@@_eval_skip_to_end:Nw \c_false_bool } -\cs_new_nopar:cpn { @@_|_1:w } | { \@@_eval_skip_to_end:Nw \c_true_bool } +\cs_new_nopar:cpn { @@_&_0:w } & { \@@_eval_skip_to_end_auxi:Nw \c_false_bool } +\cs_new_nopar:cpn { @@_|_1:w } | { \@@_eval_skip_to_end_auxi:Nw \c_true_bool } % \end{macrocode} % There is always at least one |)| waiting, namely the outer % one. However, we are facing the problem that there may be more than @@ -1188,9 +1188,9 @@ % finally close the group nicely. % \begin{macrocode} %% ( -\cs_new:Npn \@@_eval_skip_to_end:Nw #1#2 ) +\cs_new:Npn \@@_eval_skip_to_end_auxi:Nw #1#2 ) { - \@@_eval_skip_to_end_ii:Nw #1#2 ( % ) + \@@_eval_skip_to_end_auxii:Nw #1#2 ( % ) \q_no_value \q_stop {#2} } @@ -1199,20 +1199,20 @@ % the boolean |#1|. If there is, we need to grab a |()| pair and then % recurse % \begin{macrocode} -\cs_new:Npn \@@_eval_skip_to_end_ii:Nw #1#2 ( #3#4 \q_stop #5 % ) +\cs_new:Npn \@@_eval_skip_to_end_auxii:Nw #1#2 ( #3#4 \q_stop #5 % ) { \quark_if_no_value:NTF #3 {#1} - { \@@_eval_skip_to_end_iii:Nw #1 #5 } + { \@@_eval_skip_to_end_auxiii:Nw #1 #5 } } % \end{macrocode} % Keep the boolean, throw away anything up to the |(| as it is % irrelevant, remove a |()| pair but remember to reinsert |#3| as it may % contain |(| tokens! % \begin{macrocode} -\cs_new:Npn \@@_eval_skip_to_end_iii:Nw #1#2 ( #3 ) +\cs_new:Npn \@@_eval_skip_to_end_auxiii:Nw #1#2 ( #3 ) { % ( - \@@_eval_skip_to_end:Nw #1#3 ) + \@@_eval_skip_to_end_auxi:Nw #1#3 ) } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index 1a3d34eeaac..f9c8f06e7e3 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3seq.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3seq.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Sequences and stacks} %</driver|package> %<*driver> @@ -815,7 +815,7 @@ % \begin{macro}[aux]{\@@_set_split:NNnn} % \begin{macro}[aux] % { -% \@@_set_split_i:w, \@@_set_split_ii:w, +% \@@_set_split_auxi:w, \@@_set_split_auxii:w, % \@@_set_split_end: % } % The goal is to split a given token list at a marker, @@ -824,11 +824,11 @@ % spaces the item is enclosed within braces. After % \cs{tl_replace_all:Nnn}, the token list \cs{l_@@_internal_a_tl} % is a repetition of the pattern -% \cs{@@_set_split_i:w} \cs{prg_do_nothing:} +% \cs{@@_set_split_auxi:w} \cs{prg_do_nothing:} % \meta{item with spaces} \cs{@@_set_split_end:}. -% Then, \texttt{x}-expansion causes \cs{@@_set_split_i:w} +% Then, \texttt{x}-expansion causes \cs{@@_set_split_auxi:w} % to trim spaces, and leaves its result as -% \cs{@@_set_split_ii:w} \meta{trimmed item} +% \cs{@@_set_split_auxii:w} \meta{trimmed item} % \cs{@@_set_split_end:}. This is then converted % to the \pkg{l3seq} internal structure by another % \texttt{x}-expansion. In the first step, we insert @@ -848,26 +848,26 @@ { \tl_set:Nn \l_@@_internal_a_tl { - \@@_set_split_i:w \prg_do_nothing: + \@@_set_split_auxi:w \prg_do_nothing: #4 \@@_set_split_end: } \tl_replace_all:Nnn \l_@@_internal_a_tl { #3 } { \@@_set_split_end: - \@@_set_split_i:w \prg_do_nothing: + \@@_set_split_auxi:w \prg_do_nothing: } \tl_set:Nx \l_@@_internal_a_tl { \l_@@_internal_a_tl } #1 #2 { \l_@@_internal_a_tl } } } -\cs_new:Npn \@@_set_split_i:w #1 \@@_set_split_end: +\cs_new:Npn \@@_set_split_auxi:w #1 \@@_set_split_end: { - \exp_not:N \@@_set_split_ii:w + \exp_not:N \@@_set_split_auxii:w \exp_args:No \tl_trim_spaces:n {#1} \exp_not:N \@@_set_split_end: } -\cs_new:Npn \@@_set_split_ii:w #1 \@@_set_split_end: +\cs_new:Npn \@@_set_split_auxii:w #1 \@@_set_split_end: { \@@_wrap_item:n {#1} } \cs_generate_variant:Nn \seq_set_split:Nnn { NnV } \cs_generate_variant:Nn \seq_gset_split:Nnn { NnV } @@ -1015,7 +1015,7 @@ % The idea of the code here is to avoid a relatively expensive addition of % items one at a time to an intermediate sequence. % The approach taken is therefore similar to -% that in \cs{@@_pop_right_aux_ii:NNN}, using a \enquote{flexible} +% that in \cs{@@_pop_right_aux:NNN}, using a \enquote{flexible} % \texttt{x}-type expansion to do most of the work. As \cs{tl_if_eq:nnT} % is not expandable, a two-part strategy is needed. First, the % \texttt{x}-type expansion uses \cs{str_if_eq:nnT} to find potential diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index b48cbcd1854..0f166541978 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3tl.dtx 4244 2012-09-28 22:46:36Z bruno $ +\GetIdInfo$Id: l3tl.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Token lists} %</driver|package> %<*driver> @@ -2011,21 +2011,21 @@ % \begin{macro}[int]{\@@_trim_spaces:nn} % \begin{macro}[aux] % { -% \@@_trim_spaces_i:w, \@@_trim_spaces_ii:w -% \@@_trim_spaces_iii:w, \@@_trim_spaces_iv:w +% \@@_trim_spaces_auxi:w, \@@_trim_spaces_auxii:w +% \@@_trim_spaces_auxiii:w, \@@_trim_spaces_auxiv:w % } % Trimming spaces from around the input is done using delimited % arguments and quarks, and to get spaces at odd places in the % definitions, we nest those in \cs{@@_tmp:w}, which then receives % a single space as its argument: |#1| is \verb*+ +. -% Removing leading spaces is done with \cs{@@_trim_spaces_i:w}, +% Removing leading spaces is done with \cs{@@_trim_spaces_auxi:w}, % which loops until \cs{q_mark}\verb*+ + matches the end of the token % list: then |##1| is the token list and |##3| is -% \cs{@@_trim_spaces_ii:w}. This hands the relevant tokens to the -% loop \cs{@@_trim_spaces_iii:w}, responsible for trimming +% \cs{@@_trim_spaces_auxii:w}. This hands the relevant tokens to the +% loop \cs{@@_trim_spaces_auxiii:w}, responsible for trimming % trailing spaces. The end is reached when \verb*+ + \cs{q_nil} % matches the one present in the definition of \cs{tl_trim_spacs:n}. -% Then \cs{@@_trim_spaces_iv:w} puts the token list into a group, +% Then \cs{@@_trim_spaces_auxiv:w} puts the token list into a group, % with \cs{use_none:n} placed there to gobble a lingering \cs{q_mark}, % and feeds this to the \meta{continuation}. % \begin{macrocode} @@ -2033,37 +2033,37 @@ { \cs_new:Npn \@@_trim_spaces:nn ##1 { - \@@_trim_spaces_i:w + \@@_trim_spaces_auxi:w ##1 \q_nil \q_mark #1 { } - \q_mark \@@_trim_spaces_ii:w - \@@_trim_spaces_iii:w + \q_mark \@@_trim_spaces_auxii:w + \@@_trim_spaces_auxiii:w #1 \q_nil - \@@_trim_spaces_iv:w + \@@_trim_spaces_auxiv:w \q_stop } - \cs_new:Npn \@@_trim_spaces_i:w ##1 \q_mark #1 ##2 \q_mark ##3 + \cs_new:Npn \@@_trim_spaces_auxi:w ##1 \q_mark #1 ##2 \q_mark ##3 { ##3 - \@@_trim_spaces_i:w + \@@_trim_spaces_auxi:w \q_mark ##2 \q_mark #1 {##1} } - \cs_new:Npn \@@_trim_spaces_ii:w - \@@_trim_spaces_i:w \q_mark \q_mark ##1 + \cs_new:Npn \@@_trim_spaces_auxii:w + \@@_trim_spaces_auxi:w \q_mark \q_mark ##1 { - \@@_trim_spaces_iii:w + \@@_trim_spaces_auxiii:w ##1 } - \cs_new:Npn \@@_trim_spaces_iii:w ##1 #1 \q_nil ##2 + \cs_new:Npn \@@_trim_spaces_auxiii:w ##1 #1 \q_nil ##2 { ##2 ##1 \q_nil - \@@_trim_spaces_iii:w + \@@_trim_spaces_auxiii:w } - \cs_new:Npn \@@_trim_spaces_iv:w ##1 \q_nil ##2 \q_stop ##3 + \cs_new:Npn \@@_trim_spaces_auxiv:w ##1 \q_nil ##2 \q_stop ##3 { ##3 { \use_none:n ##1 } } } \@@_tmp:w { ~ } @@ -2224,7 +2224,7 @@ % \subsection{The first token from a token list} % % \begin{macro}{\tl_head:N, \tl_head:n, \tl_head:V, \tl_head:v, \tl_head:f} -% \begin{macro}[aux]{\@@_head_i:nw, \@@_head_ii:nw} +% \begin{macro}[aux]{\@@_head_auxi:nw, \@@_head_auxii:nw} % \begin{macro}{\tl_head:w} % \begin{macro}{\tl_tail:N, \tl_tail:n, \tl_tail:V, \tl_tail:v, \tl_tail:f} % Finding the head of a token list expandably will always strip braces, which @@ -2242,11 +2242,11 @@ \cs_new:Npn \tl_head:n #1 { \etex_unexpanded:D - \if_false: { \fi: \@@_head_i:nw #1 { } \q_stop } + \if_false: { \fi: \@@_head_auxi:nw #1 { } \q_stop } } -\cs_new:Npn \@@_head_i:nw #1#2 \q_stop - { \exp_after:wN \@@_head_ii:nw \exp_after:wN { \if_false: } \fi: {#1} } -\cs_new:Npn \@@_head_ii:nw #1 +\cs_new:Npn \@@_head_auxi:nw #1#2 \q_stop + { \exp_after:wN \@@_head_auxii:nw \exp_after:wN { \if_false: } \fi: {#1} } +\cs_new:Npn \@@_head_auxii:nw #1 { \exp_after:wN \if_meaning:w \exp_after:wN \q_nil \tl_to_str:n \exp_after:wN { \use_none:n #1 } \q_nil @@ -2255,7 +2255,7 @@ \exp_after:wN \use_ii:nn \fi: {#1} - { \if_false: { \fi: \@@_head_i:nw #1 } } + { \if_false: { \fi: \@@_head_auxi:nw #1 } } } \cs_generate_variant:Nn \tl_head:n { V , v , f } \cs_new:Npn \tl_head:w #1#2 \q_stop {#1} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index e539f0bfcec..6e3ef14d414 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3token.dtx 4251 2012-11-01 16:30:06Z joseph $ +\GetIdInfo$Id: l3token.dtx 4384 2012-12-20 15:47:56Z bruno $ {L3 Experimental token manipulation} %</driver|package> %<*driver> @@ -730,7 +730,7 @@ % as described above. % \end{variable} % -% \begin{function}[updated = 2011-07-02, TF]{\peek_catcode:N} +% \begin{function}[updated = 2012-12-20, TF]{\peek_catcode:N} % \begin{syntax} % \cs{peek_catcode:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} @@ -742,19 +742,20 @@ % result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF]{\peek_catcode_ignore_spaces:N} +% \begin{function}[updated = 2012-12-20, TF]{\peek_catcode_ignore_spaces:N} % \begin{syntax} % \cs{peek_catcode_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the next \meta{token} in the input stream has the same -% category code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_catcode:NNTF}). Spaces are ignored by the test -% and the \meta{token} will be left in the input stream after -% the \meta{true code} or \meta{false code} (as appropriate to the -% result of the test). +% Tests if the next non-space \meta{token} in the input stream has the +% same category code as the \meta{test token} (as defined by the test +% \cs{token_if_eq_catcode:NNTF}). Explicit and implicit space tokens +% (with character code 32 and category code 10) are ignored and +% removed by the test and the \meta{token} will be left in the input +% stream after the \meta{true code} or \meta{false code} (as +% appropriate to the result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF]{\peek_catcode_remove:N} +% \begin{function}[updated = 2012-12-20, TF]{\peek_catcode_remove:N} % \begin{syntax} % \cs{peek_catcode_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} @@ -767,21 +768,22 @@ % appropriate to the result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF] +% \begin{function}[updated = 2012-12-20, TF] % {\peek_catcode_remove_ignore_spaces:N} % \begin{syntax} % \cs{peek_catcode_remove_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the next \meta{token} in the input stream has the same -% category code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_catcode:NNTF}). Spaces are ignored by the test -% and the \meta{token} will be removed from the input stream if the -% test is true. The function will then place either the -% \meta{true code} or \meta{false code} in the input stream (as -% appropriate to the result of the test). +% Tests if the next non-space \meta{token} in the input stream has the +% same category code as the \meta{test token} (as defined by the test +% \cs{token_if_eq_catcode:NNTF}). Explicit and implicit space tokens +% (with character code 32 and category code 10) are ignored and +% removed by the test and the \meta{token} will be removed from the +% input stream if the test is true. The function will then place +% either the \meta{true code} or \meta{false code} in the input stream +% (as appropriate to the result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF]{\peek_charcode:N} +% \begin{function}[updated = 2012-12-20, TF]{\peek_charcode:N} % \begin{syntax} % \cs{peek_charcode:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} @@ -793,19 +795,20 @@ % result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF]{\peek_charcode_ignore_spaces:N} +% \begin{function}[updated = 2012-12-20, TF]{\peek_charcode_ignore_spaces:N} % \begin{syntax} % \cs{peek_charcode_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the next \meta{token} in the input stream has the same -% character code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_charcode:NNTF}). Spaces are ignored by the test -% and the \meta{token} will be left in the input stream after +% Tests if the next non-space \meta{token} in the input stream has the +% same character code as the \meta{test token} (as defined by the test +% \cs{token_if_eq_charcode:NNTF}). Explicit and implicit space tokens +% (with character code 32 and category code 10) are ignored and removed by +% the test and the \meta{token} will be left in the input stream after % the \meta{true code} or \meta{false code} (as appropriate to the % result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF]{\peek_charcode_remove:N} +% \begin{function}[updated = 2012-12-20, TF]{\peek_charcode_remove:N} % \begin{syntax} % \cs{peek_charcode_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} @@ -818,19 +821,20 @@ % appropriate to the result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF] +% \begin{function}[updated = 2012-12-20, TF] % {\peek_charcode_remove_ignore_spaces:N} % \begin{syntax} % \cs{peek_charcode_remove_ignore_spaces:NTF} \meta{test token} % ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the next \meta{token} in the input stream has the same -% character code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_charcode:NNTF}). Spaces are ignored by the test -% and the \meta{token} will be removed from the input stream if the -% test is true. The function will then place either the -% \meta{true code} or \meta{false code} in the input stream (as -% appropriate to the result of the test). +% Tests if the next non-space \meta{token} in the input stream has the +% same character code as the \meta{test token} (as defined by the test +% \cs{token_if_eq_charcode:NNTF}). Explicit and implicit space tokens +% (with character code 32 and category code 10) are ignored and +% removed by the test and the \meta{token} will be removed from the +% input stream if the test is true. The function will then place +% either the \meta{true code} or \meta{false code} in the input stream +% (as appropriate to the result of the test). % \end{function} % % \begin{function}[updated = 2011-07-02, TF]{\peek_meaning:N} @@ -845,16 +849,17 @@ % result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF]{\peek_meaning_ignore_spaces:N} +% \begin{function}[updated = 2012-12-05, TF]{\peek_meaning_ignore_spaces:N} % \begin{syntax} % \cs{peek_meaning_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the next \meta{token} in the input stream has the same -% meaning as the \meta{test token} (as defined by the test -% \cs{token_if_eq_meaning:NNTF}). Spaces are ignored by the test -% and the \meta{token} will be left in the input stream after -% the \meta{true code} or \meta{false code} (as appropriate to the -% result of the test). +% Tests if the next non-space \meta{token} in the input stream has the +% same meaning as the \meta{test token} (as defined by the test +% \cs{token_if_eq_meaning:NNTF}). Explicit and implicit space tokens +% (with character code 32 and category code 10) are ignored and +% removed by the test and the \meta{token} will be left in the input +% stream after the \meta{true code} or \meta{false code} (as +% appropriate to the result of the test). % \end{function} % % \begin{function}[updated = 2011-07-02, TF]{\peek_meaning_remove:N} @@ -870,19 +875,20 @@ % appropriate to the result of the test). % \end{function} % -% \begin{function}[updated = 2011-07-02, TF] +% \begin{function}[updated = 2012-12-05, TF] % {\peek_meaning_remove_ignore_spaces:N} % \begin{syntax} % \cs{peek_meaning_remove_ignore_spaces:NTF} \meta{test token} % ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the next \meta{token} in the input stream has the same -% meaning as the \meta{test token} (as defined by the test -% \cs{token_if_eq_meaning:NNTF}). Spaces are ignored by the test -% and the \meta{token} will be removed from the input stream if the -% test is true. The function will then place either the -% \meta{true code} or \meta{false code} in the input stream (as -% appropriate to the result of the test). +% Tests if the next non-space \meta{token} in the input stream has the +% same meaning as the \meta{test token} (as defined by the test +% \cs{token_if_eq_meaning:NNTF}). Explicit and implicit space tokens +% (with character code 32 and category code 10) are ignored and +% removed by the test and the \meta{token} will be removed from the +% input stream if the test is true. The function will then place +% either the \meta{true code} or \meta{false code} in the input stream +% (as appropriate to the result of the test). % \end{function} % % \section{Decomposing a macro definition} @@ -1852,7 +1858,7 @@ % \end{macro} % % \subsection{Peeking ahead at the next token} -% +% % \begin{macrocode} %<@@=peek> % \end{macrocode} @@ -1985,19 +1991,9 @@ % \end{macrocode} % \end{macro} % -% \begin{macro} -% {\@@_execute_branches_catcode:, \@@_execute_branches_meaning:} -% The category code and meaning tests are straight forward. +% \begin{macro}{\@@_execute_branches_meaning:} +% The meaning test is straight forward. % \begin{macrocode} -\cs_new_nopar:Npn \@@_execute_branches_catcode: - { - \if_catcode:w - \exp_not:N \l_peek_token \exp_not:N \l_@@_search_token - \exp_after:wN \@@_true:w - \else: - \exp_after:wN \@@_false:w - \fi: - } \cs_new_nopar:Npn \@@_execute_branches_meaning: { \if_meaning:w \l_peek_token \l_@@_search_token @@ -2009,35 +2005,71 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_execute_branches_charcode:} -% \begin{macro}[aux]{\@@_execute_branches_charcode:NN} -% First the character code test there is a need to worry about \TeX{} -% grabbing brace group or skipping spaces. These are all tested for -% using a category code check before grabbing what must be a real -% single token and doing the comparison. +% \begin{macro}{\@@_execute_branches_catcode:, \@@_execute_branches_charcode:} +% \begin{macro}[aux] +% { +% \@@_execute_branches_catcode_aux: , +% \@@_execute_branches_catcode_auxii:N , +% \@@_execute_branches_catcode_auxiii: +% } +% The catcode and charcode tests are very similar, and in order to use +% the same auxiliaries we do something a little bit odd, firing +% \cs{if_catcode:w} and \cs{if_charcode:w} before finding the operands +% for those tests, which will only be given in in the |auxii:N| and +% |auxiii:| auxiliaries. For our purposes, three kinds of tokens may +% follow the peeking function: +% \begin{itemize} +% \item control sequences which are not equal to a non-active +% character token (\emph{e.g.}, macro, primitive); +% \item active characters which are not equal to a non-active +% character token (\emph{e.g.}, macro, primitive); +% \item explicit non-active character tokens, or control sequences +% or active characters set equal to a non-active character token. +% \end{itemize} +% The first two cases are not distinguishable simply using \TeX{}'s +% \tn{futurelet}, because we can only access the \tn{meaning} of +% tokens in that way. In those cases, detected thanks to a +% comparison with \cs{scan_stop:}, we grab the following token, and +% compare it explicitly with the explicit search token stored in +% \cs{l_@@_search_tl}. The \cs{exp_not:N} prevents outer macros +% (coming from non-\LaTeX3 code) from blowing up. In the third case, +% \cs{l_peek_token} is good enough for the test, and we compare it +% again with the explicit search token. Just like the peek token, the +% search token may be of any of the three types above, hence the need +% to use the explicit token that was given to the peek function. % \begin{macrocode} +\cs_new_nopar:Npn \@@_execute_branches_catcode: + { \if_catcode:w \@@_execute_branches_catcode_aux: } \cs_new_nopar:Npn \@@_execute_branches_charcode: + { \if_charcode:w \@@_execute_branches_catcode_aux: } +\cs_new_nopar:Npn \@@_execute_branches_catcode_aux: { - \bool_if:nTF - { - \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token - || \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token - || \token_if_eq_meaning_p:NN \l_peek_token \c_space_token - } - { \@@_false:w } - { - \exp_after:wN \@@_execute_branches_charcode_aux:NN - \l_@@_search_tl - } + \if_catcode:w \exp_not:N \l_peek_token \scan_stop: + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_execute_branches_catcode_auxii:N + \exp_after:wN \exp_not:N + \else: + \exp_after:wN \@@_execute_branches_catcode_auxiii: + \fi: } -\cs_new:Npn \@@_execute_branches_charcode_aux:NN #1#2 +\cs_new:Npn \@@_execute_branches_catcode_auxii:N #1 { - \if:w \exp_not:N #1 \exp_not:N #2 + \exp_not:N #1 + \exp_after:wN \exp_not:N \l_@@_search_tl + \exp_after:wN \@@_true:w + \else: + \exp_after:wN \@@_false:w + \fi: + #1 + } +\cs_new_nopar:Npn \@@_execute_branches_catcode_auxiii: + { + \exp_not:N \l_peek_token + \exp_after:wN \exp_not:N \l_@@_search_tl \exp_after:wN \@@_true:w \else: \exp_after:wN \@@_false:w \fi: - #2 } % \end{macrocode} % \end{macro} @@ -2045,17 +2077,23 @@ % % \begin{macro}{\@@_ignore_spaces_execute_branches:} % \begin{macro}[aux]{\@@_ignore_spaces_execute_branches_aux:} -% This function removes one token at a time with a mechanism that can -% be applied to things other than spaces. +% This function removes one token at a time with the same mechanism as +% \cs{@@_true_remove:w}. We directly use the primitive meaning test +% rather than \cs{token_if_eq_meaning:NNTF} because \cs{l_peek_token} +% may be an outer macro (coming from non-\LaTeX3 packages). We cannot +% replace \cs{@@_tmp:w} by \cs{l_peek_token} here because if the +% latter is an outer macro, it may not appear in the skipped branch of +% a conditional. % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_ignore_spaces_execute_branches: { - \token_if_eq_meaning:NNTF \l_peek_token \c_space_token - { - \tex_afterassignment:D \@@_ignore_spaces_execute_branches_aux: - \cs_set_eq:NN \@@_tmp:w - } - { \@@_execute_branches: } + \if_meaning:w \l_peek_token \c_space_token + \tex_afterassignment:D \@@_ignore_spaces_execute_branches_aux: + \exp_after:wN \cs_set_eq:NN + \exp_after:wN \@@_tmp:w + \else: + \exp_after:wN \@@_execute_branches: + \fi: } \cs_new_protected_nopar:Npn \@@_ignore_spaces_execute_branches_aux: { \peek_after:Nw \@@_ignore_spaces_execute_branches: } diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx index dd098c9ff6d..b460dc095cb 100644 --- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx +++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx @@ -37,19 +37,20 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2012/11/21] -%<package>\@ifpackagelater{expl3}{2012/11/21} +\RequirePackage{expl3}[2012/12/21] +%<package>\@ifpackagelater{expl3}{2012/12/21} %<package> {} %<package> {% -%<package> \PackageError{l3keys2e}{Support package l3kernel too old.} +%<package> \PackageError{l3keys2e}{Support package l3kernel too old} %<package> {% -%<package> Please install an up to date version of l3kernel -%<package> using your TeX package manager or from CTAN.\\ \\ +%<package> Please install an up to date version of l3kernel\MessageBreak +%<package> using your TeX package manager or from CTAN.\MessageBreak +%<package> \MessageBreak %<package> Loading l3keys2e will abort!% %<package> }% %<package> \endinput %<package> } -\GetIdInfo$Id: l3keys2e.dtx 4332 2012-11-21 21:40:31Z joseph $ +\GetIdInfo$Id: l3keys2e.dtx 4390 2012-12-21 06:59:20Z joseph $ {LaTeX2e option processing using LaTeX3 keys} %</driver|package> %<*driver> diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx index 8f9364f993f..67b80d5358a 100644 --- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx @@ -41,19 +41,20 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2012/11/21] -%<package>\@ifpackagelater{expl3}{2012/11/21} +\RequirePackage{expl3}[2012/12/21] +%<package>\@ifpackagelater{expl3}{2012/12/21} %<package> {} %<package> {% -%<package> \PackageError{xparse}{Support package l3kernel too old.} +%<package> \PackageError{xparse}{Support package l3kernel too old} %<package> {% -%<package> Please install an up to date version of l3kernel -%<package> using your TeX package manager or from CTAN.\\ \\ +%<package> Please install an up to date version of l3kernel\MessageBreak +%<package> using your TeX package manager or from CTAN.\MessageBreak +%<package> \MessageBreak %<package> Loading xparse will abort!% %<package> }% %<package> \endinput %<package> } -\GetIdInfo$Id: xparse.dtx 4332 2012-11-21 21:40:31Z joseph $ +\GetIdInfo$Id: xparse.dtx 4390 2012-12-21 06:59:20Z joseph $ {L3 Experimental document command parser} %</driver|package> %<*driver> @@ -1047,6 +1048,7 @@ {#1} { \tl_to_str:n {#2} } } \prop_put:Nnn \l_@@_environment_arg_specs_prop {#1} {#2} + \bool_set_false:N \l_@@_expandable_bool \bool_set_true:N \l_@@_environment_bool \@@_declare_env_internal:nnnn {#1} {#2} } @@ -1806,8 +1808,8 @@ % \cs{@@_grab_arg:w} is then called to actually do the grabbing. % % \begin{macro}{\@@_grab_arg:w} -% \begin{macro}[aux]{\@@_grab_arg_aux_i:w} -% \begin{macro}[aux]{\@@_grab_arg_aux_ii:w} +% \begin{macro}[aux]{\@@_grab_arg_auxi:w} +% \begin{macro}[aux]{\@@_grab_arg_auxii:w} % Each time an argument is actually grabbed, \pkg{xparse} defines a % function to do it. In that way, long arguments from previous functions % can be included in the definition of the grabber function, so that @@ -1816,8 +1818,8 @@ % needed in various places. % \begin{macrocode} \cs_new_protected:Npn \@@_grab_arg:w { } -\cs_new_protected:Npn \@@_grab_arg_aux_i:w { } -\cs_new_protected:Npn \@@_grab_arg_aux_ii:w { } +\cs_new_protected:Npn \@@_grab_arg_auxi:w { } +\cs_new_protected:Npn \@@_grab_arg_auxii:w { } % \end{macrocode} % \end{macro} % \end{macro} @@ -2345,7 +2347,7 @@ % \begin{macro} % { % \@@_grab_v_aux_loop:N, -% \@@_grab_v_aux_loop_ii:NN, +% \@@_grab_v_aux_loop:NN, % \@@_grab_v_aux_loop_end: % } % Check that the opening delimiter is a character, setup category codes, @@ -2379,10 +2381,10 @@ \cs_new_protected:Npn \@@_grab_v_aux_loop:N #1 { \peek_N_type:TF - { \@@_grab_v_aux_loop_ii:NN #1 } + { \@@_grab_v_aux_loop:NN #1 } { \@@_grab_v_aux_abort: } } -\cs_new_protected:Npn \@@_grab_v_aux_loop_ii:NN #1 #2 +\cs_new_protected:Npn \@@_grab_v_aux_loop:NN #1 #2 { \@@_grab_v_token_if_char:NTF #2 { @@ -2407,7 +2409,7 @@ % % \begin{macro}{\@@_grab_v_bgroup:} % \begin{macro}{\@@_grab_v_bgroup_loop:} -% \begin{macro}{\@@_grab_v_bgroup_loop_ii:N} +% \begin{macro}{\@@_grab_v_bgroup_loop:N} % \begin{variable}{\l_@@_v_nesting_int} % If the opening delimiter is a left brace, we keep track of % how many left and right braces were encountered so far in @@ -2432,10 +2434,10 @@ \cs_new_protected:Npn \@@_grab_v_bgroup_loop: { \peek_N_type:TF - { \@@_grab_v_bgroup_loop_ii:N } + { \@@_grab_v_bgroup_loop:N } { \@@_grab_v_aux_abort: } } -\cs_new_protected:Npn \@@_grab_v_bgroup_loop_ii:N #1 +\cs_new_protected:Npn \@@_grab_v_bgroup_loop:N #1 { \@@_grab_v_token_if_char:NTF #1 { @@ -2466,7 +2468,7 @@ % % \begin{macro}{\@@_grab_v_aux_catcodes:} % \begin{macro}{\@@_grab_v_aux_abort:} -% \begin{macro}{\@@_grab_v_aux_abort_ii:w} +% \begin{macro}{\@@_grab_v_aux_abort:w} % In a standalone format, the list of special characters is kept % as a sequence, \cs{c_@@_special_chars_seq}, and we use % \tn{dospecials} in package mode. @@ -2495,9 +2497,9 @@ { \@@_grab_v_group_end: \@@_add_arg:o \c_@@_no_value_tl - \exp_after:wN \@@_grab_v_aux_abort_ii:w \l_@@_args_tl \q_stop + \exp_after:wN \@@_grab_v_aux_abort:w \l_@@_args_tl \q_stop } -\cs_new_protected:Npn \@@_grab_v_aux_abort_ii:w #1 #2 \q_stop +\cs_new_protected:Npn \@@_grab_v_aux_abort:w #1 #2 \q_stop { \group_begin: \char_set_lccode:nn { `\# } { \tex_endlinechar:D } @@ -2594,16 +2596,16 @@ % \subsection{Grabbing arguments expandably} % % \begin{macro}[EXP]{\@@_expandable_grab_D:w} -% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_i:NNNnwN} -% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_ii:NNNwNnnn} -% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_iii:Nw} -% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_iv:nnNNNwN} +% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:NNNnwN} +% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:NNNwNnnn} +% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:Nw} +% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:nnNNNwN} % The first step is to grab the first token or group. The generic grabber % \cs{\meta{function}}\verb*| | is just after \cs{q_@@}, we go and find % it. % \begin{macrocode} \cs_new:Npn \@@_expandable_grab_D:w #1 \q_@@ #2 - { #2 { \@@_expandable_grab_D_i:NNNnwNn #1 \q_@@ #2 } } + { #2 { \@@_expandable_grab_D:NNNnwNn #1 \q_@@ #2 } } % \end{macrocode} % We then wish to test whether |#7|, which we just grabbed, is exactly |#2|. % Expand the only grabber function we have, |#1|, once: the two strings below @@ -2644,14 +2646,14 @@ % no opening delimiter any more, hence the balance is reached, and the final % argument is \meta{piece 1} \meta{piece 2}. % \begin{macrocode} -\cs_new:Npn \@@_expandable_grab_D_i:NNNnwNn #1#2#3#4#5 \q_@@ #6#7 +\cs_new:Npn \@@_expandable_grab_D:NNNnwNn #1#2#3#4#5 \q_@@ #6#7 { \str_if_eq:onTF { #1 { } { } #7 #2 \q_@@ #3 } { { } { #2 } { } } { #1 - { \@@_expandable_grab_D_ii:NNNwNnnn #1#2#3#5 \q_@@ #6 } + { \@@_expandable_grab_D:NNNwNnnn #1#2#3#5 \q_@@ #6 } \q_nil { } #2 \ERROR \q_@@ \ERROR } { #5 {#4} \q_@@ #6 {#7} } @@ -2664,14 +2666,14 @@ % for piece 2}. We concatenate those, replacing the two \cs{ERROR} by the % closing delimiter |#3|. % \begin{macrocode} -\cs_new:Npn \@@_expandable_grab_D_ii:NNNwNnnn #1#2#3#4 \q_@@ #5#6#7#8 +\cs_new:Npn \@@_expandable_grab_D:NNNwNnnn #1#2#3#4 \q_@@ #5#6#7#8 { - \exp_args:Nof \@@_expandable_grab_D_iv:nnNNNwN + \exp_args:Nof \@@_expandable_grab_D:nnNNNwN { \use_ii:nn #6 #2 } - { \@@_expandable_grab_D_iii:Nw #3 \exp_stop_f: #7 #8 } + { \@@_expandable_grab_D:Nw #3 \exp_stop_f: #7 #8 } #1#2#3 #4 \q_@@ #5 } -\cs_new:Npn \@@_expandable_grab_D_iii:Nw #1#2 \ERROR \ERROR { #2 #1 } +\cs_new:Npn \@@_expandable_grab_D:Nw #1#2 \ERROR \ERROR { #2 #1 } % \end{macrocode} % Armed with our two new \meta{pieces}, we are ready to loop. However, we % must first see if \meta{piece 2} (here |#2|) contains any opening @@ -2681,9 +2683,9 @@ % delimiter. In that case, we are done, and put the argument (from which we % remove a spurious pair of delimiters coming from how we started the loop). % Otherwise, we go back to looping with -% \cs{@@_expandable_grab_D_ii:NNNwNnnn}. +% \cs{@@_expandable_grab_D:NNNwNnnn}. % \begin{macrocode} -\cs_new:Npn \@@_expandable_grab_D_iv:nnNNNwN #1#2#3#4#5#6 \q_@@ #7 +\cs_new:Npn \@@_expandable_grab_D:nnNNNwN #1#2#3#4#5#6 \q_@@ #7 { \exp_args:No \tl_if_empty:oTF { #3 { \use_none:nnn } #2 \q_@@ #5 #4 \q_@@ #5 } @@ -2693,7 +2695,7 @@ } { #3 - { \@@_expandable_grab_D_ii:NNNwNnnn #3#4#5#6 \q_@@ #7 } + { \@@_expandable_grab_D:NNNwNnnn #3#4#5#6 \q_@@ #7 } \q_nil {#1} #2 \ERROR \q_@@ \ERROR } } @@ -2705,27 +2707,27 @@ % \end{macro} % % \begin{macro}[EXP]{\@@_expandable_grab_D_alt:w} -% \begin{macro}[EXP]{\@@_expandable_grab_D_alt_i:NNnwNn} -% \begin{macro}[EXP]{\@@_expandable_grab_D_alt_ii:Nw} +% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:NNnwNn} +% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:Nw} % When the delimiters are identical, nesting is not possble and a simplified % approach is used. The test concept here is the same as for the case where % the delimiters are different. % \begin{macrocode} \cs_new:Npn \@@_expandable_grab_D_alt:w #1 \q_@@ #2 - { #2 { \@@_expandable_grab_D_alt_i:NNnwNn #1 \q_@@ #2 } } -\cs_new:Npn \@@_expandable_grab_D_alt_i:NNnwNn #1#2#3#4 \q_@@ #5#6 + { #2 { \@@_expandable_grab_D_alt:NNnwNn #1 \q_@@ #2 } } +\cs_new:Npn \@@_expandable_grab_D_alt:NNnwNn #1#2#3#4 \q_@@ #5#6 { \str_if_eq:onTF { #1 { } #6 #2 #2 } { { } #2 } { #1 - { \@@_expandable_grab_D_alt_ii:Nwn #5 #4 \q_@@ } + { \@@_expandable_grab_D_alt:Nwn #5 #4 \q_@@ } #6 \ERROR } { #4 {#3} \q_@@ #5 {#6} } } -\cs_new:Npn \@@_expandable_grab_D_alt_ii:Nwn #1#2 \q_@@ #3 +\cs_new:Npn \@@_expandable_grab_D_alt:Nwn #1#2 \q_@@ #3 { \@@_put_arg_expandable:ow { \use_none:n #3 } #2 \q_@@ #1 } % \end{macrocode} % \end{macro} @@ -2759,7 +2761,7 @@ { { } { #2 } { } } { #1 - { \@@_expandable_grab_D_ii:NNNwNnnn #1#2#3#5 \q_@@ #6 } + { \@@_expandable_grab_D:NNNwNnnn #1#2#3#5 \q_@@ #6 } \q_nil { } #2 \ERROR \q_@@ \ERROR } { @@ -2787,7 +2789,7 @@ { { } #2 } { #1 - { \@@_expandable_grab_D_alt_ii:Nwn #5 #4 \q_@@ } + { \@@_expandable_grab_D_alt:Nwn #5 #4 \q_@@ } #6 \ERROR } { diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx index 8aa2fbde65e..9f632ae9109 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx @@ -41,19 +41,20 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2012/11/21] -%<package>\@ifpackagelater{expl3}{2012/11/21} +\RequirePackage{expl3}[2012/12/21] +%<package>\@ifpackagelater{expl3}{2012/12/21} %<package> {} %<package> {% -%<package> \PackageError{xtemplate}{Support package l3kernel too old.} +%<package> \PackageError{xtemplate}{Support package l3kernel too old} %<package> {% -%<package> Please install an up to date version of l3kernel -%<package> using your TeX package manager or from CTAN.\\ \\ +%<package> Please install an up to date version of l3kernel\MessageBreak +%<package> using your TeX package manager or from CTAN.\MessageBreak +%<package> \MessageBreak %<package> Loading xtemplate will abort!% %<package> }% %<package> \endinput %<package> } -\GetIdInfo$Id: xtemplate.dtx 4332 2012-11-21 21:40:31Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 4390 2012-12-21 06:59:20Z joseph $ {L3 Experimental prototype document functions} %</driver|package> %<*driver> @@ -2085,7 +2086,9 @@ % Setting a Boolean value is slightly different to everything else % as the value can be used to work out which \texttt{set} function to % call. As long as there is no need to recover things from another -% variable, everything is pretty easy. +% variable, everything is pretty easy. If there is, then we need to allow +% for the fact that the recovered value here will \emph{not} be expandable, +% so needs to be converted to something that is. % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_assign_boolean: { @@ -2095,12 +2098,22 @@ } \cs_new_protected_nopar:Npn \@@_assign_boolean_aux:n #1 { - \@@_if_key_value:oT \l_@@_value_tl - { \@@_key_to_value: } - \tl_put_right:Nx \l_@@_assignments_tl + \@@_if_key_value:oTF \l_@@_value_tl { - \exp_not:c { #1 _ \l_@@_value_tl :N } - \exp_not:o \l_@@_var_tl + \@@_key_to_value: + \tl_put_right:Nx \l_@@_assignments_tl + { + \exp_not:c { #1 _eq:NN } + \exp_not:o \l_@@_var_tl + \exp_not:o \l_@@_value_tl + } + } + { + \tl_put_right:Nx \l_@@_assignments_tl + { + \exp_not:c { #1 _ \l_@@_value_tl :N } + \exp_not:o \l_@@_var_tl + } } } % \end{macrocode} diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3sort/l3sort.sty b/Master/texmf-dist/tex/latex/l3experimental/l3sort/l3sort.sty index a719b42e7a4..21c29315228 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3sort/l3sort.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3sort/l3sort.sty @@ -47,7 +47,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{expl3} -\GetIdInfo$Id: l3sort.dtx 3991 2012-07-16 19:00:35Z joseph $ +\GetIdInfo$Id: l3sort.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Experimental sorting functions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -60,32 +60,32 @@ \int_new:N \l__sort_A_int \int_new:N \l__sort_B_int \int_new:N \l__sort_C_int -\cs_new:Npn \tl_sort:nN #1#2 { \__sort_quick_i:nNn {#1} #2 { } } -\cs_new:Npn \__sort_quick_i:nNn #1#2 +\cs_new:Npn \tl_sort:nN #1#2 { \__sort_quick:nNn {#1} #2 { } } +\cs_new:Npn \__sort_quick:nNn #1#2 { - \exp_after:wN \__sort_quick_ii:wn + \exp_after:wN \__sort_quick:wn \use_none:n #1 \__prg_break_point: - \__sort_quick_iii:nnNnn { } { } #2 + \__sort_quick:nnNnn { } { } #2 #1 { \__prg_break_point: } \__prg_break_point: } -\cs_new:Npn \__sort_quick_ii:wn #1 \__prg_break_point: #2 {#2} -\cs_new:Npn \__sort_quick_iii:nnNnn #1#2#3#4#5 +\cs_new:Npn \__sort_quick:wn #1 \__prg_break_point: #2 {#2} +\cs_new:Npn \__sort_quick:nnNnn #1#2#3#4#5 { \__prg_break: #5 - \__sort_quick_iv:nnNnwn {#1} {#2} + \__sort_quick:nnNnwn {#1} {#2} \__prg_break_point: #3 {#4} {#5} - { \__sort_quick_iii:nnNnn {#1} { #2 {#5} } } - { \__sort_quick_iii:nnNnn { #1 {#5} } {#2} } + { \__sort_quick:nnNnn {#1} { #2 {#5} } } + { \__sort_quick:nnNnn { #1 {#5} } {#2} } #3 {#4} } -\cs_new:Npn \__sort_quick_iv:nnNnwn +\cs_new:Npn \__sort_quick:nnNnwn #1#2 \__prg_break_point: #3#4 #5 \__prg_break_point: #6 { - \__sort_quick_i:nNn {#2} #3 - { \__sort_quick_i:nNn {#1} #3 {#6} {#4} } + \__sort_quick:nNn {#2} #3 + { \__sort_quick:nNn {#1} #3 {#6} {#4} } } \cs_new_protected:Npn \__sort_main:NNNnNn #1#2#3#4#5#6 { diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty index 156d2c1393f..ccb695c0f0e 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{expl3} -\GetIdInfo$Id: l3regex.dtx 4219 2012-09-09 13:28:51Z bruno $ +\GetIdInfo$Id: l3regex.dtx 4341 2012-11-27 08:39:42Z bruno $ {L3 Experimental regular expressions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -366,22 +366,22 @@ \if_charcode:w \c_space_token #1 \exp_after:wN \__regex_escape_x_test:N \else: - \exp_after:wN \__regex_escape_x_test_ii:N + \exp_after:wN \__regex_escape_x_test_two:N \exp_after:wN #1 \fi: } } -\cs_new:Npn \__regex_escape_x_test_ii:N #1 +\cs_new:Npn \__regex_escape_x_test_two:N #1 { \if_charcode:w \c_lbrace_str #1 \exp_after:wN \__regex_escape_x_loop:N \else: \__str_hexadecimal_use:NTF #1 - { \exp_after:wN \__regex_escape_x_ii:N } + { \exp_after:wN \__regex_escape_x:N } { ; \exp_after:wN \__regex_escape_loop:N \exp_after:wN #1 } \fi: } -\cs_new:Npn \__regex_escape_x_ii:N #1 +\cs_new:Npn \__regex_escape_x:N #1 { \str_if_eq_x:nnTF {#1} { break } { ; } { @@ -701,10 +701,10 @@ \cs_new_protected:cpn { __regex_compile_quantifier_ \c_lbrace_str :w } { \__regex_get_digits:NTFw \l__regex_internal_a_int - { \__regex_compile_quantifier_braced_i:w } + { \__regex_compile_quantifier_braced_auxi:w } { \__regex_compile_quantifier_abort:xNN { \c_lbrace_str } } } -\cs_new_protected:Npn \__regex_compile_quantifier_braced_i:w #1#2 +\cs_new_protected:Npn \__regex_compile_quantifier_braced_auxi:w #1#2 { \str_case_x:nnn { #1 #2 } { @@ -716,8 +716,8 @@ { \__regex_compile_special:N , } { \__regex_get_digits:NTFw \l__regex_internal_b_int - { \__regex_compile_quantifier_braced_iii:w } - { \__regex_compile_quantifier_braced_ii:w } + { \__regex_compile_quantifier_braced_auxiii:w } + { \__regex_compile_quantifier_braced_auxii:w } } } { @@ -726,7 +726,7 @@ #1 #2 } } -\cs_new_protected:Npn \__regex_compile_quantifier_braced_ii:w #1#2 +\cs_new_protected:Npn \__regex_compile_quantifier_braced_auxii:w #1#2 { \str_if_eq_x:nnTF { #1 #2 } { \__regex_compile_special:N \c_rbrace_str } @@ -740,7 +740,7 @@ #1 #2 } } -\cs_new_protected:Npn \__regex_compile_quantifier_braced_iii:w #1#2 +\cs_new_protected:Npn \__regex_compile_quantifier_braced_auxiii:w #1#2 { \str_if_eq_x:nnTF { #1 #2 } { \__regex_compile_special:N \c_rbrace_str } @@ -957,14 +957,14 @@ \str_if_eq:nnTF { #3 #4 } { \__regex_compile_special:N ^ } { \__tl_build_one:n { #2 { \if_false: } \fi: } - \__regex_compile_class_ii:NN + \__regex_compile_class:NN } { \__tl_build_one:n { #1 { \if_false: } \fi: } - \__regex_compile_class_ii:NN #3 #4 + \__regex_compile_class:NN #3 #4 } } -\cs_new_protected:Npn \__regex_compile_class_ii:NN #1#2 +\cs_new_protected:Npn \__regex_compile_class:NN #1#2 { \token_if_eq_charcode:NNTF #2 ] { \__regex_compile_raw:N #2 } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty index eba57ade74e..5273399d7be 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{expl3} -\GetIdInfo$Id: l3regex.dtx 4219 2012-09-09 13:28:51Z bruno $ +\GetIdInfo$Id: l3regex.dtx 4341 2012-11-27 08:39:42Z bruno $ {L3 Experimental regular expressions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -364,22 +364,22 @@ \if_charcode:w \c_space_token #1 \exp_after:wN \__regex_escape_x_test:N \else: - \exp_after:wN \__regex_escape_x_test_ii:N + \exp_after:wN \__regex_escape_x_test_two:N \exp_after:wN #1 \fi: } } -\cs_new:Npn \__regex_escape_x_test_ii:N #1 +\cs_new:Npn \__regex_escape_x_test_two:N #1 { \if_charcode:w \c_lbrace_str #1 \exp_after:wN \__regex_escape_x_loop:N \else: \__str_hexadecimal_use:NTF #1 - { \exp_after:wN \__regex_escape_x_ii:N } + { \exp_after:wN \__regex_escape_x:N } { ; \exp_after:wN \__regex_escape_loop:N \exp_after:wN #1 } \fi: } -\cs_new:Npn \__regex_escape_x_ii:N #1 +\cs_new:Npn \__regex_escape_x:N #1 { \str_if_eq_x:nnTF {#1} { break } { ; } { @@ -699,10 +699,10 @@ \cs_new_protected:cpn { __regex_compile_quantifier_ \c_lbrace_str :w } { \__regex_get_digits:NTFw \l__regex_internal_a_int - { \__regex_compile_quantifier_braced_i:w } + { \__regex_compile_quantifier_braced_auxi:w } { \__regex_compile_quantifier_abort:xNN { \c_lbrace_str } } } -\cs_new_protected:Npn \__regex_compile_quantifier_braced_i:w #1#2 +\cs_new_protected:Npn \__regex_compile_quantifier_braced_auxi:w #1#2 { \str_case_x:nnn { #1 #2 } { @@ -714,8 +714,8 @@ { \__regex_compile_special:N , } { \__regex_get_digits:NTFw \l__regex_internal_b_int - { \__regex_compile_quantifier_braced_iii:w } - { \__regex_compile_quantifier_braced_ii:w } + { \__regex_compile_quantifier_braced_auxiii:w } + { \__regex_compile_quantifier_braced_auxii:w } } } { @@ -724,7 +724,7 @@ #1 #2 } } -\cs_new_protected:Npn \__regex_compile_quantifier_braced_ii:w #1#2 +\cs_new_protected:Npn \__regex_compile_quantifier_braced_auxii:w #1#2 { \str_if_eq_x:nnTF { #1 #2 } { \__regex_compile_special:N \c_rbrace_str } @@ -738,7 +738,7 @@ #1 #2 } } -\cs_new_protected:Npn \__regex_compile_quantifier_braced_iii:w #1#2 +\cs_new_protected:Npn \__regex_compile_quantifier_braced_auxiii:w #1#2 { \str_if_eq_x:nnTF { #1 #2 } { \__regex_compile_special:N \c_rbrace_str } @@ -955,14 +955,14 @@ \str_if_eq:nnTF { #3 #4 } { \__regex_compile_special:N ^ } { \__tl_build_one:n { #2 { \if_false: } \fi: } - \__regex_compile_class_ii:NN + \__regex_compile_class:NN } { \__tl_build_one:n { #1 { \if_false: } \fi: } - \__regex_compile_class_ii:NN #3 #4 + \__regex_compile_class:NN #3 #4 } } -\cs_new_protected:Npn \__regex_compile_class_ii:NN #1#2 +\cs_new_protected:Npn \__regex_compile_class:NN #1#2 { \token_if_eq_charcode:NNTF #2 ] { \__regex_compile_raw:N #2 } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty index 902d147cd3f..57e71f04988 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty @@ -63,51 +63,51 @@ \cs_generate_variant:Nn \__str_format_put:nw { o , f } \cs_new:Npn \__str_format_parse:n #1 { - \exp_last_unbraced:Nf \__str_format_parse_i:NN + \exp_last_unbraced:Nf \__str_format_parse_auxi:NN \__str_to_other:n {#1} \s__stop \s__stop {#1} } -\cs_new:Npx \__str_format_parse_i:NN #1#2 +\cs_new:Npx \__str_format_parse_auxi:NN #1#2 { \exp_not:N \__str_if_contains_char:nNTF { < > = ^ } #2 - { \exp_not:N \__str_format_parse_iii:nN { #1 #2 } } + { \exp_not:N \__str_format_parse_auxiii:nN { #1 #2 } } { - \exp_not:N \__str_format_parse_ii:nN + \exp_not:N \__str_format_parse_auxii:nN { \c_catcode_other_space_tl } #1 #2 } } -\cs_new:Npn \__str_format_parse_ii:nN #1#2 +\cs_new:Npn \__str_format_parse_auxii:nN #1#2 { \__str_if_contains_char:nNTF { < > = ^ } #2 - { \__str_format_parse_iii:nN { #1 #2 } } - { \__str_format_parse_iii:nN { #1 ? } #2 } + { \__str_format_parse_auxiii:nN { #1 #2 } } + { \__str_format_parse_auxiii:nN { #1 ? } #2 } } -\cs_new:Npx \__str_format_parse_iii:nN #1#2 +\cs_new:Npx \__str_format_parse_auxiii:nN #1#2 { \exp_not:N \__str_if_contains_char:nNTF { + - \c_catcode_other_space_tl } #2 - { \exp_not:N \__str_format_parse_iv:nwN { #1 #2 } ; } - { \exp_not:N \__str_format_parse_iv:nwN { #1 ? } ; #2 } + { \exp_not:N \__str_format_parse_auxiv:nwN { #1 #2 } ; } + { \exp_not:N \__str_format_parse_auxiv:nwN { #1 ? } ; #2 } } -\cs_new:Npn \__str_format_parse_iv:nwN #1#2; #3 +\cs_new:Npn \__str_format_parse_auxiv:nwN #1#2; #3 { \__str_format_if_digit:NTF #3 - { \__str_format_parse_iv:nwN {#1} #2 #3 ; } - { \__str_format_parse_v:nN { #1 {#2} } #3 } + { \__str_format_parse_auxiv:nwN {#1} #2 #3 ; } + { \__str_format_parse_auxv:nN { #1 {#2} } #3 } } -\cs_new:Npn \__str_format_parse_v:nN #1#2 +\cs_new:Npn \__str_format_parse_auxv:nN #1#2 { \token_if_eq_charcode:NNTF . #2 - { \__str_format_parse_vi:nwN {#1} 0 ; } - { \__str_format_parse_vii:nN { #1 { } } #2 } + { \__str_format_parse_auxvi:nwN {#1} 0 ; } + { \__str_format_parse_auxvii:nN { #1 { } } #2 } } -\cs_new:Npn \__str_format_parse_vi:nwN #1#2; #3 +\cs_new:Npn \__str_format_parse_auxvi:nwN #1#2; #3 { \__str_format_if_digit:NTF #3 - { \__str_format_parse_vi:nwN {#1} #2 #3 ; } - { \__str_format_parse_vii:nN { #1 {#2} } #3 } + { \__str_format_parse_auxvi:nwN {#1} #2 #3 ; } + { \__str_format_parse_auxvii:nN { #1 {#2} } #3 } } -\cs_new:Npn \__str_format_parse_vii:nN #1#2 +\cs_new:Npn \__str_format_parse_auxvii:nN #1#2 { \token_if_eq_meaning:NNTF \s__stop #2 { \__str_format_parse_end:nwn { #1 ? } #2 } @@ -367,12 +367,12 @@ {3} { nan } } { - \exp_last_unbraced:Nf \__str_format_fp_e_ii:wn + \exp_last_unbraced:Nf \__str_format_fp_e_aux:wn \__str_format_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 } {#4} } } - \cs_new:Npn \__str_format_fp_e_ii:wn + \cs_new:Npn \__str_format_fp_e_aux:wn \s__fp \__fp_chk:w #1#2 #3 #4#5#6#7 ; #8 { \__str_format_put:fw { \int_eval:n { #3 - 1 } } @@ -399,14 +399,14 @@ {3} { nan } } { - \exp_last_unbraced:Nf \__str_format_fp_f_ii:wwwn + \exp_last_unbraced:Nf \__str_format_fp_f_aux:wwwn \fp_to_decimal:n { abs ( round ( \s__fp \__fp_chk:w #1#2#3 ; , #4 ) ) } . . ; {#4} } } -\cs_new:Npn \__str_format_fp_f_ii:wwwn #1 . #2 . #3 ; #4 +\cs_new:Npn \__str_format_fp_f_aux:wwwn #1 . #2 . #3 ; #4 { \use:nf { #1 . #2 } @@ -421,13 +421,13 @@ {3} { nan } } { - \exp_last_unbraced:Nf \__str_format_fp_g_ii:wn + \exp_last_unbraced:Nf \__str_format_fp_g_aux:wn \__str_format_fp_round:wn \s__fp \__fp_chk:w #1#2 ; { \int_max:nn {1} {#3} } { \int_max:nn {1} {#3} } } } -\cs_new:Npn \__str_format_fp_g_ii:wn #1; #2 +\cs_new:Npn \__str_format_fp_g_aux:wn #1; #2 { \int_compare:nNnTF { \__fp_exponent:w #1; } < { -3 } { \fp_to_scientific:n } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty index 05cd375a84d..8fb7f22b337 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{expl3} -\GetIdInfo$Id: l3str.dtx 4119 2012-08-16 22:35:59Z bruno $ +\GetIdInfo$Id: l3str.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Experimental strings} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -231,17 +231,17 @@ \cs_new_nopar:Npn \str_tail:N { \exp_args:No \str_tail:n } \cs_set:Npn \str_tail:n #1 { - \exp_after:wN \__str_tail:w + \exp_after:wN \__str_tail_auxi:w \reverse_if:N \if_charcode:w \scan_stop: \tl_to_str:n {#1} X X \q_stop } -\cs_set:Npn \__str_tail:w #1 X #2 \q_stop { \fi: #1 } +\cs_set:Npn \__str_tail_auxi:w #1 X #2 \q_stop { \fi: #1 } \cs_new:Npn \str_tail_ignore_spaces:n #1 { - \exp_after:wN \__str_tail_ii:w + \exp_after:wN \__str_tail_auxii:w \tl_to_str:n {#1} X X \q_stop } -\cs_new:Npn \__str_tail_ii:w #1 #2 X #3 \q_stop { #2 } +\cs_new:Npn \__str_tail_auxii:w #1 #2 X #3 \q_stop { #2 } \cs_new:Npn \__str_skip_c_zero:w #1; { \if_int_compare:w \__int_eval:w #1 > \c_eight @@ -256,11 +256,11 @@ { \exp_after:wN \__str_skip_c_zero:w \int_use:N \__int_eval:w #1 - \c_eight ; } \cs_new:Npn \__str_skip_end:w #1 ; { - \exp_after:wN \__str_skip_end_ii:NNNNNNNN + \exp_after:wN \__str_skip_end:NNNNNNNN \if_case:w \if_int_compare:w #1 > \c_zero #1 \else: 0 \fi: \exp_stop_f: \or: \or: \or: \or: \or: \or: \or: \or: } -\cs_new:Npn \__str_skip_end_ii:NNNNNNNN #1#2#3#4#5#6#7#8 { \fi: \c_zero } +\cs_new:Npn \__str_skip_end:NNNNNNNN #1#2#3#4#5#6#7#8 { \fi: \c_zero } \cs_new:Npn \__str_collect_delimit_by_q_stop:w #1; { \exp_after:wN \__str_collect_loop:wn @@ -270,13 +270,13 @@ \cs_new:Npn \__str_collect_loop:wn #1 ; { \if_int_compare:w #1 > \c_seven - \exp_after:wN \__str_collect_loop_ii:wnNNNNNNN + \exp_after:wN \__str_collect_loop:wnNNNNNNN \else: \exp_after:wN \__str_collect_end:wn \fi: #1 ; } -\cs_new:Npn \__str_collect_loop_ii:wnNNNNNNN #1; #2 #3#4#5#6#7#8#9 +\cs_new:Npn \__str_collect_loop:wnNNNNNNN #1; #2 #3#4#5#6#7#8#9 { \exp_after:wN \__str_collect_loop:wn \int_use:N \__int_eval:w #1 - \c_seven ; @@ -284,11 +284,11 @@ } \cs_new:Npn \__str_collect_end:wn #1 ; { - \exp_after:wN \__str_collect_end_ii:nnnnnnnnw + \exp_after:wN \__str_collect_end:nnnnnnnnw \if_case:w \if_int_compare:w #1 > \c_zero #1 \else: 0 \fi: \exp_stop_f: \or: \or: \or: \or: \or: \or: \fi: } -\cs_new:Npn \__str_collect_end_ii:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \q_stop +\cs_new:Npn \__str_collect_end:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \q_stop { #1#2#3#4#5#6#7#8 } \cs_new_nopar:Npn \str_item:Nn { \exp_args:No \str_item:nn } \cs_new:Npn \str_item:nn #1#2 @@ -342,23 +342,23 @@ { \exp_args:No \__str_substr_unsafe:nnn { \tl_to_str:n {#1} } } \cs_new:Npn \__str_substr_unsafe:nnn #1#2#3 { - \exp_after:wN \__str_substr_ii:www + \exp_after:wN \__str_substr:www \__int_value:w \__str_count_unsafe:n {#1} \exp_after:wN ; \int_use:N \__int_eval:w #2 + \c_zero \exp_after:wN ; \int_use:N \__int_eval:w - \exp_args:Nf \__str_substr_i:nN {#3} \c_max_int ; + \exp_args:Nf \__str_substr:nN {#3} \c_max_int ; { } #1 \q_stop } -\cs_new:Npn \__str_substr_i:nN #1 #2 +\cs_new:Npn \__str_substr:nN #1 #2 { \tl_if_empty:nTF {#1} {#2} {#1} } -\cs_new:Npn \__str_substr_ii:www #1; #2; #3; +\cs_new:Npn \__str_substr:www #1; #2; #3; { - \exp_args:Nf \__str_substr_iii:nnw + \exp_args:Nf \__str_substr:nnw { \__str_substr_normalize_range:nn {#2} {#1} } { \__str_substr_normalize_range:nn {#3} {#1} } } -\cs_new:Npn \__str_substr_iii:nnw #1#2 +\cs_new:Npn \__str_substr:nnw #1#2 { \exp_after:wN \__str_collect_delimit_by_q_stop:w \int_use:N \__int_eval:w #2 + \c_one - #1 \exp_after:wN ; @@ -539,14 +539,14 @@ \cs_new_protected:Npn \__str_if_flag_times:nT #1#2 { \flag_if_raised:nT {#1} { #2~(x \flag_height:n {#1} ) } } \cs_new_protected_nopar:Npn \str_set_convert:Nnnn - { \__str_convert_i:nNNnnn { } \tl_set_eq:NN } + { \__str_convert:nNNnnn { } \tl_set_eq:NN } \cs_new_protected_nopar:Npn \str_gset_convert:Nnnn - { \__str_convert_i:nNNnnn { } \tl_gset_eq:NN } + { \__str_convert:nNNnnn { } \tl_gset_eq:NN } \prg_new_protected_conditional:Npnn \str_set_convert:Nnnn #1#2#3#4 { T , F , TF } { \bool_gset_false:N \g__str_error_bool - \__str_convert_i:nNNnnn + \__str_convert:nNNnnn { \cs_set_eq:NN \__str_if_flag_error:nnx \__str_if_flag_no_error:nnx } \tl_set_eq:NN #1 {#2} {#3} {#4} \bool_if:NTF \g__str_error_bool \prg_return_false: \prg_return_true: @@ -555,22 +555,22 @@ \str_gset_convert:Nnnn #1#2#3#4 { T , F , TF } { \bool_gset_false:N \g__str_error_bool - \__str_convert_i:nNNnnn + \__str_convert:nNNnnn { \cs_set_eq:NN \__str_if_flag_error:nnx \__str_if_flag_no_error:nnx } \tl_gset_eq:NN #1 {#2} {#3} {#4} \bool_if:NTF \g__str_error_bool \prg_return_false: \prg_return_true: } -\cs_new_protected:Npn \__str_convert_i:nNNnnn #1#2#3#4#5#6 +\cs_new_protected:Npn \__str_convert:nNNnnn #1#2#3#4#5#6 { \group_begin: #1 \__str_gset_other:Nn \g__str_result_tl {#4} - \exp_after:wN \__str_convert_ii:wwwnn + \exp_after:wN \__str_convert:wwwnn \tl_to_str:n {#5} /// \q_stop { decode } { unescape } \prg_do_nothing: \__str_convert_decode_: - \exp_after:wN \__str_convert_ii:wwwnn + \exp_after:wN \__str_convert:wwwnn \tl_to_str:n {#6} /// \q_stop { encode } { escape } \use_ii_i:nn @@ -578,15 +578,15 @@ \group_end: #2 #3 \g__str_result_tl } -\cs_new_protected:Npn \__str_convert_ii:wwwnn +\cs_new_protected:Npn \__str_convert:wwwnn #1 / #2 // #3 \q_stop #4#5 { - \__str_convert_iv:nnn {enc} {#4} {#1} - \__str_convert_iv:nnn {esc} {#5} {#2} - \exp_args:Ncc \__str_convert_iii:NNnNN + \__str_convert:nnn {enc} {#4} {#1} + \__str_convert:nnn {esc} {#5} {#2} + \exp_args:Ncc \__str_convert:NNnNN { __str_convert_#4_#1: } { __str_convert_#5_#2: } {#2} } -\cs_new_protected:Npn \__str_convert_iii:NNnNN #1#2#3#4#5 +\cs_new_protected:Npn \__str_convert:NNnNN #1#2#3#4#5 { \if_meaning:w #1 #5 \tl_if_empty:nF {#3} @@ -596,16 +596,16 @@ #4 #2 #1 \fi: } -\cs_new_protected:Npn \__str_convert_iv:nnn #1#2#3 +\cs_new_protected:Npn \__str_convert:nnn #1#2#3 { \cs_if_exist:cF { __str_convert_#2_#3: } { - \exp_args:Nx \__str_convert_v:nnnn + \exp_args:Nx \__str_convert:nnnn { \__str_convert_lowercase_alphanum:n {#3} } {#1} {#2} {#3} } } -\cs_new_protected:Npn \__str_convert_v:nnnn #1#2#3#4 +\cs_new_protected:Npn \__str_convert:nnnn #1#2#3#4 { \cs_if_exist:cF { __str_convert_#3_#1: } { diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3tl-analysis.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3tl-analysis.sty index eb4a612e028..134eeed9815 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3tl-analysis.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3tl-analysis.sty @@ -87,8 +87,8 @@ \group_begin: \group_align_safe_begin: \__tl_analysis_setup:n {#1} - \__tl_analysis_i:n {#1} - \__tl_analysis_ii:n {#1} + \__tl_analysis_a:n {#1} + \__tl_analysis_b:n {#1} \group_align_safe_end: \group_end: } @@ -108,18 +108,18 @@ \__tl_analysis_disable_loop:N } \group_end: -\cs_new_protected:Npn \__tl_analysis_i:n #1 +\cs_new_protected:Npn \__tl_analysis_a:n #1 { \int_set:Nn \tex_escapechar:D { 92 } \int_zero:N \l__tl_analysis_normal_int \int_zero:N \l__tl_analysis_index_int \int_zero:N \l__tl_analysis_nesting_int - \if_false: { \fi: \__tl_analysis_i_loop:w #1 } + \if_false: { \fi: \__tl_analysis_a_loop:w #1 } \int_decr:N \l__tl_analysis_index_int } -\cs_new_protected_nopar:Npn \__tl_analysis_i_loop:w - { \tex_futurelet:D \l__tl_analysis_token \__tl_analysis_i_type:w } -\cs_new_protected_nopar:Npn \__tl_analysis_i_type:w +\cs_new_protected_nopar:Npn \__tl_analysis_a_loop:w + { \tex_futurelet:D \l__tl_analysis_token \__tl_analysis_a_type:w } +\cs_new_protected_nopar:Npn \__tl_analysis_a_type:w { \l__tl_analysis_type_int = \if_meaning:w \l__tl_analysis_token \c_space_token @@ -136,61 +136,61 @@ \fi: \fi: \if_case:w \l__tl_analysis_type_int - \exp_after:wN \__tl_analysis_i_space:w - \or: \exp_after:wN \__tl_analysis_i_bgroup:w - \or: \exp_after:wN \__tl_analysis_i_safe:N - \else: \exp_after:wN \__tl_analysis_i_egroup:w + \exp_after:wN \__tl_analysis_a_space:w + \or: \exp_after:wN \__tl_analysis_a_bgroup:w + \or: \exp_after:wN \__tl_analysis_a_safe:N + \else: \exp_after:wN \__tl_analysis_a_egroup:w \fi: } -\cs_new_protected_nopar:Npn \__tl_analysis_i_space:w +\cs_new_protected_nopar:Npn \__tl_analysis_a_space:w { - \tex_afterassignment:D \__tl_analysis_i_space_test:w + \tex_afterassignment:D \__tl_analysis_a_space_test:w \exp_after:wN \cs_set_eq:NN \exp_after:wN \l__tl_analysis_char_token \token_to_str:N } -\cs_new_protected_nopar:Npn \__tl_analysis_i_space_test:w +\cs_new_protected_nopar:Npn \__tl_analysis_a_space_test:w { \if_meaning:w \l__tl_analysis_char_token \c_space_token \tex_toks:D \l__tl_analysis_index_int { \exp_not:n { ~ } } - \__tl_analysis_i_store: + \__tl_analysis_a_store: \else: \int_incr:N \l__tl_analysis_normal_int \fi: - \__tl_analysis_i_loop:w + \__tl_analysis_a_loop:w } \group_begin: \char_set_catcode_group_begin:N \^^@ \char_set_catcode_group_end:N \^^E - \cs_new_protected_nopar:Npn \__tl_analysis_i_bgroup:w - { \__tl_analysis_i_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } } + \cs_new_protected_nopar:Npn \__tl_analysis_a_bgroup:w + { \__tl_analysis_a_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } } \char_set_catcode_group_begin:N \^^B \char_set_catcode_group_end:N \^^@ - \cs_new_protected_nopar:Npn \__tl_analysis_i_egroup:w - { \__tl_analysis_i_group:nw { \if_false: ^^B \fi: ^^@ } } + \cs_new_protected_nopar:Npn \__tl_analysis_a_egroup:w + { \__tl_analysis_a_group:nw { \if_false: ^^B \fi: ^^@ } } \group_end: -\cs_new_protected:Npn \__tl_analysis_i_group:nw #1 +\cs_new_protected:Npn \__tl_analysis_a_group:nw #1 { \tex_lccode:D \c_zero = \__tl_analysis_extract_charcode: \scan_stop: \tl_to_lowercase:n { \tex_toks:D \l__tl_analysis_index_int {#1} } \if_int_compare:w \tex_lccode:D \c_zero = \tex_escapechar:D \int_set:Nn \tex_escapechar:D { 139 - \tex_escapechar:D } \fi: - \tex_afterassignment:D \__tl_analysis_i_group_test:w + \tex_afterassignment:D \__tl_analysis_a_group_test:w \exp_after:wN \cs_set_eq:NN \exp_after:wN \l__tl_analysis_char_token \token_to_str:N } -\cs_new_protected_nopar:Npn \__tl_analysis_i_group_test:w +\cs_new_protected_nopar:Npn \__tl_analysis_a_group_test:w { \if_charcode:w \l__tl_analysis_token \l__tl_analysis_char_token - \__tl_analysis_i_store: + \__tl_analysis_a_store: \else: \int_incr:N \l__tl_analysis_normal_int \fi: - \__tl_analysis_i_loop:w + \__tl_analysis_a_loop:w } -\cs_new_protected_nopar:Npn \__tl_analysis_i_store: +\cs_new_protected_nopar:Npn \__tl_analysis_a_store: { \tex_advance:D \l__tl_analysis_nesting_int \l__tl_analysis_type_int \if_int_compare:w \tex_lccode:D \c_zero = \c_thirty_two @@ -201,10 +201,10 @@ \int_incr:N \l__tl_analysis_index_int \int_zero:N \l__tl_analysis_normal_int \if_int_compare:w \l__tl_analysis_nesting_int = \c_minus_one - \cs_set_eq:NN \__tl_analysis_i_loop:w \scan_stop: + \cs_set_eq:NN \__tl_analysis_a_loop:w \scan_stop: \fi: } -\cs_new_protected:Npn \__tl_analysis_i_safe:N #1 +\cs_new_protected:Npn \__tl_analysis_a_safe:N #1 { \if_charcode:w \scan_stop: @@ -212,11 +212,11 @@ \scan_stop: \int_incr:N \l__tl_analysis_normal_int \else: - \__tl_analysis_cs_space_count:NN \__tl_analysis_i_cs:ww #1 + \__tl_analysis_cs_space_count:NN \__tl_analysis_a_cs:ww #1 \fi: - \__tl_analysis_i_loop:w + \__tl_analysis_a_loop:w } -\cs_new_protected:Npn \__tl_analysis_i_cs:ww #1; #2; +\cs_new_protected:Npn \__tl_analysis_a_cs:ww #1; #2; { \if_int_compare:w #1 > \c_zero \tex_skip:D \l__tl_analysis_index_int @@ -227,36 +227,36 @@ \tex_advance:D \l__tl_analysis_normal_int #2 \exp_stop_f: \fi: } -\cs_new_protected:Npn \__tl_analysis_ii:n #1 +\cs_new_protected:Npn \__tl_analysis_b:n #1 { \tl_gset:Nx \g__tl_analysis_result_tl { - \__tl_analysis_ii_loop:w 0; #1 + \__tl_analysis_b_loop:w 0; #1 \__prg_break_point: } } -\cs_new:Npn \__tl_analysis_ii_loop:w #1; +\cs_new:Npn \__tl_analysis_b_loop:w #1; { - \exp_after:wN \__tl_analysis_ii_normals:ww + \exp_after:wN \__tl_analysis_b_normals:ww \__int_value:w \tex_skip:D #1 ; #1 ; } -\cs_new:Npn \__tl_analysis_ii_normals:ww #1; +\cs_new:Npn \__tl_analysis_b_normals:ww #1; { \if_int_compare:w #1 = \c_zero - \__tl_analysis_ii_special:w + \__tl_analysis_b_special:w \fi: - \__tl_analysis_ii_normal:wwN #1; + \__tl_analysis_b_normal:wwN #1; } -\cs_new:Npn \__tl_analysis_ii_normal:wwN #1; #2; #3 +\cs_new:Npn \__tl_analysis_b_normal:wwN #1; #2; #3 { \exp_not:n { \exp_not:n { #3 } } \s__tl \if_charcode:w \scan_stop: \exp_after:wN \use_none:n \token_to_str:N #3 \prg_do_nothing: \scan_stop: - \exp_after:wN \__tl_analysis_ii_char:Nww + \exp_after:wN \__tl_analysis_b_char:Nww \else: - \exp_after:wN \__tl_analysis_ii_cs:Nww + \exp_after:wN \__tl_analysis_b_cs:Nww \fi: #3 #1; #2; } @@ -267,7 +267,7 @@ \char_set_uccode:nn { `? } { `D } \tl_to_uppercase:n { - \cs_new:Npn \__tl_analysis_ii_char:Nww #1 + \cs_new:Npn \__tl_analysis_b_char:Nww #1 { \if_meaning:w #1 \c_undefined:D ? \else: \if_catcode:w #1 \c_catcode_other_token C \else: @@ -280,19 +280,19 @@ 6 \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \__int_value:w `#1 \s__tl - \exp_after:wN \__tl_analysis_ii_normals:ww + \exp_after:wN \__tl_analysis_b_normals:ww \int_use:N \__int_eval:w \c_minus_one + } } \group_end: -\cs_new:Npn \__tl_analysis_ii_cs:Nww #1 +\cs_new:Npn \__tl_analysis_b_cs:Nww #1 { 0 -1 \s__tl - \__tl_analysis_cs_space_count:NN \__tl_analysis_ii_cs_test:ww #1 + \__tl_analysis_cs_space_count:NN \__tl_analysis_b_cs_test:ww #1 } -\cs_new:Npn \__tl_analysis_ii_cs_test:ww #1 ; #2 ; #3 ; #4 ; +\cs_new:Npn \__tl_analysis_b_cs_test:ww #1 ; #2 ; #3 ; #4 ; { - \exp_after:wN \__tl_analysis_ii_normals:ww + \exp_after:wN \__tl_analysis_b_normals:ww \int_use:N \__int_eval:w \if_int_compare:w #1 = \c_zero #3 @@ -305,8 +305,8 @@ } \group_begin: \char_set_catcode_other:N A - \cs_new:Npn \__tl_analysis_ii_special:w - \fi: \__tl_analysis_ii_normal:wwN 0 ; #1 ; + \cs_new:Npn \__tl_analysis_b_special:w + \fi: \__tl_analysis_b_normal:wwN 0 ; #1 ; { \fi: \if_int_compare:w #1 = \l__tl_analysis_index_int @@ -320,23 +320,23 @@ \else: 2 \fi: \if_int_odd:w \etex_gluestretch:D \tex_skip:D #1 \exp_stop_f: - \exp_after:wN \__tl_analysis_ii_special_char:wN \int_use:N + \exp_after:wN \__tl_analysis_b_special_char:wN \int_use:N \else: - \exp_after:wN \__tl_analysis_ii_special_space:w \int_use:N + \exp_after:wN \__tl_analysis_b_special_space:w \int_use:N \fi: \__int_eval:w \c_one + #1 \exp_after:wN ; \token_to_str:N } \group_end: -\cs_new:Npn \__tl_analysis_ii_special_char:wN #1 ; #2 +\cs_new:Npn \__tl_analysis_b_special_char:wN #1 ; #2 { \__int_value:w `#2 \s__tl - \__tl_analysis_ii_loop:w #1 ; + \__tl_analysis_b_loop:w #1 ; } -\cs_new:Npn \__tl_analysis_ii_special_space:w #1 ; ~ +\cs_new:Npn \__tl_analysis_b_special_space:w #1 ; ~ { 32 \s__tl - \__tl_analysis_ii_loop:w #1 ; + \__tl_analysis_b_loop:w #1 ; } \cs_new_protected:Npn \__tl_analysis_map_inline:nn #1 { diff --git a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty index 30c72196f57..a16079a1428 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty @@ -48,16 +48,18 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{xparse} -\GetIdInfo$Id: l3galley.dtx 4155 2012-08-29 10:29:58Z joseph $ +\GetIdInfo$Id: l3galley.dtx 4388 2012-12-20 22:15:35Z joseph $ {L3 Experimental galley code} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\clist_new:N \l__galley_parshape_left_indent_clist -\clist_new:N \l__galley_parshape_right_indent_clist +\cs_generate_variant:Nn \seq_map_function:NN { Nc } +\int_new:N \l__galley_tmp_int +\seq_new:N \l__galley_tmpa_seq +\seq_new:N \l__galley_tmpb_seq +\tl_new:N \l__galley_tmp_tl \bool_new:N \l__galley_parshape_multipar_bool -\bool_new:N \l__galley_parshape_resume_std_bool -\bool_new:N \l__galley_parshape_fixed_lines_bool -\int_new:N \l_galley_parshape_std_lines_int +\seq_new:N \l__galley_parshape_left_indent_seq +\seq_new:N \l__galley_parshape_right_indent_seq \cs_new_eq:NN \l_galley_text_width_dim \linewidth \cs_new_eq:NN \l_galley_total_left_margin_dim \@totalleftmargin \dim_new:N \l_galley_total_right_margin_dim @@ -66,20 +68,24 @@ \cs_new_eq:NN \l_galley_width_dim \tex_hsize:D \bool_new:N \g__galley_begin_level_bool \bool_new:N \l__galley_begin_level_bool +\seq_new:N \g__galley_cutout_left_seq +\seq_new:N \l__galley_cutout_left_seq +\seq_new:N \g__galley_cutout_right_seq +\seq_new:N \l__galley_cutout_right_seq \bool_new:N \g_galley_omit_next_indent_bool \bool_new:N \l__galley_omit_next_indent_bool -\bool_new:N \g__galley_parshape_set_bool -\bool_new:N \l__galley_parshape_set_bool \bool_new:N \g_galley_no_break_next_bool \bool_new:N \l__galley_no_break_next_bool \tl_new:N \g_galley_par_begin_hook_tl -\tl_new:N \l__galley_galley_par_begin_hook_tl +\tl_new:N \l__galley_par_begin_hook_tl \tl_new:N \g_galley_par_end_hook_tl -\tl_new:N \l__galley_galley_par_end_hook_tl -\tl_new:N \g_galley_par_after_hook_tl -\tl_new:N \l__galley_par_after_hook_tl +\tl_new:N \l__galley_par_end_hook_tl +\tl_new:N \g_galley_par_reset_hook_tl +\tl_new:N \l__galley_par_reset_hook_tl \int_new:N \g_galley_previous_par_lines_int \int_new:N \l__galley_previous_par_lines_int +\int_new:N \g__galley_current_par_lines_int +\int_new:N \l__galley_current_par_lines_int \tl_new:N \g_galley_restore_running_tl \tl_new:N \l__galley_restore_running_tl \tl_new:N \g_galley_whatsit_next_tl @@ -93,14 +99,16 @@ \cs_new_protected_nopar:Npn \__galley_initialise_variables: { \bool_gset_true:N \g__galley_begin_level_bool + \seq_gclear:N \g__galley_cutout_left_seq + \seq_gclear:N \g__galley_cutout_right_seq \tl_gclear:N \g__galley_interpar_penalty_user_tl \tl_gclear:N \g__galley_interpar_vspace_user_tl \bool_gset_true:N \g_galley_omit_next_indent_bool \bool_gset_false:N \g_galley_no_break_next_bool \tl_gclear:N \g_galley_par_begin_hook_tl \tl_gclear:N \g_galley_par_end_hook_tl - \tl_gclear:N \g_galley_par_after_hook_tl - \bool_gset_false:N \g__galley_parshape_set_bool + \tl_gclear:N \g_galley_par_reset_hook_tl + \int_gzero:N \g__galley_current_par_lines_int \int_gzero:N \g_galley_previous_par_lines_int \tl_gclear:N \g_galley_restore_running_tl \tl_gclear:N \g_galley_whatsit_previous_tl @@ -117,6 +125,10 @@ { \bool_set_eq:NN \l__galley_begin_level_bool \g__galley_begin_level_bool + \seq_set_eq:NN \l__galley_cutout_left_seq + \g__galley_cutout_left_seq + \seq_set_eq:NN \l__galley_cutout_right_seq + \g__galley_cutout_right_seq \tl_set_eq:NN \l__galley_interpar_penalty_user_tl \g__galley_interpar_penalty_user_tl \tl_set_eq:NN \l__galley_interpar_vspace_user_tl @@ -125,14 +137,14 @@ \g_galley_omit_next_indent_bool \bool_set_eq:NN \l__galley_no_break_next_bool \g_galley_no_break_next_bool - \tl_set_eq:NN \l__galley_galley_par_begin_hook_tl + \tl_set_eq:NN \l__galley_par_begin_hook_tl \g_galley_par_begin_hook_tl - \tl_set_eq:NN \l__galley_galley_par_end_hook_tl + \tl_set_eq:NN \l__galley_par_end_hook_tl \g_galley_par_end_hook_tl - \tl_set_eq:NN \l__galley_par_after_hook_tl - \g_galley_par_after_hook_tl - \bool_set_eq:NN \l__galley_parshape_set_bool - \g__galley_parshape_set_bool + \tl_set_eq:NN \l__galley_par_reset_hook_tl + \g_galley_par_reset_hook_tl + \int_set_eq:NN \l__galley_current_par_lines_int + \g__galley_current_par_lines_int \int_set_eq:NN \l__galley_previous_par_lines_int \g_galley_previous_par_lines_int \tl_set_eq:NN \l__galley_restore_running_tl @@ -146,6 +158,10 @@ { \bool_gset_eq:NN \g__galley_begin_level_bool \l__galley_begin_level_bool + \seq_gset_eq:NN \g__galley_cutout_left_seq + \l__galley_cutout_left_seq + \seq_gset_eq:NN \g__galley_cutout_right_seq + \l__galley_cutout_right_seq \tl_gset_eq:NN \g__galley_interpar_penalty_user_tl \l__galley_interpar_penalty_user_tl \tl_gset_eq:NN \g__galley_interpar_vspace_user_tl @@ -155,13 +171,13 @@ \bool_gset_eq:NN \g_galley_no_break_next_bool \l__galley_no_break_next_bool \tl_gset_eq:NN \g_galley_par_begin_hook_tl - \l__galley_galley_par_begin_hook_tl + \l__galley_par_begin_hook_tl \tl_gset_eq:NN \g_galley_par_end_hook_tl - \l__galley_galley_par_end_hook_tl - \tl_gset_eq:NN \g_galley_par_after_hook_tl - \l__galley_par_after_hook_tl - \bool_gset_eq:NN \g__galley_parshape_set_bool - \l__galley_parshape_set_bool + \l__galley_par_end_hook_tl + \tl_gset_eq:NN \g_galley_par_reset_hook_tl + \l__galley_par_reset_hook_tl + \int_gset_eq:NN \g__galley_current_par_lines_int + \l__galley_current_par_lines_int \int_gset_eq:NN \g_galley_previous_par_lines_int \l__galley_previous_par_lines_int \tl_gset_eq:NN \g_galley_restore_running_tl @@ -186,52 +202,58 @@ \group_end: } \__scan_new:N \s__par_omit -\cs_new_protected_nopar:Npn \__galley_std_par: +\cs_new_protected_nopar:Npn \galley_par: { \s__par_omit - \exp_after:wN \__galley_std_par_aux_i: \tex_romannumeral:D - `0 + \exp_after:wN \__galley_par_auxi: \tex_romannumeral:D - `0 } -\cs_new_protected:Npn \__galley_std_par_aux_i: +\cs_new_protected:Npn \__galley_par_auxi: { \peek_meaning:NTF \s__par_omit - { \__galley_std_par_aux:N } - { \__galley_std_par_aux_ii: } + { \__galley_par_aux:N } + { \__galley_par_auxii: } } -\cs_new_protected:Npn \__galley_std_par_aux:N #1 +\cs_new_protected:Npn \__galley_par_aux:N #1 { \str_if_eq_x:nnF {#1} { \s__par_omit } { - \__galley_std_par_aux_ii: + \__galley_par_auxii: #1 } } -\cs_new_protected_nopar:Npn \__galley_std_par_aux_ii: +\cs_new_protected_nopar:Npn \__galley_par_auxii: { \mode_if_vertical:TF - { \tex_par:D } + { + \group_begin: + \tex_par:D + \group_end: + } { \g_galley_par_end_hook_tl - \__galley_set_measure_and_parshape: \group_begin: \tex_par:D \group_end: - \int_gadd:Nn \g_galley_previous_par_lines_int \tex_prevgraf:D + \int_gset:Nn \g_galley_previous_par_lines_int + { \tex_prevgraf:D + \g__galley_current_par_lines_int } + \__galley_parshape_reset: + \int_gzero:N \g__galley_current_par_lines_int } - \g_galley_par_after_hook_tl - \tl_gclear:N \g_galley_par_after_hook_tl + \g_galley_par_reset_hook_tl + \tl_gclear:N \g_galley_par_reset_hook_tl \tex_penalty:D \c_ten_thousand } -\cs_new_protected:Npn \__galley_end_par:n #1 +\cs_new_protected:Npn \galley_par:n #1 { \s__par_omit \bool_if:nF \g__galley_begin_level_bool { #1 - \__galley_std_par: + \galley_par: } } -\cs_set_protected_nopar:Npn \par { \__galley_std_par: } -\tl_set:Nn \@par { \__galley_std_par: } +\cs_set_protected_nopar:Npn \par { \galley_par: } +\tl_set:Nn \@par { \galley_par: } \cs_new_protected_nopar:Npn \galley_display_begin: { \group_begin: @@ -285,7 +307,7 @@ } \cs_new_protected_nopar:Npn \__galley_display_par: { - \cs_set_eq:NN \par \__galley_std_par: + \cs_set_eq:NN \par \galley_par: \mode_if_vertical:TF { \par @@ -294,11 +316,10 @@ \__galley_display_vspace:N \l_galley_display_end_par_vspace_tl } { - \__galley_set_measure_and_parshape: \group_begin: \tex_par:D \group_end: - \int_gadd:Nn \g_galley_previous_par_lines_int \tex_prevgraf:D + \int_gadd:Nn \g__galley_current_par_lines_int \tex_prevgraf:D \__galley_display_penalty:N \l_galley_display_end_penalty_tl \__galley_display_vspace:N \l_galley_display_end_vspace_tl } @@ -325,7 +346,6 @@ \tex_everypar:D { } \tex_noindent:D \group_end: - \int_gzero:N \g_galley_previous_par_lines_int \__galley_insert_horizontal_items: \__galley_restore_running_parameters: } @@ -391,8 +411,11 @@ \g_galley_restore_running_tl \tl_gclear:N \g_galley_restore_running_tl } +\dim_new:N \l__galley_total_left_margin_dim +\dim_new:N \l__galley_total_right_margin_dim \cs_new_protected:Npn \galley_margins_set_absolute:nn #1#2 { + \__galley_save_margins: \dim_set:Nn \l_galley_total_left_margin_dim {#1} \dim_set:Nn \l_galley_total_right_margin_dim {#2} \dim_set:Nn \l_galley_text_width_dim @@ -401,9 +424,11 @@ - \l_galley_total_left_margin_dim - \l_galley_total_right_margin_dim } + \__galley_set_measure: } \cs_new_protected:Npn \galley_margins_set_relative:nn #1#2 { + \__galley_save_margins: \dim_add:Nn \l_galley_total_left_margin_dim {#1} \dim_add:Nn \l_galley_total_right_margin_dim {#2} \dim_set:Nn \l_galley_text_width_dim @@ -412,144 +437,241 @@ - \l_galley_total_left_margin_dim - \l_galley_total_right_margin_dim } + \__galley_set_measure: } -\cs_new_protected:Npn \galley_parshape_fixed_lines:nnn #1#2#3 +\cs_new_protected_nopar:Npn \__galley_save_margins: { - \bool_gset_true:N \g__galley_parshape_set_bool - \bool_set_true:N \l__galley_parshape_fixed_lines_bool - \int_set:Nn \l_galley_parshape_std_lines_int {#1} - \clist_set:Nn \l__galley_parshape_left_indent_clist {#2} - \clist_set:Nn \l__galley_parshape_right_indent_clist {#3} - \bool_set_true:N \l__galley_parshape_resume_std_bool + \dim_set_eq:NN \l__galley_total_left_margin_dim + \l_galley_total_left_margin_dim + \dim_set_eq:NN \l__galley_total_right_margin_dim + \l_galley_total_right_margin_dim } -\cs_new_protected:Npn \galley_parshape_multi_par:nnnN #1#2#3#4 +\cs_new_protected_nopar:Npn \__galley_set_measure: { - \bool_gset_true:N \g__galley_parshape_set_bool - \bool_set_true:N \l__galley_parshape_multipar_bool - \bool_set_false:N \l__galley_parshape_fixed_lines_bool - \int_set:Nn \l_galley_parshape_std_lines_int {#1} - \clist_set:Nn \l__galley_parshape_left_indent_clist {#2} - \clist_set:Nn \l__galley_parshape_right_indent_clist {#3} - \bool_set_eq:NN \l__galley_parshape_resume_std_bool #4 + \int_compare:nNnTF \tex_parshape:D = \c_zero + { \__galley_parshape_measure: } + { + \dim_sub:Nn \l__galley_total_left_margin_dim + \l_galley_total_left_margin_dim + \dim_sub:Nn \l__galley_total_right_margin_dim + \l_galley_total_right_margin_dim + \tex_parshape:D + \tex_parshape:D + \int_step_function:nnnN + \c_one \c_one \tex_parshape:D + \__galley_set_measure_aux:n + } } -\cs_new_protected:Npn \galley_parshape_single_par:nnnN #1#2#3#4 +\cs_new:Npn \__galley_set_measure_aux:n #1 { - \bool_gset_true:N \g__galley_parshape_set_bool - \bool_set_false:N \l__galley_parshape_multipar_bool - \bool_set_false:N \l__galley_parshape_fixed_lines_bool - \int_set:Nn \l_galley_parshape_std_lines_int {#1} - \clist_set:Nn \l__galley_parshape_left_indent_clist {#2} - \clist_set:Nn \l__galley_parshape_right_indent_clist {#3} - \bool_set_eq:NN \l__galley_parshape_resume_std_bool #4 + \__dim_eval:w + \etex_parshapeindent:D #1 - \l__galley_total_left_margin_dim + \__dim_eval_end: + \__dim_eval:w + \etex_parshapelength:D #1 + + \l__galley_total_left_margin_dim + \l__galley_total_right_margin_dim + \__dim_eval_end: } -\cs_generate_variant:Nn \galley_parshape_fixed_lines:nnn { nVV } -\cs_generate_variant:Nn \galley_parshape_multi_par:nnnN { nVV } -\cs_generate_variant:Nn \galley_parshape_single_par:nnnN { nVV } -\cs_new_protected_nopar:Npn \__galley_set_measure_and_parshape: +\cs_new_protected_nopar:Npn \__galley_parshape_reset: { - \bool_if:NTF \g__galley_parshape_set_bool + \int_compare:nNnF \tex_parshape:D = \c_zero { - \bool_if:NTF \l__galley_parshape_fixed_lines_bool + \bool_if:nTF + { + \seq_if_empty_p:N \g__galley_cutout_left_seq + && \seq_if_empty_p:N \g__galley_cutout_right_seq + } { - \int_compare:nNnTF \g_galley_previous_par_lines_int > \c_zero - { \__galley_generate_parshape_lines: } - { \__galley_generate_parshape: } + \bool_if:NF \l__galley_parshape_multipar_bool + { \__galley_parshape_measure: } } { - \bool_gset_eq:NN \g__galley_parshape_set_bool - \l__galley_parshape_multipar_bool - \__galley_generate_parshape: + \prg_replicate:nn \g__galley_previous_par_lines_int + { + \seq_gpop:NN \g__galley_cutout_left_seq \l__galley_tmp_tl + \seq_gpop:NN \g__galley_cutout_right_seq \l__galley_tmp_tl + } + \bool_if:NTF \l__galley_parshape_multipar_bool + { \__galley_parshape_set: } + { \__galley_parshape_measure: } + \__galley_cutout_set:Nn \g__galley_cutout_left_seq { left } + \__galley_cutout_set:Nn \g__galley_cutout_right_seq { right } } } + } +\cs_new_protected_nopar:Npn \__galley_parshape_measure: + { + \tex_parshape:D + \c_one + \l_galley_total_left_margin_dim + \l_galley_text_width_dim + } +\cs_new_protected_nopar:Npn \galley_parshape_set_multi:nnnN + { + \bool_set_true:N \l__galley_parshape_multipar_bool + \__galley_parshape_set:nnnN + } +\cs_new_protected_nopar:Npn \galley_parshape_set_single:nnnN + { + \bool_set_false:N \l__galley_parshape_multipar_bool + \__galley_parshape_set:nnnN + } +\cs_generate_variant:Nn \galley_parshape_set_multi:nnnN { nVV } +\cs_generate_variant:Nn \galley_parshape_set_single:nnnN { nVV } +\cs_new_protected:Npn \__galley_parshape_set:nnnN #1#2#3#4 + { + \seq_set_from_clist:Nn \l__galley_parshape_left_indent_seq {#2} + \seq_set_from_clist:Nn \l__galley_parshape_right_indent_seq {#3} + \prg_replicate:nn {#1} + { + \seq_put_left:Nn \l__galley_parshape_left_indent_seq { 0 pt } + \seq_put_left:Nn \l__galley_parshape_right_indent_seq { 0 pt } + } + \bool_if:NT #4 { - \tex_global:D \tex_parshape:D - \c_one - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim + \seq_put_right:Nn \l__galley_parshape_left_indent_seq { 0 pt } + \seq_put_right:Nn \l__galley_parshape_right_indent_seq { 0 pt } } + \__galley_parshape_set: } -\cs_new_protected_nopar:Npn \__galley_generate_parshape: +\cs_new_protected_nopar:Npn \__galley_parshape_set: { - \tex_global:D \tex_parshape:D + \tex_parshape:D \__int_eval:w - \l_galley_parshape_std_lines_int + - \int_min:nn - { \clist_count:N \l__galley_parshape_left_indent_clist } - { \clist_count:N \l__galley_parshape_right_indent_clist } - \bool_if:NT \l__galley_parshape_resume_std_bool { + 1 } + \int_min:nn + { \seq_count:N \l__galley_parshape_left_indent_seq } + { \seq_count:N \l__galley_parshape_right_indent_seq } \__int_eval_end: - \prg_replicate:nn \l_galley_parshape_std_lines_int - { - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim - \c_space_tl - } - \__galley_set_parshape_map:oo - \l__galley_parshape_left_indent_clist - \l__galley_parshape_right_indent_clist - \bool_if:NT \l__galley_parshape_resume_std_bool - { - \c_space_tl - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim - } + \seq_mapthread_function:NNN + \l__galley_parshape_left_indent_seq + \l__galley_parshape_right_indent_seq + \__galley_parshape_set:nn + } +\cs_new:Npn \__galley_parshape_set:nn #1#2 + { + \__dim_eval:w \l_galley_total_left_margin_dim + ( #1 ) \__dim_eval_end: + \__dim_eval:w + \l_galley_text_width_dim - ( ( #1 ) + ( #2 ) ) + \__dim_eval_end: + } +\cs_new_protected_nopar:Npn \galley_cutout_left:nn + { \__galley_cutout:nnn { left } } +\cs_new_protected_nopar:Npn \galley_cutout_right:nn + { \__galley_cutout:nnn { right } } +\cs_new_protected:Npn \__galley_cutout:nnn #1#2#3 + { + \seq_set_from_clist:Nn \l__galley_tmpa_seq {#3} + \prg_replicate:nn {#2} + { \seq_put_left:Nn \l__galley_tmpa_seq { 0 pt } } + \__galley_cutout_set:Nn \l__galley_tmpa_seq {#1} + \seq_clear:N \l__galley_tmpb_seq + \int_compare:nNnTF + { \seq_count:N \l__galley_tmpa_seq } > + { \seq_count:c { g__galley_cutout_ #1 _ seq } } + { + \seq_map_inline:Nn \l__galley_tmpa_seq + { + \__galley_cutout_store:nn + { \seq_gpop:cNF { g__galley_cutout_ #1 _ seq } } + {##1} + } + } + { + \seq_map_inline:cn { g__galley_cutout_ #1 _ seq } + { + \__galley_cutout_store:nn + { \seq_pop:NNF \l__galley_tmpa_seq } + {##1} + } + } + \seq_gset_eq:cN { g__galley_cutout_ #1 _ seq } \l__galley_tmpb_seq + } +\cs_new_protected:Npn \__galley_cutout_store:nn #1#2 + { + #1 \l__galley_tmp_tl + { \tl_set:Nn \l__galley_tmp_tl { 0 pt } } + \seq_put_right:Nx \l__galley_tmpb_seq + { \dim_eval:n { \l__galley_tmp_tl + #2 } } } -\cs_new:Npn \__galley_set_parshape_map:nn #1#2 - { \__galley_set_parshape_map_aux:nw { } #1 , \q_mark #2 , \q_stop } -\cs_generate_variant:Nn \__galley_set_parshape_map:nn { oo } -\cs_new:Npn \__galley_set_parshape_map_aux:nw #1#2 , #3 \q_mark #4 , #5 \q_stop +\cs_new_protected:Npn \__galley_cutout_set:Nn #1#2 { - \bool_if:nTF { \tl_if_empty_p:n {#3} || \tl_if_empty_p:n {#5} } + \int_zero:N \l__galley_tmp_int + \tl_clear:N \l__galley_tmp_tl + \seq_map_function:Nc #1 { __galley_cutout_ #2 :n } + \int_compare:nNnTF \tex_parshape:D > \l__galley_tmp_int { - #1 - \dim_eval:n { \l_galley_total_left_margin_dim + ( #2 ) } - \c_space_tl - \dim_eval:n { \l_galley_text_width_dim - ( ( #2 ) + ( #4 ) ) } + \int_step_function:nnnN + { \l__galley_tmp_int + \c_one } + \c_one + \tex_parshape:D + \__galley_cutout_end:n } { - \__galley_set_parshape_map_aux:nw + \int_incr:N \l__galley_tmp_int + \int_compare:nNnTF \tex_parshape:D = \c_zero { - #1 - \dim_eval:n { \l_galley_total_left_margin_dim + ( #2 ) } - \c_space_tl - \dim_eval:n { \l_galley_text_width_dim - ( ( #2 ) + ( #4 ) ) } - \c_space_tl + \tl_put_right:Nn \l__galley_tmp_tl + { \l__galley_total_left_margin_dim \l__galley_text_width_dim } + } + { + \tl_put_right:Nx \l__galley_tmp_tl + { + \dim_eval:n { \etex_parshapeindent:D \tex_parshape:D } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D \tex_parshape:D } + \c_space_tl + } } - #3 \q_mark #5 \q_stop } + \tex_parshape:D + \l__galley_tmp_int + \l__galley_tmp_tl } -\cs_new_protected_nopar:Npn \__galley_generate_parshape_lines: +\cs_new_protected:Npn \__galley_cutout_left:n #1 { - \int_compare:nNnTF \tex_parshape:D > \g_galley_previous_par_lines_int + \int_incr:N \l__galley_tmp_int + \tl_put_right:Nx \l__galley_tmp_tl { - \tex_global:D \tex_parshape:D - \__int_eval:w \tex_parshape:D - \g_galley_previous_par_lines_int - \__int_eval_end: - \int_step_function:nnnN - { \g_galley_previous_par_lines_int + \c_one } - \c_one \tex_parshape:D \__galley_generate_parshape_lines:n + \int_compare:nNnTF \l__galley_tmp_int > \tex_parshape:D + { + \dim_eval:n { \l__galley_total_left_margin_dim + ( #1 ) } + \c_space_tl + \dim_eval:n { \l__galley_text_width_dim - ( #1 ) } + \c_space_tl + } + { + \dim_eval:n { \etex_parshapeindent:D \l__galley_tmp_int + ( #1 ) } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D \l__galley_tmp_int - ( #1 ) } + \c_space_tl + } } + } +\cs_new_protected:Npn \__galley_cutout_right:n #1 + { + \int_incr:N \l__galley_tmp_int + \tl_put_right:Nx \l__galley_tmp_tl { - \bool_gset_false:N \g__galley_parshape_set_bool - \tex_global:D \tex_parshape:D - \c_one - \dim_use:N \l_galley_total_left_margin_dim - \c_space_tl - \dim_use:N \l_galley_text_width_dim + \dim_eval:n { \etex_parshapeindent:D \l__galley_tmp_int } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D \l__galley_tmp_int - ( #1 ) } + \c_space_tl } } -\cs_new:Npn \__galley_generate_parshape_lines:n #1 +\cs_new_protected:Npn \__galley_cutout_end:n #1 { - \etex_parshapeindent:D #1 - ~ - \etex_parshapelength:D #1 + \int_incr:N \l__galley_tmp_int + \tl_put_right:Nx \l__galley_tmp_tl + { + \dim_eval:n { \etex_parshapeindent:D #1 } + \c_space_tl + \dim_eval:n { \etex_parshapelength:D #1 } + \c_space_tl + } } -\cs_new_protected:Npn \galley_set_user_penalty:n #1 +\cs_new_protected:Npn \galley_penalty_set_single:n #1 { \tl_gset:Nx \g__galley_interpar_penalty_user_tl { \int_eval:n {#1} } } -\cs_new_protected:Npn \galley_set_user_vspace:n #1 +\cs_new_protected:Npn \galley_vspace_set_single:n #1 { \tl_gset:Nx \g__galley_interpar_vspace_user_tl { \skip_eval:n {#1} } } \dim_set:Nn \parskip \c_zero_dim \cs_undefine:N \parskip @@ -560,7 +682,7 @@ \cs_new_eq:NN \l_galley_par_end_skip \tex_parfillskip:D \cs_new_eq:NN \l_galley_par_indent_dim \tex_parindent:D \cs_new_eq:NN \l_galley_last_line_fit_int \etex_lastlinefit:D -\cs_new_protected:Npn \galley_set_interword_spacing:N #1 +\cs_new_protected:Npn \galley_interword_spacing_set:N #1 { \bool_if:NTF #1 { % TODO Hook for font changes required! @@ -607,45 +729,45 @@ \cs_new_eq:NN \l_galley_pre_display_penalty_int \tex_predisplaypenalty:D \clist_new:N \l_galley_club_penalties_clist \clist_new:N \l_galley_line_penalties_clist -\cs_new_protected:Npn \galley_set_display_widow_penalties:n #1 +\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: - \clist_map_function:nN {#1} \galley_set_aux:n + \clist_map_function:nN {#1} \__galley_set_aux:n \c_zero } -\cs_generate_variant:Nn \galley_set_display_widow_penalties:n { V , v } -\cs_new_protected:Npn \galley_set_widow_penalties:n #1 +\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: - \clist_map_function:nN {#1} \galley_set_aux:n + \clist_map_function:nN {#1} \__galley_set_aux:n \c_zero } -\cs_generate_variant:Nn \galley_set_widow_penalties:n { V , v } -\cs_new:Npn \galley_set_aux:n #1 { #1 ~ } -\cs_new_protected:Npn \galley_set_club_penalties:n #1 +\cs_generate_variant:Nn \galley_widow_penalties_set:n { V , v } +\cs_new:Npn \__galley_set_aux:n #1 { \int_eval:n {#1} ~ } +\cs_new_protected:Npn \galley_club_penalties_set:n #1 { \clist_set:Nn \l_galley_club_penalties_clist {#1} \__galley_calc_interline_penalties: } -\cs_generate_variant:Nn \galley_set_club_penalties:n { V , v } -\cs_new_protected:Npn \galley_set_interline_penalties:n #1 +\cs_generate_variant:Nn \galley_club_penalties_set:n { V , v } +\cs_new_protected:Npn \galley_interline_penalties_set:n #1 { \clist_set:Nn \l_galley_line_penalties_clist {#1} \__galley_calc_interline_penalties: } -\cs_generate_variant:Nn \galley_set_interline_penalties:n { V , v } -\cs_new_protected:Npn \galley_set_display_club_penalties:n #1 +\cs_generate_variant:Nn \galley_interline_penalties_set:n { V , v } +\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: - \clist_map_function:nN {#1} \galley_set_aux:n + \clist_map_function:nN {#1} \__galley_set_aux:n \c_zero \__galley_calc_interline_penalties: } -\cs_generate_variant:Nn \galley_set_display_club_penalties:n { V , v } -\cs_new_protected:Npn \galley_set_interline_penalty:n #1 +\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 { @@ -653,7 +775,7 @@ \__galley_calc_interline_penalties: } { - \cs_set:Npn \__galley_set_interline_penalty_ii:n ##1 + \cs_set:Npn \__galley_set_interline_penalty_auxii:n ##1 { \__int_eval:w \etex_interlinepenalties:D ##1 @@ -670,34 +792,31 @@ \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero \int_step_function:nnnN \c_one \c_one {#1} - \__galley_set_interline_penalty_i:n + \__galley_set_interline_penalty_auxi:n \int_step_function:nnnN { #1 + \c_one } \c_one { \etex_interlinepenalties:D \c_zero - \c_one } - \__galley_set_interline_penalty_ii:n + \__galley_set_interline_penalty_auxii:n \__int_eval:w #2 \__int_eval_end: } -\cs_new:Npn \__galley_set_interline_penalty_i:n #1 +\cs_new:Npn \__galley_set_interline_penalty_auxi:n #1 { \etex_interlinepenalties:D \__int_eval:w #1 \__int_eval_end: } -\cs_new:Npn \__galley_set_interline_penalty_ii:n #1 { } +\cs_new:Npn \__galley_set_interline_penalty_auxii:n #1 { } \cs_new_protected_nopar:Npn \__galley_calc_interline_penalties: { \exp_args:Nff \__galley_calc_interline_penalties:nn { - \int_eval:n + \int_max:nn + { + \clist_count:N \l_galley_club_penalties_clist + + \c_one + } { \int_max:nn { - \clist_count:N \l_galley_club_penalties_clist + \clist_count:N \l_galley_line_penalties_clist + \c_one } - { - \int_max:nn - { - \clist_count:N \l_galley_line_penalties_clist - + \c_one - } - { \etex_clubpenalties:D \c_zero } - } + { \etex_clubpenalties:D \c_zero } } } { \clist_count:N \l_galley_line_penalties_clist } @@ -706,12 +825,12 @@ { \etex_interlinepenalties:D #1 ~ \int_step_function:nnnN \c_one \c_one {#2} - \__galley_calc_interline_penalties_i:n + \__galley_calc_interline_penalties_auxi:n \int_step_function:nnnN { #2 + \c_one } \c_one { #1 - \c_one } - \__galley_calc_interline_penalties_ii:n + \__galley_calc_interline_penalties_auxii:n \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero } -\cs_new:Npn \__galley_calc_interline_penalties_i:n #1 +\cs_new:Npn \__galley_calc_interline_penalties_auxi:n #1 { \__int_eval:w \clist_item:Nn \l_galley_line_penalties_clist {#1} @@ -719,7 +838,7 @@ - \etex_clubpenalties:D #1 ~ \__int_eval_end: } -\cs_new:Npn \__galley_calc_interline_penalties_ii:n #1 +\cs_new:Npn \__galley_calc_interline_penalties_auxii:n #1 { \__int_eval:w \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero @@ -737,21 +856,21 @@ { \int_step_function:nnnN \c_one \c_one { \etex_clubpenalties:D \c_zero - \c_one } - \galley_save_display_club_penalties:_aux:n + \__galley_save_display_club_penalties:n } } -\cs_new:Npn \galley_save_display_club_penalties:_aux:n #1 - { \int_use:N \etex_clubpenaltes:D \__int_eval:w #1 \__int_eval_end: , } +\cs_new:Npn \__galley_save_display_club_penalties:n #1 + { \int_use:N \etex_clubpenalties:D \__int_eval:w #1 \__int_eval_end: , } \cs_new_protected:Npn \galley_save_display_widow_penalties:N #1 { \clist_set:Nx #1 { \int_step_function:nnnN \c_one \c_one { \etex_displaywidowpenalties:D \c_zero - \c_one } - \galley_save_display_widow_penalties:_aux:n + \__galley_save_display_widow_penalties:n } } -\cs_new:Npn \galley_save_display_widow_penalties:_aux:n #1 +\cs_new:Npn \__galley_save_display_widow_penalties:n #1 { \int_use:N \etex_displaywidowpenalties:D \__int_eval:w #1 \__int_eval_end: , } \cs_new_protected:Npn \galley_save_widow_penalties:N #1 { @@ -759,10 +878,10 @@ { \int_step_function:nnnN \c_one \c_one { \etex_widowpenalties:D \c_zero - \c_one } - \galley_save_widow_penalties:_aux:n + \__galley_save_widow_penalties:n } } -\cs_new:Npn \galley_save_widow_penalties:_aux:n #1 +\cs_new:Npn \__galley_save_widow_penalties:n #1 { \int_use:N \etex_widowpenalties:D \__int_eval:w #1 \__int_eval_end: , } \cs_new_protected_nopar:Npn \galley_interline_penalty: { \int_use:N \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero } @@ -782,7 +901,7 @@ \tl_gput_right:Nn \g_galley_whatsit_next_tl { \iow_shipout:Nx \c_minus_one { } } \tex_vbox:D { } - \galley_set_user_penalty:n { -\@Mi } + \galley_penalty_set_single:n { -\@Mi } } \RenewDocumentCommand \nobreak { } { \bool_gset_true:N \g_galley_no_break_next_bool } @@ -794,20 +913,20 @@ \RenewDocumentCommand \vspace { s m } { \IfBooleanTF #1 - { \galley_set_user_vspace:n {#2} } - { \galley_set_user_vspace:n {#2} } + { \galley_vspace_set_single:n {#2} } + { \galley_vspace_set_single:n {#2} } } \RenewDocumentCommand \\ { s O { 0 pt } } { \galley_break_line:Nn #1 {#2} } \RenewDocumentCommand \newline { } { \galley_break_line:Nn \c_true_bool { 0 pt } } -\cs_set_eq:NN \__galleypar \__galley_std_par: +\cs_set_eq:cN { @ @ par } \galley_par: \cs_set_protected_nopar:Npn \@afterheading { \bool_gset_true:N \g_galley_no_break_next_bool \if@afterindent \else - \bool_gset_true:N \galley_omit_next_indent_bool + \bool_gset_true:N \g_galley_omit_next_indent_bool \fi } \cs_set_protected:Npn \@hangfrom #1 @@ -815,7 +934,7 @@ \bool_gset_true:N \g_galley_omit_next_indent_bool \leavevmode \setbox \@tempboxa = \hbox { {#1} } - \galley_parshape_single_par:nnnN + \galley_parshape_set_single:nnnN \c_one { \box_wd:N \@tempboxa } \c_zero_dim diff --git a/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty b/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty index f8552f3f8e4..f736e2b74a6 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty @@ -48,7 +48,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{expl3} -\GetIdInfo$Id: xgalley.dtx 4253 2012-11-01 21:01:54Z joseph $ +\GetIdInfo$Id: xgalley.dtx 4373 2012-12-17 16:41:59Z joseph $ {L3 Experimental galley} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -111,14 +111,14 @@ \AssignTemplateKeys \bool_if:NTF \l__galley_parshape_on_left_bool { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \l__galley_parshape_lines_int \l__galley_parshape_indent_dim \c_zero_dim \c_false_bool } { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \l__galley_parshape_lines_int \c_zero_dim \l__galley_parshape_indent_dim @@ -144,14 +144,14 @@ } \bool_if:NTF \l__galley_parshape_on_left_bool { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \c_zero \l__galley_tmpa_clist \l__galley_tmpb_clist \c_true_bool } { - \galley_parshape_single_par:nVVN + \galley_parshape_set_single:nVVN \c_zero \l__galley_tmpb_clist \l__galley_tmpa_clist @@ -242,7 +242,7 @@ { \AssignTemplateKeys \tl_clear:N \l__galley_justification_other_tl - \galley_set_interword_spacing:N \l_galley_fixed_spacing_bool + \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_zero:N \l_galley_last_line_fit_int } @@ -266,7 +266,7 @@ \bool_if:NTF \l_galley_fixed_spacing_bool { \bool_set_true:N \exp_not:N \l_galley_fixed_spacing_bool } { \bool_set_false:N \exp_not:N \l_galley_fixed_spacing_bool } - \galley_set_interword_spacing:N + \galley_interword_spacing_set:N \exp_not:N \l_galley_fixed_spacing_bool \dim_set:Nn \exp_not:N \l_galley_par_indent_dim { \dim_use:N \l_galley_par_indent_dim } @@ -284,7 +284,7 @@ \tl_gput_right:Nn \g_galley_restore_running_tl { \l__galley_justification_other_tl } \AssignTemplateKeys - \galley_set_interword_spacing:N \l_galley_fixed_spacing_bool + \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_zero:N \l_galley_last_line_fit_int } @@ -401,11 +401,11 @@ } { \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_club_penalties_set:V \l__galley_club_penalty_int + \galley_display_club_penalties_set:V \l__galley_display_club_penalty_int + \galley_display_widow_penalties_set:V \l__galley_display_widow_penalty_int + \galley_interline_penalty_set:n \l__galley_interline_penalty_int + \galley_widow_penalties_set:V \l__galley_widow_penalty_int } \DeclareInstance { paragraph-breaking } { std } { std } { } \UseInstance { paragraph-breaking } { std } @@ -451,7 +451,7 @@ \AssignTemplateKeys \tl_if_empty:NF \l__galley_interline_penalty_tl { - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \int_set:Nn \exp_not:N \l__galley_interline_penalty_int { \galley_interline_penalty: } @@ -461,7 +461,7 @@ } \tl_if_empty:NF \l__galley_parbreak_fuzz_tl { - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \dim_set:Nn \exp_not:N \l_galley_parbreak_fuzz_dim { \dim_use:N \l_galley_parbreak_fuzz_dim } @@ -472,7 +472,7 @@ { \tl_if_empty:cF { l_galley_ ##1 _tl } { - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \int_set:Nn \exp_not:c { l_galley_ ##1 _int } { \int_use:c { l_galley_ ##1 _int } } @@ -486,7 +486,7 @@ \tl_if_empty:cF { l_galley_ ##1 _tl } { \use:c { galley_save_ ##1 :N } \l__galley_tmpa_clist - \tl_gput_right:Nx \g_galley_par_after_hook_tl + \tl_gput_right:Nx \g_galley_par_reset_hook_tl { \exp_not:c { galley_set_ ##1 :n } { \exp_not:o \l__galley_tmpa_clist } diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 268d2cd285d..653499b0ca4 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names}[2012/07/15] -\@ifpackagelater{l3names}{2012/07/15} +\RequirePackage{l3names}[2012/12/07] +\@ifpackagelater{l3names}{2012/12/07} {} {% \PackageError{expl3}{Mismatched LaTeX3 packages detected.} @@ -60,9 +60,10 @@ } \def\ExplFileName{expl3} \def\ExplFileDescription{L3 Experimental code bundle wrapper} -\def\ExplFileDate{2012/11/21} -\def\ExplFileVersion{4332} +\def\ExplFileDate{2012/12/21} +\def\ExplFileVersion{4390} \RequirePackage{etex} +\relax \reserveinserts{32} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty index 318c7d9bcb2..bc53602f68f 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3basics.dtx 4306 2012-11-10 12:57:20Z joseph $ +\GetIdInfo$Id: l3basics.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Basic definitions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -364,14 +364,14 @@ \cs_set:Npn \__cs_split_function:NN #1 { \exp_after:wN \exp_after:wN - \exp_after:wN \__cs_split_function_i:w + \exp_after:wN \__cs_split_function_auxi:w \cs_to_str:N #1 \q_mark \c_true_bool @ \q_mark \c_false_bool \q_stop } - \cs_set:Npn \__cs_split_function_i:w #1 @ #2 \q_mark #3#4 \q_stop #5 - { \__cs_split_function_ii:w #5 #1 \q_mark \q_stop {#2} #3 } - \cs_set:Npn \__cs_split_function_ii:w #1#2 \q_mark #3 \q_stop + \cs_set:Npn \__cs_split_function_auxi:w #1 @ #2 \q_mark #3#4 \q_stop #5 + { \__cs_split_function_auxii:w #5 #1 \q_mark \q_stop {#2} #3 } + \cs_set:Npn \__cs_split_function_auxii:w #1#2 \q_mark #3 \q_stop { #1 {#2} } } \cs_set:Npn \__cs_get_function_name:N #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty b/Master/texmf-dist/tex/latex/l3kernel/l3box.sty index a9e84331634..56016c45566 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3box.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3box.dtx 4259 2012-11-04 17:15:11Z joseph $ +\GetIdInfo$Id: l3box.dtx 4347 2012-12-08 09:11:29Z joseph $ {L3 Experimental boxes} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -210,7 +210,7 @@ \cs_new_eq:NN \hbox_gset_inline_end: \hbox_gset_end: \cs_new_protected:Npn \hbox_to_wd:nn #1#2 { \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end: {#2} } -\cs_new_protected:Npn \hbox_to_zero:n #1 { \tex_hbox:D to \c_zero_skip {#1} } +\cs_new_protected:Npn \hbox_to_zero:n #1 { \tex_hbox:D to \c_zero_dim {#1} } \cs_new_protected:Npn \hbox_overlap_left:n #1 { \hbox_to_zero:n { \tex_hss:D #1 } } \cs_new_protected:Npn \hbox_overlap_right:n #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty b/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty index cee29baf26e..65919abf3ec 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty @@ -47,7 +47,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3candidates.dtx 4298 2012-11-09 13:34:43Z joseph $ +\GetIdInfo$Id: l3candidates.dtx 4383 2012-12-20 15:10:48Z bruno $ {L3 Experimental additions to l3kernel} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -502,20 +502,20 @@ { 2 } { \exp_after:wN \__clist_use:wwn #1 , {#2} } } { - \exp_after:wN \__clist_use_ii:nwwwwnwn + \exp_after:wN \__clist_use:nwwwwnwn \exp_after:wN { \exp_after:wN } #1 , - \q_mark , { \__clist_use_ii:nwwwwnwn {#3} } - \q_mark , { \__clist_use_iii:nwwn {#4} } + \q_mark , { \__clist_use:nwwwwnwn {#3} } + \q_mark , { \__clist_use:nwwn {#4} } \q_stop { } } } { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} } } \cs_new:Npn \__clist_use:wwn #1 , #2 , #3 { \exp_not:n { #1 #3 #2 } } -\cs_new:Npn \__clist_use_ii:nwwwwnwn +\cs_new:Npn \__clist_use:nwwwwnwn #1#2 , #3 , #4 , #5 \q_mark , #6#7 \q_stop #8 { #6 {#3} , {#4} , #5 \q_mark , {#6} #7 \q_stop { #8 #1 #2 } } -\cs_new:Npn \__clist_use_iii:nwwn #1#2 , #3 \q_stop #4 +\cs_new:Npn \__clist_use:nwwn #1#2 , #3 \q_stop #4 { \exp_not:n { #4 #1 #2 } } \fp_new:N \l__coffin_sin_fp \fp_new:N \l__coffin_cos_fp @@ -935,10 +935,10 @@ { 2 } { \exp_after:wN \__seq_use:NnNnn #1 {#2} } } { - \exp_after:wN \__seq_use_ii:nwwwwnwn + \exp_after:wN \__seq_use:nwwwwnwn \exp_after:wN { \exp_after:wN } #1 \__seq_item:n - \q_mark { \__seq_use_ii:nwwwwnwn {#3} } - \q_mark { \__seq_use_iii:nwwn {#4} } + \q_mark { \__seq_use:nwwwwnwn {#3} } + \q_mark { \__seq_use:nwwn {#4} } \q_stop { } } } @@ -946,14 +946,14 @@ } \cs_new:Npn \__seq_use:NnNnn \__seq_item:n #1 \__seq_item:n #2#3 { \exp_not:n { #1 #3 #2 } } -\cs_new:Npn \__seq_use_ii:nwwwwnwn +\cs_new:Npn \__seq_use:nwwwwnwn #1 \__seq_item:n #2 \__seq_item:n #3 \__seq_item:n #4#5 \q_mark #6#7 \q_stop #8 { #6 \__seq_item:n {#3} \__seq_item:n {#4} #5 \q_mark {#6} #7 \q_stop { #8 #1 #2 } } -\cs_new:Npn \__seq_use_iii:nwwn #1 \__seq_item:n #2 #3 \q_stop #4 +\cs_new:Npn \__seq_use:nwwn #1 \__seq_item:n #2 #3 \q_stop #4 { \exp_not:n { #4 #1 #2 } } \cs_new:Npn \skip_split_finite_else_action:nnNN #1#2#3#4 { @@ -1104,16 +1104,41 @@ \char_tmp:NN \char_set_active_eq:NN \cs_set_eq:NN \char_tmp:NN \char_gset_active_eq:NN \cs_gset_eq:NN \group_end: -\cs_new_protected_nopar:Npn \__peek_execute_branches_N_type: +\group_begin: + \char_set_catcode_other:N \O + \char_set_catcode_other:N \U + \char_set_catcode_other:N \T + \char_set_catcode_other:N \E + \char_set_catcode_other:N \R + \tl_to_lowercase:n + { + \cs_new_protected_nopar:Npn \__peek_execute_branches_N_type: + { + \if_int_odd:w + \if_catcode:w \exp_not:N \l_peek_token { \c_two \fi: + \if_catcode:w \exp_not:N \l_peek_token } \c_two \fi: + \if_meaning:w \l_peek_token \c_space_token \c_two \fi: + \c_one + \exp_after:wN \__peek_N_type:w + \token_to_meaning:N \l_peek_token + \q_mark \__peek_N_type_aux:nnw + OUTER \q_mark \use_none_delimit_by_q_stop:w + \q_stop + \exp_after:wN \__peek_true:w + \else: + \exp_after:wN \__peek_false:w + \fi: + } + \cs_new_protected_nopar:Npn \__peek_N_type:w #1 OUTER #2 \q_mark #3 + { #3 {#1} {#2} } + } +\group_end: +\cs_new_protected_nopar:Npn \__peek_N_type_aux:nnw #1 #2 #3 \fi: { - \bool_if:nTF - { - \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token || - \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || - \token_if_eq_meaning_p:NN \l_peek_token \c_space_token - } - { \__peek_false:w } + \fi: + \tl_if_in:noTF {#1} { \tl_to_str:n {ma} } { \__peek_true:w } + { \tl_if_empty:nTF {#2} { \__peek_true:w } { \__peek_false:w } } } \cs_new_protected_nopar:Npn \peek_N_type:TF { \__peek_token_generic:NNTF \__peek_execute_branches_N_type: \scan_stop: } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty b/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty index 284830694db..6edd2295361 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty @@ -48,7 +48,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3clist.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3clist.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Comma separated lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -106,22 +106,22 @@ \cs_new:Npn \__clist_trim_spaces:n #1 { \__clist_trim_spaces_generic:nw - { \__clist_trim_spaces_ii:nn { } } + { \__clist_trim_spaces:nn { } } \q_mark #1 , \q_recursion_tail, \q_recursion_stop } -\cs_new:Npn \__clist_trim_spaces_ii:nn #1 #2 +\cs_new:Npn \__clist_trim_spaces:nn #1 #2 { \quark_if_recursion_tail_stop:n {#2} \tl_if_empty:nTF {#2} { \__clist_trim_spaces_generic:nw - { \__clist_trim_spaces_ii:nn {#1} } \q_mark + { \__clist_trim_spaces:nn {#1} } \q_mark } { #1 \exp_not:n {#2} \__clist_trim_spaces_generic:nw - { \__clist_trim_spaces_ii:nn { , } } \q_mark + { \__clist_trim_spaces:nn { , } } \q_mark } } \cs_new_protected:Npn \clist_set:Nn #1#2 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty b/Master/texmf-dist/tex/latex/l3kernel/l3file.sty index b3c04f68873..b1a119b7fd3 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3file.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3file.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3file.dtx 4377 2012-12-20 11:13:29Z bruno $ {L3 File and I/O operations} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -131,12 +131,11 @@ } \cs_new_protected:Npn \__file_input:n #1 { - \quark_if_nil:oTF { \__file_input_aux:w #1 . \q_nil . \q_stop } - { \__file_input_aux:o { \tl_to_str:n { #1 .tex } } } + \tl_if_in:nnTF {#1} { . } { \__file_input_aux:n {#1} } + { \__file_input_aux:o { \tl_to_str:n { #1 . tex } } } } \cs_generate_variant:Nn \__file_input:n { V } -\cs_new:Npn \__file_input_aux:w #1 . #2 . #3 \q_stop { #2 } \cs_new_protected:Npn \__file_input_aux:n #1 { \clist_if_exist:NTF \@filelist diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty index 4754b592c0c..ec67d73f5d5 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty @@ -286,8 +286,8 @@ \__fp_tmp:w {xv} {\use_none:n #2#3+#4#5} { 000{0000}0000{0000}#2 #3 #4 #5 } \__fp_tmp:w {xvi} { #2#3+#4#5} {{0000}0000{0000}0000 #2 #3 #4 #5 } \cs_new:Npn \__fp_decimate_pack:nnnnnnnnnnw #1#2#3#4#5 - { \__fp_decimate_pack_ii:nnnnnnw { #1#2#3#4#5 } } -\cs_new:Npn \__fp_decimate_pack_ii:nnnnnnw #1 #2#3#4#5#6 + { \__fp_decimate_pack:nnnnnnw { #1#2#3#4#5 } } +\cs_new:Npn \__fp_decimate_pack:nnnnnnw #1 #2#3#4#5#6 { {#1} {#2#3#4#5#6} } \cs_new:Npn \__fp_case_use:nw #1#2 \fi: #3 \s__fp { \fi: #1 \s__fp } \cs_new:Npn \__fp_case_return:nw #1#2 \fi: #3 ; { \fi: #1 } @@ -715,11 +715,11 @@ \cs_new:Npn \__fp_round_normal:NwNNnw #1#2 \s__fp \__fp_chk:w 1#3#4#5; { \__fp_decimate:nNnnnn { \c_sixteen - #4 - #2 } - \__fp_round_normal_ii:NnnwNNnn #5 #1 #3 {#4} {#2} + \__fp_round_normal:NnnwNNnn #5 #1 #3 {#4} {#2} } -\cs_new:Npn \__fp_round_normal_ii:NnnwNNnn #1#2#3#4; #5#6 +\cs_new:Npn \__fp_round_normal:NnnwNNnn #1#2#3#4; #5#6 { - \exp_after:wN \__fp_round_normal_iii:NNwNnn + \exp_after:wN \__fp_round_normal:NNwNnn \int_use:N \__int_eval:w \if_int_compare:w #2 > \c_zero 1 \__int_value:w #2 @@ -739,7 +739,7 @@ } \cs_new:Npn \__fp_round_pack:Nw #1 { \if_meaning:w 2 #1 + \c_one \fi: \__int_eval_end: } -\cs_new:Npn \__fp_round_normal_iii:NNwNnn #1 #2 +\cs_new:Npn \__fp_round_normal:NNwNnn #1 #2 { \if_meaning:w 0 #2 \exp_after:wN \__fp_round_special:NwwNnn @@ -1174,14 +1174,14 @@ \cs_new:Npn \__fp_parse_exponent:N #1 { \if:w e #1 - \exp_after:wN \__fp_parse_exponent_ii:N + \exp_after:wN \__fp_parse_exponent_aux:N \tex_romannumeral:D \else: 0 \__fp_parse_return_semicolon:w #1 \fi: \__fp_parse_expand:w } -\cs_new:Npn \__fp_parse_exponent_ii:N #1 +\cs_new:Npn \__fp_parse_exponent_aux:N #1 { \if_int_compare:w \if_catcode:w \tex_relax:D #1 \c_zero \else: `#1 \fi: > `9 \exp_stop_f: @@ -1321,7 +1321,7 @@ \cs_new:Npn \__fp_parse_large_round_after:wNN #1 ; #2 #3 { \if:w . #3 - \exp_after:wN \__fp_parse_large_round_after_ii:wN + \exp_after:wN \__fp_parse_large_round_after_aux:wN \int_use:N \__int_eval:w #1 + \c_zero * \__int_eval:w \c_zero \exp_after:wN \__fp_cfs_round_loop:N @@ -1334,7 +1334,7 @@ \exp_after:wN #3 \fi: } -\cs_new:Npn \__fp_parse_large_round_after_ii:wN #1 ; #2 +\cs_new:Npn \__fp_parse_large_round_after_aux:wN #1 ; #2 { + #2 \exp_after:wN ; @@ -1809,7 +1809,7 @@ \__msg_kernel_expandable_error:nnnn { kernel } { fp-missing } { ? } { ~for~?: } \exp_after:wN @ - \exp_after:wN \__fp_ternary_ii:NwwN + \exp_after:wN \__fp_ternary_auxii:NwwN \tex_romannumeral:D \__fp_parse_until:Nw \c_two \exp_after:wN \__fp_parse_expand:w @@ -2079,9 +2079,9 @@ { \if_meaning:w 3 #4 \if_meaning:w 3 #2 - \__fp_minmax_i:ww + \__fp_minmax_auxi:ww \else: - \__fp_minmax_ii:ww + \__fp_minmax_auxii:ww \fi: \else: \if_int_compare:w @@ -2089,18 +2089,18 @@ \s__fp \__fp_chk:w #4#5; \s__fp \__fp_chk:w #2#3; = #1 - \__fp_minmax_ii:ww + \__fp_minmax_auxii:ww \else: - \__fp_minmax_i:ww + \__fp_minmax_auxi:ww \fi: \fi: \__fp_minmax_loop:Nww #1 \s__fp \__fp_chk:w #2#3; \s__fp \__fp_chk:w #4#5; } -\cs_new:Npn \__fp_minmax_i:ww #1 \fi: \fi: #2 \s__fp #3 ; \s__fp #4; +\cs_new:Npn \__fp_minmax_auxi:ww #1 \fi: \fi: #2 \s__fp #3 ; \s__fp #4; { \fi: \fi: #2 \s__fp #3 ; } -\cs_new:Npn \__fp_minmax_ii:ww #1 \fi: \fi: #2 \s__fp #3 ; +\cs_new:Npn \__fp_minmax_auxii:ww #1 \fi: \fi: #2 \s__fp #3 ; { \fi: \fi: #2 } \cs_new:Npn \__fp_minmax_break_o:w #1 \fi: \fi: #2 \s__fp #3; #4; { \fi: \__fp_exp_after_o:w \s__fp #3; } @@ -2131,7 +2131,7 @@ \__fp_ternary_loop:Nw #2 \s__fp \__fp_chk:w { \__fp_ternary_loop_break:w } ; - \__fp_ternary_break_point:n { \exp_after:wN \__fp_ternary_i:NwwN } + \__fp_ternary_break_point:n { \exp_after:wN \__fp_ternary_auxi:NwwN } \exp_after:wN #1 \tex_romannumeral:D -`0 \__fp_exp_after_array_f:w #3 \s__fp_stop @@ -2153,7 +2153,7 @@ \cs_new:Npn \__fp_ternary_loop_break:w #1 \fi: #2 \__fp_ternary_break_point:n #3 { \c_zero = \c_zero \fi: - \exp_after:wN \__fp_ternary_ii:NwwN + \exp_after:wN \__fp_ternary_auxii:NwwN } \cs_new:Npn \__fp_ternary_loop:Nw \s__fp \__fp_chk:w #1#2; { @@ -2163,7 +2163,7 @@ \__fp_ternary_loop:Nw } \cs_new:Npn \__fp_ternary_map_break: #1 \__fp_ternary_break_point:n #2 {#2} -\cs_new:Npn \__fp_ternary_i:NwwN #1#2@#3@#4 +\cs_new:Npn \__fp_ternary_auxi:NwwN #1#2@#3@#4 { \exp_after:wN \__fp_parse_until_test:NwN \exp_after:wN #1 @@ -2171,7 +2171,7 @@ \__fp_exp_after_array_f:w #2 \s__fp_stop #4 #1 } -\cs_new:Npn \__fp_ternary_ii:NwwN #1#2@#3@#4 +\cs_new:Npn \__fp_ternary_auxii:NwwN #1#2@#3@#4 { \exp_after:wN \__fp_parse_until_test:NwN \exp_after:wN #1 @@ -2850,43 +2850,43 @@ \exp_after:wN \__fp_fixed_div_int_after:Nw \exp_after:wN #8 \int_use:N \__int_eval:w \c_minus_one - \__fp_fixed_div_int_i:wnN - #1; {#7} \__fp_fixed_div_int_ii:wnn - #2; {#7} \__fp_fixed_div_int_ii:wnn - #3; {#7} \__fp_fixed_div_int_ii:wnn - #4; {#7} \__fp_fixed_div_int_ii:wnn - #5; {#7} \__fp_fixed_div_int_ii:wnn - #6; {#7} \__fp_fixed_div_int_iii:wnn ; + \__fp_fixed_div_int:wnN + #1; {#7} \__fp_fixed_div_int_auxi:wnn + #2; {#7} \__fp_fixed_div_int_auxi:wnn + #3; {#7} \__fp_fixed_div_int_auxi:wnn + #4; {#7} \__fp_fixed_div_int_auxi:wnn + #5; {#7} \__fp_fixed_div_int_auxi:wnn + #6; {#7} \__fp_fixed_div_int_auxii:wnn ; } -\cs_new:Npn \__fp_fixed_div_int_i:wnN #1; #2 #3 +\cs_new:Npn \__fp_fixed_div_int:wnN #1; #2 #3 { \exp_after:wN #3 \int_use:N \__int_eval:w #1 / #2 - \c_one ; {#2} {#1} } -\cs_new:Npn \__fp_fixed_div_int_ii:wnn #1; #2 #3 +\cs_new:Npn \__fp_fixed_div_int_auxi:wnn #1; #2 #3 { + #1 \exp_after:wN \__fp_fixed_div_int_pack:Nw \int_use:N \__int_eval:w 9999 - \exp_after:wN \__fp_fixed_div_int_i:wnN + \exp_after:wN \__fp_fixed_div_int:wnN \int_use:N \__int_eval:w #3 - #1*#2 \__int_eval_end: } -\cs_new:Npn \__fp_fixed_div_int_iii:wnn #1; #2 #3 { + #1 + \c_two ; } +\cs_new:Npn \__fp_fixed_div_int_auxii:wnn #1; #2 #3 { + #1 + \c_two ; } \cs_new:Npn \__fp_fixed_div_int_pack:Nw #1 #2; { + #1; {#2} } \cs_new:Npn \__fp_fixed_div_int_after:Nw #1 #2; { #1 {#2} } -\cs_new_nopar:Npn \__fp_fixed_add:wwn { \__fp_fixed_add_i:Nnnnnwnn + } -\cs_new_nopar:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add_i:Nnnnnwnn - } -\cs_new:Npn \__fp_fixed_add_i:Nnnnnwnn #1 #2#3#4#5 #6; #7#8 +\cs_new_nopar:Npn \__fp_fixed_add:wwn { \__fp_fixed_add:Nnnnnwnn + } +\cs_new_nopar:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add:Nnnnnwnn - } +\cs_new:Npn \__fp_fixed_add:Nnnnnwnn #1 #2#3#4#5 #6; #7#8 { \exp_after:wN \__fp_fixed_add_after:NNNNNwn \int_use:N \__int_eval:w 9 9999 9998 + #2#3 #1 #7#8 \exp_after:wN \__fp_fixed_add_pack:NNNNNwn \int_use:N \__int_eval:w 1 9999 9998 + #4#5 - \__fp_fixed_add_ii:nnNnnnwn #6 #1 + \__fp_fixed_add:nnNnnnwn #6 #1 } -\cs_new:Npn \__fp_fixed_add_ii:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8 +\cs_new:Npn \__fp_fixed_add:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8 { #3 #4#5 \exp_after:wN \__fp_fixed_add_pack:NNNNNwn @@ -2916,9 +2916,9 @@ \int_use:N \__int_eval:w \c__fp_trailing_shift_int + #2*#9 + #3*#8 + #4*#7 + ( #3*#9 + #4*#8 - + \__fp_fixed_mul_i:nnnnnnnwn #5 {#6}{#7} {#1}{#2} + + \__fp_fixed_mul:nnnnnnnwn #5 {#6}{#7} {#1}{#2} } -\cs_new:Npn \__fp_fixed_mul_i:nnnnnnnwn #1#2 #3#4 #5#6 #7#8 ; #9 +\cs_new:Npn \__fp_fixed_mul:nnnnnnnwn #1#2 #3#4 #5#6 #7#8 ; #9 { #1*#4 + #2*#3 + #5*#8 + #6*#7 ) / \c_ten_thousand + #1*#3 + #5*#7 ; @@ -2930,7 +2930,7 @@ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4 - \__fp_fixed_mul_add_i:Nwnnnwnnn + + \__fp_fixed_mul_add:Nwnnnwnnn + + #5 #6 ; #2 ; #1 ; #2 ; + + #7 #8 ; {#9} ; } @@ -2940,7 +2940,7 @@ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4 - \__fp_fixed_mul_add_i:Nwnnnwnnn - + \__fp_fixed_mul_add:Nwnnnwnnn - + #5 #6 ; #2 ; #1 ; #2 ; - + #7 #8 ; {#9} ; } @@ -2950,11 +2950,11 @@ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + 1 0000 0000 - \__fp_fixed_mul_add_i:Nwnnnwnnn - + \__fp_fixed_mul_add:Nwnnnwnnn - ; #2 ; #1 ; #2 ; - ; {#3} ; } -\cs_new:Npn \__fp_fixed_mul_add_i:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9 +\cs_new:Npn \__fp_fixed_mul_add:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9 { #1 #7*#3 \exp_after:wN \__fp_pack_big:NNNNNNwn @@ -2965,20 +2965,20 @@ #1 #7*#5 #1 #8*#4 #1 #9*#3 #2 \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_middle_shift_int - #1 \__fp_fixed_mul_add_ii:nnnnwnnnn {#7}{#8}{#9} + #1 \__fp_fixed_mul_add:nnnnwnnnn {#7}{#8}{#9} } -\cs_new:Npn \__fp_fixed_mul_add_ii:nnnnwnnnn #1#2#3#4#5; #6#7#8#9 +\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnnn #1#2#3#4#5; #6#7#8#9 { ( #1*#9 + #2*#8 + #3*#7 + #4*#6 ) \exp_after:wN \__fp_pack_big:NNNNNNwn \int_use:N \__int_eval:w \c__fp_big_trailing_shift_int - \__fp_fixed_mul_add_iii:nnnnwnnwN + \__fp_fixed_mul_add:nnnnwnnwN { #6 + #4*#7 + #3*#8 + #2*#9 + #1 } { #7 + #4*#8 + #3*#9 + #2 } {#1} #5; {#6} } -\cs_new:Npn \__fp_fixed_mul_add_iii:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9 +\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9 { #9 (#4* #1 *#7) #9 (#5*#6+#4* #2 *#7+#3*#8) / \c_ten_thousand @@ -3092,32 +3092,32 @@ #2 \c_two * \c__fp_max_exponent_int \use_i_ii:nnn \fi: - \__fp_fixed_dtf_zeros_ii:ww + \__fp_fixed_dtf_zeros_auxi:ww #1#3 0000 0000 0000 0000 0000 0000 ; } -\cs_new:Npn \__fp_fixed_dtf_zeros_ii:ww +\cs_new:Npn \__fp_fixed_dtf_zeros_auxi:ww { \__fp_pack_twice_four:wNNNNNNNN \__fp_pack_twice_four:wNNNNNNNN \__fp_pack_twice_four:wNNNNNNNN - \__fp_fixed_dtf_zeros_iii:ww + \__fp_fixed_dtf_zeros_auxii:ww ; } -\cs_new:Npn \__fp_fixed_dtf_zeros_iii:ww #1; #2; #3 { #3 #1; } +\cs_new:Npn \__fp_fixed_dtf_zeros_auxii:ww #1; #2; #3 { #3 #1; } \cs_new:Npn \__fp_fixed_dtf_approx:n #1 { - \exp_after:wN \__fp_fixed_dtf_approx_ii:wnn + \exp_after:wN \__fp_fixed_dtf_approx:wnn \int_use:N \__int_eval:w 10 0000 0000 / ( #1 + \c_one ) ; {#1} } -\cs_new:Npn \__fp_fixed_dtf_approx_ii:wnn #1; #2#3 +\cs_new:Npn \__fp_fixed_dtf_approx:wnn #1; #2#3 { - \exp_after:wN \__fp_fixed_dtf_approx_iii:NNNNNw + \exp_after:wN \__fp_fixed_dtf_approx:NNNNNw \int_use:N \__int_eval:w 10 0000 0000 - 1750 + #1000 + (10 0000 0000/#2-#1) * (1000-#3/10) ; {#2}{#3} } -\cs_new:Npn \__fp_fixed_dtf_approx_iii:NNNNNw 1#1#2#3#4#5#6; #7; #8; +\cs_new:Npn \__fp_fixed_dtf_approx:NNNNNw 1#1#2#3#4#5#6; #7; #8; { + \c_four % because of the line below "dtf_epsilon" here. \__fp_fixed_mul:wwn {000#1}{#2#3#4#5}{#6}{0000}{0000}{0000} ; #7; @@ -3128,14 +3128,14 @@ } \cs_new:Npn \__fp_fixed_dtf_epsilon:wN #1#2#3#4#5#6; { - \exp_after:wN \__fp_fixed_dtf_epsilon_ii:NNNNNww + \exp_after:wN \__fp_fixed_dtf_epsilon:NNNNNww \int_use:N \__int_eval:w 1 9999 9998 - #3#4 + \exp_after:wN \__fp_fixed_dtf_epsilon_pack:NNNNNw \int_use:N \__int_eval:w 2 0000 0000 - #5#6 ; {0000} ; } \cs_new:Npn \__fp_fixed_dtf_epsilon_pack:NNNNNw #1#2#3#4#5#6; { #1 ; {#2#3#4#5} {#6} } -\cs_new:Npn \__fp_fixed_dtf_epsilon_ii:NNNNNww #1#2#3#4#5#6; #7; +\cs_new:Npn \__fp_fixed_dtf_epsilon:NNNNNww #1#2#3#4#5#6; #7; { \__fp_fixed_mul:wwn %^^A todo: optimize to use \__fp_mul_significand. {0000} {#2#3#4#5} {#6} #7 ; @@ -4020,19 +4020,19 @@ \prg_replicate:nn { - #1 } { 0 } #2#3#4#5 0000 0000 ; } \cs_new:Npn \__fp_trig_large:ww #1; #2#3; - { \__fp_trig_large_i:www #2; #3 ; #1; } -\cs_new:Npn \__fp_trig_large_i:www #1; #2; #3; + { \__fp_trig_large:www #2; #3 ; #1; } +\cs_new:Npn \__fp_trig_large:www #1; #2; #3; { \if_meaning:w 0 #3 \__fp_trig_large_break:w \fi: - \exp_after:wN \__fp_trig_large_ii_o:wnnnn + \exp_after:wN \__fp_trig_large_o:wnnnn \int_use:N \__int_eval:w ( #1 - 3141 ) / 6283 ; {#1} #2 \exp_after:wN ; \int_use:N \__int_eval:w \c_minus_one + #3; } -\cs_new:Npn \__fp_trig_large_ii_o:wnnnn #1; #2#3#4#5 +\cs_new:Npn \__fp_trig_large_o:wnnnn #1; #2#3#4#5 { - \exp_after:wN \__fp_trig_large_i:www + \exp_after:wN \__fp_trig_large:www \int_use:N \__int_eval:w \c__fp_leading_shift_int + #20 - #1*62831 \exp_after:wN \__fp_pack:NNNNNw \int_use:N \__int_eval:w \c__fp_middle_shift_int + #30 - #1*8530 @@ -4403,12 +4403,12 @@ } \cs_new:Npn \__fp_from_dim:Nw #1 #2; { - \__fp_pack_twice_four:wNNNNNNNN \__fp_from_dim_ii:wNNnnnnnn ; + \__fp_pack_twice_four:wNNNNNNNN \__fp_from_dim:wNNnnnnnn ; #2 000 0000 00 {10}987654321; #1 } -\cs_new:Npn \__fp_from_dim_ii:wNNnnnnnn #1; #2#3#4#5#6#7#8#9 - { \__fp_from_dim_iii:wnnnnwN #1 {#2#300} {0000} ; } -\cs_new:Npn \__fp_from_dim_iii:wnnnnwN #1; #2#3#4#5#6; #7 +\cs_new:Npn \__fp_from_dim:wNNnnnnnn #1; #2#3#4#5#6#7#8#9 + { \__fp_from_dim:wnnnnwN #1 {#2#300} {0000} ; } +\cs_new:Npn \__fp_from_dim:wnnnnwN #1; #2#3#4#5#6; #7 { \__fp_mul_npos_o:Nww #7 \s__fp \__fp_chk:w 1 #7 {#5} #1 ; diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3names.sty b/Master/texmf-dist/tex/latex/l3kernel/l3names.sty index 7c12c601af2..a1cc3246ef6 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3names.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3names.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap}[2012/07/15] -\GetIdInfo$Id: l3names.dtx 4230 2012-09-24 21:44:28Z joseph $ +\GetIdInfo$Id: l3names.dtx 4346 2012-12-07 13:46:13Z joseph $ {L3 Namespace for primitives} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -475,6 +475,11 @@ \__expl_primitive:NN \latelua \luatex_latelua:D \__expl_primitive:NN \luatexversion \luatex_luatexversion:D \__expl_primitive:NN \savecatcodetable \luatex_savecatcodetable:D + \__expl_primitive:NN \bodydir \luatex_bodydir:D + \__expl_primitive:NN \mathdir \luatex_mathdir:D + \__expl_primitive:NN \pagedir \luatex_pagedir:D + \__expl_primitive:NN \pardir \luatex_pardir:D + \__expl_primitive:NN \textdir \luatex_textdir:D \tex_endgroup:D \tex_let:D \tex_end:D \@@end \tex_let:D \tex_everydisplay:D \frozen@everydisplay @@ -487,6 +492,11 @@ \tex_let:D \luatex_initcatcodetable:D \luatexinitcatcodetable \tex_let:D \luatex_latelua:D \luatexlatelua \tex_let:D \luatex_savecatcodetable:D \luatexsavecatcodetable +\tex_let:D \luatex_bodydir:D \luatexbodydir +\tex_let:D \luatex_mathdir:D \luatexmathdir +\tex_let:D \luatex_pagedir:D \luatexpagedir +\tex_let:D \luatex_pardir:D \luatexpardir +\tex_let:D \luatex_textdir:D \luatextextdir %% %% %% End of file `l3names.sty'. diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty index 0b719688663..4a544ab6720 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3prg.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3prg.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Control structures} %% \ProvidesExplPackage @@ -184,24 +184,24 @@ \cs_new_nopar:cpn { __bool_S_1:w } { \group_align_safe_end: \c_true_bool } \cs_new_nopar:cpn { __bool_&_1:w } & { \__bool_get_next:NN \use_i:nn } \cs_new_nopar:cpn { __bool_|_0:w } | { \__bool_get_next:NN \use_i:nn } -\cs_new_nopar:cpn { __bool_&_0:w } & { \__bool_eval_skip_to_end:Nw \c_false_bool } -\cs_new_nopar:cpn { __bool_|_1:w } | { \__bool_eval_skip_to_end:Nw \c_true_bool } +\cs_new_nopar:cpn { __bool_&_0:w } & { \__bool_eval_skip_to_end_auxi:Nw \c_false_bool } +\cs_new_nopar:cpn { __bool_|_1:w } | { \__bool_eval_skip_to_end_auxi:Nw \c_true_bool } %% ( -\cs_new:Npn \__bool_eval_skip_to_end:Nw #1#2 ) +\cs_new:Npn \__bool_eval_skip_to_end_auxi:Nw #1#2 ) { - \__bool_eval_skip_to_end_ii:Nw #1#2 ( % ) + \__bool_eval_skip_to_end_auxii:Nw #1#2 ( % ) \q_no_value \q_stop {#2} } -\cs_new:Npn \__bool_eval_skip_to_end_ii:Nw #1#2 ( #3#4 \q_stop #5 % ) +\cs_new:Npn \__bool_eval_skip_to_end_auxii:Nw #1#2 ( #3#4 \q_stop #5 % ) { \quark_if_no_value:NTF #3 {#1} - { \__bool_eval_skip_to_end_iii:Nw #1 #5 } + { \__bool_eval_skip_to_end_auxiii:Nw #1 #5 } } -\cs_new:Npn \__bool_eval_skip_to_end_iii:Nw #1#2 ( #3 ) +\cs_new:Npn \__bool_eval_skip_to_end_auxiii:Nw #1#2 ( #3 ) { % ( - \__bool_eval_skip_to_end:Nw #1#3 ) + \__bool_eval_skip_to_end_auxi:Nw #1#3 ) } \cs_new:Npn \bool_not_p:n #1 { \bool_if_p:n { ! ( #1 ) } } \cs_new:Npn \bool_xor_p:nn #1#2 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty index 1a59d7c4911..55cb5f18fb0 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3seq.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3seq.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Sequences and stacks} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -88,26 +88,26 @@ { \tl_set:Nn \l__seq_internal_a_tl { - \__seq_set_split_i:w \prg_do_nothing: + \__seq_set_split_auxi:w \prg_do_nothing: #4 \__seq_set_split_end: } \tl_replace_all:Nnn \l__seq_internal_a_tl { #3 } { \__seq_set_split_end: - \__seq_set_split_i:w \prg_do_nothing: + \__seq_set_split_auxi:w \prg_do_nothing: } \tl_set:Nx \l__seq_internal_a_tl { \l__seq_internal_a_tl } #1 #2 { \l__seq_internal_a_tl } } } -\cs_new:Npn \__seq_set_split_i:w #1 \__seq_set_split_end: +\cs_new:Npn \__seq_set_split_auxi:w #1 \__seq_set_split_end: { - \exp_not:N \__seq_set_split_ii:w + \exp_not:N \__seq_set_split_auxii:w \exp_args:No \tl_trim_spaces:n {#1} \exp_not:N \__seq_set_split_end: } -\cs_new:Npn \__seq_set_split_ii:w #1 \__seq_set_split_end: +\cs_new:Npn \__seq_set_split_auxii:w #1 \__seq_set_split_end: { \__seq_wrap_item:n {#1} } \cs_generate_variant:Nn \seq_set_split:Nnn { NnV } \cs_generate_variant:Nn \seq_gset_split:Nnn { NnV } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty index ef644d3dfd6..6035dfe2f07 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3tl.dtx 4244 2012-09-28 22:46:36Z bruno $ +\GetIdInfo$Id: l3tl.dtx 4339 2012-11-24 19:16:43Z joseph $ {L3 Token lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -484,37 +484,37 @@ { \cs_new:Npn \__tl_trim_spaces:nn ##1 { - \__tl_trim_spaces_i:w + \__tl_trim_spaces_auxi:w ##1 \q_nil \q_mark #1 { } - \q_mark \__tl_trim_spaces_ii:w - \__tl_trim_spaces_iii:w + \q_mark \__tl_trim_spaces_auxii:w + \__tl_trim_spaces_auxiii:w #1 \q_nil - \__tl_trim_spaces_iv:w + \__tl_trim_spaces_auxiv:w \q_stop } - \cs_new:Npn \__tl_trim_spaces_i:w ##1 \q_mark #1 ##2 \q_mark ##3 + \cs_new:Npn \__tl_trim_spaces_auxi:w ##1 \q_mark #1 ##2 \q_mark ##3 { ##3 - \__tl_trim_spaces_i:w + \__tl_trim_spaces_auxi:w \q_mark ##2 \q_mark #1 {##1} } - \cs_new:Npn \__tl_trim_spaces_ii:w - \__tl_trim_spaces_i:w \q_mark \q_mark ##1 + \cs_new:Npn \__tl_trim_spaces_auxii:w + \__tl_trim_spaces_auxi:w \q_mark \q_mark ##1 { - \__tl_trim_spaces_iii:w + \__tl_trim_spaces_auxiii:w ##1 } - \cs_new:Npn \__tl_trim_spaces_iii:w ##1 #1 \q_nil ##2 + \cs_new:Npn \__tl_trim_spaces_auxiii:w ##1 #1 \q_nil ##2 { ##2 ##1 \q_nil - \__tl_trim_spaces_iii:w + \__tl_trim_spaces_auxiii:w } - \cs_new:Npn \__tl_trim_spaces_iv:w ##1 \q_nil ##2 \q_stop ##3 + \cs_new:Npn \__tl_trim_spaces_auxiv:w ##1 \q_nil ##2 \q_stop ##3 { ##3 { \use_none:n ##1 } } } \__tl_tmp:w { ~ } @@ -593,11 +593,11 @@ \cs_new:Npn \tl_head:n #1 { \etex_unexpanded:D - \if_false: { \fi: \__tl_head_i:nw #1 { } \q_stop } + \if_false: { \fi: \__tl_head_auxi:nw #1 { } \q_stop } } -\cs_new:Npn \__tl_head_i:nw #1#2 \q_stop - { \exp_after:wN \__tl_head_ii:nw \exp_after:wN { \if_false: } \fi: {#1} } -\cs_new:Npn \__tl_head_ii:nw #1 +\cs_new:Npn \__tl_head_auxi:nw #1#2 \q_stop + { \exp_after:wN \__tl_head_auxii:nw \exp_after:wN { \if_false: } \fi: {#1} } +\cs_new:Npn \__tl_head_auxii:nw #1 { \exp_after:wN \if_meaning:w \exp_after:wN \q_nil \tl_to_str:n \exp_after:wN { \use_none:n #1 } \q_nil @@ -606,7 +606,7 @@ \exp_after:wN \use_ii:nn \fi: {#1} - { \if_false: { \fi: \__tl_head_i:nw #1 } } + { \if_false: { \fi: \__tl_head_auxi:nw #1 } } } \cs_generate_variant:Nn \tl_head:n { V , v , f } \cs_new:Npn \tl_head:w #1#2 \q_stop {#1} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty index a95678f3d6c..c4b3a28e6a5 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3token.dtx 4251 2012-11-01 16:30:06Z joseph $ +\GetIdInfo$Id: l3token.dtx 4384 2012-12-20 15:47:56Z bruno $ {L3 Experimental token manipulation} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -573,54 +573,56 @@ { \__peek_token_remove_generic:NNTF #1 #2 {#3} { } } \cs_new_protected:Npn \__peek_token_remove_generic:NNF #1#2#3 { \__peek_token_remove_generic:NNTF #1 #2 { } {#3} } -\cs_new_nopar:Npn \__peek_execute_branches_catcode: +\cs_new_nopar:Npn \__peek_execute_branches_meaning: { - \if_catcode:w - \exp_not:N \l_peek_token \exp_not:N \l__peek_search_token + \if_meaning:w \l_peek_token \l__peek_search_token \exp_after:wN \__peek_true:w \else: \exp_after:wN \__peek_false:w \fi: } -\cs_new_nopar:Npn \__peek_execute_branches_meaning: +\cs_new_nopar:Npn \__peek_execute_branches_catcode: + { \if_catcode:w \__peek_execute_branches_catcode_aux: } +\cs_new_nopar:Npn \__peek_execute_branches_charcode: + { \if_charcode:w \__peek_execute_branches_catcode_aux: } +\cs_new_nopar:Npn \__peek_execute_branches_catcode_aux: { - \if_meaning:w \l_peek_token \l__peek_search_token + \if_catcode:w \exp_not:N \l_peek_token \scan_stop: + \exp_after:wN \exp_after:wN + \exp_after:wN \__peek_execute_branches_catcode_auxii:N + \exp_after:wN \exp_not:N + \else: + \exp_after:wN \__peek_execute_branches_catcode_auxiii: + \fi: + } +\cs_new:Npn \__peek_execute_branches_catcode_auxii:N #1 + { + \exp_not:N #1 + \exp_after:wN \exp_not:N \l__peek_search_tl \exp_after:wN \__peek_true:w \else: \exp_after:wN \__peek_false:w \fi: + #1 } -\cs_new_nopar:Npn \__peek_execute_branches_charcode: +\cs_new_nopar:Npn \__peek_execute_branches_catcode_auxiii: { - \bool_if:nTF - { - \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token - || \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token - || \token_if_eq_meaning_p:NN \l_peek_token \c_space_token - } - { \__peek_false:w } - { - \exp_after:wN \__peek_execute_branches_charcode_aux:NN - \l__peek_search_tl - } - } -\cs_new:Npn \__peek_execute_branches_charcode_aux:NN #1#2 - { - \if:w \exp_not:N #1 \exp_not:N #2 + \exp_not:N \l_peek_token + \exp_after:wN \exp_not:N \l__peek_search_tl \exp_after:wN \__peek_true:w \else: \exp_after:wN \__peek_false:w \fi: - #2 } \cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches: { - \token_if_eq_meaning:NNTF \l_peek_token \c_space_token - { - \tex_afterassignment:D \__peek_ignore_spaces_execute_branches_aux: - \cs_set_eq:NN \__peek_tmp:w - } - { \__peek_execute_branches: } + \if_meaning:w \l_peek_token \c_space_token + \tex_afterassignment:D \__peek_ignore_spaces_execute_branches_aux: + \exp_after:wN \cs_set_eq:NN + \exp_after:wN \__peek_tmp:w + \else: + \exp_after:wN \__peek_execute_branches: + \fi: } \cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches_aux: { \peek_after:Nw \__peek_ignore_spaces_execute_branches: } diff --git a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty index 365837076f4..7411941082b 100644 --- a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty +++ b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty @@ -46,19 +46,20 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/11/21] -\@ifpackagelater{expl3}{2012/11/21} +\RequirePackage{expl3}[2012/12/21] +\@ifpackagelater{expl3}{2012/12/21} {} {% - \PackageError{l3keys2e}{Support package l3kernel too old.} + \PackageError{l3keys2e}{Support package l3kernel too old} {% - Please install an up to date version of l3kernel - using your TeX package manager or from CTAN.\\ \\ + Please install an up to date version of l3kernel\MessageBreak + using your TeX package manager or from CTAN.\MessageBreak + \MessageBreak Loading l3keys2e will abort!% }% \endinput } -\GetIdInfo$Id: l3keys2e.dtx 4332 2012-11-21 21:40:31Z joseph $ +\GetIdInfo$Id: l3keys2e.dtx 4390 2012-12-21 06:59:20Z joseph $ {LaTeX2e option processing using LaTeX3 keys} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty index f1a144b2e16..16f16a26a13 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty @@ -50,19 +50,20 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/11/21] -\@ifpackagelater{expl3}{2012/11/21} +\RequirePackage{expl3}[2012/12/21] +\@ifpackagelater{expl3}{2012/12/21} {} {% - \PackageError{xparse}{Support package l3kernel too old.} + \PackageError{xparse}{Support package l3kernel too old} {% - Please install an up to date version of l3kernel - using your TeX package manager or from CTAN.\\ \\ + Please install an up to date version of l3kernel\MessageBreak + using your TeX package manager or from CTAN.\MessageBreak + \MessageBreak Loading xparse will abort!% }% \endinput } -\GetIdInfo$Id: xparse.dtx 4332 2012-11-21 21:40:31Z joseph $ +\GetIdInfo$Id: xparse.dtx 4390 2012-12-21 06:59:20Z joseph $ {L3 Experimental document command parser} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -206,6 +207,7 @@ {#1} { \tl_to_str:n {#2} } } \prop_put:Nnn \l__xparse_environment_arg_specs_prop {#1} {#2} + \bool_set_false:N \l__xparse_expandable_bool \bool_set_true:N \l__xparse_environment_bool \__xparse_declare_env_internal:nnnn {#1} {#2} } @@ -629,8 +631,8 @@ { \__msg_kernel_error:nn { xparse } { inconsistent-long } } } \cs_new_protected:Npn \__xparse_grab_arg:w { } -\cs_new_protected:Npn \__xparse_grab_arg_aux_i:w { } -\cs_new_protected:Npn \__xparse_grab_arg_aux_ii:w { } +\cs_new_protected:Npn \__xparse_grab_arg_auxi:w { } +\cs_new_protected:Npn \__xparse_grab_arg_auxii:w { } \cs_new_protected:Npn \__xparse_grab_D:w #1#2#3#4 \l__xparse_args_tl { \__xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set_protected_nopar:Npn @@ -972,10 +974,10 @@ \cs_new_protected:Npn \__xparse_grab_v_aux_loop:N #1 { \peek_N_type:TF - { \__xparse_grab_v_aux_loop_ii:NN #1 } + { \__xparse_grab_v_aux_loop:NN #1 } { \__xparse_grab_v_aux_abort: } } -\cs_new_protected:Npn \__xparse_grab_v_aux_loop_ii:NN #1 #2 +\cs_new_protected:Npn \__xparse_grab_v_aux_loop:NN #1 #2 { \__xparse_grab_v_token_if_char:NTF #2 { @@ -1005,10 +1007,10 @@ \cs_new_protected:Npn \__xparse_grab_v_bgroup_loop: { \peek_N_type:TF - { \__xparse_grab_v_bgroup_loop_ii:N } + { \__xparse_grab_v_bgroup_loop:N } { \__xparse_grab_v_aux_abort: } } -\cs_new_protected:Npn \__xparse_grab_v_bgroup_loop_ii:N #1 +\cs_new_protected:Npn \__xparse_grab_v_bgroup_loop:N #1 { \__xparse_grab_v_token_if_char:NTF #1 { @@ -1044,9 +1046,9 @@ { \__xparse_grab_v_group_end: \__xparse_add_arg:o \c__xparse_no_value_tl - \exp_after:wN \__xparse_grab_v_aux_abort_ii:w \l__xparse_args_tl \q_stop + \exp_after:wN \__xparse_grab_v_aux_abort:w \l__xparse_args_tl \q_stop } -\cs_new_protected:Npn \__xparse_grab_v_aux_abort_ii:w #1 #2 \q_stop +\cs_new_protected:Npn \__xparse_grab_v_aux_abort:w #1 #2 \q_stop { \group_begin: \char_set_lccode:nn { `\# } { \tex_endlinechar:D } @@ -1103,28 +1105,28 @@ } \cs_generate_variant:Nn \__xparse_add_arg_aux:n { V } \cs_new:Npn \__xparse_expandable_grab_D:w #1 \q__xparse #2 - { #2 { \__xparse_expandable_grab_D_i:NNNnwNn #1 \q__xparse #2 } } -\cs_new:Npn \__xparse_expandable_grab_D_i:NNNnwNn #1#2#3#4#5 \q__xparse #6#7 + { #2 { \__xparse_expandable_grab_D:NNNnwNn #1 \q__xparse #2 } } +\cs_new:Npn \__xparse_expandable_grab_D:NNNnwNn #1#2#3#4#5 \q__xparse #6#7 { \str_if_eq:onTF { #1 { } { } #7 #2 \q__xparse #3 } { { } { #2 } { } } { #1 - { \__xparse_expandable_grab_D_ii:NNNwNnnn #1#2#3#5 \q__xparse #6 } + { \__xparse_expandable_grab_D:NNNwNnnn #1#2#3#5 \q__xparse #6 } \q_nil { } #2 \ERROR \q__xparse \ERROR } { #5 {#4} \q__xparse #6 {#7} } } -\cs_new:Npn \__xparse_expandable_grab_D_ii:NNNwNnnn #1#2#3#4 \q__xparse #5#6#7#8 +\cs_new:Npn \__xparse_expandable_grab_D:NNNwNnnn #1#2#3#4 \q__xparse #5#6#7#8 { - \exp_args:Nof \__xparse_expandable_grab_D_iv:nnNNNwN + \exp_args:Nof \__xparse_expandable_grab_D:nnNNNwN { \use_ii:nn #6 #2 } - { \__xparse_expandable_grab_D_iii:Nw #3 \exp_stop_f: #7 #8 } + { \__xparse_expandable_grab_D:Nw #3 \exp_stop_f: #7 #8 } #1#2#3 #4 \q__xparse #5 } -\cs_new:Npn \__xparse_expandable_grab_D_iii:Nw #1#2 \ERROR \ERROR { #2 #1 } -\cs_new:Npn \__xparse_expandable_grab_D_iv:nnNNNwN #1#2#3#4#5#6 \q__xparse #7 +\cs_new:Npn \__xparse_expandable_grab_D:Nw #1#2 \ERROR \ERROR { #2 #1 } +\cs_new:Npn \__xparse_expandable_grab_D:nnNNNwN #1#2#3#4#5#6 \q__xparse #7 { \exp_args:No \tl_if_empty:oTF { #3 { \use_none:nnn } #2 \q__xparse #5 #4 \q__xparse #5 } @@ -1134,25 +1136,25 @@ } { #3 - { \__xparse_expandable_grab_D_ii:NNNwNnnn #3#4#5#6 \q__xparse #7 } + { \__xparse_expandable_grab_D:NNNwNnnn #3#4#5#6 \q__xparse #7 } \q_nil {#1} #2 \ERROR \q__xparse \ERROR } } \cs_new:Npn \__xparse_expandable_grab_D_alt:w #1 \q__xparse #2 - { #2 { \__xparse_expandable_grab_D_alt_i:NNnwNn #1 \q__xparse #2 } } -\cs_new:Npn \__xparse_expandable_grab_D_alt_i:NNnwNn #1#2#3#4 \q__xparse #5#6 + { #2 { \__xparse_expandable_grab_D_alt:NNnwNn #1 \q__xparse #2 } } +\cs_new:Npn \__xparse_expandable_grab_D_alt:NNnwNn #1#2#3#4 \q__xparse #5#6 { \str_if_eq:onTF { #1 { } #6 #2 #2 } { { } #2 } { #1 - { \__xparse_expandable_grab_D_alt_ii:Nwn #5 #4 \q__xparse } + { \__xparse_expandable_grab_D_alt:Nwn #5 #4 \q__xparse } #6 \ERROR } { #4 {#3} \q__xparse #5 {#6} } } -\cs_new:Npn \__xparse_expandable_grab_D_alt_ii:Nwn #1#2 \q__xparse #3 +\cs_new:Npn \__xparse_expandable_grab_D_alt:Nwn #1#2 \q__xparse #3 { \__xparse_put_arg_expandable:ow { \use_none:n #3 } #2 \q__xparse #1 } \cs_new:Npn \__xparse_expandable_grab_m:w #1 \q__xparse #2 { #2 { \__xparse_expandable_grab_m_aux:wNn #1 \q__xparse #2 } } @@ -1167,7 +1169,7 @@ { { } { #2 } { } } { #1 - { \__xparse_expandable_grab_D_ii:NNNwNnnn #1#2#3#5 \q__xparse #6 } + { \__xparse_expandable_grab_D:NNNwNnnn #1#2#3#5 \q__xparse #6 } \q_nil { } #2 \ERROR \q__xparse \ERROR } { @@ -1185,7 +1187,7 @@ { { } #2 } { #1 - { \__xparse_expandable_grab_D_alt_ii:Nwn #5 #4 \q__xparse } + { \__xparse_expandable_grab_D_alt:Nwn #5 #4 \q__xparse } #6 \ERROR } { diff --git a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty index c2fa5195eba..7c33f8c0803 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty @@ -50,19 +50,20 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/11/21] -\@ifpackagelater{expl3}{2012/11/21} +\RequirePackage{expl3}[2012/12/21] +\@ifpackagelater{expl3}{2012/12/21} {} {% - \PackageError{xtemplate}{Support package l3kernel too old.} + \PackageError{xtemplate}{Support package l3kernel too old} {% - Please install an up to date version of l3kernel - using your TeX package manager or from CTAN.\\ \\ + Please install an up to date version of l3kernel\MessageBreak + using your TeX package manager or from CTAN.\MessageBreak + \MessageBreak Loading xtemplate will abort!% }% \endinput } -\GetIdInfo$Id: xtemplate.dtx 4332 2012-11-21 21:40:31Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 4390 2012-12-21 06:59:20Z joseph $ {L3 Experimental prototype document functions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -843,12 +844,22 @@ } \cs_new_protected_nopar:Npn \__xtemplate_assign_boolean_aux:n #1 { - \__xtemplate_if_key_value:oT \l__xtemplate_value_tl - { \__xtemplate_key_to_value: } - \tl_put_right:Nx \l__xtemplate_assignments_tl + \__xtemplate_if_key_value:oTF \l__xtemplate_value_tl { - \exp_not:c { #1 _ \l__xtemplate_value_tl :N } - \exp_not:o \l__xtemplate_var_tl + \__xtemplate_key_to_value: + \tl_put_right:Nx \l__xtemplate_assignments_tl + { + \exp_not:c { #1 _eq:NN } + \exp_not:o \l__xtemplate_var_tl + \exp_not:o \l__xtemplate_value_tl + } + } + { + \tl_put_right:Nx \l__xtemplate_assignments_tl + { + \exp_not:c { #1 _ \l__xtemplate_value_tl :N } + \exp_not:o \l__xtemplate_var_tl + } } } \cs_new_protected_nopar:Npn \__xtemplate_assign_choice: |