diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/gtl/gtl.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/gtl/gtl.sty | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/generic/gtl/gtl.sty b/Master/texmf-dist/tex/generic/gtl/gtl.sty index 45525f44c1b..5f45f16d3c7 100644 --- a/Master/texmf-dist/tex/generic/gtl/gtl.sty +++ b/Master/texmf-dist/tex/generic/gtl/gtl.sty @@ -11,21 +11,25 @@ %% Communicate any suggestions for changing this package %% to Bruno Le Floch (blflatex@gmail.com). %% -%% File: gtl.dtx Copyright (C) 2013,2015 Bruno Le Floch +%% File: gtl.dtx Copyright (C) 2013,2015,2017 Bruno Le Floch %% -%% It may be distributed and/or modified under the conditions of the -%% LaTeX Project Public License (LPPL), either version 1.3c of this -%% license or (at your option) any later version. The latest version -%% of this license is in the file +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt %% -%% http://www.latex-project.org/lppl.txt +%% This work has the LPPL maintenance status 'maintained' +%% and the current maintainer is Bruno Le Floch. %% +%% This work consists of the files gtl.dtx and gtl.ins and +%% derived file gtl.sty. %% ----------------------------------------------------------------------- \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname RequirePackage\endcsname\relax \input expl3-generic.tex \else - \RequirePackage{expl3}[2015/09/11] + \RequirePackage{expl3}[2017/11/14] \fi \ExplSyntaxOn \cs_if_exist:NTF \ProvidesExplPackage @@ -47,7 +51,7 @@ } \__gtl_tmp:w } - {gtl} {2015/09/29} {0.2} {Manipulate unbalanced lists of tokens} + {gtl} {2017/11/29} {0.3} {Manipulate unbalanced lists of tokens} \cs_generate_variant:Nn \use:nn { no } \cs_new:Npn \__gtl_exp_not_n:N #1 { \exp_not:n {#1} } \cs_new:Npn \__gtl_brace:nn #1#2 { { #1 #2 } } @@ -387,6 +391,24 @@ { #2 ~ } { #2 } } +\cs_new:Npn \gtl_head_do:NNT #1#2#3 + { + \gtl_if_empty:NTF #1 + { } + { \gtl_head_do:NN #1 #2 #3 } + } +\cs_new:Npn \gtl_head_do:NNF #1#2#3 + { + \gtl_if_empty:NTF #1 + {#3} + { \gtl_head_do:NN #1 #2 } + } +\cs_new:Npn \gtl_head_do:NNTF #1#2#3#4 + { + \gtl_if_empty:NTF #1 + {#4} + { \gtl_head_do:NN #1 #2 #3 } + } \cs_new_protected:Npn \gtl_get_left:NN #1#2 { \exp_after:wN \__gtl_head:wnnnnn #1 @@ -592,10 +614,10 @@ { \quark_if_nil:nTF {#1} { \__gtl_tl_count_test:w } - { + \c_one \__gtl_tl_count_loop:n } + { + 1 \__gtl_tl_count_loop:n } } \cs_new:Npn \__gtl_tl_count_test:w #1 \q_stop - { \tl_if_empty:nF {#1} { + \c_one \__gtl_tl_count_loop:n #1 \q_stop } } + { \tl_if_empty:nF {#1} { + 1 \__gtl_tl_count_loop:n #1 \q_stop } } \cs_new:Npn \gtl_extra_end:N #1 { \exp_after:wN \__gtl_extra_end:w #1 } \cs_new:Npn \__gtl_extra_end:w \s__gtl #1#2#3 @@ -609,14 +631,14 @@ \cs_new:Npn \__gtl_count_tokens:w \s__gtl #1#2#3 { \int_eval:n - { \c_minus_one \__gtl_count_auxi:nw #1 {#2} #3 \q_nil \q_stop } + { -1 \__gtl_count_auxi:nw #1 {#2} #3 \q_nil \q_stop } } \cs_new:Npn \__gtl_count_auxi:nw #1 { \quark_if_nil:nTF {#1} { \__gtl_count_auxii:w } { - + \c_one + + 1 \__gtl_count_auxiii:n {#1} \__gtl_count_auxi:nw } @@ -625,7 +647,7 @@ { \tl_if_empty:nF {#1} { - + \c_two + + 2 \__gtl_count_auxi:nw #1 \q_stop } } @@ -635,11 +657,11 @@ { \tl_if_head_is_group:nTF {#1} { - + \c_two + + 2 \exp_args:No \__gtl_count_auxiii:n { \use:n #1 } } { - + \c_one + + 1 \tl_if_head_is_N_type:nTF {#1} { \exp_args:No \__gtl_count_auxiii:n { \use_none:n #1 } } { \exp_args:Nf \__gtl_count_auxiii:n {#1} } |