use expl3 interface of hooks instead

This commit is contained in:
Maximilian Keßler 2022-01-16 18:03:43 +01:00
parent 73d473b25d
commit a8cca1cbc6

View file

@ -6,10 +6,10 @@ __HEADER__(Grouping theorems for easier customization.)
\RequirePackage{amsthm} \RequirePackage{amsthm}
\RequirePackage{thmtools} \RequirePackage{thmtools}
\NewHook { groupthm / prename } \hook_new:n { groupthm / prename }
\NewHook { groupthm / postname } \hook_new:n { groupthm / postname }
\NewHook { groupthm / mapname } \hook_new:n { groupthm / mapname }
\NewHook { groupthm / thmtools } \hook_new:n { groupthm / thmtools }
\newcounter{indocument} \newcounter{indocument}
@ -88,22 +88,22 @@ __HEADER__(Grouping theorems for easier customization.)
{ {
\cs_new:cpn { group_use_#1: } \cs_new:cpn { group_use_#1: }
{ {
\AddToHook { groupthm / prename } [ #1 ] \hook_gput_code:nnn { groupthm / prename } { #1 }
{ {
\tl_put_left:Nx \l_groupthm_prename_tl { #2 } \tl_put_left:Nx \l_groupthm_prename_tl { #2 }
} }
\AddToHook { groupthm / postname } [ #1 ] \hook_gput_code:nnn { groupthm / postname } { #1 }
{ {
\tl_put_right:Nx \l_groupthm_postname_tl { #3 } \tl_put_right:Nx \l_groupthm_postname_tl { #3 }
} }
\AddToHook { groupthm / mapname } [ #1 ] \hook_gput_code:nnn { groupthm / mapname } { #1 }
{ {
\clist_put_right:Nn \l_groupthm_mapname_clist { #4 } \clist_put_right:Nn \l_groupthm_mapname_clist { #4 }
} }
\AddToHook { groupthm / thmtools } [ #1 ] \hook_gput_code:nnn { groupthm / thmtools } { #1 }
{ {
\clist_put_right:Nn \l_groupthm_thmtools_clist { #5 } \clist_put_right:Nn \l_groupthm_thmtools_clist { #5 }
} }
} }
} }
\cs_generate_variant:Nn \new_theorem_group:nnnnn { n V V V V } \cs_generate_variant:Nn \new_theorem_group:nnnnn { n V V V V }
@ -154,10 +154,10 @@ __HEADER__(Grouping theorems for easier customization.)
\clist_clear:N \l_groupthm_mapname_clist \clist_clear:N \l_groupthm_mapname_clist
\clist_set:Nn \l_groupthm_thmtools_clist { #4 } \clist_set:Nn \l_groupthm_thmtools_clist { #4 }
\RemoveFromHook { groupthm / prename }[*] \hook_gremove_code:nn { groupthm / prename }{*}
\RemoveFromHook { groupthm / postname }[*] \hook_gremove_code:nn { groupthm / postname }{*}
\RemoveFromHook { groupthm / mapname }[*] \hook_gremove_code:nn { groupthm / mapname }{*}
\RemoveFromHook { groupthm / thmtools }[*] \hook_gremove_code:nn { groupthm / thmtools }{*}
\clist_map_function:nN { #2 } \group_use:n \clist_map_function:nN { #2 } \group_use:n
\hook_use:n { groupthm / prename } \hook_use:n { groupthm / prename }