diff options
author | Karl Berry <karl@freefriends.org> | 2011-07-31 18:30:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-07-31 18:30:04 +0000 |
commit | 4fcd51f020e5d12da9e8fa9dcff83c632385cb24 (patch) | |
tree | a1f9e249974a7655966cbb0e9e9cd3a1ead48847 /Master/texmf-dist/tex | |
parent | 332d583e34cb464fadc271aac86368fc71af2c40 (diff) |
rm xpackages, now l3packages + l3experimental
git-svn-id: svn://tug.org/texlive/trunk@23286 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xbase/ldcsetup.sty | 193 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xbase/template.sty | 566 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty | 1198 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty | 1245 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty | 1026 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty | 174 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xhead/xhead.sty | 376 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty | 142 |
8 files changed, 0 insertions, 4920 deletions
diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/ldcsetup.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/ldcsetup.sty deleted file mode 100644 index 915f77a1f2e..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/ldcsetup.sty +++ /dev/null @@ -1,193 +0,0 @@ -%% -%% This is file `ldcsetup.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% ldcsetup.dtx (with options: `package') -%% -%% (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 xbase 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: ldcsetup.dtx (C) Copyright 1999 Frank Mittelbach, Chris Rowley, David Carlisle -%% (C) Copyright 2004-2009 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 ``xbase 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: ldcsetup.dtx 1628 2009-10-25 09:54:34Z mittelba $ - {coding conventions and stuff} -\ProvidesExplPackage - {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{keyval} -\RequirePackage{expl3} -\ExplSyntaxOff -%% Puts an ignored space at the end of the line, so `|\ |' does the right -\def\IgnoreWhiteSpace{% - \edef\@tempa{% - \catcode`\noexpand\~=\the\catcode`\~\relax - \catcode`\noexpand\ =\the\catcode`\ \relax - \catcode`\noexpand\^^I=\the\catcode`\^^I\relax - \catcode`\noexpand\@=\the\catcode`\@\relax - \endlinechar=\the\endlinechar\relax - }% - \ifx\@currname\@empty - \expandafter\AtBeginDocument\expandafter{\@tempa}% - \else - \expandafter\AtEndOfPackage\expandafter{\@tempa}% - \fi - \catcode`\~=10\relax - \catcode`\ =9\relax - \catcode`\^^I=9\relax - \makeatletter - \endlinechar=` % - \relax -} -\def\InternalSyntaxOn{% - \edef\@tempa{% - \catcode`\noexpand\~=\the\catcode`\~\relax - \catcode`\noexpand\ =\the\catcode`\ \relax - \catcode`\noexpand\^^I=\the\catcode`\^^I\relax - \catcode`\noexpand\@=\the\catcode`\@\relax - \catcode`\noexpand\:=\the\catcode`\:\relax - \catcode`\noexpand\_=\the\catcode`\_\relax - \endlinechar=\the\endlinechar\relax - \endlinechar=13\relax - }% -%%% ???? - \ifx\InternalSyntaxOff\relax - \expandafter\def\expandafter\InternalSyntaxOff\expandafter - {\@tempa\let\InternalSyntaxOff\relax}% - \fi - \ifx\@currname\@empty - \expandafter\AtBeginDocument\expandafter{\@tempa}% - \else - \expandafter\AtEndOfPackage\expandafter{\@tempa}% - \fi - \catcode`\~=10\relax - \catcode`\ =9\relax - \catcode`\^^I=9\relax - \makeatletter - \catcode`\_=11\relax - \catcode`\:=11\relax - \endlinechar=` % - \relax -} -\let\InternalSyntaxOff\relax -\ExplSyntaxOn -\cs_set_nopar:Npn \define@key#1#2{% - \@ifnextchar[ - {\KV@def{#1}{\string#2}} - {\@namedef{KV@#1@\string#2}####1}} -\cs_set_nopar:Npn \setkeys#1#2{% - \cs_set_nopar:Npn \KV@prefix{KV@#1@\expandafter\string}% - \KV@do#2,\relax,} -\newtoks\KV@toks -\cs_set_nopar:Npn \KV@@sp@c#1\@nil#2\relax#3{\KV@toks{#1}\cs_set_nopar:Npx #3{\the\KV@toks}} -\cs_set_nopar:Npn \KV@equal{=} -\cs_set_nopar:Npn \KV@split#1=#2=#3\relax{% - \KV@@sp@def\@tempa{#1}% - \cs_set_nopar:Npn \@tempd{#3}% - \ifx\@tempa\@empty\else - \expandafter\cs_set_eq:NN \expandafter\@tempc - \csname\KV@prefix\@tempa\endcsname - \ifx\@tempc\relax - \KV@error{\@tempa\space \expandafter\@gobbletwo\string\@undefined}\@eha - \else - \ifx\@tempd\@empty - \KV@default - \else - \KV@@sp@def\@tempb{#2}% - \ifx\@tempd\KV@equal - \expandafter\@tempc\expandafter{\@tempb}\relax - \else - \KV@error{Extra~=~ sign~ after~ `#1'}\KV@erry - \fi - \fi - \fi - \fi} -\cs_set_nopar:Npn \KV@erry{\expandafter\KV@errx\meaning\@tempd\relax ignored\MessageBreak - missing~comma~in~`\expandafter\strip@prefix\meaning\@tempb'~?} -\cs_set_nopar:Npn \KV@errx#1>#2==\relax{% - `#2' } -\cs_set_nopar:Npn \KV@default{% - \expandafter\cs_set_eq:NN \expandafter\@tempb - \csname\KV@prefix\@tempa @default\endcsname - \ifx\@tempb\relax - \KV@error{No value specified for \@tempa}\@eha - \else - \@tempb\relax - \fi} -\cs_set_nopar:Npn \KV@error#1#2{\PackageError{keyval}{#1}{#2}} -\cs_set_nopar:Npn \KV@parse#1{ - \begingroup -\cs_set_nopar:Npn \KV@@sp@c##1\@nil##2\relax##3{\addto@hook##3{{##1}}} -\cs_set_nopar:Npn \KV@split##1=##2=##3\relax{% - \cs_set_nopar:Npn \@tempd{##3}% - \expandafter\ifx\expandafter=\@firstofone##1=\else - \ifx\@tempd\@empty - \addto@hook\KV@toks\KV@default@elt - \KV@@sp@def\KV@toks{##1}% - \else - \ifx\@tempd\KV@equal - \addto@hook\KV@toks\KV@elt - \KV@@sp@def\KV@toks{##1}% - \KV@@sp@def\KV@toks{##2}% - \else - \KV@err{Extra `=' after `##1'}\@ehd - \fi - \fi - \fi} - \KV@toks{} - \KV@do#1,\relax, - \expandafter - \endgroup - \the\KV@toks} -\cs_set_eq:NN \SetInternalCounter \calc_int_set:Nn -\cs_set_eq:NN \GSetInternalCounter\calc_int_gset:Nn -\cs_set_nopar:Npn \UndeclareRobustCommand#1{% - \cs_gundefine:N #1 - \exp_args:Nc \cs_gundefine:N {\cs_to_str:N #1~} -} -\endinput -%% -%% End of file `ldcsetup.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/template.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/template.sty deleted file mode 100644 index c1c11a686a1..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/template.sty +++ /dev/null @@ -1,566 +0,0 @@ -%% -%% This is file `template.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% template.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 xbase 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: template.dtx (C) Copyright 1999-2001 David Carlisle, Frank Mittelbach -%% (C) Copyright 2004-2009 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 ``xbase 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: template.dtx 2063 2010-10-03 08:26:49Z mittelba $ - {template} -\ProvidesExplPackage - {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{expl3} -\RequirePackage{ldcsetup,xparse} -\toks_new:N\l_TP_KV_assignments_toks -\toks_new:N\l_TP_default_assignments_toks -\cs_new_nopar:Npn \TP_declare_instance:Nnn #1#2#3 { - \group_begin: - \TP_instdecl_generate_assignments:nn {#2}{#3} - \cs_gset_nopar:Npx #1 { - \tl_if_eq:cNTF { TP>/#2 } \c_TP_doparameterassignments_tl - { \toks_use:N \l_TP_KV_assignments_toks } - { - \exp_not:N \TP_push_assignments:n - {\toks_use:N\l_TP_KV_assignments_toks} - \exp_not:c {TP>/#2} - } - } - \group_end:} -\cs_generate_variant:Nn \TP_declare_instance:Nnn {cnn} -\tl_set:Nn \c_TP_doparameterassignments_tl {\DoParameterAssignments} -\cs_new_nopar:Npn \UseTemplate #1#2#3{ - \TP_instdecl_generate_assignments:nn {#1/#2}{#3} - \TP_push_assignments: - \use:c { TP>/#1/#2 } -} -\cs_new_nopar:Npn \DoParameterAssignments{ - \exp_after:wN - \TP_pop_and_execute_assignments:nw - \toks_use:N \g_TP_assignments_stack_toks \q_stop -} -\cs_new_nopar:Npn \TP_pop_and_execute_assignments:nw#1#2\q_stop{ - \toks_gset:Nn \g_TP_assignments_stack_toks {#2} - #1} -\toks_new:N \g_TP_assignments_stack_toks -\toks_gset:Nn \g_TP_assignments_stack_toks {\scan_stop:}% avoid brace loss -\cs_new:Npn \TP_push_assignments:n#1{ - \toks_gput_left:Nn\g_TP_assignments_stack_toks{{#1}} -} -\cs_new_nopar:Npn \TP_push_assignments:{ - \toks_gset:No \g_TP_assignments_stack_toks - {\exp_after:wN - {\toks_use:N\exp_after:wN\l_TP_KV_assignments_toks\exp_after:wN} - \toks_use:N\g_TP_assignments_stack_toks} -} -\cs_new_nopar:Npn \DeclareTemplateType #1#2{ - \tl_set:cn {TP@<#1>} {{}#2}} -\cs_new_nopar:Npn \TP_get_csname_prefix:n #1 { - <\exp_after:wN\exp_after:wN\exp_after:wN - \use_i:nn - \cs:w TP@<#1>\cs_end:>#1/ -} -\cs_new_nopar:Npn \TP_get_arg_count:n #1 { - \exp_after:wN\exp_after:wN\exp_after:wN - \use_ii:nn - \cs:w TP@<#1>\cs_end: -} -\cs_new:Npn\DeclareTemplate #1#2#3#4#5{ - \cs_if_free:cTF{TP@<#1>} - {\undefinedtype\DeclareTemplateType{#1}#3} - { - \int_compare:nNnF{#3}={\TP_get_arg_count:n{#1}} - { \BadArgCount } - } - \cs_set_eq:NN \KV_elt:nn \TP_templdecl_process_KV:nn - \cs_set_nopar:Npn \KV_default_elt:n##1{ - \PackageError{template}{Missing~ =~ after~ ##1}\@ehd} - \cs_set_eq:NN\KV@elt\KV_elt:nn - \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 - %\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} - \cs_set_nopar:cpx { TPD>/\l_TP_curr_name_tl } - {\toks_use:N\l_TP_default_assignments_toks} - - \tl_clear:c {TPR>/\l_TP_curr_name_tl} - - \tl_set_eq:cN {TPO>/\l_TP_curr_name_tl}\l_TP_curr_name_tl - \cs_generate_from_arg_count:cNnn {TP>/\l_TP_curr_name_tl} - \cs_set:Npn {#3}{#5} -} -\cs_set:Npn \tl_set:cx {\exp_args:Nc \tl_set:Nx} -\cs_new_nopar:Npn \TP_templdecl_process_KV:nn #1#2 {% - \cs_set_eq:NN \TP_templdecl_add_global_or_nothing: \prg_do_nothing: - \bool_set_false:N\l_TP_global_assignment_bool - \tl_set:Nn\l_TP_currkey_tl{#1} - \TP_templdecl_parse_KV:N#2\q_stop} -\cs_new_nopar:Npn \TP_templdecl_parse_KV:N #1 { - \cs_if_free:cTF{TP_use_arg_type_#1:w} - {\PackageError{template}{Unknown~key~type~ (#1)~for~\l_TP_currkey_tl}\@eha} - {\use:c{TP_use_arg_type_#1:w}} -} -\bool_new:N \l_TP_global_assignment_bool -\cs_new_nopar:cpn{TP_use_arg_type_+:w} { - \bool_set_true:N\l_TP_global_assignment_bool - \cs_set_nopar:Npn \TP_templdecl_add_global_or_nothing: - {\toks_put_right:Nn \l_TP_KV_assignments_toks {\pref_global:D} } - \TP_templdecl_parse_KV:N -} -\cs_new_nopar:Npn\TP_use_arg_type_l:w { - \TP_parse_optional_key_default:nw - { - \cs_set_eq:NN \TP_templdecl_add_global_or_nothing: \prg_do_nothing: - \bool_if:NTF \l_TP_global_assignment_bool - {\TP_templdecl_setup_register_key:Nn\gsetlength} - {\TP_templdecl_setup_register_key:Nn\setlength} - } -} -\cs_new_nopar:Npn\TP_use_arg_type_L:w { - \TP_parse_optional_key_default:nw - {\TP_templdecl_setup_fakeregister_key:NNn\setlength\l_tmpa_skip} -} -\cs_new_nopar:Npn\TP_use_arg_type_c:w { - \TP_parse_optional_key_default:nw - { - \cs_set_eq:NN\TP_templdecl_add_global_or_nothing:\prg_do_nothing: - \bool_if:NTF \l_TP_global_assignment_bool - {\TP_templdecl_setup_register_key:Nn\GSetInternalCounter} - {\TP_templdecl_setup_register_key:Nn\SetInternalCounter} - } -} -\cs_new_nopar:Npn\TP_use_arg_type_C:w { - \TP_parse_optional_key_default:nw - {\TP_templdecl_setup_fakeregister_key:NNn - \SetInternalCounter\l_tmpa_int} -} -\cs_new_nopar:Npn\TP_use_arg_type_n:w { - \TP_parse_optional_key_default:nw - {\TP_templdecl_setup_n_key:N} -} -\cs_new_nopar:Npn\TP_use_arg_type_f:w #1{ - %\TP_templdecl_parse_f_arg:nw {#1} - \TP_parse_optional_key_default:nw{\TP_templdecl_setup_f_key:Nn{#1}} -} -\cs_new_nopar:Npn \TP_templdecl_parse_f_arg:nw#1#2{ - \TP_parse_optional_key_default:nw{\TP_templdecl_setup_f_key:Nn{#1}{#2}} -} -\cs_new_nopar:Npn\TP_use_arg_type_b:w { - \TP_parse_optional_key_default:nw - {\TP_templdecl_setup_b_key:n} -} -\cs_new_nopar:Npn \TP_templdecl_setup_b_key:n#1{ - \cs_set_eq:cN { if#1 } \if_true: - \TP_templdecl_define_key:n - { \TP_templdecl_eval_b_key_value:nn {#1}{##1} } -} -\cs_new_nopar:Npn \TP_templdecl_eval_b_key_value:nn#1#2{ - \cs_if_free:cTF {if#2} - { \PackageError{template}{Bad~boolean~setting~#1=#2}\@eha } - { \tl_set_eq:cc {if_#1:}{if_#2:} - \toks_put_right:Nf \l_TP_KV_assignments_toks - { \tl_set_eq:cc {if_#1:}{if_#2:} } - } -} -\cs_new_nopar:Npn\TP_use_arg_type_s:w { - \TP_parse_optional_key_default:nw - {\TP_templdecl_setup_s_key:n} -} -\cs_new_nopar:Npn \TP_templdecl_setup_s_key:n #1 { - \TP_templdecl_define_key:n - { \TP_templdecl_eval_s_key_value:nnn{##1}#1 } -} -\cs_new_nopar:Npn\TP_use_arg_type_i:w #1{ - \TP_parse_optional_key_default:nw{\TP_templdecl_setup_i_key:nnn{#1}} -} -\cs_new_nopar:Npn \TP_templdecl_setup_i_key:nnn#1#2{ - \TP_templdecl_define_key:n - { - \TP_templdecl_eval_i_key_value:Nnn #2 {#1}{##1} - } -} -\cs_new_nopar:Npn \TP_templdecl_eval_i_key_value:Nnn #1#2#3 { - \tl_if_head_eq_meaning:nNTF {#3.}\UseTemplate - { - \iow_term:x{\token_to_str:N\UseTemplate\space seen} - {\TP_templdecl_declare_tmp_instance:nnnn #3 } - \toks_put_right:No \l_TP_KV_assignments_toks - { \exp_after:wN \KV@toks \exp_after:wN {\g_tmpa_tl} } - %\TP_templdecl_add_global_or_nothing: - %\toks_put_right:Nn \l_TP_KV_assignments_toks - % { \cs_set_nopar:Npx #1{ \toks_use:N \KV@toks} } - \bool_if:NTF \l_TP_global_assignment_bool - {\toks_put_right:Nn \l_TP_KV_assignments_toks - {\cs_gset_nopar:Npx #1 { \toks_use:N \KV@toks}} - } - {\toks_put_right:Nn \l_TP_KV_assignments_toks - {\cs_set_nopar:Npx #1 { \toks_use:N \KV@toks}} - } - } - { - \TP_let_instance:Nnn#1{#2}{#3} - \toks_put_right:Nf \l_TP_KV_assignments_toks - { \TP_let_instance:Nnn#1{#2}{#3} } - } -} -\cs_new_nopar:Npn\TP_use_arg_type_x:w { - \TP_parse_optional_key_default:nw - {\TP_templdecl_setup_x_key:n} -} -\cs_new_nopar:Npn \TP_templdecl_setup_x_key:n#1{ - \TP_templdecl_define_key:n - { \toks_put_right:Nn\l_TP_KV_assignments_toks{#1} } -} -\cs_new_nopar:Npn\TP_use_arg_type_g:w { - \TP_parse_optional_key_default:nw - {\TP_templdecl_setup_g_key:n} -} -\cs_new_nopar:Npn \TP_templdecl_setup_g_key:n #1 { - \TP_templdecl_define_key:n{#1}} -\cs_new_nopar:Npn \TP_templdecl_define_key:n#1{ - \exp_after:wN \cs_set:Npn \cs:w - KV@\l_TP_curr_name_tl @\l_TP_currkey_tl - \exp_after:wN\cs_end: - \exp_after:wN##\exp_after:wN1\exp_after:wN{ - \exp_after:wN\TP_templdecl_remove_from_default_assignments:N - \cs:w KV@\l_TP_curr_name_tl @\l_TP_currkey_tl - \exp_after:wN \cs_end: - \TP_templdecl_add_global_or_nothing: - #1 - } -} -\cs_set:Npn \TP_ignore_leading_space_in_arg_ii:nn#1#2{ - \exp_args:Nf\TP_ignore_leading_space_in_arg_ii_aux:nn - {\exp_not:N #2}{#1} -} -\cs_set:Npn \TP_ignore_leading_space_in_arg_ii_aux:nn#1#2{#2{#1}} - -\DeclareDocumentCommand\TP_parse_optional_key_default:nw{mo}{ - \IfNoValueTF{#2} - {\TP_templdecl_finish_key_setup:nw{#1}} - {\TP_templdecl_finish_key_setup_with_default:nnw{#1}{#2}} -} -\cs_new_nopar:Npn \TP_templdecl_finish_key_setup:nw#1#2\q_stop{ - \TP_ignore_leading_space_in_arg_ii:nn{#1}{#2} - %%%#1{#2} -} -\cs_new_nopar:Npn \TP_templdecl_finish_key_setup_with_default:nnw#1#2#3\q_stop{ - \TP_ignore_leading_space_in_arg_ii:nn{#1}{#3} - %%% #1 {#3} - \group_begin: - \toks_clear:N \l_TP_KV_assignments_toks - \cs_set_eq:NN \TP_templdecl_remove_from_default_assignments:N \use_none:n - \use:c{KV@\l_TP_curr_name_tl @\l_TP_currkey_tl}{#2} - \exp_after:wN - \group_end: - \exp_after:wN - \toks_set:Nn - \exp_after:wN - \l_TP_default_assignments_toks - \exp_after:wN - { \cs:w KV@\l_TP_curr_name_tl @\l_TP_currkey_tl \exp_after:wN \cs_end: - \exp_after:wN - { \toks_use:N \exp_after:wN \l_TP_KV_assignments_toks - \exp_after:wN - } - \toks_use:N\l_TP_default_assignments_toks - } -} -\tl_new:Nn \c_TP_true_tl {true} -\cs_new_nopar:Npn \TP_templdecl_eval_s_key_value:nnn#1#2#3 { - \tl_set:Nn \l_tmpa_tl {#1} - \tl_if_eq:NNTF \l_tmpa_tl \c_TP_true_tl - { \toks_put_right:Nn \l_TP_KV_assignments_toks {#2} } - { \toks_put_right:Nn \l_TP_KV_assignments_toks {#3} } -} -\cs_new_nopar:Npn \TP_templdecl_setup_register_key:Nn #1#2{ - \TP_templdecl_define_key:n{ - \tl_if_head_eq_meaning:nNTF{##1}\DelayEvaluation - { - \toks_put_right:Nn \l_TP_KV_assignments_toks {#1#2{##1}} - %\toks_set:No\l_tmpa_toks{\use_ii:nn ##1} - %\toks_put_right:Nx \l_TP_KV_assignments_toks - % {\exp_not:n{#1#2}{\toks_use:N \l_tmpa_toks}} - } - { - \tl_if_head_eq_meaning:nNTF{##1..}\MultiSelection - { - \group_begin: - \TP_multiselection_add:nnnnnn #1#2##1 - \group_end: - \tl_if_in:onTF{\toks_use:N\g_TP_multiselection_toks}\DelayEvaluation - { - \toks_put_right:No\l_TP_KV_assignments_toks - { - \exp_after:wN#1\exp_after:wN#2\exp_after:wN - {\toks_use:N\g_TP_multiselection_toks} - } - } - { - \toks_put_right:No\l_TP_KV_assignments_toks - { - \exp_after:wN #2 - \exp_after:wN= \toks_use:N\g_TP_multiselection_toks\scan_stop: - } - } - } - { - #1#2{##1} - \toks_put_right:No\l_TP_KV_assignments_toks { - \exp_after:wN #2 \exp_after:wN = \tex_the:D #2\scan_stop: - } - } - } - } -} -\cs_new_nopar:Npn\DelayEvaluation #1{\use_none:n{\DelayEvaluation}#1} -\cs_new_nopar:Npn\MultiSelection #1{\use_none:n{\MultiSelection}#1} -\cs_new_nopar:Npn \TP_templdecl_remove_from_default_assignments:N#1{ - \cs_set_nopar:Npn \TP_tmp:w ##1#1##2##3#1##4\q_stop{ - \l_TP_default_assignments_toks{##1##3} - } - \exp_after:wN \TP_tmp:w - \toks_use:N\l_TP_default_assignments_toks #1\scan_stop:#1\q_stop} -\cs_new_nopar:Npn \TP_templdecl_setup_f_key:Nn#1#2{ - \TP_templdecl_define_key:n - { \TP_templdecl_define_function:NNn#1#2{##1} } -} -\cs_new_nopar:Npn \TP_templdecl_define_function:NNn#1#2#3{ - \cs_generate_from_arg_count:NNnn #2 \cs_set:Npn {#1}{#3} - \toks_put_right:Nf \l_TP_KV_assignments_toks { - \cs_generate_from_arg_count:NNnn #2 \cs_set:Npn {#1}{#3} - } -} -\cs_new_nopar:Npn \TP_templdecl_setup_n_key:N#1{ - \TP_templdecl_define_key:n{ - \tl_if_head_eq_meaning:nNTF{##1..}\MultiSelection - { - \group_begin: - \TP_templdecl_multiselection:nnnn ##1 - \group_end: - \toks_put_right:Nx\l_TP_KV_assignments_toks { - \exp_not:n{\tl_set:Nf #1} { \toks_use:N \g_TP_multiselection_toks} - } - } - { - \cs_set_nopar:Npn #1{##1} % setting it? - \toks_put_right:Nn \l_TP_KV_assignments_toks - { \tl_set:Nn #1{##1} } - } - } -} -\cs_new_nopar:Npn \TP_templdecl_multiselection:nnnn #1#2#3#4{ - \toks_gset:Nn \g_TP_multiselection_toks {\if_case:w #2} - \clist_map_inline:nn {#3}{ - \TP_multiselection_add_or_case:n {\exp_stop_f:##1} - } - \toks_gput_right:Nn\g_TP_multiselection_toks { - \else: \use_i_after_fi:nw { \exp_stop_f: #4} \fi: - } -} -\cs_new_nopar:Npn \DeclareInstance { \DeclareCollectionInstance{} } -\cs_new:Npn \DeclareCollectionInstance#1#2#3#4{ - \TP_declare_instance:cnn { <#1>#2/#3 }{ #2/#4 } -} -\cs_new_nopar:Npn \UseCollection#1#2{ - \tl_set:cx { TP@<#1> } - { {#2} \TP_get_arg_count:n{#1} } -} -\cs_new_nopar:Npn \TP_let_instance:Nnn#1#2#3{ - \cs_set_eq:Nc #1 - { - \cs_if_free:cTF { \TP_get_csname_prefix:n{#2} #3 } - { <>#2/ } - { \TP_get_csname_prefix:n{#2} } - #3 - } -} -\cs_new_nopar:Npn \UseInstance#1#2{ - \TP_let_instance:Nnn \l_tmpa_tl {#1}{#2} - \tl_if_eq:NNTF \l_tmpa_tl \scan_stop: - \INSTANCEundefined - \l_tmpa_tl -} -\cs_new:Npn \TP_templdecl_declare_tmp_instance:nnnn#1#2#3{% - \TP_declare_instance:Nnn \g_tmpa_tl {#2/#3} } -\cs_new_nopar:Npn \ShowTemplate#1#2{ - \iow_term:x{*******~ Template:~ #1/#2~ *******} - \iow_term:x{*} - \iow_term:x{*~ Defaults:} - \iow_term:x{*} - \iow_term:x{\token_to_str:N\TPD>/#1/#2= - \cs_meaning:c{TPD>/#1/#2}} - \iow_term:x{*} - \iow_term:x{*~ Restrictions:} - \iow_term:x{*} - \iow_term:x{\token_to_str:N\TPR>/#1/#2= - \cs_meaning:c{TPR>/#1/#2}} - \iow_term:x{*} - \iow_term:x{*~ Body:} - \iow_term:x{*} - \cs_show:c {TP>/#1/#2}} -\cs_new_nopar:Npn \ShowCollectionInstance#1#2#3{ - \iow_term:x{*******~ Instance:~ <#1>#2/#3~ *******} - \iow_term:x{*} - \cs_show:c {<#1>#2/#3}} -\cs_new_nopar:Npn \ShowInstance{\ShowCollectionInstance{}} -\cs_new_nopar:Npn \TP_templdecl_setup_fakeregister_key:NNn#1#2#3{ - \TP_templdecl_define_key:n{ - \tl_if_head_eq_meaning:nNTF{##1..}\DelayEvaluation - { - \toks_set:No \l_tmpa_toks {\use_ii:nn ##1} - \toks_put_right:Nx \l_TP_KV_assignments_toks { - \exp_not:n{#1#2}{\toks_use:N \l_tmpa_toks} - \exp_not:n{ \cs_set_nopar:Npx #3{\toks_use:N#2} } - - } - } - { - \tl_if_head_eq_meaning:nNTF{##1..}\MultiSelection - { - \group_begin: - \TP_multiselection_add:nnnnnn#1#2##1 - \group_end: - \toks_put_right:Nx\l_TP_KV_assignments_toks - {\exp_not:n{\cs_set_nopar:Npn #3} {\toks_use:N\g_TP_multiselection_toks}} - } - { - #1#2{##1} - \toks_put_right:Nx\l_TP_KV_assignments_toks - {\exp_not:n{\cs_set_nopar:Npn#3} {\toks_use:N#2}} - } - } - } -} -\toks_new:N \g_TP_multiselection_toks -\cs_new_nopar:Npn \TP_multiselection_add:nnnnnn #1#2#3#4#5#6{ - \toks_gset:Nn \g_TP_multiselection_toks {\if_case:w #4} - \clist_map_inline:nn {#5}{ - \tl_if_head_eq_meaning:nNTF{##1..}\DelayEvaluation - { - \TP_multiselection_add_or_case:n {##1} - } - { - #1#2{##1} - \TP_multiselection_add_or_case:o { \toks_use:N #2 } - } - } - \toks_gput_right:Nn \g_TP_multiselection_toks { - \else: \use_i_after_fi:nw{#6}\fi: - } -} -\cs_new_nopar:Npn \TP_multiselection_add_or_case:n #1 { - \toks_gput_right:Nn \g_TP_multiselection_toks { - \or: \use_i_after_orelse:nw{#1} - } -} -\cs_generate_variant:Nn \TP_multiselection_add_or_case:n {o} -\cs_new_nopar:Npn \IfExistsInstanceTF#1#2{ - \cs_if_exist:cTF{<>#1/#2} -} -\cs_set_nopar:Npn \IfExistsInstanceTF#1#2{ - \TP_let_instance:Nnn \l_tmpa_tl {#1}{#2} - \if_meaning:w\l_tmpa_tl\scan_stop: - \exp_after:wN\use_ii:nn - \else: - \exp_after:wN\use_i:nn - \fi:} -\cs_new_nopar:Npn \DeclareRestrictedTemplate#1#2#3#4{ - % CCC do we need a group here?? - \tl_set_eq:cc { TPD>/#1/#2 } { TPD>/#1/#3 } - \tl_set_eq:cc { TP>/#1/#2 } { TP>/#1/#3 } - \toks_set:Nv \l_TP_KV_assignments_toks { TPR>/ #1 / #3 } - \setkeys {\cs:w TPO>/#1/#3\cs_end:}{#4} - - \tl_set:cx { TPR>/#1/#2 } - { \toks_use:N \l_TP_KV_assignments_toks } - \cs_if_free:cTF { TPO>/#1/#3 } - { \tl_set:cn {TPO>/#1/#2}{#1/#3} } - { \tl_set_eq:cc {TPO>/#1/#2}{TPO>/#1/#3} } -} -\cs_new_nopar:Npn \TP_instdecl_generate_assignments:nn#1#2 { - % Returns to \l_TP_KV_assignments_toks - % the restrictions - % stored in the TP-structure (at present - % in YAM) of the template #1 - \exp_args:NNo \toks_set:No \l_TP_default_assignments_toks - {\cs:w TPD>/#1\cs_end:\scan_stop:\scan_stop:} - \toks_set:Nv \l_TP_KV_assignments_toks { TPR>/ #1 } - \setkeys { \cs:w TPO>/#1 \cs_end: } - { #2 } % adds stuff to \l_TP_KV_assignments_toks - - \exp_after:wN\TP_instdecl_add_default_recurse:nn - \toks_use:N\l_TP_default_assignments_toks - -} -\cs_new_nopar:Npn \TP_instdecl_add_default_recurse:nn#1#2{ - \token_if_eq_meaning:NNF #1\scan_stop: - { - \l_tmpa_toks{#2} - \tl_set:Nx \l_tmpa_tl { - {\toks_use:N \l_tmpa_toks \toks_use:N \l_TP_KV_assignments_toks} - } - \l_TP_KV_assignments_toks \l_tmpa_tl - \TP_instdecl_add_default_recurse:nn - } -} -\cs_new_nopar:Npn \TP_split_finite_skip_value:nnNN #1#2{ - \skip_split_finite_else_action:nnNN {#1} { - \PackageError{template}{Value~ for~ key~ #2~ contains~ `fil(ll)'} - {Only~ finite~ minus~ or~ plus~ parts~ are~ allowed~ for~ this~ key.} - } -} -\endinput -%% -%% End of file `template.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty deleted file mode 100644 index bdb507e62ff..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty +++ /dev/null @@ -1,1198 +0,0 @@ -%% -%% This is file `xparse.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% xparse.dtx (with options: `package') -%% -%% (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 xbase 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: xparse.dtx (C) Copyright 1999 Frank Mittelbach, Chris Rowley, -%% David Carlisle -%% (C) Copyright 2004-2008 Frank Mittelbach, -%% LaTeX3 Project -%% (C) Copyright 2009-2010 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 ``xbase 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{l3names} -\GetIdInfo$Id: xparse.dtx 2219 2011-04-08 21:07:45Z joseph $ - {Generic document command parser} -\ProvidesExplPackage - {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{expl3} -\prop_new:N \c_xparse_shorthands_prop -\prop_put:Nnn \c_xparse_shorthands_prop { o } { d[] } -\prop_put:Nnn \c_xparse_shorthands_prop { O } { D[] } -\prop_put:Nnn \c_xparse_shorthands_prop { s } { t* } -\tl_new:N \l_xparse_arg_tl -\tl_new:N \l_xparse_args_tl -\bool_new:N \l_xparse_environment_bool -\bool_new:N \l_xparse_error_bool -\tl_new:N \l_xparse_function_tl -\tl_new:N \l_xparse_last_arg_tl -\bool_new:N \l_xparse_long_bool -\int_new:N \l_xparse_m_args_int -\bool_new:N \l_xparse_m_only_bool -\int_new:N \l_xparse_mandatory_args_int -\bool_new:N \l_xparse_processor_bool -\int_new:N \l_xparse_processor_int -\tl_new:N \l_xparse_signature_tl -\tl_new:N \l_xparse_tmp_tl -\int_new:N \l_xparse_total_args_int -\cs_new_nopar:Npn \xparse_add_grabber_mandatory:N #1 { - \tl_put_right:Nx \l_xparse_signature_tl { - \exp_not:c { - xparse_grab_ #1 \bool_if:NT \l_xparse_long_bool { _long } :w - } - } - \bool_set_false:N \l_xparse_long_bool - \int_decr:N \l_xparse_mandatory_args_int -} -\cs_new_nopar:Npn \xparse_add_grabber_optional:N #1 { - \tl_put_right:Nx \l_xparse_signature_tl { - \exp_not:c { - xparse_grab_ #1 - \bool_if:NT \l_xparse_long_bool { _long } - \int_compare:nF { - \l_xparse_mandatory_args_int > \c_zero - } { _trailing } - :w - } - } - \bool_set_false:N \l_xparse_long_bool -} -\cs_new_nopar:cpn { xparse_add_type_+:w } { - \xparse_flush_m_args: - \bool_set_true:N \l_xparse_long_bool - \bool_set_false:N \l_xparse_m_only_bool - \int_decr:N \l_xparse_total_args_int - \xparse_prepare_signature:N -} -\cs_new:cpn { xparse_add_type_>:w } #1 { - \bool_set_true:N \l_xparse_processor_bool - \xparse_flush_m_args: - \int_decr:N \l_xparse_total_args_int - \tl_put_right:Nn \l_xparse_signature_tl { - \xparse_process_arg:n {#1} - } - \xparse_prepare_signature_aux:N -} -\cs_new:Npn \xparse_add_type_d:w #1#2 { - \xparse_add_type_D:w #1 #2 { \NoValue } -} -\cs_new:Npn \xparse_add_type_D:w #1#2#3 { - \xparse_flush_m_args: - \xparse_add_grabber_optional:N D - \tl_put_right:Nn \l_xparse_signature_tl { #1 #2 {#3} } - \xparse_prepare_signature:N -} -\cs_new_nopar:Npn \xparse_add_type_g:w { - \xparse_add_type_G:w { \NoValue } -} -\cs_new:Npn \xparse_add_type_G:w #1 { - \xparse_flush_m_args: - \xparse_add_grabber_optional:N G - \tl_put_right:Nn \l_xparse_signature_tl { {#1} } - \xparse_prepare_signature:N -} -\cs_new_nopar:Npn \xparse_add_type_l:w { - \xparse_flush_m_args: - \xparse_add_grabber_mandatory:N l - \xparse_prepare_signature:N -} -\cs_new_nopar:Npn \xparse_add_type_m:w { - \bool_if:nTF { - \l_xparse_long_bool || \l_xparse_processor_bool - } { - \xparse_flush_m_args: - \xparse_add_grabber_mandatory:N m - }{ - \int_incr:N \l_xparse_m_args_int - } - \xparse_prepare_signature:N -} -\cs_new:Npn \xparse_add_type_t:w #1 { - \xparse_flush_m_args: - \xparse_add_grabber_optional:N t - \tl_put_right:Nn \l_xparse_signature_tl { #1 } - \xparse_prepare_signature:N -} -\cs_new:Npn \xparse_add_type_u:w #1 { - \xparse_flush_m_args: - \xparse_add_grabber_mandatory:N u - \tl_put_right:Nn \l_xparse_signature_tl { {#1} } - \xparse_prepare_signature:N -} -\cs_new_nopar:Npn \xparse_check_and_add:N #1 { - \cs_if_free:cTF { xparse_add_type_ #1 :w } { - \msg_kernel_error:nnx { xparse } { unknown-argument-type } {#1} - \xparse_add_type_m:w - }{ - \use:c { xparse_add_type_ #1 :w } - } -} -\cs_new:Npn \xparse_count_mandatory:n #1 { - \int_zero:N \l_xparse_mandatory_args_int - \xparse_count_mandatory:N #1 \q_nil -} -\cs_new:Npn \xparse_count_mandatory:N #1 { - \quark_if_nil:NF #1 { - \prop_if_in:NnTF \c_xparse_shorthands_prop {#1} { - \prop_get:NnN \c_xparse_shorthands_prop {#1} \l_xparse_tmp_tl - \exp_last_unbraced:NV \xparse_count_mandatory:N \l_xparse_tmp_tl - }{ - \xparse_count_mandatory_aux:N #1 - } - } -} -\cs_new:Npn \xparse_count_mandatory_aux:N #1 { - \cs_if_free:cTF { xparse_count_type_ #1 :w } { - \xparse_count_type_m:w - }{ - \use:c { xparse_count_type_ #1 :w } - } -} -\cs_new:cpn { xparse_count_type_>:w } #1 { - \xparse_count_mandatory:N -} -\cs_new_nopar:cpn { xparse_count_type_+:w } { - \xparse_count_mandatory:N -} -\cs_new:Npn \xparse_count_type_d:w #1#2 { - \xparse_count_mandatory:N -} -\cs_new:Npn \xparse_count_type_D:w #1#2#3 { - \xparse_count_mandatory:N -} -\cs_new_nopar:Npn \xparse_count_type_g:w { - \xparse_count_mandatory:N -} -\cs_new:Npn \xparse_count_type_G:w #1 { - \xparse_count_mandatory:N -} -\cs_new_nopar:Npn \xparse_count_type_l:w { - \int_incr:N \l_xparse_mandatory_args_int - \xparse_count_mandatory:N -} -\cs_new_nopar:Npn \xparse_count_type_m:w { - \int_incr:N \l_xparse_mandatory_args_int - \xparse_count_mandatory:N -} -\cs_new:Npn \xparse_count_type_t:w #1 { - \xparse_count_mandatory:N -} -\cs_new:Npn \xparse_count_type_u:w #1 { - \int_incr:N \l_xparse_mandatory_args_int - \xparse_count_mandatory:N -} -\cs_new:Npn \xparse_declare_cmd:Nnn #1#2 { - \cs_if_exist:NTF #1 - { - \msg_kernel_warning:nnxx { xparse } { redefine-command } - { \token_to_str:N #1 } { \exp_not:n {#2} } - } - { - \msg_kernel_info:nnxx { xparse } { define-command } - { \token_to_str:N #1 } { \exp_not:n {#2} } - } - \xparse_declare_cmd_aux:Nnn #1 {#2} -} -\cs_new:Npn \xparse_declare_cmd_aux:Nnn #1#2#3 { - \cs_if_exist:cF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } - { \tl_new:c { l_xparse_ \token_to_str:N #1 _arg_spec_tl } } - \tl_set:cn { l_xparse_ \token_to_str:N #1 _arg_spec_tl } {#2} - \xparse_count_mandatory:n {#2} - \xparse_prepare_signature:n {#2} - \bool_if:NTF \l_xparse_m_only_bool { - \xparse_declare_cmd_all_m:Nn #1 {#3} - }{ - \xparse_declare_cmd_mixed:Nn #1 {#3} - } -} -\cs_generate_variant:Nn \xparse_declare_cmd_aux:Nnn { cnn } -\cs_new:Npn \xparse_declare_cmd_all_m:Nn #1#2 { - \cs_generate_from_arg_count:NNnn - #1 \cs_set_protected_nopar:Npn \l_xparse_total_args_int {#2} -} -\cs_new:Npn \xparse_declare_cmd_mixed:Nn #1#2 { - \group_begin: - \tex_escapechar:D 92 \scan_stop: - \tl_set:Nx \l_xparse_function_tl { \token_to_str:N #1 } - \exp_args:NNNo \group_end: - \tl_set:Nn \l_xparse_function_tl { \l_xparse_function_tl } - \cs_set_protected_nopar:Npx #1 { - \exp_not:n { - \int_zero:N \l_xparse_processor_int - \tl_set:Nn \l_xparse_args_tl - } { \exp_not:c { \l_xparse_function_tl } } - \exp_not:V \l_xparse_signature_tl - \exp_not:N \l_xparse_args_tl - } - \cs_generate_from_arg_count:cNnn - { \token_to_str:N #1 } \cs_set:Npn \l_xparse_total_args_int {#2} -} -\cs_new:Npn \xparse_declare_cmd_implementation:nNn #1#2#3 { - \cs_generate_from_arg_count:cNnn { implementation_ #1 :w } - \cs_set:Npn {#2} {#3} -} -\cs_new:Npn \xparse_declare_cmd_interface:Nnn #1#2#3 { - \xparse_prepare_signature:n {#3} - \bool_if:NTF \l_xparse_m_only_bool { - \xparse_declare_cmd_interface_all_m:Nn #1 {#2} - }{ - \xparse_declare_cmd_interface_mixed:Nn #1 {#2} - } - \cs_generate_from_arg_count:cNnn { implementation_ #2 :w } - \cs_set:Npn \l_xparse_total_args_int { ``#2'' } -} -\cs_new:Npn \xparse_declare_cmd_interface_all_m:Nn #1#2 { - \cs_generate_from_arg_count:NNnn - #1 \cs_set_protected_nopar:Npn \l_xparse_total_args_int - { \use:c { implementation_ #2 :w } } -} -\cs_new:Npn \xparse_declare_cmd_interface_mixed:Nn #1#2 { - \cs_set_protected_nopar:Npx #1 { - \exp_not:n { - \int_zero:N \l_xparse_processor_int - \tl_set:Nn \l_xparse_args_tl - } { \exp_not:c { \token_to_str:N #1 } } - \exp_not:V \l_xparse_signature_tl - \exp_not:N \l_xparse_args_tl - } - \cs_generate_from_arg_count:cNnn - { \token_to_str:N #1 } \cs_set:Npn \l_xparse_total_args_int - { \use:c { implementation_ #2 :w } } -} -\cs_new:Npn \xparse_declare_env:nnnn #1#2#3#4 { - \bool_set_true:N \l_xparse_environment_bool - \cs_if_exist:cTF {#1} - { - \msg_kernel_warning:nnxx { xparse } { redefine-environment } - {#1} { \exp_not:n {#2} } - } - { - \msg_kernel_info:nnxx { xparse } { define-environment } - {#1} { \exp_not:n {#2} } - } - \xparse_declare_cmd_aux:cnn { environment_begin_ #1 :w } {#2} { - \group_begin: - \cs_set_protected_nopar:cpx { environment_end_ #1 :w } - { - \exp_not:c { environment_end_ #1 _aux:N } - \exp_not:V \l_xparse_args_tl - \group_end: - } - #3 - } - \cs_set_protected_nopar:cpx { environment_end_ #1 : } - { \exp_not:c { environment_end_ #1 :w } } - \bool_set_false:N \l_xparse_environment_bool - \cs_set_nopar:cpx { environment_end_ #1 _aux:N } ##1 { - \exp_not:c { environment_end_ #1 _aux :w } - } - \cs_generate_from_arg_count:cNnn - { environment_end_ #1 _aux :w } \cs_set:Npn - \l_xparse_total_args_int {#4} - \cs_set_eq:cc {#1} { environment_begin_ #1 :w } - \cs_set_eq:cc { end #1 } { environment_end_ #1 : } -} -\cs_new_nopar:Npn \xparse_flush_m_args: { - \cs_if_exist:cT { - xparse_grab_m_ \int_use:N \l_xparse_m_args_int :w - } { - \tl_put_right:Nx \l_xparse_signature_tl { - \exp_not:c { xparse_grab_m_ \int_use:N \l_xparse_m_args_int :w } - } - \int_set:Nn \l_xparse_mandatory_args_int { - \l_xparse_mandatory_args_int - \l_xparse_m_args_int - } - } - \int_zero:N \l_xparse_m_args_int - \bool_set_false:N \l_xparse_m_only_bool -} -\prg_new_conditional:Nnn \xparse_if_no_value:n { TF,T,F } { - \str_if_eq:nnTF {#1} { \NoValue } { - \prg_return_true: - }{ - \prg_return_false: - } -} -\cs_new:Npn \xparse_prepare_signature:n #1 { - \bool_set_false:N \l_xparse_long_bool - \int_zero:N \l_xparse_m_args_int - \bool_if:NTF \l_xparse_environment_bool { - \bool_set_false:N \l_xparse_m_only_bool - }{ - \bool_set_true:N \l_xparse_m_only_bool - } - \bool_set_false:N \l_xparse_processor_bool - \tl_clear:N \l_xparse_signature_tl - \int_zero:N \l_xparse_total_args_int - \xparse_prepare_signature:N #1 \q_nil -} -\cs_new:Npn \xparse_prepare_signature:N #1 { - \bool_set_false:N \l_xparse_processor_bool - \xparse_prepare_signature_aux:N #1 -} -\cs_new:Npn \xparse_prepare_signature_aux:N #1 { - \quark_if_nil:NTF #1 { - \bool_if:NF \l_xparse_m_only_bool { - \xparse_flush_m_args: - } - }{ - \prop_if_in:NnTF \c_xparse_shorthands_prop {#1} { - \prop_get:NnN \c_xparse_shorthands_prop {#1} \l_xparse_tmp_tl - \exp_last_unbraced:NV \xparse_prepare_signature:N \l_xparse_tmp_tl - }{ - \int_incr:N \l_xparse_total_args_int - \xparse_check_and_add:N #1 - } - } -} -\cs_new:Npn \xparse_process_arg:n #1 { - \int_incr:N \l_xparse_processor_int - \cs_set:cpn { - xparse_processor_ \int_use:N \l_xparse_processor_int :n - } ##1 - { #1 {##1} } -} -\cs_new:Npn \xparse_add_arg:n #1 { - \int_compare:nTF { \l_xparse_processor_int = \c_zero } { - \tl_put_right:Nn \l_xparse_args_tl { {#1} } - }{ - \xparse_if_no_value:nTF {#1} { - \int_zero:N \l_xparse_processor_int - \tl_put_right:Nn \l_xparse_args_tl { {#1} } - }{ - \xparse_add_arg_aux:n {#1} - } - } -} -\cs_generate_variant:Nn \xparse_add_arg:n { V } -\cs_new:Npn \xparse_add_arg_aux:n #1 { - \tl_set_eq:NN \ProcessedArgument \l_xparse_arg_tl - \use:c { xparse_processor_ \int_use:N \l_xparse_processor_int :n } - {#1} - \int_decr:N \l_xparse_processor_int - \int_compare:nTF { \l_xparse_processor_int = \c_zero } { - \tl_put_right:Nx \l_xparse_args_tl { - { \exp_not:V \ProcessedArgument } - } - }{ - \xparse_add_arg_aux:V \ProcessedArgument - } -} -\cs_generate_variant:Nn \xparse_add_arg_aux:n { V } -\cs_new:Npn \xparse_grab_arg:w { } -\cs_new:Npn \xparse_grab_arg_aux_i:w { } -\cs_new:Npn \xparse_grab_arg_aux_ii:w { } -\cs_new:Npn \xparse_grab_D:w #1#2#3#4 \l_xparse_args_tl { - \xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set_nopar:Npn - { _ignore_spaces } -} -\cs_new:Npn \xparse_grab_D_long:w #1#2#3#4 \l_xparse_args_tl { - \xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set:Npn - { _ignore_spaces } -} -\cs_new:Npn \xparse_grab_D_trailing:w #1#2#3#4 \l_xparse_args_tl { - \xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set_nopar:Npn { } -} -\cs_new:Npn \xparse_grab_D_long_trailing:w #1#2#3#4 - \l_xparse_args_tl { - \xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set:Npn { } -} -\cs_new:Npn \xparse_grab_D_aux:NNnnNn #1#2#3#4#5#6 { - #5 \xparse_grab_arg:w #1 { - \peek_meaning:NTF \c_group_begin_token { - \xparse_grab_arg_aux_i:w - }{ - \xparse_grab_arg_aux_ii:w - } - } - #5 \xparse_grab_arg_aux_i:w ##1 { - \peek_charcode:NTF #2 { - \xparse_grab_arg_aux_ii:w { {##1} } - }{ - \xparse_grab_arg_aux_ii:w {##1} - } - } - #5 \xparse_grab_arg_aux_ii:w ##1 #2 { - \tl_if_in:nnTF {##1} {#1} { - \xparse_grab_D_nested:NNnnN #1 #2 {##1} {#4} #5 - }{ - \xparse_add_arg:n {##1} - #4 \l_xparse_args_tl - } - } - \use:c { peek_charcode #6 :NTF } #1 { - \xparse_grab_arg:w - }{ - \xparse_add_arg:n {#3} - #4 \l_xparse_args_tl - } -} -\tl_new:N \_l_xparse_nesting_a_tl -\tl_new:N \_l_xparse_nesting_b_tl -\quark_new:N \q_xparse -\cs_new_protected:Npn \xparse_grab_D_nested:NNnnN #1#2#3#4#5 { - \tl_clear:N \_l_xparse_nesting_a_tl - \tl_clear:N \_l_xparse_nesting_b_tl - #5 \xparse_grab_arg:w ##1 #1 ##2 \q_xparse ##3 #2 - { - \tl_put_right:Nn \_l_xparse_nesting_a_tl { ##1 #1 } - \tl_put_right:Nn \_l_xparse_nesting_b_tl { #2 ##3 } - \tl_if_in:nnTF {##2} {#1} - { \xparse_grab_arg:w ##2 \q_xparse } - { - \tl_put_right:Nn \_l_xparse_nesting_a_tl {##2} - \tl_if_in:NnTF \_l_xparse_nesting_b_tl {#1} - { - \tl_set_eq:NN \l_xparse_tmp_tl \_l_xparse_nesting_b_tl - \tl_clear:N \_l_xparse_nesting_b_tl - \exp_last_unbraced:NV \xparse_grab_arg:w - \l_xparse_tmp_tl \q_xparse - } - { - \tl_put_right:NV \_l_xparse_nesting_a_tl - \_l_xparse_nesting_b_tl - \xparse_add_arg:V \_l_xparse_nesting_a_tl - #4 \l_xparse_args_tl - } - } - } - \xparse_grab_arg:w #3 \q_xparse -} -\cs_new:Npn \xparse_grab_G:w #1#2 \l_xparse_args_tl { - \xparse_grab_G_aux:nnNn {#1} {#2} \cs_set_nopar:Npn { _ignore_spaces } -} -\cs_new:Npn \xparse_grab_G_long:w #1#2 \l_xparse_args_tl { - \xparse_grab_G_aux:nnNn {#1} {#2} \cs_set:Npn { _ignore_spaces } -} -\cs_new:Npn \xparse_grab_G_trailing:w #1#2 \l_xparse_args_tl { - \xparse_grab_G_aux:nnNn {#1} {#2} \cs_set_nopar:Npn { } -} -\cs_new:Npn \xparse_grab_G_long_trailing:w #1#2 \l_xparse_args_tl { - \xparse_grab_G_aux:nnNn {#1} {#2} \cs_set:Npn { } -} -\cs_set:Npn \xparse_grab_G_aux:nnNn #1#2#3#4 { - #3 \xparse_grab_arg:w ##1 { - \xparse_add_arg:n {##1} - #2 \l_xparse_args_tl - } - \use:c { peek_meaning #4 :NTF } \c_group_begin_token { - \xparse_grab_arg:w - }{ - \xparse_add_arg:n {#1} - #2 \l_xparse_args_tl - } -} -\cs_new:Npn \xparse_grab_l:w #1 \l_xparse_args_tl { - \xparse_grab_l_aux:nN {#1} \cs_set_nopar:Npn -} -\cs_new:Npn \xparse_grab_l_long:w #1 \l_xparse_args_tl { - \xparse_grab_l_aux:nN {#1} \cs_set:Npn -} -\cs_new:Npn \xparse_grab_l_aux:nN #1#2 { - #2 \xparse_grab_arg:w ##1## { - \xparse_add_arg:n {##1} - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:Npn \xparse_grab_m:w #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1 { - \xparse_add_arg:n {##1} - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:Npn \xparse_grab_m_long:w #1 \l_xparse_args_tl { - \cs_set:Npn \xparse_grab_arg:w ##1 { - \xparse_add_arg:n {##1} - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_1:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1 { - \tl_put_right:Nn \l_xparse_args_tl { {##1} } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_2:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1##2 { - \tl_put_right:Nn \l_xparse_args_tl { {##1} {##2} } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_3:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3 { - \tl_put_right:Nn \l_xparse_args_tl { {##1} {##2} {##3} } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_4:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4 { - \tl_put_right:Nn \l_xparse_args_tl { {##1} {##2} {##3} {##4} } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_5:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5 { - \tl_put_right:Nn \l_xparse_args_tl { - {##1} {##2} {##3} {##4} {##5} - } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_6:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5##6 { - \tl_put_right:Nn \l_xparse_args_tl { - {##1} {##2} {##3} {##4} {##5} {##6} - } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_7:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5##6##7 { - \tl_put_right:Nn \l_xparse_args_tl { - {##1} {##2} {##3} {##4} {##5} {##6} {##7} - } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:cpn { xparse_grab_m_8:w } #1 \l_xparse_args_tl { - \cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5##6##7##8 { - \tl_put_right:Nn \l_xparse_args_tl { - {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} - } - #1 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:Npn \xparse_grab_t:w #1#2 \l_xparse_args_tl { - \xparse_grab_t_aux:NnNn #1 {#2} \cs_set_nopar:Npn { _ignore_spaces } -} -\cs_new:Npn \xparse_grab_t_long:w #1#2 \l_xparse_args_tl { - \xparse_grab_t_aux:NnNn #1 {#2} \cs_set:Npn { _ignore_spaces } -} -\cs_new:Npn \xparse_grab_t_trailing:w #1#2 \l_xparse_args_tl { - \xparse_grab_t_aux:NnNn #1 {#2} \cs_set_nopar:Npn { } -} -\cs_new:Npn \xparse_grab_t_long_trailing:w #1#2 \l_xparse_args_tl { - \xparse_grab_t_aux:NnNn #1 {#2} \cs_set:Npn { } -} -\cs_new:Npn \xparse_grab_t_aux:NnNn #1#2#3#4 { - #3 \xparse_grab_arg:w { - \use:c { peek_charcode_remove #4 :NTF } #1 { - \xparse_add_arg:n { \BooleanTrue } - #2 \l_xparse_args_tl - }{ - \xparse_add_arg:n { \BooleanFalse } - #2 \l_xparse_args_tl - } - } - \xparse_grab_arg:w -} -\cs_new:Npn \xparse_grab_u:w #1#2 \l_xparse_args_tl { - \xparse_grab_u_aux:NnN {#1} {#2} \cs_set_nopar:Npn -} -\cs_new:Npn \xparse_grab_u_long:w #1#2 \l_xparse_args_tl { - \xparse_grab_u_aux:NnN {#1} {#2} \cs_set:Npn -} -\cs_new:Npn \xparse_grab_u_aux:NnN #1#2#3 { - #3 \xparse_grab_arg:w ##1 #1 { - \xparse_add_arg:n {##1} - #2 \l_xparse_args_tl - } - \xparse_grab_arg:w -} -\cs_new:Npn \xparse_process_to_str:n #1 { - \tl_set:Nx \ProcessedArgument { - \tl_to_str:n {#1} - } -} -\cs_new_protected:Npn \_xparse_bool_reverse:N #1 { - \bool_if:NTF #1 - { \tl_set:Nn \ProcessedArgument { \c_false_bool } } - { \tl_set:Nn \ProcessedArgument { \c_true_bool } } -} -\tl_new:N \_l_xparse_split_argument_tl -\group_begin: - \char_make_active:N \@ - \cs_gset_protected:Npn \_xparse_split_argument:nnn #1#2#3 - { - \tl_set:Nn \_l_xparse_split_argument_tl {#3} - \group_begin: - \char_set_lccode:nn { `\@ } { `#2} - \tl_to_lowercase:n - { - \group_end: - \tl_replace_all_in:Nnn \_l_xparse_split_argument_tl { @ } {#2} - } - \cs_set_protected:Npn \_xparse_split_argument_aux_i:w - ##1 \q_mark ##2 #2 ##3 \q_stop - { - \tl_put_right:Nn \ProcessedArgument { {##2} } - ##1 \q_mark ##3 \q_stop - } - \cs_set_protected:Npn \_xparse_split_argument_aux_iii:w - ##1 #2 ##2 \q_stop - { - \IfNoValueF {##1} - { - \msg_kernel_error:nnxxx { xparse } { split-excess-tokens } - { \exp_not:n {#2} } {#1} { \exp_not:n {#3} } - } - } - \tl_set:Nx \l_xparse_tmp_tl - { - \prg_replicate:nn { #1 + 1 } - { \_xparse_split_argument_aux_i:w } - \_xparse_split_argument_aux_ii:w - \exp_not:N \q_mark - \exp_not:V \_l_xparse_split_argument_tl - \prg_replicate:nn {#1} { \exp_not:n {#2} \NoValue } - \exp_not:n { #2 \q_stop } - } - \l_xparse_tmp_tl - } -\group_end: -\cs_set_protected:Npn \_xparse_split_argument_aux_i:w { } -\cs_set_protected:Npn \_xparse_split_argument_aux_ii:w - #1 \q_mark #2 \q_stop - { - \tl_if_empty:nF {#2} - { \_xparse_split_argument_aux_iii:w #2 \q_stop } - } -\cs_set_protected:Npn \_xparse_split_argument_aux_iii:w { } -\tl_new:N \_l_xparse_split_list_tl -\group_begin: - \char_make_active:N \@ - \cs_gset_protected:Npn \_xparse_split_list:nn #1#2 - { - \tl_set:Nn \_l_xparse_split_list_tl {#2} - \group_begin: - \char_set_lccode:nn { `\@ } { `#1 } - \tl_to_lowercase:n - { - \group_end: - \tl_replace_all_in:Nnn \_l_xparse_split_list_tl { @ } {#1} - } - \cs_set:Npn \_xparse_split_list_aux:w ##1 #1 - { - \quark_if_recursion_tail_stop:n {##1} - \tl_put_right:Nn \ProcessedArgument { {##1} } - \_xparse_split_list_aux:w - } - \tl_if_empty:NTF \_l_xparse_split_list_tl - { \tl_set:Nn \ProcessedArgument { { } } } - { - \tl_clear:N \ProcessedArgument - \exp_last_unbraced:NV \_xparse_split_list_aux:w - \_l_xparse_split_list_tl #1 - \q_recursion_tail #1 \q_recursion_stop - } - } -\group_end: -\cs_set:Npn \_xparse_split_list_aux:w { } -\cs_new:Npn \xparse_exp_add_type_d:w #1#2 { - \xparse_exp_add_type_D:w #1 #2 { \NoValue } -} -\cs_new:Npn \xparse_exp_add_type_D:w #1#2#3 { - \tl_set:Nx \l_xparse_tmp_tl { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_use:N \l_xparse_total_args_int - } - \xparse_exp_set:cpx { \l_xparse_tmp_tl } ##1 \q_xparse ##2 { - \exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 { - \exp_not:c { \l_xparse_tmp_tl aux } - ##1 \exp_not:N \q_xparse - }{ - \exp_not:c { \l_xparse_tmp_tl aux } - ##1 \exp_not:N \q_xparse #3 #2 {##2} - } - } - \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 - \int_eval:n { \l_xparse_total_args_int + 1 } - } ##1 {##2} \exp_not:N \q_xparse - } - \xparse_exp_prepare_function:N -} -\cs_new_nopar:Npn \xparse_exp_add_type_l:w { - \xparse_exp_set:cpx { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse ##2## { - \exp_not:c { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_eval:n { \l_xparse_total_args_int + 1 } - } - ##1 {##2} \exp_not:N \q_xparse - } - \xparse_exp_prepare_function:N -} -\cs_new_nopar:Npn \xparse_exp_add_type_m:w { - \int_incr:N \l_xparse_m_args_int - \xparse_exp_set:cpx { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse ##2 { - \exp_not:c { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_eval:n { \l_xparse_total_args_int + 1 } - } - ##1 {##2} \exp_not:N \q_xparse - } - \xparse_exp_prepare_function:N -} -\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 - \int_eval:n { \l_xparse_total_args_int + 1 } - } - \xparse_exp_set:cpx { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse ##2 { - \exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 { - \exp_not:c { \l_xparse_tmp_tl } - ##1 \exp_not:n { { \BooleanTrue } \q_xparse } - }{ - \exp_not:c { \l_xparse_tmp_tl } - ##1 \exp_not:n { { \BooleanFalse } \q_xparse {##2} } - } - } - \xparse_exp_prepare_function:N -} -\cs_new:Npn \xparse_exp_add_type_u:w #1 { - \xparse_exp_set:cpx { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse ##2 #1 { - \exp_not:c { - \exp_after:wN \token_to_str:N \l_xparse_function_tl - \int_eval:n { \l_xparse_total_args_int + 1 } - } - ##1 {##2} \exp_not:N \q_xparse - } - \xparse_exp_prepare_function:N -} -\cs_new_nopar:Npn \xparse_exp_check_and_add:N #1 { - \cs_if_free:cTF { xparse_exp_add_type_ #1 :w } { - \msg_kernel_error:nnx { xparse } { unknown-argument-type } {#1} - \tl_set:Nn \l_xparse_last_arg_tl { m } - \xparse_exp_add_type_m:w - }{ - \tl_set:Nn \l_xparse_last_arg_tl {#1} - \use:c { xparse_exp_add_type_ #1 :w } - } -} -\cs_new:Npn \xparse_exp_declare_cmd:Nnn #1#2#3 { - \cs_if_exist:NTF #1 - { - \msg_kernel_warning:nnxx { xparse } { redefine-command } - { \token_to_str:N #1 } { \exp_not:n {#2} } - } - { - \msg_kernel_info:nnxx { xparse } { define-command } - { \token_to_str:N #1 } { \exp_not:n {#2} } - } - \group_begin: - \tex_escapechar:D 92 \scan_stop: - \tl_set:Nx \l_xparse_function_tl { \token_to_str:N #1} - \exp_args:NNNo \group_end: - \tl_set:Nn \l_xparse_function_tl { \l_xparse_function_tl } - \xparse_exp_prepare_function:n {#2} - \int_compare:nTF { - \l_xparse_total_args_int = \l_xparse_m_args_int - } { - \xparse_exp_declare_cmd_all_m:Nn #1 {#3} - }{ - \xparse_exp_declare_cmd_mixed:Nn #1 {#3} - } -} -\cs_new:Npn \xparse_exp_declare_cmd_all_m:Nn #1#2 { - \bool_if:NTF \l_xparse_long_bool { - \cs_generate_from_arg_count:NNnn - #1 \cs_set:Npn \l_xparse_total_args_int {#2} - }{ - \cs_generate_from_arg_count:NNnn - #1 \cs_set_nopar:Npn \l_xparse_total_args_int {#2} - } -} -\cs_new:Npn \xparse_exp_declare_cmd_mixed:Nn #1#2 { - \exp_args:NnV \tl_if_in:nnTF { l m u } \l_xparse_last_arg_tl { - \xparse_exp_declare_cmd_mixed_aux:Nn #1 {#2} - }{ - \msg_kernel_error:nn { xparse } { expandable-ending-optional } - } -} -\cs_new:Npn \xparse_exp_declare_cmd_mixed_aux:Nn #1#2 { - \cs_set_nopar:Npx #1 { - \exp_not:c { \token_to_str:N #1 1 } x \exp_not:N \q_xparse - } - \cs_set_nopar:cpx { - \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 - } - \cs_generate_from_arg_count:cNnn - { \token_to_str:N #1 } \cs_set:Npn \l_xparse_total_args_int {#2} -} -\cs_new:Npn \xparse_exp_prepare_function:n #1 { - \bool_set_false:N \l_xparse_error_bool - \tl_if_in:nnT {#1} { > } { - \msg_kernel_error:nnx { xparse } { processor-in-expandable } {#1} - \bool_set_true:N \l_xparse_error_bool - } - \tl_if_in:nnT {#1} { g } { - \msg_kernel_error:nnx { xparse } { grouped-in-expandable } - { g } {#1} - \bool_set_true:N \l_xparse_error_bool - } - \tl_if_in:nnT {#1} { G } { - \msg_kernel_error:nnx { xparse } { grouped-in-expandable } - { G } {#1} - \bool_set_true:N \l_xparse_error_bool - } - \bool_if:NF \l_xparse_error_bool { - \xparse_exp_prepare_function_aux:n {#1} - } -} -\cs_new:Npn \xparse_exp_prepare_function_aux:n #1 { - \cs_set_eq:NN \xparse_prepare_next:w \xparse_exp_prepare_function:N - \cs_set_eq:NN \xparse_exp_set:cpx \cs_set_nopar:cpx - \bool_set_false:N \l_xparse_long_bool - \int_zero:N \l_xparse_m_args_int - \int_zero:N \l_xparse_total_args_int - \tl_if_in:nnT {#1} { + } { - \bool_set_true:N \l_xparse_long_bool - \cs_set_eq:NN \xparse_exp_set:cpx \cs_set:cpx - } - \xparse_exp_prepare_function:N #1 \q_nil -} -\cs_new:Npn \xparse_exp_prepare_function:N #1 { - \bool_if:NTF \l_xparse_long_bool { - \xparse_exp_prepare_function_long:N #1 - }{ - \xparse_exp_prepare_function_short:N #1 - } -} -\cs_new:Npn \xparse_exp_prepare_function_long:N #1 { - \quark_if_nil:NF #1 { - \str_if_eq:nnTF {#1} { + } { - \xparse_exp_prepare_function_short:N - }{ - \msg_kernel_error:nn { xparse } { expandable-inconsistent-long } - \xparse_exp_prepare_function_short:N #1 - } - } -} -\cs_new:Npn \xparse_exp_prepare_function_short:N #1 { - \quark_if_nil:NF #1 { - \prop_if_in:NnTF \c_xparse_shorthands_prop {#1} { - \prop_get:NnN \c_xparse_shorthands_prop {#1} \l_xparse_tmp_tl - \bool_if:NT \l_xparse_long_bool { - \tl_put_left:Nn \l_xparse_tmp_tl { + } - } - \exp_last_unbraced:NV \xparse_exp_prepare_function:N - \l_xparse_tmp_tl - }{ - \int_incr:N \l_xparse_total_args_int - \xparse_exp_check_and_add:N #1 - } - } -} -\cs_new_eq:NN \xparse_exp_set:cpx \cs_set_nopar:cpx -\cs_new_protected:Npn \xparse_get_arg_spec:N #1 { - \cs_if_exist:cTF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } - { - \tl_set_eq:Nc \ArgumentSpecification - { l_xparse_ \token_to_str:N #1 _arg_spec_tl } - } - { - \msg_kernel_error:nnx { xparse } { unknown-document-command } - { \token_to_str:N #1 } - } -} -\cs_new_protected:Npn \xparse_get_arg_spec:n #1 { - \cs_if_exist:cTF { l_xparse_ #1 _arg_spec_tl } - { - \tl_set_eq:Nc \ArgumentSpecification { l_xparse_ #1 _arg_spec_tl } - } - { - \msg_kernel_error:nnx { xparse } - { unknown-document-environment } {#1} - } -} -\tl_new:N \ArgumentSpecification -\cs_new_protected:Npn \xparse_show_arg_spec:N #1 { - \cs_if_exist:cTF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } - { - \tl_set_eq:Nc \ArgumentSpecification - { l_xparse_ \token_to_str:N #1 _arg_spec_tl } - \tl_show:N \ArgumentSpecification - } - { - \msg_kernel_error:nnx { xparse } { unknown-document-command } - { \token_to_str:N #1 } - } -} -\cs_new_protected:Npn \xparse_show_arg_spec:n #1 { - \cs_if_exist:cTF { l_xparse_ #1 _arg_spec_tl } - { - \tl_set_eq:Nc \ArgumentSpecification { l_xparse_ #1 _arg_spec_tl } - \tl_show:N \ArgumentSpecification - } - { - \msg_kernel_error:nnx { xparse } - { unknown-document-environment } {#1} - } -} -\msg_kernel_new:nnnn { xparse } { command-already-defined } - { Command~'#1'~already~defined! } - { - You~have~used~\token_to_str:N \NewDocumentCommand \\ - with~a~command~that~already~has~a~definition.\\ - Perhaps~you~meant~\token_to_str:N \RenewDocumentCommand. - } -\msg_kernel_new:nnnn { xparse } { command-not-yet-defined } - { Command ~'#1'~not~yet~defined! } - { - You~have~used~\token_to_str:N \RenewDocumentCommand \\ - with~a~command~that~was~never~defined.\\ - Perhaps~you~meant~\token_to_str:N \NewDocumentCommand. - } -\msg_kernel_new:nnnn { xparse } { environment-already-defined } - { Environment~'#1'~already~defined! } - { - You~have~used~\token_to_str:N \NewDocumentEnvironment \\ - with~a~command~that~already~has~a~definition.\\ - Perhaps~you~meant~\token_to_str:N \RenewDocumentEnvironment. - } -\msg_kernel_new:nnnn { xparse } { environment-not-yet-defined } - {Environment~'#1'~not~yet~defined! } - { - You~have~used~\token_to_str:N \RenewDocumentEnvironment \\ - with~a command~that~was~never~defined.\\ - Perhaps~you~meant~\token_to_str:N \NewDocumentEnvironment. - } -\msg_kernel_new:nnnn { xparse } { expandable-ending-optional } - { - Signature~for~expandable~command~ends~with \\ - optional~argument~\msg_line_context:. - } - { - Expandable~commands~must~have~a~final~mandatory~argument \\ - (or~no arguments~at all).~You~cannot~have~a~terminal~optional \\ - argument~with~expandable~commands. - } -\msg_kernel_new:nnnn { xparse } { expandable-inconsistent-long } - { - Inconsistent~handling~of~long~arguments~for \\ - expandable~command~\msg_line_context:. - } - { - The~arguments~for~an~expandable~command~must~either~all~be \\ - short~or~all~be~long.~You~have~tried~to~mix~the~two~types. - } -\msg_kernel_new:nnnn { xparse } { grouped-in-expandable } - {% - Argument~specifier~'#1'~forbidden~in~expandable~commands~ - \msg_line_context:. - } - { - Argument~specification~'#2'~contains~the~optional~grouped~ - argument~#1':\\ - this~is only~supported~for~standard~robust~functions. - } -\msg_kernel_new:nnnn { xparse } { processor-in-expandable } - { - Argument~processors~cannot~be~used \\ - with~expandable~functions~\msg_line_context:. - } - { - Argument~specification~'#1'~contains~a~processor~function:\\ - this~is~only~supported~for~standard~robust~functions. - } -\msg_kernel_new:nnnn { xparse } { split-excess-tokens } - { Too~many~'#1'~tokens~when~trying~to~split~argument. } - { - LaTeX~was~asked~to~split~the~input~'#3'\\ - at~each~occurrence~of~the~token~'#1',~up~to~a~maximum~of~#2~tokens.\\ - There~were~too~many~'#1'~tokens. - } -\msg_kernel_new:nnnn { xparse } { unknown-argument-type } - { Unknown~argument~type~'#1'~replaced~by~'m'.~Fingers~crossed~... } - { - The~letter~#1'~does~not~specify~a~known~argument~type.\\ - I'm~assuming~you~want~a~standard~mandatory~argument~(type~'m'). - } -\msg_kernel_new:nnnn { xparse } { unknown-document-command } - { Unknown~document~command~'#1'. } - { - You~have~asked~for~the~argument~specification~for~a~command~'#1',~ - but~this~is~not~a~document~command. - } -\msg_kernel_new:nnnn { xparse } { unknown-document-environment } - { Unknown~document~environment~'#1'. } - { - You~have~asked~for~the~argument~specification~for~a~command~'#1',~ - but~this~is~not~a~document~environment. - } -\msg_kernel_new:nnn { xparse } { define-command } - { - Defining~document~command~#1\\ - with~arg.~spec.~'#2'~\msg_line_context:. - } -\msg_kernel_new:nnn { xparse } { define-environment } - { - Defining~document~environment~'#1'\\ - with~arg.~spec.~'#2'~\msg_line_context:. - } -\msg_kernel_new:nnn { xparse } { redefine-command } - { - Redefining~document~command~#1\\ - with~arg.~spec.~'#2'~\msg_line_context:. - } -\msg_kernel_new:nnn { xparse } { redefine-environment } - { - Redefining~document~environment~'#1'\\ - with~arg.~spec.~'#2'~\msg_line_context:. - } -\cs_new_eq:NN \BooleanFalse \c_false_bool -\cs_new_eq:NN \BooleanTrue \c_true_bool -\cs_new_protected:Npn \DeclareDocumentCommand #1#2#3 { - \xparse_declare_cmd:Nnn #1 {#2} {#3} -} -\cs_new_protected:Npn \NewDocumentCommand #1#2#3 { - \cs_if_exist:NTF #1 { - \msg_kernel_error:nnx { xparse } { command-already-defined } - { \token_to_str:N #1 } - }{ - \xparse_declare_cmd:Nnn #1 {#2} {#3} - } -} -\cs_new_protected:Npn \RenewDocumentCommand #1#2#3 { - \cs_if_exist:NTF #1 { - \xparse_declare_cmd_aux:Nnn #1 {#2} {#3} - \msg_kernel_info:nnxx { xparse } { redefine-command } - { \token_to_str:N #1 } { \exp_not:n {#2} } - }{ - \msg_kernel_error:nnx { xparse } { command-not-yet-defined } - { \token_to_str:N #1 } - } -} -\cs_new_protected:Npn \ProvideDocumentCommand #1#2#3 { - \cs_if_exist:NF #1 { - \xparse_declare_cmd:Nnn #1 {#2} {#3} - } -} -\cs_new_protected:Npn \DeclareDocumentCommandImplementation #1#2#3 { - \xparse_declare_cmd_implementation:nNn {#1} #2 {#3} -} -\cs_new_protected:Npn \DeclareDocumentCommandInterface #1#2#3 { - \xparse_declare_cmd_interface:Nnn #1 {#2} {#3} -} -\cs_new_protected:Npn \DeclareDocumentEnvironment #1#2#3#4 { - \xparse_declare_env:nnnn {#1} {#2} {#3} {#4} -} -\cs_new_protected:Npn \NewDocumentEnvironment #1#2#3#4 { - \cs_if_exist:cTF {#1} { - \msg_kernel_error:nnx { xparse } - { environment-already-defined } {#1} - }{ - \xparse_declare_env:nnnn {#1} {#2} {#3} {#4} - } -} -\cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4 { - \cs_if_exist:cTF {#1} { - \xparse_declare_env:nnnn {#1} {#2} {#3} {#4} - }{ - \msg_kernel_error:nnx { xparse } - { environment-not-yet-defined } {#1} - } -} -\cs_new_protected:Npn \ProvideDocumentEnvironment #1#2#3#4 { - \cs_if_exist:cF { #1 } { - \xparse_declare_env:nnnn {#1} {#2} {#3} {#4} - } -} -\cs_new_protected:Npn \DeclareExpandableDocumentCommand #1#2#3 { - \xparse_exp_declare_cmd:Nnn #1 {#2} {#3} -} -\cs_new_eq:NN \IfBooleanTF \bool_if:NTF -\cs_new_eq:NN \IfBooleanT \bool_if:NT -\cs_new_eq:NN \IfBooleanF \bool_if:NF -\cs_new_eq:NN \IfNoValueF \xparse_if_no_value:nF -\cs_new_eq:NN \IfNoValueT \xparse_if_no_value:nT -\cs_new_eq:NN \IfNoValueTF \xparse_if_no_value:nTF -\cs_set:Npn \IfValueF { \xparse_if_no_value:nT } -\cs_set:Npn \IfValueT { \xparse_if_no_value:nF } -\cs_set:Npn \IfValueTF #1#2#3 { - \xparse_if_no_value:nTF {#1} {#3} {#2} -} -\cs_new_protected:Npn \NoValue { -NoValue- } -\cs_new:Npn \ProcessedArgument { } -\cs_new_eq:NN \ReverseBoolean \_xparse_bool_reverse:N -\cs_new_eq:NN \SplitArgument \_xparse_split_argument:nnn -\cs_new_eq:NN \SplitList \_xparse_split_list:nn -\cs_new_eq:NN \GetDocumentCommandArgSpec \xparse_get_arg_spec:N -\cs_new_eq:NN \GetDocumentEnvironmmentArgSpec \xparse_get_arg_spec:n -\cs_new_eq:NN \ShowDocumentCommandArgSpec \xparse_show_arg_spec:N -\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \xparse_show_arg_spec:n -\endinput -%% -%% End of file `xparse.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty deleted file mode 100644 index 381a0ad19a6..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty +++ /dev/null @@ -1,1245 +0,0 @@ -%% -%% This is file `xtemplate.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% xtemplate.dtx (with options: `package') -%% -%% (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 xbase 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: xtemplate.dtx (C) Copyright 1999-2001 David Carlisle, Frank Mittelbach -%% (C) Copyright 2004-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 -%%1 -%% This file is part of the ``xbase 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{l3names} -\GetIdInfo$Id: xtemplate.dtx 2115 2011-01-03 21:46:30Z joseph $ - {Prototype document functions} - - -\ProvidesExplPackage - {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{expl3} -\tl_const:Nn \c_xtemplate_code_root_tl { xtemplate_code > } -\tl_new:Nn \c_xtemplate_defaults_root_tl { xtemplate_defaults > } -\tl_new:Nn \c_xtemplate_instances_root_tl { xtemplate_instances > } -\tl_new:Nn \c_xtemplate_keytypes_root_tl { xtemplate_keytypes > } -\tl_new:Nn \c_xtemplate_restrict_root_tl { xtemplate_restrict > } -\tl_new:Nn \c_xtemplate_values_root_tl { xtemplate_values > } -\tl_new:Nn \c_xtemplate_vars_root_tl { xtemplate_vars > } -\tl_new:Nn \c_xtemplate_key_order_tl { key~order } -\clist_new:N \c_xtemplate_keytypes_arg_clist -\clist_put_right:Nn \c_xtemplate_keytypes_arg_clist { choice } -\clist_put_right:Nn \c_xtemplate_keytypes_arg_clist { function } -\clist_put_right:Nn \c_xtemplate_keytypes_arg_clist { instance } -\prop_new:N \g_xtemplate_object_type_prop -\tl_new:N \l_xtemplate_assignments_tl -\tl_new:N \l_xtemplate_collection_tl -\prop_new:N \l_xtemplate_collections_prop -\tl_new:N \l_xtemplate_default_tl -\bool_new:N \l_xtemplate_error_bool -\bool_new:N \l_xtemplate_global_bool -\bool_new:N \l_xtemplate_restrict_bool -\clist_new:N \l_xtemplate_restrict_clist -\tl_new:N \l_xtemplate_key_name_tl -\tl_new:N \l_xtemplate_keytype_tl -\tl_new:N \l_xtemplate_keytype_arg_tl -\tl_new:N \l_xtemplate_value_tl -\tl_new:N \l_xtemplate_var_tl -\seq_new:N \l_xtemplate_key_seq -\prop_new:N \l_xtemplate_keytypes_prop -\prop_new:N \l_xtemplate_values_prop -\prop_new:N \l_xtemplate_vars_prop -\clist_new:N \l_xtemplate_tmp_clist -\dim_new:N \l_xtemplate_tmp_dim -\int_new:N \l_xtemplate_tmp_int -\skip_new:N \l_xtemplate_tmp_skip -\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 - \int_compare:nTF { #2 = \l_xtemplate_tmp_tl } - {#3} - { - \msg_kernel_error:nnxxx { xtemplate } - { argument-number-mismatch } {#1} { \l_xtemplate_tmp_tl } {#2} - } -} -\cs_new:Npn \xtemplate_execute_if_code_exist:nnT #1#2#3 { - \cs_if_exist:cTF { \c_xtemplate_code_root_tl #1 / #2 :w } - {#3} - { - \msg_kernel_error:nnxx { xtemplate } { no-template-code } - {#1} {#2} - } -} -\cs_new:Npn \xtemplate_execute_if_keytype_exist:nT #1#2 { - \cs_if_exist:cTF { xtemplate_store_value_ #1 :n } - {#2} - { \msg_kernel_error:nnx { xtemplate } { unknown-keytype } {#1} } -} -\cs_generate_variant:Nn \xtemplate_execute_if_keytype_exist:nT { V } -\cs_new:Npn \xtemplate_execute_if_type_exist:nT #1#2 { - \prop_if_in:NnTF \g_xtemplate_object_type_prop {#1} - {#2} - { \msg_kernel_error:nnx { xtemplate } { unknown-object-type } {#1} } -} -\cs_new:Npn \xtemplate_if_keys_exist:nnT #1#2#3 { - \cs_if_exist:cTF - { g_ \c_xtemplate_keytypes_root_tl #1 / #2 _prop } - {#3} - { - \msg_kernel_error:nnxx { xtemplate } { unknown-template } - {#1} {#2} - } -} -\prg_set_conditional:Nnn \xtemplate_if_key_value:n { T } { - \str_if_eq:noTF { \KeyValue } { \tl_head:w #1 \q_stop } { - \prg_return_true: - }{ - \prg_return_false: - } -} -\cs_generate_variant:Nn \xtemplate_if_key_value:nT { V } -\prg_new_conditional:Nnn \xtemplate_if_eval_now:n { TF } { - \str_if_eq:noTF { \EvaluateNow } { \tl_head:w #1 \q_stop } { - \prg_return_true: - }{ - \prg_return_false: - } -} -\prg_new_conditional:Nnn \xtemplate_if_instance_exist:nnn { T, F, TF } { - \cs_if_exist:cTF { \c_xtemplate_instances_root_tl #1 / #2 / #3 :w } { - \prg_return_true: - }{ - \prg_return_false: - } -} -\prg_new_conditional:Nnn \xtemplate_if_use_template:n { TF } { - \str_if_eq:noTF { \UseTemplate } { \tl_head:w #1 \q_stop } { - \prg_return_true: - }{ - \prg_return_false: - } -} -\cs_new:Npn \xtemplate_store_defaults:n #1 { - \cs_if_free:cT { g_ \c_xtemplate_defaults_root_tl #1 _prop } { - \prop_new:c { g_ \c_xtemplate_defaults_root_tl #1 _prop } - } - \prop_gset_eq:cN { g_ \c_xtemplate_defaults_root_tl #1 _prop } - \l_xtemplate_values_prop -} -\cs_new:Npn \xtemplate_store_keytypes:n #1 { - \cs_if_free:cTF { g_ \c_xtemplate_keytypes_root_tl #1 _prop } { - \msg_kernel_info:nnx { xtemplate } { define-template-interface } - {#1} - \prop_new:c { g_ \c_xtemplate_keytypes_root_tl #1 _prop } - } - { - \msg_kernel_warning:nnx { xtemplate } - { redefine-template-interface } {#1} - } - \prop_gset_eq:cN { g_ \c_xtemplate_keytypes_root_tl #1 _prop } - \l_xtemplate_keytypes_prop -} -\cs_new:Npn \xtemplate_store_values:n #1 { - \cs_if_free:cT { l_ \c_xtemplate_values_root_tl #1 _prop } { - \prop_new:c { l_ \c_xtemplate_values_root_tl #1 _prop } - } - \prop_set_eq:cN { l_ \c_xtemplate_values_root_tl #1 _prop } - \l_xtemplate_values_prop -} -\cs_new:Npn \xtemplate_store_restrictions:n #1 { - \cs_if_free:cT { g_ \c_xtemplate_restrict_root_tl #1 _clist } { - \clist_new:c { g_ \c_xtemplate_restrict_root_tl #1 _clist } - } - \clist_gset_eq:cN { g_ \c_xtemplate_restrict_root_tl #1 _clist } - \l_xtemplate_restrict_clist -} -\cs_new:Npn \xtemplate_store_vars:n #1 { - \cs_if_free:cTF { g_ \c_xtemplate_vars_root_tl #1 _prop } { - \msg_kernel_info:nnx { xtemplate } { define-template-code } {#1} - \prop_new:c { g_ \c_xtemplate_vars_root_tl #1 _prop } - } - { - \msg_kernel_warning:nnx { xtemplate } { redefine-template-code } - {#1} - } - \prop_gset_eq:cN { g_ \c_xtemplate_vars_root_tl #1 _prop } - \l_xtemplate_vars_prop -} -\cs_new:Npn \xtemplate_recover_defaults:n #1 { - \prop_set_eq:Nc \l_xtemplate_values_prop - { g_ \c_xtemplate_defaults_root_tl #1 _prop } -} -\cs_new:Npn \xtemplate_recover_keytypes:n #1 { - \prop_set_eq:Nc \l_xtemplate_keytypes_prop - { g_ \c_xtemplate_keytypes_root_tl #1 _prop } -} -\cs_new:Npn \xtemplate_recover_restrictions:n #1 { - \cs_if_free:cT { g_ \c_xtemplate_restrict_root_tl #1 _clist } { - \clist_new:c { g_ \c_xtemplate_restrict_root_tl #1 _clist } - } - \clist_set_eq:Nc \l_xtemplate_restrict_clist - { g_ \c_xtemplate_restrict_root_tl #1 _clist } -} -\cs_new:Npn \xtemplate_recover_values:n #1 { - \prop_set_eq:Nc \l_xtemplate_values_prop - { l_ \c_xtemplate_values_root_tl #1 _prop } -} -\cs_new:Npn \xtemplate_recover_vars:n #1 { - \prop_set_eq:Nc \l_xtemplate_vars_prop - { g_ \c_xtemplate_vars_root_tl #1 _prop } -} -\cs_new:Npn \xtemplate_declare_object_type:nn #1#2 { - \int_set:Nn \l_xtemplate_tmp_int {#2} - \bool_if:nTF { - \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 } - }{ - \prop_if_in:NnTF \g_xtemplate_object_type_prop {#1} - { - \msg_kernel_warning:nnxx { xtemplate } { redefine-object-type } - {#1} {#2} - } - { - \msg_kernel_info:nnxx { xtemplate } { define-object-type } - {#1} {#2} - } - \prop_gput:NnV \g_xtemplate_object_type_prop {#1} - \l_xtemplate_tmp_int - } -} -\cs_new:Npn \xtemplate_declare_template_keys:nnnn #1#2#3#4 { - \xtemplate_execute_if_type_exist:nT {#1} - { - \xtemplate_execute_if_arg_agree:nnT {#1} {#3} - { - \prop_clear:N \l_xtemplate_values_prop - \prop_clear:N \l_xtemplate_keytypes_prop - \seq_clear:N \l_xtemplate_key_seq - \KV_process_space_removal_sanitize:NNn - \xtemplate_parse_keys_elt:n \xtemplate_parse_keys_elt:nn {#4} - \prop_put:NVV \l_xtemplate_keytypes_prop \c_xtemplate_key_order_tl - \l_xtemplate_key_seq - \xtemplate_store_defaults:n { #1 / #2 } - \xtemplate_store_keytypes:n { #1 / #2 } - } - } -} -\cs_new:Npn \xtemplate_parse_keys_elt:n #1 { - \xtemplate_split_keytype:n {#1} - \bool_if:NF \l_xtemplate_error_bool - { - \xtemplate_execute_if_keytype_exist:VT \l_xtemplate_keytype_tl - { - \clist_map_function:nN { choice , function , instance } - \xtemplate_parse_keys_elt_aux:n - \bool_if:NF \l_xtemplate_error_bool - { - \seq_if_in:NVTF \l_xtemplate_key_seq - \l_xtemplate_key_name_tl - { - \msg_kernel_error:nnx { xtemplate } - { duplicate-key-interface } - { \l_xtemplate_key_name_tl } - } - { \xtemplate_parse_keys_elt_aux: } - } - } - } -} -\cs_new_nopar:Npn \xtemplate_parse_keys_elt_aux:n #1 { - \str_if_eq:VnT \l_xtemplate_keytype_tl {#1} { - \tl_if_empty:NT \l_xtemplate_keytype_arg_tl { - \msg_kernel_error:nnx { xtemplate } - { keytype-requires-argument } {#1} - \bool_set_true:N \l_xtemplate_error_bool - \clist_map_break: - } - } -} -\cs_new_nopar:Npn \xtemplate_parse_keys_elt_aux: { - \tl_set:Nx \l_xtemplate_tmp_tl { - \l_xtemplate_keytype_tl - \l_xtemplate_keytype_arg_tl - } - \prop_put:NVV \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_tl - \seq_put_right:NV \l_xtemplate_key_seq \l_xtemplate_key_name_tl - \str_if_eq:VnT \l_xtemplate_keytype_tl { choice } { - \clist_if_in:NnT \l_xtemplate_keytype_arg_tl { unknown } { - \msg_kernel_error:nn { xtemplate } { choice-unknown-reserved } - } - } -} -\cs_new:Npn \xtemplate_parse_keys_elt:nn #1#2 { - \xtemplate_parse_keys_elt:n {#1} - \str_if_eq:VnTF \l_xtemplate_keytype_tl { choice } { - \xtemplate_store_value_choice_name:n {#2} - }{ - \use:c { xtemplate_store_value_ \l_xtemplate_keytype_tl :n } {#2} - } -} -\group_begin: -\char_set_lccode:nn { `\@ } { `\: } -\char_make_other:N \@ -\tl_to_lowercase:n { - \group_end: - \cs_new:Npn \xtemplate_split_keytype:n #1 { - \bool_set_false:N \l_xtemplate_error_bool - \tl_set:Nn \l_xtemplate_tmp_tl {#1} - \tl_remove_all_in:Nn \l_xtemplate_tmp_tl { ~ } - \tl_replace_all_in:Nnn \l_xtemplate_tmp_tl { : } { @ } - \tl_if_in:VnTF \l_xtemplate_tmp_tl { @ } { - \exp_after:wN \xtemplate_split_keytype_aux:w \l_xtemplate_tmp_tl - \q_stop - }{ - \bool_set_true:N \l_xtemplate_error_bool - \msg_kernel_error:nnx { xtemplate } { no-keytype } {#1} - } - } - \cs_new:Npn \xtemplate_split_keytype_aux:w #1 @ #2 \q_stop { - \tl_if_empty:nT {#1} { - \msg_kernel_error:nnx { xtemplate } { empty-key-name } { @ #2 } - } - \tl_set:Nx \l_xtemplate_key_name_tl { \tl_to_str:n {#1} } - \xtemplate_split_keytype_arg:n {#2} - } -} -\cs_new:Npn \xtemplate_split_keytype_arg:n #1 { - \tl_set:Nn \l_xtemplate_keytype_tl {#1} - \tl_clear:N \l_xtemplate_keytype_arg_tl - \cs_set_nopar:Npn \xtemplate_split_keytype_arg_aux:n ##1 { - \tl_if_in:nnT {#1} {##1} { - \cs_set:Npn \xtemplate_split_keytype_arg_aux:w - ####1 ##1 ####2 \q_stop { - \tl_if_empty:nT {####1} { - \tl_set:Nn \l_xtemplate_keytype_tl {##1} - \tl_set:Nn \l_xtemplate_keytype_arg_tl {####2} - \clist_map_break: - } - } - \xtemplate_split_keytype_arg_aux:w #1 \q_stop - } - } - \clist_map_function:NN \c_xtemplate_keytypes_arg_clist - \xtemplate_split_keytype_arg_aux:n -} -\cs_generate_variant:Nn \xtemplate_split_keytype_arg:n { V } -\cs_new_nopar:Npn \xtemplate_split_keytype_arg_aux:n #1 { } -\cs_new_nopar:Npn \xtemplate_split_keytype_arg_aux:w #1 \q_stop { } -\cs_new:Npn \xtemplate_store_value_boolean:n #1 { - \xtemplate_if_eval_now:nTF {#1} { - \bool_if:cTF { c_ #1 _bool } { - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl - { true } - }{ - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl - { false } - } - }{ - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} - } -} -\cs_new:Npn \xtemplate_store_value_choice:n #1 { - \tl_set:Nx \l_xtemplate_tmp_tl - { \l_xtemplate_key_name_tl \c_space_tl #1 } - \prop_if_in:NVTF \l_xtemplate_vars_prop \l_xtemplate_tmp_tl { - \xtemplate_store_value_choice_aux:V \l_xtemplate_tmp_tl - }{ - \tl_set:Nx \l_xtemplate_tmp_tl - { \l_xtemplate_key_name_tl \c_space_tl unknown } - \prop_if_in:NVTF \l_xtemplate_vars_prop \l_xtemplate_tmp_tl { - \xtemplate_store_value_choice_aux:V \l_xtemplate_tmp_tl - }{ - \prop_get:NVN \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_tl - \xtemplate_split_keytype_arg:V \l_xtemplate_tmp_tl - \msg_kernel_error:nnxxx { xtemplate } { unknown-choice } - {#1} - { \l_xtemplate_key_name_tl } - { \l_xtemplate_keytype_arg_tl } - \prop_gdel:NV \l_xtemplate_values_prop \l_xtemplate_key_name_tl - } - } -} -\cs_generate_variant:Nn \xtemplate_store_value_choice:n { V } -\cs_new:Npn \xtemplate_store_value_choice_aux:n #1 { - \prop_get:NnN \l_xtemplate_vars_prop {#1} \l_xtemplate_tmp_tl - \prop_put:NVV \l_xtemplate_values_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_tl -} -\cs_generate_variant:Nn \xtemplate_store_value_choice_aux:n { V } -\cs_new:Npn \xtemplate_store_value_choice_name:n #1 { - \tl_set:Nx \l_xtemplate_tmp_tl - { \l_xtemplate_key_name_tl \c_space_tl default } - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_tmp_tl {#1} -} -\cs_new:Npn \xtemplate_store_value_code:n #1 { - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} -} -\cs_new:Npn \xtemplate_store_value_commalist:n #1 { - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} -} -\cs_new:Npn \xtemplate_store_value_function:n #1 { - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} -} -\cs_new:Npn \xtemplate_store_value_instance:n #1 { - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} -} -\cs_new:Npn \xtemplate_store_value_tokenlist:n #1 { - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} -} -\cs_new:Npn \xtemplate_store_value_integer:n #1 { - \xtemplate_if_eval_now:nTF {#1} { - \int_set:Nn \l_xtemplate_tmp_int {#1} - \prop_put:NVV \l_xtemplate_values_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_int - }{ - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} - } -} -\cs_new:Npn \xtemplate_store_value_length:n #1 { - \xtemplate_if_eval_now:nTF {#1} { - \dim_set:Nn \l_xtemplate_tmp_dim {#1} - \prop_put:NVV \l_xtemplate_values_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_dim - }{ - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} - } -} -\cs_new:Npn \xtemplate_store_value_skip:n #1 { - \xtemplate_if_eval_now:nTF {#1} { - \skip_set:Nn \l_xtemplate_tmp_skip {#1} - \prop_put:NVV \l_xtemplate_values_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_skip - }{ - \prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_key_name_tl {#1} - } -} -\cs_new:Npn \xtemplate_declare_template_code:nnnnn #1#2#3#4#5 { - \xtemplate_execute_if_type_exist:nT {#1} - { - \xtemplate_execute_if_arg_agree:nnT {#1}{#3} - { - \xtemplate_if_keys_exist:nnT {#1} {#2} - { - \xtemplate_store_key_implementation:nnn {#1} {#2} {#4} - \cs_generate_from_arg_count:cNnn - { \c_xtemplate_code_root_tl #1 / #2 :w } \cs_gset:Npn - {#3} {#5} - } - } - } -} -\cs_set:Npn \xtemplate_store_key_implementation:nnn #1#2#3 { - \xtemplate_recover_defaults:n { #1 / #2 } - \xtemplate_recover_keytypes:n { #1 / #2 } - \prop_clear:N \l_xtemplate_vars_prop - \KV_process_space_removal_sanitize:NNn - \xtemplate_parse_vars_elt:n \xtemplate_parse_vars_elt:nn {#3} - \xtemplate_store_defaults:n { #1 / #2 } - \xtemplate_store_vars:n { #1 / #2 } - \clist_clear:N \l_xtemplate_restrict_clist - \xtemplate_store_restrictions:n { #1 / #2 } - \prop_del:NV \l_xtemplate_keytypes_prop \c_xtemplate_key_order_tl - \prop_if_empty:NF \l_xtemplate_keytypes_prop { - \prop_map_inline:Nn \l_xtemplate_keytypes_prop { - \msg_kernel_error:nnxxx { xtemplate } { key-not-implemented } - {##1} {#2} {#1} - } - } -} -\cs_new:Npn \xtemplate_parse_vars_elt:n #1 { - \msg_kernel_error:nnx { xtemplate } { key-no-variable } {#1} -} -\cs_new:Npn \xtemplate_parse_vars_elt:nn #1#2 { - \tl_set:Nx \l_xtemplate_key_name_tl { \tl_to_str:n {#1} } - \tl_replace_all_in:Nnn \l_xtemplate_key_name_tl { ~ } { } - \prop_if_in:NVTF \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl { - \prop_get:NVN \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl - \l_xtemplate_keytype_tl - \xtemplate_split_keytype_arg:V \l_xtemplate_keytype_tl - \xtemplate_parse_vars_elt_aux:n {#2} - \prop_del:NV \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl - }{ - \msg_kernel_error:nnx { xtemplate } { unknown-key } {#1} - } -} -\cs_new:Npn \xtemplate_parse_vars_elt_aux:n #1 { - \str_if_eq:VnTF \l_xtemplate_keytype_tl { choice } - { \xtemplate_implement_choices:n {#1} } - { - \str_if_eq:VnTF \l_xtemplate_keytype_tl { code } - { - \prop_put:NVn \l_xtemplate_vars_prop - \l_xtemplate_key_name_tl {#1} - } - { - \str_if_eq:noTF {#1} { \tl_head:w #1 \q_stop } - { - \cs_if_exist:NTF #1 - { - \prop_put:NVn \l_xtemplate_vars_prop - \l_xtemplate_key_name_tl {#1} - } - { - \msg_kernel_error:nnx { xtemplate } - { undeclared-variable } - { \exp_not:N #1 } - } - } - { - \tl_if_in:nnTF {#1} { global } - { \xtemplate_parse_vars_elt_aux:w #1 \q_stop } - { - \msg_kernel_error:nnx { xtemplate } { bad-variable } - { \exp_not:n {#1} } - } - } - } - } -} -\cs_new:Npn \xtemplate_parse_vars_elt_aux:w #1 global #2 \q_stop { - \tl_if_empty:nTF {#1} - { - \str_if_eq:noTF {#2} { \tl_head:w #2 \q_stop } - { - \cs_if_exist:NTF #2 - { - \prop_put:NVn \l_xtemplate_vars_prop - \l_xtemplate_key_name_tl { #1 global #2 } - } - { - \msg_kernel_error:nnx { xtemplate } - { undeclared-variable } - { \exp_not:N #2 } - } - } - { - \msg_kernel_error:nnx { xtemplate } { bad-variable } - { \exp_not:n { #1 global #2 } } - } - } - { - \msg_kernel_error:nnx { xtemplate } { bad-variable } - { \exp_not:n { #1 global #2 } } - } -} -\cs_new:Npn \xtemplate_implement_choices:n #1 { - \clist_set_eq:NN \l_xtemplate_tmp_clist \l_xtemplate_keytype_arg_tl - \prop_put:NVn \l_xtemplate_vars_prop \l_xtemplate_key_name_tl { } - \KV_process_space_removal_sanitize:NNn - \xtemplate_implement_choice_elt:n \xtemplate_implement_choice_elt:nn - {#1} - \tl_set:Nx \l_xtemplate_tmp_tl - { \l_xtemplate_key_name_tl \c_space_tl default } - \prop_if_in:NVT \l_xtemplate_values_prop \l_xtemplate_tmp_tl { - \prop_get:NVN \l_xtemplate_values_prop \l_xtemplate_tmp_tl - \l_xtemplate_tmp_tl - \xtemplate_store_value_choice:V \l_xtemplate_tmp_tl - } - \clist_if_empty:NF \l_xtemplate_tmp_clist { - \clist_map_inline:Nn \l_xtemplate_tmp_clist - { - \msg_kernel_error:nnx { xtemplate } { choice-not-implemented } - {##1} - } - } -} -\cs_new:Npn \xtemplate_implement_choice_elt:n #1 { - \clist_if_empty:NTF \l_xtemplate_tmp_clist { - \str_if_eq:nnF {#1} { unknown } { - \prop_get:NVN \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_tl - \xtemplate_split_keytype_arg:V \l_xtemplate_tmp_tl - \msg_kernel_error:nnxxx { xtemplate } { unknown-choice } - {#1} - { \l_xtemplate_key_name_tl } - { \l_xtemplate_keytype_arg_tl } - } - }{ - \clist_if_in:NnTF \l_xtemplate_tmp_clist {#1} { - \clist_remove_element:Nn \l_xtemplate_tmp_clist {#1} - }{ - \prop_get:NVN \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl - \l_xtemplate_tmp_tl - \xtemplate_split_keytype_arg:V \l_xtemplate_tmp_tl - \msg_kernel_error:nnxxx { xtemplate } { unknown-choice } - {#1} - { \l_xtemplate_key_name_tl } - { \l_xtemplate_keytype_arg_tl } - } - } -} -\cs_new:Npn \xtemplate_implement_choice_elt:nn #1#2 { - \xtemplate_implement_choice_elt:n {#1} - \tl_set:Nx \l_xtemplate_tmp_tl - { \l_xtemplate_key_name_tl \c_space_tl #1 } - \prop_put:NVn \l_xtemplate_vars_prop \l_xtemplate_tmp_tl {#2} -} -\cs_new:Npn \xtemplate_declare_restricted:nnnn #1#2#3#4 { - \xtemplate_if_keys_exist:nnT {#1} {#2} - { - \xtemplate_set_template_eq:nn { #1 / #3 } { #1 / #2 } - \bool_set_true:N \l_xtemplate_restrict_bool - \xtemplate_edit_defaults_aux:nnn {#1} {#3} {#4} - } -} -\cs_new:Npn \xtemplate_edit_defaults:nnn { - \bool_set_false:N \l_xtemplate_restrict_bool - \xtemplate_edit_defaults_aux:nnn -} -\cs_new:Npn \xtemplate_edit_defaults_aux:nnn #1#2#3 { - \xtemplate_if_keys_exist:nnT {#1} {#2} - { - \xtemplate_recover_defaults:n { #1 / #2 } - \xtemplate_recover_restrictions:n { #1 / #2 } - \xtemplate_parse_values:nn { #1 / #2 } {#3} - \xtemplate_store_defaults:n { #1 / #2 } - \xtemplate_store_restrictions:n { #1 / #2 } - } -} -\cs_new:Npn \xtemplate_parse_values:nn #1#2 { - \xtemplate_recover_keytypes:n {#1} - \clist_clear:N \l_xtemplate_restrict_clist - \KV_process_space_removal_sanitize:NNn - \xtemplate_parse_values_elt:n \xtemplate_parse_values_elt:nn {#2} -} -\cs_new:Npn \xtemplate_parse_values_elt:n #1 { - \bool_set_true:N \l_xtemplate_error_bool - \msg_kernel_error:nnx { xtemplate } { key-no-value } {#1} -} -\cs_new:Npn \xtemplate_parse_values_elt:nn #1#2 { - \tl_set:Nx \l_xtemplate_key_name_tl { \tl_to_str:n {#1} } - \tl_replace_all_in:Nnn \l_xtemplate_key_name_tl { ~ } { } - \prop_if_in:NVTF \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl { - \bool_if:NTF \l_xtemplate_restrict_bool { - \clist_if_in:NVF \l_xtemplate_restrict_clist - \l_xtemplate_key_name_tl { - \xtemplate_parse_values_elt_aux:Vn \l_xtemplate_key_name_tl {#2} - } - }{ - \xtemplate_parse_values_elt_aux:Vn \l_xtemplate_key_name_tl {#2} - } - }{ - \msg_kernel_error:nnx { xtemplate } { unknown-key } - { \l_xtemplate_key_name_tl } - } -} -\cs_new:Npn \xtemplate_parse_values_elt_aux:nn #1#2 { - \clist_put_right:Nn \l_xtemplate_restrict_clist {#1} - \prop_get:NnN \l_xtemplate_keytypes_prop {#1} \l_xtemplate_tmp_tl - \xtemplate_split_keytype_arg:V \l_xtemplate_tmp_tl - \use:c { xtemplate_store_value_ \l_xtemplate_keytype_tl :n } {#2} -} -\cs_generate_variant:Nn \xtemplate_parse_values_elt_aux:nn { Vn } -\cs_new:Npn \xtemplate_set_template_eq:nn #1#2 { - \xtemplate_recover_defaults:n {#2} - \xtemplate_store_defaults:n {#1} - \xtemplate_recover_keytypes:n {#2} - \xtemplate_store_keytypes:n {#1} - \xtemplate_recover_vars:n {#2} - \xtemplate_store_vars:n {#1} - \cs_gset_eq:cc { \c_xtemplate_code_root_tl #1 :w } - { \c_xtemplate_code_root_tl #2 :w } -} -\cs_new:Npn \xtemplate_declare_instance:nnnnn #1#2#3#4#5 { - \xtemplate_execute_if_code_exist:nnT {#1} {#2} - { - \xtemplate_recover_defaults:n { #1 / #2 } - \xtemplate_recover_vars:n { #1 / #2 } - \xtemplate_declare_instance_aux:nnnnn {#1} {#2} {#3} {#4} {#5} - } -} -\cs_new:Npn \xtemplate_declare_instance_aux:nnnnn #1#2#3#4#5 { - \bool_set_false:N \l_xtemplate_error_bool - \xtemplate_parse_values:nn { #1 / #2 } {#5} - \bool_if:NF \l_xtemplate_error_bool { - \prop_put:Nnn \l_xtemplate_values_prop { from~template } {#2} - \xtemplate_store_values:n { #1 / #3 / #4 } - \xtemplate_convert_to_assignments: - \cs_set:cpx { \c_xtemplate_instances_root_tl #1 / #3 / #4 :w } { - \exp_not:N \xtemplate_assignments_push:n { - \exp_not:V \l_xtemplate_assignments_tl - } - \exp_not:c { \c_xtemplate_code_root_tl #1 / #2 :w } - } - \xtemplate_if_instance_exist:nnnF {#1} { } {#4} { - \cs_set_eq:cc - { \c_xtemplate_instances_root_tl #1 / / #4 :w } - { \c_xtemplate_instances_root_tl #1 / #3 / #4 :w } - } - } -} -\cs_new:Npn \xtemplate_edit_instance:nnnn #1#2#3 { - \xtemplate_if_instance_exist:nnnTF {#1} {#2} {#3} - { - \xtemplate_recover_values:n { #1 / #2 / #3 } - \prop_get:NnN \l_xtemplate_values_prop { from~template } - \l_xtemplate_tmp_tl - \xtemplate_edit_instance_aux:nVnnn {#1} \l_xtemplate_tmp_tl - {#2} {#3} - } - { - \msg_kernel_error:nnxx { xtemplate } { unknown-instance } - {#1} {#3} - } -} -\cs_new:Npn \xtemplate_edit_instance_aux:nnnnn #1#2 { - \xtemplate_recover_vars:n { #1 / #2 } - \xtemplate_declare_instance_aux:nnnnn {#1} {#2} -} -\cs_generate_variant:Nn \xtemplate_edit_instance_aux:nnnnn { nV } -\cs_new_nopar:Npn \xtemplate_convert_to_assignments: { - \tl_clear:N \l_xtemplate_assignments_tl - \prop_get:NVN \l_xtemplate_keytypes_prop \c_xtemplate_key_order_tl - \l_xtemplate_key_seq - \seq_map_function:NN \l_xtemplate_key_seq - \xtemplate_convert_to_assignments_aux:n -} -\cs_new:Npn \xtemplate_convert_to_assignments_aux:n #1 { - \prop_get:NnN \l_xtemplate_keytypes_prop {#1} \l_xtemplate_tmp_tl - \xtemplate_convert_to_assignments_aux:nV {#1} \l_xtemplate_tmp_tl -} -\cs_new:Npn \xtemplate_convert_to_assignments_aux:nn #1#2 { - \prop_if_in:NnT \l_xtemplate_values_prop {#1} { - \prop_if_in:NnTF \l_xtemplate_vars_prop {#1} { - \prop_get:NnN \l_xtemplate_values_prop {#1} \l_xtemplate_value_tl - \prop_get:NnN \l_xtemplate_vars_prop {#1} \l_xtemplate_var_tl - \xtemplate_split_keytype_arg:n {#2} - \str_if_eq:VnF \l_xtemplate_keytype_tl { choice } { - \str_if_eq:VnF \l_xtemplate_keytype_tl { code } { - \xtemplate_find_global: - } - } - \use:c { xtemplate_assign_ \l_xtemplate_keytype_tl : } - }{ - \msg_kernel_error:nnx { xtemplate } { unknown-attribute } {#1} - } - } -} -\cs_generate_variant:Nn \xtemplate_convert_to_assignments_aux:nn { nV } -\cs_new_nopar:Npn \xtemplate_find_global: { - \bool_set_false:N \l_xtemplate_global_bool - \tl_if_in:VnT \l_xtemplate_var_tl { global } { - \exp_after:wN \xtemplate_find_global_aux:w \l_xtemplate_var_tl \q_stop - } -} -\cs_new:Npn \xtemplate_find_global_aux:w #1 global #2 \q_stop { - \tl_set:Nn \l_xtemplate_var_tl {#2} - \bool_set_true:N \l_xtemplate_global_bool -} -\cs_new:Npn \xtemplate_use_template:nnn #1#2#3 { - \xtemplate_execute_if_code_exist:nnT {#1} {#2} - { - \xtemplate_recover_defaults:n { #1 / #2 } - \xtemplate_recover_vars:n { #1 / #2 } - \xtemplate_parse_values:nn { #1 / #2 } {#3} - \xtemplate_convert_to_assignments: - \use:c { \c_xtemplate_code_root_tl #1 / #2 :w } - } -} -\cs_new_nopar:Npn \xtemplate_assign_boolean: { - \bool_if:NTF \l_xtemplate_global_bool { - \xtemplate_assign_boolean_aux:n { bool_gset } - }{ - \xtemplate_assign_boolean_aux:n { bool_set } - } -} -\cs_new_nopar:Npn \xtemplate_assign_boolean_aux:n #1 { - \xtemplate_if_key_value:VT \l_xtemplate_value_tl { - \xtemplate_key_to_value: - } - \tl_put_left:Nx \l_xtemplate_assignments_tl { - \exp_not:c { #1 _ \l_xtemplate_value_tl :N } - \exp_not:V \l_xtemplate_var_tl - } -} -\cs_new_nopar:Npn \xtemplate_assign_choice: { - \tl_put_left:NV \l_xtemplate_assignments_tl \l_xtemplate_value_tl -} -\cs_new_nopar:Npn \xtemplate_assign_code: { - \tl_put_left:Nx \l_xtemplate_assignments_tl { - \exp_not:N \cs_set:Npn \exp_not:N \xtemplate_assign_code:n - \exp_not:n {##1} - { \exp_not:V \l_xtemplate_var_tl } - \exp_not:N \xtemplate_assign_code:n - { \exp_not:V \l_xtemplate_value_tl } - } -} -\cs_new:Npn \xtemplate_assign_code:n #1 { } -\cs_new_nopar:Npn \xtemplate_assign_function: { - \bool_if:NTF \l_xtemplate_global_bool { - \xtemplate_assign_function_aux:N \cs_gset:Npn - }{ - \xtemplate_assign_function_aux:N \cs_set:Npn - } -} -\cs_new_nopar:Npn \xtemplate_assign_function_aux:N #1 { - \tl_put_left:Nx \l_xtemplate_assignments_tl { - \exp_not:N \cs_generate_from_arg_count:NNnn - \exp_not:V \l_xtemplate_var_tl - \exp_not:N #1 - { \exp_not:V \l_xtemplate_keytype_arg_tl } - { \exp_not:V \l_xtemplate_value_tl } - } -} -\cs_new_nopar:Npn \xtemplate_assign_instance: { - \bool_if:NTF \l_xtemplate_global_bool { - \xtemplate_assign_instance_aux:N \cs_gset:Npn - }{ - \xtemplate_assign_instance_aux:N \cs_set:Npn - } -} -\cs_new_nopar:Npn \xtemplate_assign_instance_aux:N #1 { - \tl_put_left:Nx \l_xtemplate_assignments_tl { - \exp_not:N #1 \exp_not:V \l_xtemplate_var_tl { - \exp_not:N \xtemplate_use_instance:nn - { \exp_not:V \l_xtemplate_keytype_arg_tl } - { \exp_not:V \l_xtemplate_value_tl } - } - } -} -\cs_new_nopar:Npn \xtemplate_assign_integer: { - \bool_if:NTF \l_xtemplate_global_bool { - \xtemplate_assign_variable:N \int_gset:Nn - }{ - \xtemplate_assign_variable:N \int_set:Nn - } -} -\cs_new_nopar:Npn \xtemplate_assign_length: { - \bool_if:NTF \l_xtemplate_global_bool { - \xtemplate_assign_variable:N \dim_gset:Nn - }{ - \xtemplate_assign_variable:N \dim_set:Nn - } -} -\cs_new_nopar:Npn \xtemplate_assign_skip: { - \bool_if:NTF \l_xtemplate_global_bool { - \xtemplate_assign_variable:N \skip_gset:Nn - }{ - \xtemplate_assign_variable:N \skip_set:Nn - } -} -\cs_new_nopar:Npn \xtemplate_assign_tokenlist: { - \bool_if:NTF \l_xtemplate_global_bool { - \xtemplate_assign_tokenlist_aux:N \tl_gset:Nn - }{ - \xtemplate_assign_tokenlist_aux:N \tl_set:Nn - } -} -\cs_new_eq:NN \xtemplate_assign_commalist: - \xtemplate_assign_tokenlist: -\cs_new_nopar:Npn \xtemplate_assign_tokenlist_aux:N #1 { - \tl_put_left:Nx \l_xtemplate_assignments_tl { - \exp_not:N #1 \exp_not:V \l_xtemplate_var_tl - { \exp_not:V \l_xtemplate_value_tl } - } -} -\cs_new_nopar:Npn \xtemplate_assign_variable:N #1 { - \xtemplate_if_key_value:VT \l_xtemplate_value_tl { - \xtemplate_key_to_value: - } - \tl_put_left:Nx \l_xtemplate_assignments_tl { - \exp_not:N #1 \exp_not:V \l_xtemplate_var_tl - { \exp_not:V \l_xtemplate_value_tl } - } -} -\cs_new_nopar:Npn \xtemplate_key_to_value: { - \exp_after:wN \xtemplate_key_to_value_aux:w \l_xtemplate_value_tl -} -\cs_new:Npn \xtemplate_key_to_value_aux:w \KeyValue #1 { - \tl_set:Nx \l_xtemplate_tmp_tl { \tl_to_str:n {#1} } - \tl_replace_all_in:Nnn \l_xtemplate_key_name_tl { ~ } { } - \prop_if_in:NVTF \l_xtemplate_vars_prop \l_xtemplate_tmp_tl { - \prop_get:NVN \l_xtemplate_vars_prop \l_xtemplate_tmp_tl - \l_xtemplate_value_tl - }{ - \msg_kernel_error:nnx { xtemplate } { unknown-attribute } - { \l_xtemplate_tmp_tl } - } -} -\cs_new:Npn \xtemplate_use_instance:nn #1#2 { - \xtemplate_if_use_template:nTF {#2} { - \xtemplate_use_instance_aux:nNnnn {#1} #2 - }{ - \xtemplate_use_instance_aux:nn {#1} {#2} - } -} -\cs_new:Npn \xtemplate_use_instance_aux:nNnnn #1#2#3#4#5 { - \str_if_eq:nnTF {#1} {#3} { - \xtemplate_use_template:nnn {#3} {#4} {#5} - }{ - \msg_kernel_error:nnxx { xtemplate } { type-mismatch } {#1} {#3} - } -} -\cs_new:Npn \xtemplate_use_instance_aux:nn #1#2 { - \xtemplate_get_collection:n {#1} - \xtemplate_if_instance_exist:nnnTF - {#1} { \l_xtemplate_collection_tl } {#2} { - \use:c { - \c_xtemplate_instances_root_tl #1 / \l_xtemplate_collection_tl /#2 - :w - } - }{ - \xtemplate_if_instance_exist:nnnTF {#1} { } {#2} { - \use:c { \c_xtemplate_instances_root_tl #1 / / #2 :w } - }{ - \msg_kernel_error:nnxx { xtemplate } { unknown-instance } - {#1} {#2} - } - } -} -\cs_new:Npn \xtemplate_use_collection:nn #1#2 { - \prop_put:Nnn \l_xtemplate_collections_prop {#1} {#2} -} -\cs_new:Npn \xtemplate_get_collection:n #1 { - \prop_if_in:NnTF \l_xtemplate_collections_prop {#1} { - \prop_get:NnN \l_xtemplate_collections_prop {#1} - \l_xtemplate_collection_tl - }{ - \tl_clear:N \l_xtemplate_collection_tl - } -} -\cs_new_nopar:Npn \xtemplate_assignments_pop: { - \tl_use:N \l_xtemplate_assignments_tl -} -\cs_new:Npn \xtemplate_assignments_push:n #1 { - \tl_set:Nn \l_xtemplate_assignments_tl {#1} -} -\cs_new:Npn \xtemplate_show_code:nn #1#2 { - \xtemplate_execute_if_code_exist:nnT {#1} {#2} - { \cs_show:c { \c_xtemplate_code_root_tl #1 / #2 :w } } -} -\cs_new:Npn \xtemplate_show_defaults:nn #1#2 { - \xtemplate_if_keys_exist:nnT {#1} {#2} - { - \xtemplate_recover_defaults:n { #1 / #2 } - \prop_display:N \l_xtemplate_values_prop - } -} -\cs_new:Npn \xtemplate_show_keytypes:nn #1#2 { - \xtemplate_if_keys_exist:nnT {#1} {#2} - { - \xtemplate_recover_keytypes:n { #1 / #2 } - \prop_display:N \l_xtemplate_keytypes_prop - } -} -\cs_new:Npn \xtemplate_show_values:nnn #1#2#3 { - \xtemplate_if_instance_exist:nnnTF {#1} {#2} {#3} - { - \xtemplate_recover_values:n { #1 / #2 / #3 } - \prop_display:N \l_xtemplate_values_prop - } - { - \msg_kernel_error:nnxx { xtemplate } { unknown-instance } - {#1} {#2} - } -} -\cs_new:Npn \xtemplate_show_vars:nn #1#2 { - \xtemplate_execute_if_code_exist:nnT {#1} {#2} - { - \xtemplate_recover_vars:n { #1 / #2 } - \prop_display:N \l_xtemplate_vars_prop - } -} -\msg_kernel_new:nnnn { xtemplate } { argument-number-mismatch } - { Object~type~'#1'~takes~'#2'~not~'#3'~argument(s). } - { - Objects~of~type~'#1'~require~'#2'~arguments.\\ - You~have~tried~to~make~a~template~for~'#1'\\ - with~'#3'~arguments,~which~is~not~possible:\\ - the~number~of~arguments~must~agree.% - } -\msg_kernel_new:nnnn { xtemplate } { bad-number-of-arguments } - { - Impossible~number~of~arguments~declared~for \\ - object~type~'#1'. - } - { - An~object~may~accept~between~0~and~9~arguments.\\ - You~asked~to~use~#2~arguments:~this~is~not~supported. - } -\msg_kernel_new:nnnn { xtemplate } { bad-variable } - { Incorrect~variable~description~\msg_line_context:. } - { - The~argument~'#1'\\ - is~not~of~the~form~'<variable>'~or~'global~<variable>'.\\ - It~must~be~given~in~one~of~these~formats~to~be~used~in~a~template. - } -\msg_kernel_new:nnnn { xtemplate } { choice-not-implemented } - { The~choice~'#1'~has~no~implementation~\msg_line_context:. } - { - Each~choice~listed~in~the~interface~for~a~template~must\\ - have~an~implementation.\\ - I~did~not~find~an~implementation~for~'#1'. - } -\msg_kernel_new:nnnn { xtemplate } { choice-unknown-reserved } - { The~choice~'unknown'~cannot~be~given~for~a~template~key.} - { - The~'unknown'~choice~is~automatically~checked~by~template~when \\ - a~choice~key~is~given~with~an~unknown~value.~It~should~not~be \\ - included~in~the~list~of~named~choices~for~a~key,~and~is~always \\ - given~last~in~the~implementation~of~choices. - } -\msg_kernel_new:nnnn { xtemplate } { duplicate-key-interface } - { Key~'#1'~appears~twice~in~interface~definition~\msg_line_context:. } - { - Each~key~can~only~have~one~interface~declared~in~a~template.\\ - I~found~two~interfaces~for~'#1':~probably~a~typing~error. - } -\msg_kernel_new:nnnn { xtemplate } { empty-key-name } - { No~key~name~found~in~'#1'~\msg_line_context:. } - { - A~template~key~name~and~type~is~given~in~the~form:\\ - \c_space_tl <name>~:~<type> \\ - Parsing~your~input~I~found~a~:'~but~nothing~before~it! - } -\msg_kernel_new:nnnn { xtemplate } { key-no-value } - { The~key~'#1'~has~no~value~\msg_line_context:.} - { - When~creating~an~instance~of~a~template\\ - every~key~listed~must~include~a~value: - \c_space_tl \c_space_tl <key>~=~<value> - } -\msg_kernel_new:nnnn { xtemplate } { key-no-variable } - { The~key~'#1'~requires~implementation~details~\msg_line_context:. } - { - When~creating~template~code~using~\DeclareTemplateCode,\\ - each~key~name~must~have~an~associated~implementation.\\ - This~should~be~given~after~a~'='~sign:~I~did~not~find~one. - } -\msg_kernel_new:nnnn { xtemplate } { key-not-implemented } - { Key~'#1'~has~no~implementation~\msg_line_context:. } - { - The~definition~of~key~implementations~for~template~'#2'\\ - of~object~type~'#3'~does not~include~any~details~for~key~'#1'.\\ - The~key~was~declared~in~the~interface~definition,\\ - and~so~an~implementation~is~required. - } -\msg_kernel_new:nnnn { xtemplate } { keytype-requires-argument } - { The~keytype~'#1'~requires~an~argument~\msg_line_context:. } - { - You~should~have~put:\\ - \c_space_tl \c_space_tl <key-name>~:~#1~ - \token_to_str:N {~<argument>~\token_to_str:N } \\ - but~I~did~not~find~an~<argument>. - } -\msg_kernel_new:nnnn { xtemplate } { no-keytype } - { The~key~'#1'~is missing~a~keytype~\msg_line_context:. } - {% - You~should~have~put:\\ - \c_space_tl \c_space_tl #1~:~<keytype>\\ - but~I~did~not~find~a~<keytype>. - } -\msg_kernel_new:nnnn { xtemplate } { no-template-code } - { - The~template~'#2'~of~type~'#1'~is~unknown\\ - or~has~no~implementation. - } - { - You~need~to~declare~a~template~with~\DeclareTemplateInterface \\ - and~its~code~with~\DeclareTemplateCode prior~to~using~it. - } -\msg_kernel_new:nnnn { xtemplate } { type-mismatch } - { Object~types~'#1'~and~'#2'~do~not~agree. } - { - You~are~trying~to~use~a~template~directly~with~\UseInstance \\ - (or~a~similar~function),~but~the~object~types~do~not~match. - } -\msg_kernel_new:nnnn { xtemplate } { undeclared-variable } - { The~variable~#1~has~not~been~declared. } - { - Before~declaring~an~instance,~all~of~the~required~variables\\ - used~in~template~keys~must~be~created. - } -\msg_kernel_new:nnnn { xtemplate } { unknown-attribute } - { The~template~attribute~'#1'~is~unknown. } - { - There~is~a~definition~in~the~current~template~reading\\ - \token_to_str:N \KeyValue - \token_to_str:N {~#1~\token_to_str:N }\\ - but~there~is~no~key~called~'#1'. - } -\msg_kernel_new:nnnn { xtemplate } { unknown-choice } - { The~choice~'#1'~was~not~declared~for~key~'#2'~\msg_line_context:. } - { - The~key~'#2'~takes~a~fixed~number~of~choices:\\ - \clist_map_function:NN #3 \xtemplate_unknown_choice_aux:n - and~this~list~does~not~include~'#1'. - } -\cs_new:Npn \xtemplate_unknown_choice_aux:n #1 { -~ #1 ;\\} -\msg_kernel_new:nnnn { xtemplate } { unknown-keytype } - { The~keytype~'#1'~is~unknown~\msg_line_context:. } - { - Valid~keytypes~are:\\ - -~boolean;\\ - -~choice;\\ - -~code;\\ - -~commalist;\\ - -~function;\\ - -~instance;\\ - -~integer;\\ - -~length;\\ - -~skip;\\ - -~tokenlist. - } -\msg_kernel_new:nnnn { xtemplate } { unknown-object-type } - { The~object~type~'#1'~is~unknown~\msg_line_context:. } - { - An~object~type~needs~to~be~declared~with~ - \DeclareObjectType prior~to~using~it. - } -\msg_kernel_new:nnnn { xtemplate } { unknown-instance } - { The~instance~'#2'~of~type~'#1'~is~unknown. } - { - You~have~asked~to~use~an~instance~'#2',\\ - but~this~has~not~been~created. - } -\msg_kernel_new:nnnn { xtemplate } { unknown-key } - { Unknown~template~key~'#1'~\msg_line_context:. } - { - The~key~'#1'~was~not~declared~in~the~interface\\ - for~the~current~template.\\ - Probably~you~have~misspelled~the~key~name. - } -\msg_kernel_new:nnnn { xtemplate } { unknown-template } - { The~template~'#2'~of~type~'#1'~is~unknown~\msg_line_context:. } - { - No~interface~has~been~declared~for~a~template\\ - '#2'~of~object~type~'#1'. - } -\msg_kernel_new:nnn { xtemplate } { define-template-code } - {Defining~template~code~for~'#1'~\msg_line_context:.} -\msg_kernel_new:nnn { xtemplate } { define-template-interface } - {Defining~template~interface~for~'#1'~\msg_line_context:.} -\msg_kernel_new:nnn { xtemplate } { define-object-type } - {Defining~object~type~'#1'~with~#2~argument(s)~\msg_line_context:.} -\msg_kernel_new:nnn { xtemplate } { redefine-template-code } - {Redefining~template~code~for~'#1'~\msg_line_context:.} -\msg_kernel_new:nnn { xtemplate } { redefine-template-interface } - {Redefining~template~interface~for~'#1'~\msg_line_context:.} -\msg_kernel_new:nnn { xtemplate } { redefine-object-type } - {Redefining~object~type~'#1'~with~#2~argument(s)~\msg_line_context:.} -\cs_new_protected_nopar:Npn \DeclareObjectType #1#2 { - \xtemplate_declare_object_type:nn {#1} {#2} -} -\cs_new_protected:Npn \DeclareTemplateInterface #1#2#3#4 { - \xtemplate_declare_template_keys:nnnn {#1} {#2} {#3} {#4} -} -\cs_new_protected:Npn \DeclareTemplateCode #1#2#3#4#5 { - \xtemplate_declare_template_code:nnnnn {#1} {#2} {#3} {#4} {#5} -} -\cs_new_protected:Npn \DeclareRestrictedTemplate #1#2#3#4 { - \xtemplate_declare_restricted:nnnn {#1} {#2} {#3} {#4} -} -\cs_new_protected:Npn \DeclareInstance #1#2#3#4 { - \xtemplate_declare_instance:nnnnn {#1} {#3} { } {#2} {#4} -} -\cs_new_protected:Npn \DeclareCollectionInstance #1#2#3#4#5 { - \xtemplate_declare_instance:nnnnn {#2} {#4} {#1} {#3} {#5} -} -\cs_new_protected:Npn \EditTemplateDefaults #1#2#3 { - \xtemplate_edit_defaults:nnn {#1} {#2} {#3} -} -\cs_new_protected:Npn \EditInstance #1#2#3 { - \xtemplate_edit_instance:nnnn {#1} { } {#2} {#3} -} -\cs_new_protected:Npn \EditCollectionInstance #1#2#3#4 { - \xtemplate_edit_instance:nnnn {#2} {#1} {#3} {#4} -} -\cs_new_protected_nopar:Npn \UseTemplate #1#2#3 { - \xtemplate_use_template:nnn {#1} {#2} {#3} -} -\cs_new_protected_nopar:Npn \UseInstance #1#2 { - \xtemplate_use_instance:nn {#1} {#2} -} -\cs_new_protected_nopar:Npn \UseCollection #1#2 { - \xtemplate_use_collection:nn {#1} {#2} -} -\cs_new_protected_nopar:Npn \ShowTemplateCode #1#2 { - \xtemplate_show_code:nn {#1} {#2} -} -\cs_new_protected_nopar:Npn \ShowTemplateDefaults #1#2 { - \xtemplate_show_defaults:nn {#1} {#2} -} -\cs_new_protected_nopar:Npn \ShowTemplateKeytypes #1#2 { - \xtemplate_show_keytypes:nn {#1} {#2} -} -\cs_new_protected_nopar:Npn \ShowTemplateVariables #1#2 { - \xtemplate_show_vars:nn {#1} {#2} -} -\cs_new_protected_nopar:Npn \ShowInstanceValues #1#2 { - \xtemplate_show_values:nnn {#1} { } {#2} -} -\cs_new_protected_nopar:Npn \ShowCollectionInstanceValues #1#2#3 { - \xtemplate_show_values:nnn {#1} {#2} {#3} -} -\cs_new_nopar:Npn \IfInstanceExistTF #1#2 { - \xtemplate_if_instance_exist:nnnTF {#1} { } {#2} -} -\cs_new_nopar:Npn \IfInstanceExistT #1#2 { - \xtemplate_if_instance_exist:nnnT {#1} { } {#2} -} -\cs_new_nopar:Npn \IfInstanceExistF #1#2 { - \xtemplate_if_instance_exist:nnnF {#1} { } {#2} -} -\cs_new_protected:Npn \EvaluateNow #1 {#1} -\cs_new_protected:Npn \KeyValue #1 {#1} -\cs_new_protected_nopar:Npn \AssignTemplateKeys { - \xtemplate_assignments_pop: -} -\cs_new_nopar:Npn \TP_split_finite_skip_value:nnNN #1#2{ - \skip_split_finite_else_action:nnNN {#1} { - \PackageError{xtemplate}{Value~ for~ key~ #2~ contains~ `fil(ll)'} - {Only~ finite~ minus~ or~ plus~ parts~ are~ allowed~ for~ this~ key.} - } -} -\endinput -%% -%% End of file `xtemplate.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty b/Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty deleted file mode 100644 index 9c3636292f5..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty +++ /dev/null @@ -1,1026 +0,0 @@ -%% -%% This is file `l3coffins.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% l3coffins.dtx (with options: `package') -%% -%% (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 xcoffins 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 l3coffins.dtx (C) Copyright 2010 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 ``xcoffins 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} -\RequirePackage{graphicx,xcolor,trace} -\GetIdInfo$Id: l3coffins.dtx 2209 2011-03-23 08:33:19Z joseph $ - {Coffins} -\ProvidesExplPackage - {\filename}{\filedate}{\fileversion}{\filedescription} -\box_new:N \l_coffin_tmp_box -\dim_new:N \l_coffin_tmp_dim -\fp_new:N \l_coffin_tmp_fp -\tl_new:N \l_coffin_tmp_tl -\prop_new:N \c_coffin_corners_prop -\tl_set:Nn \l_coffin_tmp_tl { { 0 pt } { 0 pt } } -\prop_put:Nno \c_coffin_corners_prop { tl } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_corners_prop { tr } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_corners_prop { bl } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_corners_prop { br } { \l_coffin_tmp_tl } -\prop_new:N \c_coffin_poles_prop -\tl_set:Nn \l_coffin_tmp_tl { { 0 pt } { 0 pt } { 0 pt } { 1000 pt } } -\prop_put:Nno \c_coffin_poles_prop { l } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { hc } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { r } { \l_coffin_tmp_tl } -\tl_set:Nn \l_coffin_tmp_tl { { 0 pt } { 0 pt } { 1000 pt } { 0 pt } } -\prop_put:Nno \c_coffin_poles_prop { b } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { vc } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { t } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { B } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { H } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { T } { \l_coffin_tmp_tl } -\fp_new:N \l_coffin_calc_a_fp -\fp_new:N \l_coffin_calc_b_fp -\fp_new:N \l_coffin_calc_c_fp -\fp_new:N \l_coffin_calc_d_fp -\fp_new:N \l_coffin_calc_result_fp -\bool_new:N \l_coffin_error_bool -\dim_new:N \l_coffin_offset_x_dim -\dim_new:N \l_coffin_offset_y_dim -\tl_new:N \l_coffin_pole_a_tl -\tl_new:N \l_coffin_pole_b_tl -\fp_new:N \l_coffin_sin_fp -\fp_new:N \l_coffin_cos_fp -\dim_new:N \l_coffin_x_dim -\dim_new:N \l_coffin_y_dim -\dim_new:N \l_coffin_x_prime_dim -\dim_new:N \l_coffin_y_prime_dim -\fp_new:N \l_coffin_x_fp -\fp_new:N \l_coffin_y_fp -\fp_new:N \l_coffin_x_prime_fp -\fp_new:N \l_coffin_y_prime_fp -\dim_new:N \l_coffin_Depth_dim -\dim_new:N \l_coffin_Height_dim -\dim_new:N \l_coffin_TotalHeight_dim -\dim_new:N \l_coffin_Width_dim -\cs_new_nopar:Npn \coffin_saved_Depth: { } -\cs_new_nopar:Npn \coffin_saved_Height: { } -\cs_new_nopar:Npn \coffin_saved_TotalHeight: { } -\cs_new_nopar:Npn \coffin_saved_Width: { } -\cs_new_protected:Npn \coffin_if_exist_execute:Nn #1#2 { - \cs_if_exist:NTF #1 - { - \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } - { #2 } - { - \msg_kernel_error:nnx { coffin } { unknown-coffin } - { \token_to_str:N #1 } - } - } - { - \msg_kernel_error:nnx { coffin } { unknown-coffin } - { \token_to_str:N #1 } - } -} -\cs_new_protected_nopar:Npn \coffin_clear:N #1 { - \coffin_if_exist_execute:Nn #1 - { - \box_clear:N #1 - \coffin_reset_structure:N #1 - } -} -\cs_generate_variant:Nn \coffin_clear:N { c } -\cs_new_protected_nopar:Npn \coffin_new:N #1 { - \box_new:N #1 - \cs_gundefine:c { l_coffin_corners_ \tex_number:D #1 _prop } - \cs_gundefine:c { l_coffin_poles_ \tex_number:D #1 _prop } - \prop_new:c { l_coffin_corners_ \tex_number:D #1 _prop } - \prop_new:c { l_coffin_poles_ \tex_number:D #1 _prop } - \prop_gset_eq:cN { l_coffin_corners_ \tex_number:D #1 _prop } - \c_coffin_corners_prop - \prop_gset_eq:cN { l_coffin_poles_ \tex_number:D #1 _prop } - \c_coffin_poles_prop -} -\cs_generate_variant:Nn \coffin_new:N { c } -\cs_new_protected:Npn \hcoffin_set:Nn #1#2 { - \coffin_if_exist_execute:Nn #1 - { - \hbox_set:Nn #1 - { - \group_begin: - \set@color - #2 - \group_end: - } - \coffin_reset_structure:N #1 - \coffin_update_poles:N #1 - \coffin_update_corners:N #1 - } -} -\cs_generate_variant:Nn \hcoffin_set:Nn { c } -\cs_new_protected:Npn \vcoffin_set:Nnn #1#2#3 { - \coffin_if_exist_execute:Nn #1 - { - \vbox_set:Nn #1 - { - \dim_set:Nn \tex_hsize:D {#2} - \group_begin: - \set@color - #3 - \group_end: - } - \coffin_reset_structure:N #1 - \coffin_update_poles:N #1 - \coffin_update_corners:N #1 - \vbox_set_top:Nn \l_coffin_tmp_box { \vbox_unpack:N #1 } - \dim_set:Nn \l_coffin_tmp_dim - { \box_ht:N #1 - \box_ht:N \l_coffin_tmp_box } - \coffin_set_pole:Nnx #1 { T } - { - { 0 pt } { \dim_use:N \l_coffin_tmp_dim } { 1000 pt } { 0 pt } - } - } -} -\cs_generate_variant:Nn \vcoffin_set:Nnn { c } -\cs_new_protected_nopar:Npn \coffin_set_eq:NN #1#2 { - \coffin_if_exist_execute:Nn #1 - { - \box_set_eq:NN #1 #2 - \coffin_set_eq_structure:NN #1 #2 - } -} -\cs_generate_variant:Nn \coffin_set_eq:NN { c , Nc , cc } -\coffin_new:N \c_empty_coffin -\hbox_set:Nn \c_empty_coffin { } -\coffin_new:N \l_coffin_aligned_coffin -\coffin_new:N \l_coffin_aligned_internal_coffin -\cs_set_protected_nopar:Npn \coffin_get_pole:NnN #1#2#3 { - \prop_get:cnN { l_coffin_poles_ \tex_number:D #1 _prop } {#2} #3 - \quark_if_no_value:NT #3 - { - \msg_kernel_error:nnxx { coffin } { unknown-coffin-pole } - {#2} { \token_to_str:N #1 } - \tl_set:Nn #3 { { 0 pt } { 0 pt } { 0 pt } { 0 pt } } - } -} -\cs_new_protected_nopar:Npn \coffin_reset_structure:N #1 { - \prop_set_eq:cN { l_coffin_corners_ \tex_number:D #1 _prop } - \c_coffin_corners_prop - \prop_set_eq:cN { l_coffin_poles_ \tex_number:D #1 _prop } - \c_coffin_poles_prop -} -\cs_new_protected_nopar:Npn \coffin_set_eq_structure:NN #1#2 { - \prop_set_eq:cc { l_coffin_corners_ \tex_number:D #1 _prop } - { l_coffin_corners_ \tex_number:D #2 _prop } - \prop_set_eq:cc { l_coffin_poles_ \tex_number:D #1 _prop } - { l_coffin_poles_ \tex_number:D #2 _prop } -} -\cs_new_protected_nopar:Npn \coffin_set_user_dimensions:N #1 { - \cs_set_eq:NN \coffin_saved_Height: \Height - \cs_set_eq:NN \coffin_saved_Depth: \Depth - \cs_set_eq:NN \coffin_saved_TotalHeight: \TotalHeight - \cs_set_eq:NN \coffin_saved_Width: \Width - \cs_set_eq:NN \Height \l_coffin_Height_dim - \cs_set_eq:NN \Depth \l_coffin_Depth_dim - \cs_set_eq:NN \TotalHeight \l_coffin_TotalHeight_dim - \cs_set_eq:NN \Width \l_coffin_Width_dim - \dim_set:Nn \Height { \box_ht:N #1 } - \dim_set:Nn \Depth { \box_dp:N #1 } - \dim_set:Nn \TotalHeight { \box_ht:N #1 - \box_dp:N #1 } - \dim_set:Nn \Width { \box_wd:N #1 } -} -\cs_new_protected_nopar:Npn \coffin_end_user_dimensions: { - \cs_set_eq:NN \Height \coffin_saved_Height: - \cs_set_eq:NN \Depth \coffin_saved_Depth: - \cs_set_eq:NN \TotalHeight \coffin_saved_TotalHeight: - \cs_set_eq:NN \Width \coffin_saved_Width: -} -\cs_new_protected_nopar:Npn \coffin_set_horizontal_pole:Nnn #1#2#3 { - \coffin_if_exist_execute:Nn #1 - { - \coffin_set_user_dimensions:N #1 - \coffin_set_pole:Nnx #1 {#2} - { - { 0 pt } { \dim_eval:n {#3} } - { 1000 pt } { 0 pt } - } - \coffin_end_user_dimensions: - } -} -\cs_new_protected_nopar:Npn \coffin_set_vertical_pole:Nnn #1#2#3 { - \coffin_if_exist_execute:Nn #1 - { - \coffin_set_user_dimensions:N #1 - \coffin_set_pole:Nnx #1 {#2} - { - { \dim_eval:n {#3} } { 0 pt } - { 0 pt } { 1000 pt } - } - \coffin_end_user_dimensions: - } -} -\cs_new_protected_nopar:Npn \coffin_set_pole:Nnn #1#2#3 { - \prop_put:cnn { l_coffin_poles_ \tex_number:D #1 _prop } {#2} {#3} -} -\cs_generate_variant:Nn \coffin_set_horizontal_pole:Nnn { c } -\cs_generate_variant:Nn \coffin_set_vertical_pole:Nnn { c } -\cs_generate_variant:Nn \coffin_set_pole:Nnn { Nnx } -\cs_new_protected_nopar:Npn \coffin_update_corners:N #1 { - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } { tl } - { { 0 pt } { \dim_use:N \box_ht:N #1 } } - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } { tr } - { { \dim_use:N \box_wd:N #1 } { \dim_use:N \box_ht:N #1 } } - \dim_set:Nn \l_coffin_tmp_dim { - \dim_use:N \box_dp:N #1 } - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } { bl } - { { 0 pt } { \dim_use:N \l_coffin_tmp_dim } } - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } { br } - { { \dim_use:N \box_wd:N #1 } { \dim_use:N \l_coffin_tmp_dim } } -} -\cs_new_protected_nopar:Npn \coffin_update_poles:N #1 { - \dim_set:Nn \l_coffin_tmp_dim { 0.5 \box_wd:N #1 } - \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _prop } { hc } - { { \dim_use:N \l_coffin_tmp_dim } { 0 pt } { 0 pt } { 1000 pt } } - \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _prop } { r } - { { \dim_use:N \box_wd:N #1 } { 0 pt } { 0 pt } { 1000 pt } } - \dim_set:Nn \l_coffin_tmp_dim { ( \box_ht:N #1 - \box_dp:N #1 ) / 2 } - \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _prop } { vc } - { { 0 pt } { \dim_use:N \l_coffin_tmp_dim } { 1000 pt } { 0 pt } } - \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _prop } { t } - { { 0 pt } { \dim_use:N \box_ht:N #1 } { 1000 pt } { 0 pt } } - \dim_set:Nn \l_coffin_tmp_dim { \box_dp:N #1 } - \dim_compare:nNnF { \l_coffin_tmp_dim } = { \c_zero_dim } - { \dim_set:Nn \l_coffin_tmp_dim { -\l_coffin_tmp_dim } } - \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _prop } { b } - { { 0 pt } { \dim_use:N \l_coffin_tmp_dim } { 1000 pt } { 0 pt } } -} -\cs_new_protected_nopar:Npn \coffin_calculate_intersection:Nnn #1#2#3 { - \coffin_get_pole:NnN #1 {#2} \l_coffin_pole_a_tl - \coffin_get_pole:NnN #1 {#3} \l_coffin_pole_b_tl - \bool_set_false:N \l_coffin_error_bool - \exp_last_two_unbraced:Noo - \coffin_calculate_intersection:nnnnnnnn - \l_coffin_pole_a_tl \l_coffin_pole_b_tl - \bool_if:NT \l_coffin_error_bool - { - \msg_kernel_error:nn { coffin } { no-pole-intersection } - \dim_zero:N \l_coffin_x_dim - \dim_zero:N \l_coffin_y_dim - } -} -\cs_new_protected_nopar:Npn - \coffin_calculate_intersection:nnnnnnnn #1#2#3#4#5#6#7#8 { - \dim_compare:nNnTF {#3} = { \c_zero_dim } - { - \dim_set:Nn \l_coffin_x_dim {#1} - \dim_compare:nNnTF {#7} = { \c_zero_dim } - { \bool_set_true:N \l_coffin_error_bool } - { - \dim_compare:nNnTF {#8} = { \c_zero_dim } - { \dim_set:Nn \l_coffin_y_dim {#6} } - { - \coffin_calculate_intersection_aux:nnnnnN - {#1} {#5} {#6} {#7} {#8} \l_coffin_y_dim - } - } - } - { - \dim_compare:nNnTF {#4} = { \c_zero_dim } - { - \dim_set:Nn \l_coffin_y_dim {#2} - \dim_compare:nNnTF {#8} = { \c_zero_dim } - { \bool_set_true:N \l_coffin_error_bool } - { - \dim_compare:nNnTF {#7} = { \c_zero_dim } - { \dim_set:Nn \l_coffin_x_dim {#5} } - { - \coffin_calculate_intersection_aux:nnnnnN - {#2} {#6} {#5} {#8} {#7} \l_coffin_x_dim - } - } - } - { - \dim_compare:nNnTF {#7} = { \c_zero_dim } - { - \dim_set:Nn \l_coffin_x_dim {#5} - \coffin_calculate_intersection_aux:nnnnnN - {#5} {#1} {#2} {#3} {#4} \l_coffin_y_dim - } - { - \dim_compare:nNnTF {#8} = { \c_zero_dim } - { - \dim_set:Nn \l_coffin_x_dim {#6} - \coffin_calculate_intersection_aux:nnnnnN - {#6} {#2} {#1} {#4} {#3} \l_coffin_x_dim - } - { - \fp_set_from_dim:Nn \l_coffin_calc_a_fp {#3} - \fp_set_from_dim:Nn \l_coffin_calc_b_fp {#4} - \fp_set_from_dim:Nn \l_coffin_calc_c_fp {#7} - \fp_set_from_dim:Nn \l_coffin_calc_d_fp {#8} - \fp_div:Nn \l_coffin_calc_b_fp \l_coffin_calc_a_fp - \fp_div:Nn \l_coffin_calc_d_fp \l_coffin_calc_c_fp - \fp_compare:nNnTF - { \l_coffin_calc_b_fp } = { \l_coffin_calc_d_fp } - { \bool_set_true:N \l_coffin_error_bool } - { - \fp_set_from_dim:Nn \l_coffin_calc_result_fp {#6} - \fp_set_from_dim:Nn \l_coffin_calc_a_fp {#2} - \fp_sub:Nn \l_coffin_calc_result_fp - { \l_coffin_calc_a_fp } - \fp_set_from_dim:Nn \l_coffin_calc_a_fp {#1} - \fp_mul:Nn \l_coffin_calc_a_fp - { \l_coffin_calc_b_fp } - \fp_add:Nn \l_coffin_calc_result_fp - { \l_coffin_calc_a_fp } - \fp_set_from_dim:Nn \l_coffin_calc_a_fp {#5} - \fp_mul:Nn \l_coffin_calc_a_fp - { \l_coffin_calc_d_fp } - \fp_sub:Nn \l_coffin_calc_result_fp - { \l_coffin_calc_a_fp } - \fp_sub:Nn \l_coffin_calc_b_fp - { \l_coffin_calc_d_fp } - \fp_div:Nn \l_coffin_calc_result_fp - { \l_coffin_calc_b_fp } - \dim_set:Nn \l_coffin_x_dim - { \fp_to_dim:N \l_coffin_calc_result_fp } - \coffin_calculate_intersection_aux:nnnnnN - { \l_coffin_x_dim } - {#5} {#6} {#8} {#7} \l_coffin_y_dim - } - } - } - } - } -} -\cs_new_protected_nopar:Npn - \coffin_calculate_intersection_aux:nnnnnN #1#2#3#4#5#6 { - \fp_set_from_dim:Nn \l_coffin_calc_result_fp {#1} - \fp_set_from_dim:Nn \l_coffin_calc_a_fp {#2} - \fp_set_from_dim:Nn \l_coffin_calc_b_fp {#3} - \fp_set_from_dim:Nn \l_coffin_calc_c_fp {#4} - \fp_set_from_dim:Nn \l_coffin_calc_d_fp {#5} - \fp_sub:Nn \l_coffin_calc_result_fp { \l_coffin_calc_a_fp } - \fp_div:Nn \l_coffin_calc_result_fp { \l_coffin_calc_d_fp } - \fp_mul:Nn \l_coffin_calc_result_fp { \l_coffin_calc_c_fp } - \fp_add:Nn \l_coffin_calc_result_fp { \l_coffin_calc_b_fp } - \dim_set:Nn #6 { \fp_to_dim:N \l_coffin_calc_result_fp } -} -\cs_new_protected_nopar:Npn \coffin_join:NnnNnnnn #1#2#3#4#5#6#7#8 { - \coffin_align:NnnNnnnnN - #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l_coffin_aligned_coffin - \hbox_set:Nn \l_coffin_aligned_coffin - { - \dim_compare:nNnT { \l_coffin_offset_x_dim } < { \c_zero_dim } - { \tex_kern:D -\l_coffin_offset_x_dim } - \hbox_unpack:N \l_coffin_aligned_coffin - \dim_set:Nn \l_coffin_tmp_dim - { \l_coffin_offset_x_dim - \box_wd:N #1 + \box_wd:N #4 } - \dim_compare:nNnT { \l_coffin_tmp_dim } < { \c_zero_dim } - { \tex_kern:D -\l_coffin_tmp_dim } - } - \coffin_reset_structure:N \l_coffin_aligned_coffin - \prop_clear:c - { - l_coffin_corners_ \tex_number:D \l_coffin_aligned_coffin _ prop - } - \coffin_update_poles:N \l_coffin_aligned_coffin - \dim_compare:nNnTF { \l_coffin_offset_x_dim } < { \c_zero_dim } - { - \coffin_offset_poles:Nnn #1 { -\l_coffin_offset_x_dim } { 0 pt } - \coffin_offset_poles:Nnn #4 { 0 pt } { \l_coffin_offset_y_dim } - \coffin_offset_corners:Nnn #1 { -\l_coffin_offset_x_dim } { 0 pt } - \coffin_offset_corners:Nnn #4 { 0 pt } { \l_coffin_offset_y_dim } - } - { - \coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt } - \coffin_offset_poles:Nnn #4 - { \l_coffin_offset_x_dim } { \l_coffin_offset_y_dim } - \coffin_offset_corners:Nnn #1 { 0 pt } { 0 pt } - \coffin_offset_corners:Nnn #4 - { \l_coffin_offset_x_dim } { \l_coffin_offset_y_dim } - } - \coffin_update_vertical_poles:NNN #1 #4 \l_coffin_aligned_coffin - \coffin_set_eq:NN #1 \l_coffin_aligned_coffin -} -\cs_generate_variant:Nn \coffin_join:NnnNnnnn { c , Nnnc , cnnc } -\cs_new_protected_nopar:Npn \coffin_attach:NnnNnnnn #1#2#3#4#5#6#7#8 { - \coffin_align:NnnNnnnnN - #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l_coffin_aligned_coffin - \box_set_ht:Nn \l_coffin_aligned_coffin { \box_ht:N #1 } - \box_set_dp:Nn \l_coffin_aligned_coffin { \box_dp:N #1 } - \box_set_wd:Nn \l_coffin_aligned_coffin { \box_wd:N #1 } - \coffin_reset_structure:N \l_coffin_aligned_coffin - \prop_set_eq:cc - { l_coffin_corners_ \tex_number:D \l_coffin_aligned_coffin _prop } - { l_coffin_corners_ \tex_number:D #1 _prop } - \coffin_update_poles:N \l_coffin_aligned_coffin - \coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt } - \coffin_offset_poles:Nnn #4 - { \l_coffin_offset_x_dim } { \l_coffin_offset_y_dim } - \coffin_update_vertical_poles:NNN #1 #4 \l_coffin_aligned_coffin - \coffin_set_eq:NN #1 \l_coffin_aligned_coffin -} -\cs_new_protected_nopar:Npn - \coffin_attach_mark:NnnNnnnn #1#2#3#4#5#6#7#8 { - \coffin_align:NnnNnnnnN - #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l_coffin_aligned_coffin - \box_set_ht:Nn \l_coffin_aligned_coffin { \box_ht:N #1 } - \box_set_dp:Nn \l_coffin_aligned_coffin { \box_dp:N #1 } - \box_set_wd:Nn \l_coffin_aligned_coffin { \box_wd:N #1 } - \box_set_eq:NN #1 \l_coffin_aligned_coffin -} -\cs_generate_variant:Nn \coffin_attach:NnnNnnnn { c , Nnnc , cnnc } -\cs_new_protected_nopar:Npn - \coffin_align:NnnNnnnnN #1#2#3#4#5#6#7#8#9 { - \coffin_calculate_intersection:Nnn #4 {#5} {#6} - \dim_set:Nn \l_coffin_x_prime_dim { \l_coffin_x_dim } - \dim_set:Nn \l_coffin_y_prime_dim { \l_coffin_y_dim } - \coffin_calculate_intersection:Nnn #1 {#2} {#3} - \dim_set:Nn \l_coffin_offset_x_dim - { \l_coffin_x_dim - \l_coffin_x_prime_dim + #7 } - \dim_set:Nn \l_coffin_offset_y_dim - { \l_coffin_y_dim - \l_coffin_y_prime_dim + #8 } - \hbox_set:Nn \l_coffin_aligned_internal_coffin - { - \box_use:N #1 - \tex_kern:D -\box_wd:N #1 - \tex_kern:D \l_coffin_offset_x_dim - \box_move_up:nn { \l_coffin_offset_y_dim } { \box_use:N #4 } - } - \coffin_set_eq:NN #9 \l_coffin_aligned_internal_coffin -} -\cs_new_protected_nopar:Npn \coffin_offset_poles:Nnn #1#2#3 { - \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } - { \coffin_offset_pole:Nnnnnnn #1 {##1} ##2 {#2} {#3} } -} -\cs_new_protected_nopar:Npn - \coffin_offset_pole:Nnnnnnn #1#2#3#4#5#6#7#8 { - \dim_set:Nn \l_coffin_x_dim { #3 + #7 } - \dim_set:Nn \l_coffin_y_dim { #4 + #8 } - \tl_if_in:nnTF {#2} { - } - { \tl_set:Nn \l_coffin_tmp_tl { {#2} } } - { \tl_set:Nn \l_coffin_tmp_tl { { #1 - #2 } } } - \exp_last_unbraced:NNo \coffin_set_pole:Nnx \l_coffin_aligned_coffin - { \l_coffin_tmp_tl } - { - { \dim_use:N \l_coffin_x_dim } { \dim_use:N \l_coffin_y_dim } - {#5} {#6} - } -} -\cs_new_protected_nopar:Npn \coffin_offset_corners:Nnn #1#2#3 { - \prop_map_inline:cn { l_coffin_corners_ \tex_number:D #1 _prop } - { \coffin_offset_corner:Nnnnn #1 {##1} ##2 {#2} {#3} } -} -\cs_new_protected_nopar:Npn \coffin_offset_corner:Nnnnn #1#2#3#4#5#6 { - \prop_put:cnx - { l_coffin_corners_ \tex_number:D \l_coffin_aligned_coffin _prop } - { #1 - #2 } - { - { \dim_eval:n { #3 + #5 } } - { \dim_eval:n { #4 + #6 } } - } -} -\cs_new_protected_nopar:Npn \coffin_update_vertical_poles:NNN #1#2#3 { - \coffin_get_pole:NnN #3 { #1 -T } \l_coffin_pole_a_tl - \coffin_get_pole:NnN #3 { #2 -T } \l_coffin_pole_b_tl - \exp_last_two_unbraced:Noo \coffin_update_T:nnnnnnnnN - \l_coffin_pole_a_tl \l_coffin_pole_b_tl #3 - \coffin_get_pole:NnN #3 { #1 -B } \l_coffin_pole_a_tl - \coffin_get_pole:NnN #3 { #2 -B } \l_coffin_pole_b_tl - \exp_last_two_unbraced:Noo \coffin_update_B:nnnnnnnnN - \l_coffin_pole_a_tl \l_coffin_pole_b_tl #3 -} -\cs_new_protected_nopar:Npn - \coffin_update_T:nnnnnnnnN #1#2#3#4#5#6#7#8#9 { - \dim_compare:nNnTF {#2} < {#6} - { - \coffin_set_pole:Nnx #9 { T } - { { 0 pt } {#6} { 1000 pt } { 0 pt } } - } - { - \coffin_set_pole:Nnx #9 { T } - { { 0 pt } {#2} { 1000 pt } { 0 pt } } - } -} -\cs_new_protected_nopar:Npn - \coffin_update_B:nnnnnnnnN #1#2#3#4#5#6#7#8#9 { - \dim_compare:nNnTF {#2} < {#6} - { - \coffin_set_pole:Nnx #9 { B } - { { 0 pt } {#2} { 1000 pt } { 0 pt } } - } - { - \coffin_set_pole:Nnx #9 { B } - { { 0 pt } {#6} { 1000 pt } { 0 pt } } - } -} -\cs_new_protected_nopar:Npn \coffin_typeset:Nnnnn #1#2#3#4#5 { - \coffin_align:NnnNnnnnN \c_empty_coffin { H } { l } - #1 {#2} {#3} {#4} {#5} \l_coffin_aligned_coffin - \hbox_set:Nn \l_coffin_aligned_coffin - { - \dim_compare:nNnT { \l_coffin_offset_x_dim } < { \c_zero_dim } - { \tex_kern:D -\l_coffin_offset_x_dim } - \hbox_unpack:N \l_coffin_aligned_coffin - \dim_set:Nn \l_coffin_tmp_dim - { \l_coffin_offset_x_dim + \box_wd:N #1 } - \dim_compare:nNnT { \l_coffin_tmp_dim } < { \c_zero_dim } - { \tex_kern:D -\l_coffin_tmp_dim } - } - \hbox_unpack:N \c_empty_box - \box_use:N \l_coffin_aligned_coffin -} -\cs_generate_variant:Nn \coffin_typeset:Nnnnn { c } -\prop_new:N \l_coffin_bounding_prop -\dim_new:N \l_coffin_bounding_shift_dim -\dim_new:N \l_coffin_left_corner_dim -\dim_new:N \l_coffin_right_corner_dim -\dim_new:N \l_coffin_bottom_corner_dim -\dim_new:N \l_coffin_top_corner_dim -\cs_new_protected_nopar:Npn \coffin_rotate:Nn #1#2 { - \fp_set:Nn \l_coffin_tmp_fp {#2} - \fp_div:Nn \l_coffin_tmp_fp { 180 } - \fp_mul:Nn \l_coffin_tmp_fp { \c_pi_fp } - \fp_sin:Nn \l_coffin_sin_fp { \l_coffin_tmp_fp } - \fp_cos:Nn \l_coffin_cos_fp { \l_coffin_tmp_fp } - \prop_map_inline:cn { l_coffin_corners_ \tex_number:D #1 _prop } - { \coffin_rotate_corner:Nnnn #1 {##1} ##2 } - \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } - { \coffin_rotate_pole:Nnnnnn #1 {##1} ##2 } - \coffin_set_bounding:N #1 - \prop_map_inline:Nn \l_coffin_bounding_prop - { \coffin_rotate_bounding:nnn {##1} ##2 } - \coffin_find_corner_maxima:N #1 - \coffin_find_bounding_shift: - \hbox_set:Nn #1 { \rotatebox {#2} { \box_use:N #1 } } - \hbox_set:Nn #1 - { - \tex_kern:D \l_coffin_bounding_shift_dim - \tex_kern:D -\l_coffin_left_corner_dim - \box_move_down:nn { \l_coffin_bottom_corner_dim } - { \box_use:N #1 } - } - \box_set_ht:Nn #1 - { \l_coffin_top_corner_dim - \l_coffin_bottom_corner_dim } - \box_set_dp:Nn #1 { 0 pt } - \box_set_wd:Nn #1 - { \l_coffin_right_corner_dim - \l_coffin_left_corner_dim } - \prop_map_inline:cn { l_coffin_corners_ \tex_number:D #1 _prop } - { \coffin_shift_corner:Nnnn #1 {##1} ##2 } - \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } - { \coffin_shift_pole:Nnnnnn #1 {##1} ##2 } -} -\cs_generate_variant:Nn \coffin_rotate:Nn { c } -\cs_new_protected_nopar:Npn \coffin_set_bounding:N #1 { - \prop_put:Nnx \l_coffin_bounding_prop { tl } - { { 0 pt } { \dim_use:N \box_ht:N #1 } } - \prop_put:Nnx \l_coffin_bounding_prop { tr } - { { \dim_use:N \box_wd:N #1 } { \dim_use:N \box_ht:N #1 } } - \dim_set:Nn \l_coffin_tmp_dim { - \dim_use:N \box_dp:N #1 } - \prop_put:Nnx \l_coffin_bounding_prop { bl } - { { 0 pt } { \dim_use:N \l_coffin_tmp_dim } } - \prop_put:Nnx \l_coffin_bounding_prop { br } - { { \dim_use:N \box_wd:N #1 } { \dim_use:N \l_coffin_tmp_dim } } -} -\cs_new_protected_nopar:Npn \coffin_rotate_bounding:nnn #1#2#3 { - \coffin_rotate_vector:nnNN {#2} {#3} \l_coffin_x_dim \l_coffin_y_dim - \prop_put:Nnx \l_coffin_bounding_prop {#1} - { { \dim_use:N \l_coffin_x_dim } { \dim_use:N \l_coffin_y_dim } } -} -\cs_new_protected_nopar:Npn \coffin_rotate_corner:Nnnn #1#2#3#4 { - \coffin_rotate_vector:nnNN {#3} {#4} \l_coffin_x_dim \l_coffin_y_dim - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } {#2} - { { \dim_use:N \l_coffin_x_dim } { \dim_use:N \l_coffin_y_dim } } -} -\cs_new_protected_nopar:Npn \coffin_rotate_pole:Nnnnnn #1#2#3#4#5#6 { - \coffin_rotate_vector:nnNN {#3} {#4} \l_coffin_x_dim \l_coffin_y_dim - \coffin_rotate_vector:nnNN {#5} {#6} - \l_coffin_x_prime_dim \l_coffin_y_prime_dim - \coffin_set_pole:Nnx #1 {#2} - { - { \dim_use:N \l_coffin_x_dim } { \dim_use:N \l_coffin_y_dim } - { \dim_use:N \l_coffin_x_prime_dim } - { \dim_use:N \l_coffin_y_prime_dim } - } -} -\cs_new_protected_nopar:Npn \coffin_rotate_vector:nnNN #1#2#3#4 { - \fp_set_from_dim:Nn \l_coffin_x_fp {#1} - \fp_set_from_dim:Nn \l_coffin_y_fp {#2} - \fp_set_eq:NN \l_coffin_x_prime_fp \l_coffin_x_fp - \fp_set_eq:NN \l_coffin_tmp_fp \l_coffin_y_fp - \fp_mul:Nn \l_coffin_x_prime_fp { \l_coffin_cos_fp } - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_sin_fp } - \fp_sub:Nn \l_coffin_x_prime_fp { \l_coffin_tmp_fp } - \fp_set_eq:NN \l_coffin_y_prime_fp \l_coffin_y_fp - \fp_set_eq:NN \l_coffin_tmp_fp \l_coffin_x_fp - \fp_mul:Nn \l_coffin_y_prime_fp { \l_coffin_cos_fp } - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_sin_fp } - \fp_add:Nn \l_coffin_y_prime_fp { \l_coffin_tmp_fp } - \dim_set:Nn #3 { \fp_to_dim:N \l_coffin_x_prime_fp } - \dim_set:Nn #4 { \fp_to_dim:N \l_coffin_y_prime_fp } -} -\cs_new_protected_nopar:Npn \coffin_find_corner_maxima:N #1 { - \dim_set:Nn \l_coffin_top_corner_dim { -\c_max_dim } - \dim_set:Nn \l_coffin_right_corner_dim { -\c_max_dim } - \dim_set:Nn \l_coffin_bottom_corner_dim { \c_max_dim } - \dim_set:Nn \l_coffin_left_corner_dim { \c_max_dim } - \prop_map_inline:cn { l_coffin_corners_ \tex_number:D #1 _prop } - { \coffin_find_corner_maxima_aux:nn ##2 } -} -\cs_new_protected_nopar:Npn \coffin_find_corner_maxima_aux:nn #1#2 { - \dim_set_min:Nn \l_coffin_left_corner_dim {#1} - \dim_set_max:Nn \l_coffin_right_corner_dim {#1} - \dim_set_min:Nn \l_coffin_bottom_corner_dim {#2} - \dim_set_max:Nn \l_coffin_top_corner_dim {#2} -} -\cs_new_protected_nopar:Npn \coffin_find_bounding_shift: { - \dim_set:Nn \l_coffin_bounding_shift_dim { \c_max_dim } - \prop_map_inline:Nn \l_coffin_bounding_prop - { \coffin_find_bounding_shift_aux:nn ##2 } -} -\cs_new_protected_nopar:Npn \coffin_find_bounding_shift_aux:nn #1#2 { - \dim_set_min:Nn \l_coffin_bounding_shift_dim {#1} -} -\cs_new_protected_nopar:Npn \coffin_shift_corner:Nnnn #1#2#3#4 { - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _ prop } {#2} - { - { \dim_eval:n { #3 - \l_coffin_left_corner_dim } } - { \dim_eval:n { #4 - \l_coffin_bottom_corner_dim } } - } -} -\cs_new_protected_nopar:Npn \coffin_shift_pole:Nnnnnn #1#2#3#4#5#6 { - \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _ prop } {#2} - { - { \dim_eval:n { #3 - \l_coffin_left_corner_dim } } - { \dim_eval:n { #4 - \l_coffin_bottom_corner_dim } } - {#5} {#6} - } -} -\fp_new:N \l_coffin_scale_x_fp -\fp_new:N \l_coffin_scale_y_fp -\dim_new:N \l_coffin_scaled_total_height_dim -\dim_new:N \l_coffin_scaled_width_dim -\cs_new_protected_nopar:Npn \coffin_resize:Nnn #1#2#3 { - \coffin_set_user_dimensions:N #1 - \fp_set_from_dim:Nn \l_coffin_scale_x_fp {#2} - \fp_set_from_dim:Nn \l_coffin_tmp_fp { \Width } - \fp_div:Nn \l_coffin_scale_x_fp { \l_coffin_tmp_fp } - \fp_set_from_dim:Nn \l_coffin_scale_y_fp {#3} - \fp_set_from_dim:Nn \l_coffin_tmp_fp { \TotalHeight } - \fp_div:Nn \l_coffin_scale_y_fp { \l_coffin_tmp_fp } - \hbox_set:Nn #1 { \resizebox * {#2} {#3} { \box_use:N #1 } } - \coffin_resize_common:Nnn #1 {#2} {#3} -} -\cs_generate_variant:Nn \coffin_resize:Nnn { c } -\cs_new_protected_nopar:Npn \coffin_resize_common:Nnn #1#2#3 { - \prop_map_inline:cn { l_coffin_corners_ \tex_number:D #1 _prop } - { \coffin_scale_corner:Nnnn #1 {##1} ##2 } - \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } - { \coffin_scale_pole:Nnnnnn #1 {##1} ##2 } - \fp_compare:NNNT \l_coffin_scale_x_fp < \c_zero_fp - { - \prop_map_inline:cn { l_coffin_corners_ \tex_number:D #1 _prop } - { \coffin_x_shift_corner:Nnnn #1 {##1} ##2 } - \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } - { \coffin_x_shift_pole:Nnnnnn #1 {##1} ##2 } - } - \coffin_end_user_dimensions: -} -\cs_new_protected_nopar:Npn \coffin_scale:Nnn #1#2#3 { - \coffin_set_user_dimensions:N #1 - \fp_set:Nn \l_coffin_scale_x_fp {#2} - \fp_set:Nn \l_coffin_scale_y_fp {#3} - \fp_compare:NNNTF \l_coffin_scale_y_fp > \c_zero_fp - { \l_coffin_scaled_total_height_dim #3 \TotalHeight } - { \l_coffin_scaled_total_height_dim -#3 \TotalHeight } - \fp_compare:NNNTF \l_coffin_scale_x_fp > \c_zero_fp - { \l_coffin_scaled_width_dim -#2 \Width } - { \l_coffin_scaled_width_dim #2 \Width } - \hbox_set:Nn #1 { \scalebox {#2} [#3] { \box_use:N #1 } } - \coffin_resize_common:Nnn #1 - { \l_coffin_scaled_width_dim } { \l_coffin_scaled_total_height_dim } -} -\cs_generate_variant:Nn \coffin_scale:Nnn { c } -\cs_new_protected_nopar:Npn \coffin_scale_vector:nnNN #1#2#3#4 { - \fp_set_from_dim:Nn \l_coffin_tmp_fp {#1} - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_scale_x_fp } - \dim_set:Nn #3 { \fp_to_dim:N \l_coffin_tmp_fp } - \fp_set_from_dim:Nn \l_coffin_tmp_fp {#2} - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_scale_y_fp } - \dim_set:Nn #4 { \fp_to_dim:N \l_coffin_tmp_fp } -} -\cs_new_protected_nopar:Npn \coffin_scale_corner:Nnnn #1#2#3#4 { - \coffin_scale_vector:nnNN {#3} {#4} \l_coffin_x_dim \l_coffin_y_dim - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } {#2} - { { \dim_use:N \l_coffin_x_dim } { \dim_use:N \l_coffin_y_dim } } -} -\cs_new_protected_nopar:Npn \coffin_scale_pole:Nnnnnn #1#2#3#4#5#6 { - \coffin_scale_vector:nnNN {#3} {#4} \l_coffin_x_dim \l_coffin_y_dim - \coffin_set_pole:Nnx #1 {#2} - { - { \dim_use:N \l_coffin_x_dim } { \dim_use:N \l_coffin_y_dim } - {#5} {#6} - } -} -\cs_new_protected_nopar:Npn \coffin_x_shift_corner:Nnnn #1#2#3#4 { - \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } {#2} - { - { \the_tex:D \etex_dimexpr:D #3 + \box_wd:N #1 \scan_stop: } {#4} - } -} -\cs_new_protected_nopar:Npn \coffin_x_shift_pole:Nnnnnn #1#2#3#4#5#6 { - \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _prop } {#2} - { - { \the_tex:D \etex_dimexpr:D #3 + \box_wd:N #1 \scan_stop: } {#4} - {#5} {#6} - } -} -\coffin_new:N \l_coffin_display_coffin -\coffin_new:N \l_coffin_display_coord_coffin -\coffin_new:N \l_coffin_display_pole_coffin -\prop_new:N \l_coffin_display_handles_prop -\prop_put:Nnn \l_coffin_display_handles_prop { tl } - { { b } { r } { -1 } { 1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { thc } - { { b } { hc } { 0 } { 1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { tr } - { { b } { l } { 1 } { 1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { vcl } - { { vc } { r } { -1 } { 0 } } -\prop_put:Nnn \l_coffin_display_handles_prop { vchc } - { { vc } { hc } { 0 } { 0 } } -\prop_put:Nnn \l_coffin_display_handles_prop { vcr } - { { vc } { l } { 1 } { 0 } } -\prop_put:Nnn \l_coffin_display_handles_prop { bl } - { { t } { r } { -1 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { bhc } - { { t } { hc } { 0 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { br } - { { t } { l } { 1 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Tl } - { { t } { r } { -1 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Thc } - { { t } { hc } { 0 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Tr } - { { t } { l } { 1 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Hl } - { { vc } { r } { -1 } { 1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Hhc } - { { vc } { hc } { 0 } { 1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Hr } - { { vc } { l } { 1 } { 1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Bl } - { { b } { r } { -1 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Bhc } - { { b } { hc } { 0 } { -1 } } -\prop_put:Nnn \l_coffin_display_handles_prop { Br } - { { b } { l } { 1 } { -1 } } -\dim_new:N \l_coffin_display_offset_dim -\dim_set:Nn \l_coffin_display_offset_dim { 2 pt } -\dim_new:N \l_coffin_display_x_dim -\dim_new:N \l_coffin_display_y_dim -\prop_new:N \l_coffin_display_poles_prop -\tl_new:N \l_coffin_display_font_tl -\tl_set:Nn \l_coffin_display_font_tl { \sffamily \tiny } -\cs_new_eq:NN \l_coffin_show_toks \toks@ -\prop_new:N \l_coffin_handles_tmp_prop -\cs_new_protected_nopar:Npn \coffin_mark_handle:Nnnn #1#2#3#4 { - \hcoffin_set:Nn \l_coffin_display_pole_coffin - { - \color {#4} - \rule { 1 pt } { 1 pt } - \hbox:n { \tex_vrule:D width 1 pt height 1 pt \scan_stop: } % TEMP - } - \coffin_attach_mark:NnnNnnnn #1 {#2} {#3} - \l_coffin_display_pole_coffin { hc } { vc } { 0 pt } { 0 pt } - \hcoffin_set:Nn \l_coffin_display_coord_coffin - { - \color {#4} - \l_coffin_display_font_tl - ( \tl_to_str:n { #2 , #3 } ) - } - \prop_get:NnN \l_coffin_display_handles_prop - { #2 #3 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl - { - \prop_get:NnN \l_coffin_display_handles_prop - { #3 #2 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl - { - \coffin_attach_mark:NnnNnnnn #1 {#2} {#3} - \l_coffin_display_coord_coffin { l } { vc } - { 1 pt } { 0 pt } - } - { - \exp_last_unbraced:No \coffin_mark_handle_aux:nnnnNnn - \l_coffin_tmp_tl #1 {#2} {#3} - } - } - { - \exp_last_unbraced:No \coffin_mark_handle_aux:nnnnNnn - \l_coffin_tmp_tl #1 {#2} {#3} - } -} -\cs_new_protected_nopar:Npn - \coffin_mark_handle_aux:nnnnNnn #1#2#3#4#5#6#7 { - \coffin_attach_mark:NnnNnnnn #5 {#6} {#7} - \l_coffin_display_coord_coffin {#1} {#2} - { #3 \l_coffin_display_offset_dim } - { #4 \l_coffin_display_offset_dim } -} -\cs_generate_variant:Nn \coffin_mark_handle:Nnnn { c } -\cs_new_protected_nopar:Npn \coffin_display_handles:Nn #1#2 { - \hcoffin_set:Nn \l_coffin_display_pole_coffin - { - \color {#2} - \rule { 1 pt } { 1 pt } - } - \prop_set_eq:Nc \l_coffin_display_poles_prop - { l_coffin_poles_ \tex_number:D #1 _prop } - \coffin_get_pole:NnN #1 { H } \l_coffin_pole_a_tl - \coffin_get_pole:NnN #1 { T } \l_coffin_pole_b_tl - \tl_if_eq:NNT \l_coffin_pole_a_tl \l_coffin_pole_b_tl - { \prop_del:Nn \l_coffin_display_poles_prop { T } } - \coffin_get_pole:NnN #1 { B } \l_coffin_pole_b_tl - \tl_if_eq:NNT \l_coffin_pole_a_tl \l_coffin_pole_b_tl - { \prop_del:Nn \l_coffin_display_poles_prop { B } } - \coffin_set_eq:NN \l_coffin_display_coffin #1 - \prop_clear:N \l_coffin_handles_tmp_prop - \prop_map_inline:Nn \l_coffin_display_poles_prop - { - \prop_del:Nn \l_coffin_display_poles_prop {##1} - \coffin_display_handles_aux:nnnnnn {##1} ##2 {#2} - } - \box_use:N \l_coffin_display_coffin -} -\cs_new_protected_nopar:Npn - \coffin_display_handles_aux:nnnnnn #1#2#3#4#5#6 { - \prop_map_inline:Nn \l_coffin_display_poles_prop - { - \bool_set_false:N \l_coffin_error_bool - \coffin_calculate_intersection:nnnnnnnn {#2} {#3} {#4} {#5} ##2 - \bool_if:NF \l_coffin_error_bool - { - \dim_set:Nn \l_coffin_display_x_dim { \l_coffin_x_dim } - \dim_set:Nn \l_coffin_display_y_dim { \l_coffin_y_dim } - \coffin_display_attach:Nnnnn - \l_coffin_display_pole_coffin { hc } { vc } - { 0 pt } { 0 pt } - \hcoffin_set:Nn \l_coffin_display_coord_coffin - { - \color {#6} - \l_coffin_display_font_tl - ( \tl_to_str:n { #1 , ##1 } ) - } - \prop_get:NnN \l_coffin_display_handles_prop - { #1 ##1 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl - { - \prop_get:NnN \l_coffin_display_handles_prop - { ##1 #1 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl - { - \coffin_display_attach:Nnnnn - \l_coffin_display_coord_coffin { l } { vc } - { 1 pt } { 0 pt } - } - { - \exp_last_unbraced:No - \coffin_display_handles_aux:nnnn - \l_coffin_tmp_tl - } - } - { - \exp_last_unbraced:No \coffin_display_handles_aux:nnnn - \l_coffin_tmp_tl - } - } - } -} -\cs_new_protected_nopar:Npn \coffin_display_handles_aux:nnnn #1#2#3#4 { - \coffin_display_attach:Nnnnn - \l_coffin_display_coord_coffin {#1} {#2} - { #3 \l_coffin_display_offset_dim } - { #4 \l_coffin_display_offset_dim } -} -\cs_generate_variant:Nn \coffin_display_handles:Nn { c } -\cs_new_protected_nopar:Npn \coffin_display_attach:Nnnnn #1#2#3#4#5 { - \coffin_calculate_intersection:Nnn #1 {#2} {#3} - \dim_set:Nn \l_coffin_x_prime_dim { \l_coffin_x_dim } - \dim_set:Nn \l_coffin_y_prime_dim { \l_coffin_y_dim } - \dim_set:Nn \l_coffin_offset_x_dim - { \l_coffin_display_x_dim - \l_coffin_x_prime_dim + #4 } - \dim_set:Nn \l_coffin_offset_y_dim - { \l_coffin_display_y_dim - \l_coffin_y_prime_dim + #5 } - \hbox_set:Nn \l_coffin_aligned_coffin - { - \box_use:N \l_coffin_display_coffin - \tex_kern:D -\box_wd:N \l_coffin_display_coffin - \tex_kern:D \l_coffin_offset_x_dim - \box_move_up:nn { \l_coffin_offset_y_dim } { \box_use:N #1 } - } - \box_set_ht:Nn \l_coffin_aligned_coffin - { \box_ht:N \l_coffin_display_coffin } - \box_set_dp:Nn \l_coffin_aligned_coffin - { \box_dp:N \l_coffin_display_coffin } - \box_set_wd:Nn \l_coffin_aligned_coffin - { \box_wd:N \l_coffin_display_coffin } - \box_set_eq:NN \l_coffin_display_coffin \l_coffin_aligned_coffin -} -\cs_new_protected_nopar:Npn \coffin_show_structure:N #1 { - \toks_clear:N \l_coffin_show_toks - \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } - { - \iow_term:x - { - \iow_newline: - Size~of~coffin~\token_to_str:N #1 : \iow_newline: - > ~ ht~=~\dim_use:N \box_ht:N #1 \iow_newline: - > ~ dp~=~\dim_use:N \box_dp:N #1 \iow_newline: - > ~ wd~=~\dim_use:N \box_wd:N #1 \iow_newline: - } - \iow_term:x { Poles~of~coffin~\token_to_str:N #1 : } - \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } - { - \toks_if_empty:NF \l_coffin_show_toks - { - \toks_put_right:Nx \l_coffin_show_toks - { \iow_newline: > ~ } - } - \toks_put_right:Nx \l_coffin_show_toks - { ~ \exp_not:n {##1} \c_space_tl => ~ \exp_not:n {##2} } - } - } - { - \iow_term:x { ---~No~poles~found~--- } - \toks_put_right:Nn \l_coffin_show_toks - { Is~this~really~a~coffin? } - } - \toks_show:N \l_coffin_show_toks -} -\cs_generate_variant:Nn \coffin_show_structure:N { c } -\msg_kernel_new:nnnn { coffin } { no-pole-intersection } - { No~intersection~between~coffin~poles. } - { - \l_msg_coding_error_text_tl - LaTeX~was~asked~to~find~the~intersection~between~two~poles,~ - but~they~do~not~have~a~unique~meeting~point:~ - the~value~(0~pt,~0~pt)~will~be~used. - } -\msg_kernel_new:nnnn { coffin } { unknown-coffin } - { Unknown~coffin~'#1'. } - { The~coffin~'#1'~was~never~defined. } -\msg_kernel_new:nnnn { coffin } { unknown-coffin-pole } - { Pole~'#1'~unknown~for~coffin~'#2'. } - { - \l_msg_coding_error_text_tl - LaTeX~was~asked~to~find~a~typesetting~pole~for~a~coffin,~ - but~either~the~coffin~does~not~exist~or~the~pole~name~is~wrong. - } -\cs_new:Npn \exp_last_two_unbraced:Noo #1 #2 #3{ - \exp_after:wN \exp_after:wN \exp_after:wN #1 \exp_after:wN #2 #3 -} -\endinput -%% -%% End of file `l3coffins.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty b/Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty deleted file mode 100644 index f201481052b..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty +++ /dev/null @@ -1,174 +0,0 @@ -%% -%% This is file `xcoffins.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% xcoffins.dtx (with options: `package') -%% -%% (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 xcoffins 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 xcoffins.dtx (C) Copyright 2010 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 ``xcoffins 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} -\RequirePackage{graphicx,xcolor} -\GetIdInfo$Id: xcoffins.dtx 2097 2010-12-05 21:59:21Z mittelba $ - {Coffins} -\ProvidesExplPackage - {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{l3coffins,xparse} -\keys_define:nn { coffin } { - coffin1-hpole .tl_set:N = \l_coffin_A_hpole_tl , - coffin1-hpole .value_required: , - coffin1-vpole .tl_set:N = \l_coffin_A_vpole_tl , - coffin1-vpole .value_required: , - coffin2-hpole .tl_set:N = \l_coffin_B_hpole_tl , - coffin2-hpole .value_required: , - coffin2-vpole .tl_set:N = \l_coffin_B_vpole_tl , - coffin2-vpole .value_required: , - grow-bounding-box .bool_set:N = \l_coffin_bound_box_grow_bool , - grow-bounding-box .default:n = true , - hoffset .dim_set:N = \l_coffin_hoffset_dim , - hoffset .value_required: , - voffset .dim_set:N = \l_coffin_voffset_dim , - voffset .value_required: , -} -\keys_set:nn { coffin } { - coffin1-hpole = H , - coffin1-vpole = l , - coffin2-hpole = H , - coffin2-vpole = l , - grow-bounding-box = true , - hoffset = 0 pt , - voffset = 0 pt , -} -\NewDocumentCommand \NewCoffin { m } { - \coffin_new:N #1 -} -\NewDocumentCommand \SetHorizontalCoffin { m +m } { - \hcoffin_set:Nn #1 {#2} -} -\NewDocumentCommand \SetVerticalCoffin { m m +m } { - \vcoffin_set:Nnn #1 {#2} {#3} -} -\NewDocumentCommand \SetHorizontalPole { m m m } { - \coffin_set_horizontal_pole:Nnn #1 {#2} {#3} -} -\NewDocumentCommand \SetVerticalPole { m m m } { - \coffin_set_vertical_pole:Nnn #1 {#2} {#3} -} -\NewDocumentCommand \JoinCoffins - { - o - s - m - > { \SplitArgument { 1 } { , } } O { H , l } - m - > { \SplitArgument { 1 } { , } } O { H , l } - > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt } - } - { - \IfNoValueTF {#1} - { - \IfBooleanTF #2 - { \coffin_attach:NnnNnnnn #3 #4 #5 #6 #7 } - { \coffin_join:NnnNnnnn #3 #4 #5 #6 #7 } - } - { - \group_begin: - \keys_set:nn { coffin } {#1} - \tl_set:Nx \l_coffin_tmp_tl - { - \group_end: - \bool_if:NTF \l_coffin_bound_box_grow_bool - { \coffin_join:NnnNnnnn } - { \coffin_attach:NnnNnnnn } - \exp_not:N #3 - { \exp_not:o { \l_coffin_A_hpole_tl } } - { \exp_not:o { \l_coffin_A_vpole_tl } } - \exp_not:N #5 - { \exp_not:o { \l_coffin_B_hpole_tl } } - { \exp_not:o { \l_coffin_B_vpole_tl } } - { \dim_use:N \l_coffin_hoffset_dim } - { \dim_use:N \l_coffin_voffset_dim } - } - \l_coffin_tmp_tl - } - } -\NewDocumentCommand \TypesetCoffin - { - m - > { \SplitArgument { 1 } { , } } O { H , l } - > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt } - } - { \coffin_typeset:Nnnnn #1 #2 #3 } -\NewDocumentCommand \RotateCoffin { m m } { - \coffin_rotate:Nn #1 {#2} -} -\NewDocumentCommand \ResizeCoffin { m m m } { - \coffin_resize:Nnn #1 {#2} {#3} -} -\NewDocumentCommand \ScaleCoffin { m m m } { - \coffin_scale:Nnn #1 {#2} {#3} -} -\NewDocumentCommand \DisplayCoffinHandles { m m } { - \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } - { \coffin_display_handles:Nn #1 {#2} } - { \msg_kernel_error:nx { unknown-coffin } { \token_to_str:N #1 } } -} -\NewDocumentCommand \MarkCoffinHandle - { m > { \SplitArgument { 1 } { , } } O { H , l } m } - { - \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } - { \coffin_mark_handle:Nnnn #1 #2 {#3} } - { \msg_kernel_error:nx { unknown-coffin } { \token_to_str:N #1 } - } -} -\NewDocumentCommand \ShowCoffinStructure { m } { - \coffin_show_structure:N #1 -} -\endinput -%% -%% End of file `xcoffins.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xhead/xhead.sty b/Master/texmf-dist/tex/latex/xpackages/xhead/xhead.sty deleted file mode 100644 index 76e375199d7..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xhead/xhead.sty +++ /dev/null @@ -1,376 +0,0 @@ -%% -%% 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 deleted file mode 100644 index 55102e3c9cc..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty +++ /dev/null @@ -1,142 +0,0 @@ -%% -%% This is file `l3keys2e.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% l3keys2e.dtx (with options: `package') -%% ---------------------------------------------------------------- -%% l3keys2e --- Parsing LaTeX3 keyvals as LaTeX2e package options -%% Copyright 2009 The LaTeX3 Project -%% Released under the LaTeX Project Public License v1.3c or later -%% See http://www.latex-project.org/lppl.txt -%% ---------------------------------------------------------------- -%% File: l3keys2e.dtx (C) Copyright 2009,2011 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 ``l3keys2e'' (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{l3names} -\GetIdInfo$Id: l3keys2e.dtx 2320 2011-05-06 16:56:27Z joseph $ - {Parsing LaTeX3 keyvals as LaTeX2e package options} -\ProvidesExplPackage - {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage { xparse } -\clist_new:N \keys_latexe_options_clist -\bool_new:N \_l_keys_process_class_bool -\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: - \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: } -} -\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_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_protected:Npn \keys_latexe_options_package:n #1 { - \clist_map_inline:Nn \@classoptionslist - { - \cs_if_exist:cT - { - \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_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} -\cs_new_protected:Npn \ProcessKeysOptions #1 { - \bool_set_true:N \_l_keys_process_class_bool - \keys_latexe_options:n {#1} -} -\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'. |