diff options
Diffstat (limited to 'macros/latex/contrib/l3packages/xtemplate.dtx')
-rw-r--r-- | macros/latex/contrib/l3packages/xtemplate.dtx | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/macros/latex/contrib/l3packages/xtemplate.dtx b/macros/latex/contrib/l3packages/xtemplate.dtx index eb9ae86e94..42d00c8657 100644 --- a/macros/latex/contrib/l3packages/xtemplate.dtx +++ b/macros/latex/contrib/l3packages/xtemplate.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2023-01-16} +% \date{Released 2023-02-01} % % \maketitle % @@ -475,6 +475,15 @@ % then inserts the appropriate code into the input stream. % \end{function} % +% \begin{function}{\DeclareInstanceCopy} +% \begin{syntax} +% \cs{DeclareInstanceCopy} +% ~~\Arg{object type} \Arg{instance1} \Arg{instance2} +% \end{syntax} +% Copies the \meta{values} for \meta{instance1} for an +% \meta{object type} to \meta{instance2}. +% \end{function} +% % \section{Document interface} % % After the instances have been chosen, document commands must be @@ -702,7 +711,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xtemplate}{2023-01-16}{} +\ProvidesExplPackage{xtemplate}{2023-02-01}{} {L3 Experimental prototype document functions} % \end{macrocode} % @@ -1987,6 +1996,27 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\@@_copy_instance:nnnn} +% Copy--paste an instance +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_instance:nnnn #1#2#3#4 + { + \@@_if_instance_exist:nnnTF {#1} {#2} {#3} + { + \@@_recover_values:n { #1 / #2 / #3 } + \@@_store_values:n { #1 / #2 / #4 } + \cs_set_eq:cc { \c_@@_instances_root_tl #1 / #2 / #4 } + { \c_@@_instances_root_tl #1 / #2 / #3 } + } + { + \msg_error:nnxx { xtemplate } { unknown-instance } + {#1} {#3} + } + } +% \end{macrocode} +% \end{macro} +% +% % \begin{macro}{\@@_edit_instance:nnnn} % \begin{macro}{\@@_edit_instance_aux:nnnnn} % \begin{macro}{\@@_edit_instance_aux:nonnn} @@ -1994,7 +2024,7 @@ % variation is the source of the values to use. When editing, they are % recovered from the previous instance run. % \begin{macrocode} -\cs_new_protected:Npn \@@_edit_instance:nnnn #1#2#3 +\cs_new_protected:Npn \@@_edit_instance:nnnn #1#2#3#4 { \@@_if_instance_exist:nnnTF {#1} {#2} {#3} { @@ -2002,7 +2032,7 @@ \prop_get:NnN \l_@@_values_prop { from~template } \l_@@_tmp_tl \@@_edit_instance_aux:nonnn {#1} \l_@@_tmp_tl - {#2} {#3} + {#2} {#3} {#4} } { \msg_error:nnxx { xtemplate } { unknown-instance } @@ -2783,6 +2813,7 @@ % \begin{macro}{\EditTemplateDefaults} % \begin{macro}{\DeclareInstance} % \begin{macro}{\DeclareCollectionInstance} +% \begin{macro}{\DeclareInstanceCopy} % \begin{macro}{\EditInstance} % \begin{macro}{\EditCollectionInstance} % \begin{macro}{\UseTemplate} @@ -2803,6 +2834,8 @@ { \@@_declare_instance:nnnnn {#1} {#3} { } {#2} {#4} } \cs_new_protected:Npn \DeclareCollectionInstance #1#2#3#4#5 { \@@_declare_instance:nnnnn {#2} {#4} {#1} {#3} {#5} } +\cs_new_protected:Npn \DeclareInstanceCopy #1#2#3 + { \@@_copy_instance:nnnn {#1} { } {#2} {#3} } \cs_new_protected:Npn \EditTemplateDefaults #1#2#3 { \@@_edit_defaults:nnn {#1} {#2} {#3} } \cs_new_protected:Npn \EditInstance #1#2#3 @@ -2828,6 +2861,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\ShowTemplateCode} % \begin{macro}{\ShowTemplateDefaults} @@ -2888,7 +2922,7 @@ % A friendly wrapper % \begin{macrocode} \cs_new_protected:Npn \SetTemplateKeys #1#2#3 - { \keys_set:nn { template / #1 / #2 } {#3} } + { \keys_set_known:nnN { template / #1 / #2 } {#3} \l_@@_tmp_clist } % \end{macrocode} % \end{macro} % |