From 22b3e2352fd8468e037c06e99bcad91688cc503d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 16 Jan 2022 23:55:29 +0100 Subject: [PATCH] some debugging --- src/environments/groupthm.pysty3 | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/environments/groupthm.pysty3 b/src/environments/groupthm.pysty3 index ec728ab..d92f3e3 100644 --- a/src/environments/groupthm.pysty3 +++ b/src/environments/groupthm.pysty3 @@ -62,8 +62,7 @@ __HEADER__(Grouping theorems for easier customization.) \clist_new:N \l_groupthm_group_clist -\str_new:N \g_groupthm_last_theorem_group_str - +\clist_new:N \g_groupthm_defined_theorem_groups_clist %%% Keys @@ -91,8 +90,6 @@ __HEADER__(Grouping theorems for easier customization.) } - - % groupname, prename, postname, mapname, thmtools \cs_new:Npn \new_theorem_group:nnnnn #1#2#3#4#5 { @@ -115,13 +112,17 @@ __HEADER__(Grouping theorems for easier customization.) \clist_put_right:Nn \l_groupthm_thmtools_clist { #5 } } } - \hook_gset_rule:nnnn { groupthm / groupsort } - \g_groupthm_last_theorem_group_str - { before } - { - #1 + + \cs_set:Npn \help:n ##1 { + \hook_gset_rule:nnnn { groupthm / groupsort } + { #1 } + { before } + { ##1 } } - \str_gset:Nn \g_groupthm_last_theorem_group_str { #1 } + + \clist_map_function:NN \g_groupthm_defined_theorem_groups_clist \help:n + + \clist_gput_left:Nn \g_groupthm_defined_theorem_groups_clist { #1 } } \cs_generate_variant:Nn \new_theorem_group:nnnnn { n V V V V } @@ -278,10 +279,17 @@ __HEADER__(Grouping theorems for easier customization.) \cs_new:Npn \__sort_group_names: { + +% \tl_show:n { sorting} +% \clist_show:N \l_groupthm_group_clist + \hook_gremove_code:nn { groupthm / groupsort }{*} \clist_map_function:NN \l_groupthm_group_clist \__add_to_sort_hook:n \clist_clear:N \l_groupthm_group_clist +% \ShowHook { groupthm / groupsort } \hook_use:n { groupthm / groupsort } + +% \clist_show:N \l_groupthm_group_clist } @@ -296,6 +304,10 @@ __HEADER__(Grouping theorems for easier customization.) \powerset_clist_foreach:Nn \l_groupthm_group_clist { \__sort_group_names: + +% \tl_show:n { Generating new theorem variant } +% \clist_show:N \l_groupthm_group_clist + \new_grouped_theorem:xVnn {__#1__groups_\clist_use:Nn \l_groupthm_group_clist {_}} \l_groupthm_group_clist