fix bugs in thmtools option not being set properly

This commit is contained in:
Maximilian Keßler 2022-01-17 00:20:14 +01:00
parent ed41616c4a
commit d609b54aac
2 changed files with 23 additions and 19 deletions

View file

@ -83,7 +83,7 @@ __HEADER__(Grouping theorems for easier customization.)
mapname .clist_set:N = \l_groupthm_mapname_clist, mapname .clist_set:N = \l_groupthm_mapname_clist,
mapname .default:n = {}, mapname .default:n = {},
mapname .groups:n = { theoremgroup }, mapname .groups:n = { theoremgroup },
thmtools .clist_set:N = \l_groupthm_thmtools_clist, thmtools .clist_set:N = \l_groupthm_key_thmtools_clist,
thmtools .default:n = {}, thmtools .default:n = {},
thmtools .groups:n = { theoremgroup, groupedtheorem, theoremvariants }, thmtools .groups:n = { theoremgroup, groupedtheorem, theoremvariants },
unknown .code:n = \msg_error:nnn { groupthm } { unknown ~ group } { \l_keys_key_str } unknown .code:n = \msg_error:nnn { groupthm } { unknown ~ group } { \l_keys_key_str }
@ -133,8 +133,8 @@ __HEADER__(Grouping theorems for easier customization.)
\new_theorem_group:nVVVV { #1 } \new_theorem_group:nVVVV { #1 }
\l_groupthm_key_prename_tl \l_groupthm_key_prename_tl
\l_groupthm_key_postname_tl \l_groupthm_key_postname_tl
\l_groupthm_mapname_clist \l_groupthm_key_mapname_clist
\l_groupthm_thmtools_clist \l_groupthm_key_thmtools_clist
} }
\NewDocumentCommand{\NewTheoremGroup}{ O{} m } \NewDocumentCommand{\NewTheoremGroup}{ O{} m }
@ -233,7 +233,6 @@ __HEADER__(Grouping theorems for easier customization.)
} }
%% Rules for different theorem groups %% Rules for different theorem groups
\cs_generate_variant:Nn \hook_gset_rule:nnnn { n n V n } \cs_generate_variant:Nn \hook_gset_rule:nnnn { n n V n }
@ -263,9 +262,6 @@ __HEADER__(Grouping theorems for easier customization.)
} }
%%% Hacks for sorting groupnames %%% Hacks for sorting groupnames
\cs_new:Npn \__add_to_sort_hook:n #1 \cs_new:Npn \__add_to_sort_hook:n #1
@ -279,17 +275,10 @@ __HEADER__(Grouping theorems for easier customization.)
\cs_new:Npn \__sort_group_names: \cs_new:Npn \__sort_group_names:
{ {
% \tl_show:n { sorting}
% \clist_show:N \l_groupthm_group_clist
\hook_gremove_code:nn { groupthm / groupsort }{*} \hook_gremove_code:nn { groupthm / groupsort }{*}
\clist_map_function:NN \l_groupthm_group_clist \__add_to_sort_hook:n \clist_map_function:NN \l_groupthm_group_clist \__add_to_sort_hook:n
\clist_clear:N \l_groupthm_group_clist \clist_clear:N \l_groupthm_group_clist
% \ShowHook { groupthm / groupsort }
\hook_use:n { groupthm / groupsort } \hook_use:n { groupthm / groupsort }
% \clist_show:N \l_groupthm_group_clist
} }
@ -305,9 +294,6 @@ __HEADER__(Grouping theorems for easier customization.)
{ {
\__sort_group_names: \__sort_group_names:
% \tl_show:n { Generating new theorem variant }
% \clist_show:N \l_groupthm_group_clist
\new_grouped_theorem:xVnn \new_grouped_theorem:xVnn
{__#1__groups_\clist_use:Nn \l_groupthm_group_clist {_}} {__#1__groups_\clist_use:Nn \l_groupthm_group_clist {_}}
\l_groupthm_group_clist \l_groupthm_group_clist
@ -336,7 +322,6 @@ __HEADER__(Grouping theorems for easier customization.)
} }
\clist_set_eq:NN \l_groupthm_group_clist \l_groupthm_key_group_clist \clist_set_eq:NN \l_groupthm_group_clist \l_groupthm_key_group_clist
\clist_put_left:Nn \l_groupthm_group_clist { starred } \clist_put_left:Nn \l_groupthm_group_clist { starred }
\generate_theorem_variants:nVVV \generate_theorem_variants:nVVV

View file

@ -1,6 +1,7 @@
\documentclass{article} \documentclass{article}
\usepackage[enable-debug]{expl3} \usepackage[enable-debug]{expl3}
\usepackage[default styles]{mkessler-thmstyle}
\ExplSyntaxOn \ExplSyntaxOn
\debug_on:n { all } \debug_on:n { all }
@ -8,7 +9,25 @@
\usepackage{mkessler-groupthm} \usepackage{mkessler-groupthm}
\GenerateTheoremVariants[ group = {star, dagger} ]{example} \mdfdefinestyle{green}{
linecolor=green,
linewidth = 2pt,
leftmargin = 0cm,
rightmargin=0cm,
rightline=false,
topline=false,
bottomline=false
}
\declaretheoremstyle[
mdframed={style=green}
]{green}
\GenerateTheoremVariants
[
group = {star, dagger},
thmtools = { style = thmgreenmargin }
]{example}
\DeclareTheoremVariants{example} { !s !t+ } \DeclareTheoremVariants{example} { !s !t+ }
{ {