diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-12 00:07:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-12 00:07:04 +0000 |
commit | a8c915878e3e9b15a28df3a92b0c1ac925d6e28e (patch) | |
tree | dd35661fdc51376d4d11645e7920a32a0fa1a041 /Master/texmf-dist/tex | |
parent | f260c3c6b4661850cc6f51f22729f2092d7ebf61 (diff) |
xpackages 2072 (10oct10)
git-svn-id: svn://tug.org/texlive/trunk@20058 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
5 files changed, 453 insertions, 60 deletions
diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/template.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/template.sty index 0e900e2323a..c1c11a686a1 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/template.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/template.sty @@ -54,7 +54,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{expl3} -\GetIdInfo$Id: template.dtx 1670 2009-11-01 22:34:54Z will $ +\GetIdInfo$Id: template.dtx 2063 2010-10-03 08:26:49Z mittelba $ {template} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -117,7 +117,7 @@ \cs_if_free:cTF{TP@<#1>} {\undefinedtype\DeclareTemplateType{#1}#3} { - \intexpr_compare:nNnF{#3}={\TP_get_arg_count:n{#1}} + \int_compare:nNnF{#3}={\TP_get_arg_count:n{#1}} { \BadArgCount } } \cs_set_eq:NN \KV_elt:nn \TP_templdecl_process_KV:nn @@ -127,7 +127,7 @@ \cs_set_eq:NN\KV@default@elt\KV_default_elt:n \tl_set:Nn \l_TP_curr_name_tl {#1/#2} \toks_clear:N\l_TP_default_assignments_toks - %\intexpr_compare:nNnTF{\char_value_catcode:n{`\ }}=\c_nine + %\int_compare:nNnTF{\char_value_catcode:n{`\ }}=\c_nine %\KV_parse_picky_no_space_removal_no_sanitize:n %\KV_parse_picky_space_removal_no_sanitize:n \KV@parse{#4} diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty index 5936b52059b..6af9c3f4570 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty @@ -57,7 +57,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: xparse.dtx 2037 2010-09-20 21:22:45Z joseph $ +\GetIdInfo$Id: xparse.dtx 2063 2010-10-03 08:26:49Z mittelba $ {Generic document command parser} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -96,7 +96,7 @@ \exp_not:c { xparse_grab_ #1 \bool_if:NT \l_xparse_long_bool { _long } - \intexpr_compare:nF { + \int_compare:nF { \l_xparse_mandatory_args_int > \c_zero } { _trailing } :w @@ -391,7 +391,7 @@ { #1 {##1} } } \cs_new:Npn \xparse_add_arg:n #1 { - \intexpr_compare:nTF { \l_xparse_processor_int = \c_zero } { + \int_compare:nTF { \l_xparse_processor_int = \c_zero } { \tl_put_right:Nn \l_xparse_args_tl { {#1} } }{ \xparse_if_no_value:nTF {#1} { @@ -408,7 +408,7 @@ \use:c { xparse_processor_ \int_use:N \l_xparse_processor_int :n } {#1} \int_decr:N \l_xparse_processor_int - \intexpr_compare:nTF { \l_xparse_processor_int = \c_zero } { + \int_compare:nTF { \l_xparse_processor_int = \c_zero } { \tl_put_right:Nx \l_xparse_args_tl { { \exp_not:V \ProcessedArgument } } @@ -757,7 +757,7 @@ \xparse_exp_set:cpx { \l_xparse_tmp_tl aux} ##1 \q_xparse ##2 #2 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl - \intexpr_eval:n { \l_xparse_total_args_int + 1 } + \int_eval:n { \l_xparse_total_args_int + 1 } } ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N @@ -769,7 +769,7 @@ } ##1 \q_xparse ##2## { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl - \intexpr_eval:n { \l_xparse_total_args_int + 1 } + \int_eval:n { \l_xparse_total_args_int + 1 } } ##1 {##2} \exp_not:N \q_xparse } @@ -783,7 +783,7 @@ } ##1 \q_xparse ##2 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl - \intexpr_eval:n { \l_xparse_total_args_int + 1 } + \int_eval:n { \l_xparse_total_args_int + 1 } } ##1 {##2} \exp_not:N \q_xparse } @@ -792,7 +792,7 @@ \cs_new:Npn \xparse_exp_add_type_t:w #1 { \tl_set:Nx \l_xparse_tmp_tl { \exp_after:wN \token_to_str:N \l_xparse_function_tl - \intexpr_eval:n { \l_xparse_total_args_int + 1 } + \int_eval:n { \l_xparse_total_args_int + 1 } } \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl @@ -815,7 +815,7 @@ } ##1 \q_xparse ##2 #1 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl - \intexpr_eval:n { \l_xparse_total_args_int + 1 } + \int_eval:n { \l_xparse_total_args_int + 1 } } ##1 {##2} \exp_not:N \q_xparse } @@ -843,7 +843,7 @@ } \tl_set:Nn \l_xparse_function_tl {#1} \xparse_exp_prepare_function:n {#2} - \intexpr_compare:nTF { + \int_compare:nTF { \l_xparse_total_args_int = \l_xparse_m_args_int } { \xparse_exp_declare_cmd_all_m:Nn #1 {#3} @@ -872,7 +872,7 @@ \exp_not:c { \token_to_str:N #1 1 } x \exp_not:N \q_xparse } \cs_set_nopar:cpx { - \token_to_str:N #1 \intexpr_eval:n { \l_xparse_total_args_int + 1 } + \token_to_str:N #1 \int_eval:n { \l_xparse_total_args_int + 1 } } x ##1 \q_xparse { \exp_not:c { \token_to_str:N #1 } ##1 } diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty index c94419b3351..7c6356a2605 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty @@ -54,7 +54,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: xtemplate.dtx 2037 2010-09-20 21:22:45Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 2063 2010-10-03 08:26:49Z mittelba $ {Prototype document functions} @@ -98,7 +98,7 @@ \tl_new:N \l_xtemplate_tmp_tl \cs_new:Npn \xtemplate_execute_if_arg_agree:nnT #1#2#3 { \prop_get:NnN \g_xtemplate_object_type_prop {#1} \l_xtemplate_tmp_tl - \intexpr_compare:nTF { #2 = \l_xtemplate_tmp_tl } + \int_compare:nTF { #2 = \l_xtemplate_tmp_tl } {#3} { \msg_kernel_error:nnxxx { xtemplate } @@ -234,8 +234,8 @@ \cs_new:Npn \xtemplate_declare_object_type:nn #1#2 { \int_set:Nn \l_xtemplate_tmp_int {#2} \bool_if:nTF { - \intexpr_compare_p:n { #2 > \c_nine } || - \intexpr_compare_p:n { #2 < \c_zero } + \int_compare_p:n { #2 > \c_nine } || + \int_compare_p:n { #2 < \c_zero } } { \msg_kernel_error:nnxx { xtemplate } { bad-number-of-arguments } {#1} { \exp_not:V \l_xtemplate_tmp_int } diff --git a/Master/texmf-dist/tex/latex/xpackages/xhead/xhead.sty b/Master/texmf-dist/tex/latex/xpackages/xhead/xhead.sty new file mode 100644 index 00000000000..76e375199d7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/xpackages/xhead/xhead.sty @@ -0,0 +1,376 @@ +%% +%% This is file `xhead.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xhead.dtx (with options: `package,trace') +%% +%% (C) Copyright The LaTeX3 Project and any individual authors +%% listed elsewhere in this file. +%% +%% This is a generated file. +%% +%% This file was generated from file(s) of the xhead bundle. +%% ----------------------------------------------------------- +%% +%% This file may only be distributed together with a copy of this bundle. +%% You may however distribute the bundle without such generated files. +%% +%% ====================================================================== +%% +%% File xhead.dtx (C) Copyright 2010 Frank Mittelbach, LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``xhead bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%% +\RequirePackage{expl3} +\GetIdInfo$Id: xhead.dtx 1914 2010-05-21 16:18:46Z schoepf $ + {Templates heading commands} +\RequirePackage{expl3,xtemplate} +\GetIdInfo$Id: xhead.dtx 1914 2010-05-21 16:18:46Z schoepf $ + {heading module} +\ProvidesExplPackage + {\filename}{\filedate}{\fileversion}{\filedescription} +\DeclareObjectType {heading} {7} +\cs_new:Npn \xhead_generate_toc:NNNNN #1#2#3#4#5 { + \typeout{xhead_generate_toc:NNNNN=#1:#2:#3:#4:#5} + \bool_if:nT + { #2 || ! #1 } + { + \group_begin: + \cs_set_eq:NN \@mkboth \use_none:nn + \cs_set_eq:NN \markboth \use_none:nn + \cs_set_eq:NN \markright \use_none:n + \addcontentsline{toc}{#3} + { + \tl_if_empty:NF #4 + { \protect\numberline{ #4 } } + #5 + } + \group_end: + } +} +\cs_generate_variant:Nn \xhead_generate_toc:NNNNN {NNNNo} +\cs_new:Npn \xhead_generate_mark:NNNNN #1#2#3#4#5 { + \typeout{xhead_generate_mark:NNNNN=#1:#2:#3:#4:#5} + \bool_if:nT + { #2 || ! #1 } + { + \group_begin: + \cs_set_eq:NN \@mkboth \use_none:nn + \use:c {#3 mark} {#5} + \group_end: + } +} +\cs_generate_variant:Nn \xhead_generate_mark:NNNNN {NNNNo} +\cs_new:Npn \xhead_generate_toc_and_mark:NNNNNNN #1#2#3#4#5#6#7 { + \xhead_generate_toc:NNNNo + #1 #2 #4 #5 #6 + \xhead_generate_mark:NNNNo + #1 #3 #4 #5 #7 +} + +\cs_new:Npn \xhead_update_prepare_number:N #1 { + \bool_if:nTF + { #1 || \intexpr_compare_p:n { \l_xhead_level_int > \c@secnumdepth } } + { \tl_clear:N \l_xhead_number_tl } + { + \refstepcounter \l_xhead_name_tl + \tl_set:Nx \l_xhead_number_tl { \use:c {the \l_xhead_name_tl} } + } +} +\cs_new:Npn \xhead_set_after_indention:N #1 { + \bool_if:NTF #1 \@afterindenttrue \@afterindentfalse +} +\cs_new:Npn \xhead_set_titles:nnn #1#2#3 { + \IfNoValueTF{#1} + { \tl_set:Nn \l_xhead_toc_title_tl {#3} } + { \tl_if_empty:nTF {#1} + { \tl_set:Nn \l_xhead_toc_title_tl {#3} } + { \tl_set:Nn \l_xhead_toc_title_tl {#1} } + } + \IfNoValueTF{#2} + { \tl_set_eq:NN \l_xhead_mark_title_tl \l_xhead_toc_title_tl } + { \tl_if_empty:nTF {#2} + { \tl_set:Nn \l_xhead_mark_title_tl {#3} } + { \tl_set:Nn \l_xhead_mark_title_tl {#2} } + } +} +\dim_new:N \l_xhead_indent_dim +\skip_new:N \l_xhead_above_skip +\skip_new:N \l_xhead_below_skip +\int_new:N \l_xhead_level_int +\int_new:N \l_xhead_break_penalty_int +\tl_new:N \l_xhead_name_tl +\tl_new:N \l_xhead_number_tl +\tl_new:N \l_xhead_toc_title_tl +\tl_new:N \l_xhead_mark_title_tl +\bool_new:N \l_xhead_indent_after_bool + +\cs_new:Npn \xhead_title_decl: {} + +\cs_new:Npn \xhead_number_format:n #1 {} + +\cs_new:Npn \xhead_default_number_format:n #1 { #1 \quad} +\DeclareTemplateInterface {heading} {2e-vertical} {7} + { + name : tokenlist = ??? , + level : integer = 0 , + break-penalty: integer = -300 , + indent : length = 0pt , + above-skip : skip = 0pt , + below-skip : skip = 0pt , + title-decl : function {0} = , + number-format: function {1} = \xhead_default_number_format:n {#1} , + indent-after : boolean = false , + } +\DeclareTemplateCode {heading} {2e-vertical} {7} + { + name = \l_xhead_name_tl , + level = \l_xhead_level_int , + break-penalty = \l_xhead_break_penalty_int , + indent = \l_xhead_indent_dim , + above-skip = \l_xhead_above_skip , + below-skip = \l_xhead_below_skip , + title-decl = \xhead_title_decl: , + number-format = \xhead_number_format:n , + indent-after = \l_xhead_indent_after_bool , + } + { + \AssignTemplateKeys + \bool_if:NF #1 + { + \IfNoValueTF{#2} + { \tl_set:Nn \l_xhead_toc_title_tl {#6} } + { \tl_set:Nn \l_xhead_toc_title_tl {#2} } + \tl_set_eq:NN \l_xhead_mark_title_tl \l_xhead_toc_title_tl + } + \xhead_update_prepare_number:N #1 + \xhead_set_after_indention:N \l_xhead_indent_after_bool + \if@noskipsec \leavevmode \fi + \par + \if@nobreak + \everypar{} + \else: + \addpenalty \l_xhead_break_penalty_int + \addvspace \l_xhead_above_skip + \fi: + \group_begin: + \xhead_title_decl: + { + \@hangfrom{\hskip \l_xhead_indent_dim \scan_stop: + \tl_if_empty:NF \l_xhead_number_tl + { \xhead_number_format:n \l_xhead_number_tl } + } + \interlinepenalty \@M #6\@@par + } + \group_end: + \xhead_generate_toc_and_mark:NNNNNNN + #1 \BooleanFalse \BooleanFalse % no forcing in 2e + \l_xhead_name_tl + \l_xhead_number_tl + \l_xhead_toc_title_tl + \l_xhead_mark_title_tl + \par \nobreak + \vspace \l_xhead_below_skip + \@afterheading + \ignorespaces + } +\DeclareTemplateInterface {heading} {3a-vertical} {7} + { + name : tokenlist = ??? , + level : integer = 0 , + break-penalty : integer = -300 , + indent : length = 0pt , + above-skip : skip = 0pt , + below-skip : skip = 0pt , + format : tokenlist = indent-by-number , + parshape : instance {parshape} = plain , + justification : instance {justification} = flush-left , + font : tokenlist = , + number-format : function {1} = \xhead_default_number_format:n {#1} , + indent-after : boolean = false , + } + +\tl_new:N \l_xhead_title_format_tl +\tl_new:N \l_xhead_title_font_tl + +\cs_new:Npn \xhead_title_parshape: {} +\cs_new:Npn \xhead_title_justification: {} + +\DeclareTemplateCode {heading} {3a-vertical} {7} + { + name = \l_xhead_name_tl , + level = \l_xhead_level_int , + break-penalty = \l_xhead_break_penalty_int , + indent = \l_xhead_indent_dim , + above-skip = \l_xhead_above_skip , + below-skip = \l_xhead_below_skip , + format = \l_xhead_title_format_tl , + parshape = \xhead_title_parshape: , + justification = \xhead_title_justification: , + font = \l_xhead_title_font_tl , + number-format = \xhead_number_format:n , + indent-after = \l_xhead_indent_after_bool , + } + { + \AssignTemplateKeys + \xhead_set_titles:nnn {#2} {#4} {#6} + \xhead_update_prepare_number:N #1 + \xhead_set_after_indention:N \l_xhead_indent_after_bool + \if@noskipsec \leavevmode \fi + \par + \if@nobreak + \everypar{} + \else: + \addpenalty \l_xhead_break_penalty_int + \addvspace \l_xhead_above_skip + \fi: + \xhead_use_title_format:nn \l_xhead_title_format_tl {#6} + + \xhead_generate_toc_and_mark:NNNNNNN + #1 #3 #5 + \l_xhead_name_tl + \l_xhead_number_tl + \l_xhead_toc_title_tl + \l_xhead_mark_title_tl + \par \nobreak + \vspace \l_xhead_below_skip + \@afterheading + \ignorespaces + } +\cs_new:Npn \xhead_use_title_format:nn #1 { + \cs_if_exist:cTF {xhead_format_ #1:n} + { \use:c{xhead_format_ #1:n} } + { \ERROR xhead format not defined } +} +\cs_new:cpn {xhead_format_indent-by-number:n} #1 { + \group_begin: + \l_xhead_title_font_tl + \hbox_set:Nn \l_tmpa_box + { + \tl_if_empty:NF \l_xhead_number_tl + { \xhead_number_format:n \l_xhead_number_tl } + } + + \UseInstance{measure}{fullwidth} + {\l_xhead_indent_dim + \box_wd:N \l_tmpa_box } + + \xhead_title_parshape: + \xhead_title_justification: + \interlinepenalty \@M + + \noindent \hbox_overlap_left:n { \box_use:N \l_tmpa_box } + #1\@@par + \group_end: +} +\cs_new:cpn {xhead_format_number-above-text:n} #1 { + \group_begin: + \l_xhead_title_font_tl + \xhead_title_parshape: + \xhead_title_justification: + \interlinepenalty \@M + + \tl_if_empty:NF \l_xhead_number_tl + { + \xhead_number_format:n \l_xhead_number_tl + } + + #1\@@par + \group_end: +} + +\input{xtextblock.sty} + +\DeclareTemplateInterface {heading} {3b-vertical} {7} + { + name : tokenlist = ??? , + level : integer = 0 , + break-penalty : integer = -300 , + indent : length = 0pt , + above-skip : skip = 0pt , + below-skip : skip = 0pt , + title-format : instance {textblock-2} = heading , + number-format : function {1} = \xhead_default_number_format:n {#1} , + indent-after : boolean = false , + } + +\cs_new:Npn \xhead_title_format:nn #1#2 {} + +\DeclareTemplateCode {heading} {3b-vertical} {7} + { + name = \l_xhead_name_tl , + level = \l_xhead_level_int , + break-penalty = \l_xhead_break_penalty_int , + indent = \l_xhead_indent_dim , + above-skip = \l_xhead_above_skip , + below-skip = \l_xhead_below_skip , + title-format = \xhead_title_format:nn , + number-format = \xhead_number_format:n , + indent-after = \l_xhead_indent_after_bool , + } + { + \AssignTemplateKeys + + \xhead_set_titles:nnn {#2} {#4} {#6} + + \xhead_update_prepare_number:N #1 + + \xhead_set_after_indention:N \l_xhead_indent_after_bool + + \if@noskipsec \leavevmode \fi + \par + \if@nobreak + \everypar{} + \else: + \addpenalty \l_xhead_break_penalty_int + \addvspace \l_xhead_above_skip + \fi: + + \xhead_title_format:nn \l_xhead_number_tl {#6} + + \xhead_generate_toc_and_mark:NNNNNNN + #1 #3 #5 + \l_xhead_name_tl + \l_xhead_number_tl + \l_xhead_toc_title_tl + \l_xhead_mark_title_tl + + \par \nobreak + \vspace \l_xhead_below_skip + \@afterheading + \ignorespaces + } + +\endinput +%% +%% End of file `xhead.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty index bae23bd05fd..d5009a13cba 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty @@ -49,77 +49,94 @@ {Parsing LaTeX3 keyvals as LaTeX2e package options} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{xparse} +\RequirePackage { xparse } \clist_new:N \keys_latexe_options_clist \bool_new:N \_l_keys_process_class_bool -\cs_new:Npn \keys_latexe_options:n #1 { +\cs_new_protected:Npn \keys_latexe_options:n #1 { \clist_clear:N \keys_latexe_options_clist \keys_latexe_options_global:n {#1} \keys_latexe_options_local: - \keys_if_exist:nnF {#1} { unknown } { - \keys_define:nn {#1} { - unknown .code:n = { - \msg_error:nnxx { Option~Processing } { unknown-option } - { \l_keys_key_tl } { \@currname } - } + \cs_if_exist:cTF { \c_keys_root_tl {#1} / unknown .cmd:n } + { + \keys_define:nn {#1} + { + unknown .code:n = + { + \msg_kernel_error:nnxx { keyvalue } { option-unknown } + { \l_keys_key_tl } { \@currname } + } + } } - } \keys_set:nV {#1} \keys_latexe_options_clist \AtEndOfPackage { \cs_set_eq:NN \@unprocessedoptions \scan_stop: } } -\msg_new:nnn { Option~Processing } { unknown-option } {% - Unknown~option~`#1'\\% - for~module~#2.% -} -\cs_new:Npn \keys_latexe_options_global:n #1 { - \cs_if_eq:NNF \@classoptionslist \scan_stop: { - \cs_if_eq:NNTF \@currext \@clsextension { - \keys_latexe_options_class:n {#1} - }{ - \bool_if:NT \_l_keys_process_class_bool - { \keys_latexe_options_package:n {#1} } +\cs_new_protected:Npn \keys_latexe_options_global:n #1 { + \cs_if_eq:NNF \@classoptionslist \scan_stop: + { + \cs_if_eq:NNTF \@currext \@clsextension + { \keys_latexe_options_class:n {#1} } + { + \bool_if:NT \_l_keys_process_class_bool + { \keys_latexe_options_package:n {#1} } + } } - } } -\cs_new:Npn \keys_latexe_options_class:n #1 { - \clist_map_inline:Nn \@classoptionslist { - \keys_if_exist:nnTF {#1} { \keys_latexe_remove_equals:n {##1} } { - \clist_put_right:Nn \keys_latexe_options_clist {##1} - }{ - \clist_put_right:Nn \@unusedoptionlist {##1} +\cs_new_protected:Npn \keys_latexe_options_class:n #1 { + \clist_map_inline:Nn \@classoptionslist + { + \cs_if_exist:cTF + { + \c_keys_root_tl #1 / + \keys_latexe_remove_equals:n {##1} .cmd:n + } + { \clist_put_right:Nn \keys_latexe_options_clist {##1} } + { \clist_put_right:Nn \@unusedoptionlist {##1} } } - } } -\cs_new:Npn \keys_latexe_options_package:n #1 { - \clist_map_inline:Nn \@classoptionslist { - \keys_if_exist:nnT {#1} { \keys_latexe_remove_equals:n {##1} } { - \clist_put_right:Nn \keys_latexe_options_clist {##1} - \clist_remove_element:Nn \@unusedoptionlist {##1} +\cs_new_protected:Npn \keys_latexe_options_package:n #1 { + \clist_map_inline:Nn \@classoptionslist + { + \cs_if_exist:cTF + { + \c_keys_root_tl #1 / + \keys_latexe_remove_equals:n {##1} .cmd:n + } + { + \clist_put_right:Nn \keys_latexe_options_clist {##1} + \clist_remove_element:Nn \@unusedoptionlist {##1} + } } - } } -\cs_new_nopar:Npn \keys_latexe_options_local: { - \cs_if_eq:NNF \@currext \@clsextension { - \cs_if_exist:cT { opt@ \@currname . \@currext } { - \exp_args:NNc \clist_put_right:NV \keys_latexe_options_clist - { opt@ \@currname . \@currext } +\cs_new_protected_nopar:Npn \keys_latexe_options_local: { + \cs_if_eq:NNF \@currext \@clsextension + { + \cs_if_exist:cT { opt@ \@currname . \@currext } + { + \exp_args:NNc \clist_put_right:NV \keys_latexe_options_clist + { opt@ \@currname . \@currext } + } } - } } \cs_new:Npn \keys_latexe_remove_equals:n #1 { \keys_latexe_remove_equals:w #1 = \q_stop } \cs_new:Npn \keys_latexe_remove_equals:w #1 = #2 \q_stop {#1} -\NewDocumentCommand \ProcessKeysOptions { m } { +\cs_new_protected:Npn \ProcessKeysOptions #1 { \bool_set_true:N \_l_keys_process_class_bool \keys_latexe_options:n {#1} } -\NewDocumentCommand \ProcessKeysPackageOptions { m } { +\cs_new_protected:Npn \ProcessKeysPackageOptions #1 { \bool_set_false:N \_l_keys_process_class_bool \keys_latexe_options:n {#1} } \@onlypreamble \ProcessKeysOptions \@onlypreamble \ProcessKeysPackageOptions +\msg_kernel_new:nnnn { keyvalue } { option-unknown } + { Unknown~option~'#1'~for~package~#2. } + { + LaTeX~has~been~asked~to~set~an~option~called~'#1'\\ + but~the~#2~package~has~not~created~an~option~with~this~name. + } \endinput %% %% End of file `l3keys2e.sty'. |