rename prename and postname to prefix and suffix

This commit is contained in:
Maximilian Keßler 2022-01-20 12:08:36 +01:00
parent b514de5e09
commit 0dd60e3447

View File

@ -103,9 +103,9 @@
% %
% %
% \begin{description} % \begin{description}
% \item[\kw{prename}] A prefix (any \meta{token list}) that will be inserted % \item[\kw{prefix}] A prefix (any \meta{token list}) that will be inserted
% before the theorem name of each member of this \meta{theorem group}. % before the theorem name of each member of this \meta{theorem group}.
% \item[\kw{postname}] A suffix (any \meta{token list}) that will be % \item[\kw{suffix}] A suffix (any \meta{token list}) that will be
% inserted before the theorem name for each member of this \meta{theorem group}. % inserted before the theorem name for each member of this \meta{theorem group}.
% This could be e.g.~some \enquote{$\star$} appended to the name to indicate % This could be e.g.~some \enquote{$\star$} appended to the name to indicate
% variants of environments. % variants of environments.
@ -247,12 +247,12 @@
% \begin{description} % \begin{description}
% \item % \item
% %
% \kw{prename} = \meta{token list}. % \kw{prefix} = \meta{token list}.
% Insert the \meta{token list} in front of the theorem name. % Insert the \meta{token list} in front of the theorem name.
% %
% \item % \item
% %
% \kw{postname} = \meta{token list}. % \kw{suffix} = \meta{token list}.
% Insert the \meta{token list} after the theorem name. % Insert the \meta{token list} after the theorem name.
% %
% \item % \item
@ -289,10 +289,10 @@
% controlling their order of application in case a theorem is member % controlling their order of application in case a theorem is member
% of both groups. % of both groups.
% %
% The \meta{keyname} can be one of \kw{prename}, \kw{postname}, \kw{mapname}, \kw{thmtools}. % The \meta{keyname} can be one of \kw{prefix}, \kw{suffix}, \kw{mapname}, \kw{thmtools}.
% If present, it declares the corresponding relation only for this subkey. % If present, it declares the corresponding relation only for this subkey.
% This can lead to \meta{theorem group 1} overwriting \meta{theorem group 2} when given % This can lead to \meta{theorem group 1} overwriting \meta{theorem group 2} when given
% contradictory \pkg{thmtools} options, but the \kw{prename} of \meta{theorem group 1} % contradictory \pkg{thmtools} options, but the \kw{prefix} of \meta{theorem group 1}
% being applied after the one of \meta{theorem group 2}. % being applied after the one of \meta{theorem group 2}.
% When the \meta{keyname} is not given, this applies to all keywords. % When the \meta{keyname} is not given, this applies to all keywords.
% %
@ -312,12 +312,12 @@
% \item[\kw{higher} or \kw{after} or \kw{\string>}] % \item[\kw{higher} or \kw{after} or \kw{\string>}]
% %
% \meta{theorem group 1} takes precedence over \meta{theorem group 2}. % \meta{theorem group 1} takes precedence over \meta{theorem group 2}.
% Its \kw{prename} is applied after the one of \meta{theorem group 2}. % Its \kw{prefix} is applied after the one of \meta{theorem group 2}.
% %
% \item[\kw{lower} or \kw{before} or \kw{\string<}] % \item[\kw{lower} or \kw{before} or \kw{\string<}]
% %
% \meta{theorem group 2} takes precedence over \meta{theorem group 1}. % \meta{theorem group 2} takes precedence over \meta{theorem group 1}.
% Its \kw{prename} is applied after the one of \meta{theorem group 1}. % Its \kw{prefix} is applied after the one of \meta{theorem group 1}.
% %
% \end{description} % \end{description}
% %
@ -730,8 +730,8 @@
% \groupthm_declare_theorem_group:nVVVV % \groupthm_declare_theorem_group:nVVVV
% } % }
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_new_theorem_group:nnnnn}\marg{theorem group}\marg{prename tl} % \cs{groupthm_new_theorem_group:nnnnn}\marg{theorem group}\marg{prefix tl}
% \marg{postname tl}\marg{mapname clist}\marg{thmtools clist} % \marg{suffix tl}\marg{mapname clist}\marg{thmtools clist}
% \end{syntax} % \end{syntax}
% %
% Non-keyval versions of % Non-keyval versions of
@ -1071,8 +1071,8 @@
% and we thus mark them with a preceding \texttt{__}. % and we thus mark them with a preceding \texttt{__}.
% %
% \begin{macrocode} % \begin{macrocode}
\hook_new:n { @@/prename } \hook_new:n { @@/prefix }
\hook_new:n { @@/postname } \hook_new:n { @@/suffix }
\hook_new:n { @@/mapname } \hook_new:n { @@/mapname }
\hook_new:n { @@/thmtools } \hook_new:n { @@/thmtools }
% \end{macrocode} % \end{macrocode}
@ -1096,15 +1096,15 @@
% %
% \begin{variable} % \begin{variable}
% { % {
% \l_@@_key_prename_tl, \l_@@_key_name_tl, \l_@@_key_postname_tl, % \l_@@_key_prefix_tl, \l_@@_key_name_tl, \l_@@_key_suffix_tl,
% \l_@@_key_group_clist, \l_@@_key_mapname_clist, \l_@@_key_thmtools_clist % \l_@@_key_group_clist, \l_@@_key_mapname_clist, \l_@@_key_thmtools_clist
% } % }
% These variables will be set by the key-value interface provided by % These variables will be set by the key-value interface provided by
% \pkg{l3keys} and are used in various places in the package. % \pkg{l3keys} and are used in various places in the package.
% \begin{macrocode} % \begin{macrocode}
\tl_new:N \l_@@_key_prename_tl \tl_new:N \l_@@_key_prefix_tl
\tl_new:N \l_@@_key_name_tl \tl_new:N \l_@@_key_name_tl
\tl_new:N \l_@@_key_postname_tl \tl_new:N \l_@@_key_suffix_tl
\clist_new:N \l_@@_key_group_clist \clist_new:N \l_@@_key_group_clist
\clist_new:N \l_@@_key_mapname_clist \clist_new:N \l_@@_key_mapname_clist
\clist_new:N \l_@@_key_thmtools_clist \clist_new:N \l_@@_key_thmtools_clist
@ -1113,9 +1113,9 @@
% %
% \begin{variable} % \begin{variable}
% { % {
% \l_@@_prename_tl, % \l_@@_prefix_tl,
% \l_@@_name_tl, % \l_@@_name_tl,
% \l_@@_postname_tl, % \l_@@_suffix_tl,
% \l_@@_mapname_clist, % \l_@@_mapname_clist,
% \l_@@_thmtools_clist, % \l_@@_thmtools_clist,
% \l_@@_group_clist % \l_@@_group_clist
@ -1126,9 +1126,9 @@
% but also in just a local variable sense. % but also in just a local variable sense.
% %
% \begin{macrocode} % \begin{macrocode}
\tl_new:N \l_@@_prename_tl \tl_new:N \l_@@_prefix_tl
\tl_new:N \l_@@_name_tl \tl_new:N \l_@@_name_tl
\tl_new:N \l_@@_postname_tl \tl_new:N \l_@@_suffix_tl
\clist_new:N \l_@@_mapname_clist \clist_new:N \l_@@_mapname_clist
\clist_new:N \l_@@_thmtools_clist \clist_new:N \l_@@_thmtools_clist
\clist_new:N \l_@@_group_clist \clist_new:N \l_@@_group_clist
@ -1171,15 +1171,15 @@
% \begin{macrocode} % \begin{macrocode}
\keys_define:nn { groupthm } \keys_define:nn { groupthm }
{ {
prename .tl_set:N = \l_@@_key_prename_tl, prefix .tl_set:N = \l_@@_key_prefix_tl,
prename .default:n = \c_empty_tl, prefix .default:n = \c_empty_tl,
prename .groups:n = { theoremgroup }, prefix .groups:n = { theoremgroup },
name .tl_set:N = \l_@@_key_name_tl, name .tl_set:N = \l_@@_key_name_tl,
name .default:n = \c_novalue_tl, name .default:n = \c_novalue_tl,
name .groups:n = { groupedtheorem, theoremvariants }, name .groups:n = { groupedtheorem, theoremvariants },
postname .tl_set:N = \l_@@_key_postname_tl, suffix .tl_set:N = \l_@@_key_suffix_tl,
postname .default:n = \c_empty_tl, suffix .default:n = \c_empty_tl,
postname .groups:n = { theoremgroup }, suffix .groups:n = { theoremgroup },
group .clist_set:N = \l_@@_key_group_clist, group .clist_set:N = \l_@@_key_group_clist,
group .default:n = {}, group .default:n = {},
group .groups:n = { groupedtheorem, theoremvariants }, group .groups:n = { groupedtheorem, theoremvariants },
@ -1214,7 +1214,7 @@
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \@@_set_normalized_keys:nnn #1 #2 #3 \cs_new:Npn \@@_set_normalized_keys:nnn #1 #2 #3
{ {
\keys_set:nn { groupthm } { prename, name, postname, group, mapname, thmtools } \keys_set:nn { groupthm } { prefix, name, suffix, group, mapname, thmtools }
\keys_set_groups:nnn { groupthm } { #2 } { #1 } \keys_set_groups:nnn { groupthm } { #2 } { #1 }
% \end{macrocode} % \end{macrocode}
% %
@ -1236,8 +1236,8 @@
% Copy set keys into local variables % Copy set keys into local variables
% %
% \begin{macrocode} % \begin{macrocode}
\tl_set_eq:NN \l_@@_prename_tl \l_@@_key_prename_tl \tl_set_eq:NN \l_@@_prefix_tl \l_@@_key_prefix_tl
\tl_set_eq:NN \l_@@_postname_tl \l_@@_key_postname_tl \tl_set_eq:NN \l_@@_suffix_tl \l_@@_key_suffix_tl
\clist_set_eq:NN \l_@@_group_clist \l_@@_key_group_clist \clist_set_eq:NN \l_@@_group_clist \l_@@_key_group_clist
\clist_set_eq:NN \l_@@_mapname_clist \l_@@_key_mapname_clist \clist_set_eq:NN \l_@@_mapname_clist \l_@@_key_mapname_clist
\clist_set_eq:NN \l_@@_thmtools_clist \l_@@_key_thmtools_clist \clist_set_eq:NN \l_@@_thmtools_clist \l_@@_key_thmtools_clist
@ -1355,8 +1355,8 @@
% %
% \begin{macro}{\@@_declare_theorem_group_aux:nnnnn} % \begin{macro}{\@@_declare_theorem_group_aux:nnnnn}
% \begin{syntax} % \begin{syntax}
% \cs{@@_declare_theorem_group_aux:nnnnn}\marg{theorem group}\marg{prename tl} % \cs{@@_declare_theorem_group_aux:nnnnn}\marg{theorem group}\marg{prefix tl}
% \marg{postname tl}\marg{mapname clist}\marg{thmtools clist} % \marg{suffix tl}\marg{mapname clist}\marg{thmtools clist}
% \end{syntax} % \end{syntax}
% %
% This creates a new theorem group out of the given parameters. % This creates a new theorem group out of the given parameters.
@ -1380,13 +1380,13 @@
% \begin{macrocode} % \begin{macrocode}
\cs_new:cpn { @@_use_group_#1: } \cs_new:cpn { @@_use_group_#1: }
{ {
\hook_gput_code:nnn { @@/prename } { #1 } \hook_gput_code:nnn { @@/prefix } { #1 }
{ {
\tl_put_left:Nx \l_@@_prename_tl { #2 } \tl_put_left:Nx \l_@@_prefix_tl { #2 }
} }
\hook_gput_code:nnn { @@/postname } { #1 } \hook_gput_code:nnn { @@/suffix } { #1 }
{ {
\tl_put_right:Nx \l_@@_postname_tl { #3 } \tl_put_right:Nx \l_@@_suffix_tl { #3 }
} }
\hook_gput_code:nnn { @@/mapname } { #1 } \hook_gput_code:nnn { @@/mapname } { #1 }
{ {
@ -1421,7 +1421,7 @@
% \end{syntax} % \end{syntax}
% %
% Undeclares / undefines the given theorem group. % Undeclares / undefines the given theorem group.
% This means removing its hook code in the \texttt{prename}, \texttt{postname}, % This means removing its hook code in the \texttt{prefix}, \texttt{suffix},
% \texttt{mapname} and \texttt{thmtools} hooks, % \texttt{mapname} and \texttt{thmtools} hooks,
% and removing all relations with other theorem groups globally % and removing all relations with other theorem groups globally
% as well as for each hook individually. % as well as for each hook individually.
@ -1437,8 +1437,8 @@
% Remove properties from hooks % Remove properties from hooks
% %
% \begin{macrocode} % \begin{macrocode}
\hook_gremove_code:nn { @@/prename } { #1 } \hook_gremove_code:nn { @@/prefix } { #1 }
\hook_gremove_code:nn { @@/postname } { #1 } \hook_gremove_code:nn { @@/suffix } { #1 }
\hook_gremove_code:nn { @@/mapname } { #1 } \hook_gremove_code:nn { @@/mapname } { #1 }
\hook_gremove_code:nn { @@/thmtools } { #1 } \hook_gremove_code:nn { @@/thmtools } { #1 }
% \end{macrocode} % \end{macrocode}
@ -1458,12 +1458,12 @@
{ unrelated } { unrelated }
{ #1 } { #1 }
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/prename } { @@/prefix }
\g_@@_defined_theorem_groups_clist \g_@@_defined_theorem_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
\@@_hook_gset_rule_foreach:nNnn \@@_hook_gset_rule_foreach:nNnn
{ @@/postname } { @@/suffix }
\g_@@_defined_theorem_groups_clist \g_@@_defined_theorem_groups_clist
{ unrelated } { unrelated }
{ #1 } { #1 }
@ -1598,8 +1598,8 @@
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_new_theorem_group:nVVVV { #2 } \groupthm_new_theorem_group:nVVVV { #2 }
\l_@@_prename_tl \l_@@_prefix_tl
\l_@@_postname_tl \l_@@_suffix_tl
\l_@@_mapname_clist \l_@@_mapname_clist
\l_@@_thmtools_clist \l_@@_thmtools_clist
} }
@ -1618,8 +1618,8 @@
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_renew_theorem_group:nVVVV { #2 } \groupthm_renew_theorem_group:nVVVV { #2 }
\l_@@_prename_tl \l_@@_prefix_tl
\l_@@_postname_tl \l_@@_suffix_tl
\l_@@_mapname_clist \l_@@_mapname_clist
\l_@@_thmtools_clist \l_@@_thmtools_clist
} }
@ -1638,8 +1638,8 @@
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_provide_theorem_group:nVVVV { #2 } \groupthm_provide_theorem_group:nVVVV { #2 }
\l_@@_prename_tl \l_@@_prefix_tl
\l_@@_postname_tl \l_@@_suffix_tl
\l_@@_mapname_clist \l_@@_mapname_clist
\l_@@_thmtools_clist \l_@@_thmtools_clist
} }
@ -1658,8 +1658,8 @@
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_declare_theorem_group:nVVVV { #2 } \groupthm_declare_theorem_group:nVVVV { #2 }
\l_@@_prename_tl \l_@@_prefix_tl
\l_@@_postname_tl \l_@@_suffix_tl
\l_@@_mapname_clist \l_@@_mapname_clist
\l_@@_thmtools_clist \l_@@_thmtools_clist
} }
@ -1891,16 +1891,16 @@
% \end{macrocode} % \end{macrocode}
% First, set local variables to default values and store current name. % First, set local variables to default values and store current name.
% \begin{macrocode} % \begin{macrocode}
\tl_clear:N \l_@@_prename_tl \tl_clear:N \l_@@_prefix_tl
\tl_set:Nn \l_@@_name_tl { #3 } \tl_set:Nn \l_@@_name_tl { #3 }
\tl_clear:N \l_@@_postname_tl \tl_clear:N \l_@@_suffix_tl
\clist_clear:N \l_@@_mapname_clist \clist_clear:N \l_@@_mapname_clist
\clist_clear:N \l_@@_thmtools_clist \clist_clear:N \l_@@_thmtools_clist
% \end{macrocode} % \end{macrocode}
% Clear all hooks % Clear all hooks
% \begin{macrocode} % \begin{macrocode}
\hook_gremove_code:nn { @@/prename }{*} \hook_gremove_code:nn { @@/prefix }{*}
\hook_gremove_code:nn { @@/postname }{*} \hook_gremove_code:nn { @@/suffix }{*}
\hook_gremove_code:nn { @@/mapname }{*} \hook_gremove_code:nn { @@/mapname }{*}
\hook_gremove_code:nn { @@/thmtools }{*} \hook_gremove_code:nn { @@/thmtools }{*}
% \end{macrocode} % \end{macrocode}
@ -1911,8 +1911,8 @@
% Execute the hooks, so that local variables will get modified according to the groups % Execute the hooks, so that local variables will get modified according to the groups
% and in the order that were specified for the hooks. % and in the order that were specified for the hooks.
% \begin{macrocode} % \begin{macrocode}
\hook_use:n { @@/prename } \hook_use:n { @@/prefix }
\hook_use:n { @@/postname } \hook_use:n { @@/suffix }
\hook_use:n { @@/mapname } \hook_use:n { @@/mapname }
\hook_use:n { @@/thmtools } \hook_use:n { @@/thmtools }
% \end{macrocode} % \end{macrocode}
@ -1926,9 +1926,9 @@
% \begin{macrocode} % \begin{macrocode}
\clist_put_right:Nx \l_@@_thmtools_clist \clist_put_right:Nx \l_@@_thmtools_clist
{ {
name = \tl_use:N \l_@@_prename_tl name = \tl_use:N \l_@@_prefix_tl
\tl_use:N \l_@@_name_tl \tl_use:N \l_@@_name_tl
\tl_use:N \l_@@_postname_tl \tl_use:N \l_@@_suffix_tl
} }
% \end{macrocode} % \end{macrocode}
% Finally, apply the additional \pkg{thmtools} keys for this specific theorem. % Finally, apply the additional \pkg{thmtools} keys for this specific theorem.