fix missing spaces in messages. fix wrong cs comparison in new/declare/provide/renew theorem

This commit is contained in:
Maximilian Keßler 2022-01-17 23:24:06 +01:00
parent a7f5aada19
commit 34888f7d4c
2 changed files with 10 additions and 15 deletions

View file

@ -898,7 +898,7 @@
% \begin{macrocode} % \begin{macrocode}
\msg_new:nnn { groupthm } { wrong ~ definition } \msg_new:nnn { groupthm } { wrong ~ definition }
{ {
Bad definition of #1 ~ '#2' ~ \msg_line_context:, #1 ~ is ~ #3 defined. Bad ~ definition ~ of ~ #1 ~ '#2' ~ \msg_line_context:, ~ #1 ~ is ~ #3 ~ defined.
} }
% \end{macrocode} % \end{macrocode}
% %
@ -1281,7 +1281,7 @@
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_new_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_new_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\cs_if_exist:cTF { @@_use_group_#1 } \cs_if_exist:cTF { @@_use_group_#1: }
{ {
\msg_error:nnnnn { groupthm } { wrong ~ definition } \msg_error:nnnnn { groupthm } { wrong ~ definition }
{ group } { #1 } { already } { group } { #1 } { already }
@ -1306,7 +1306,7 @@
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_renew_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_renew_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\cs_if_exist:cTF { @@_use_group_#1 } \cs_if_exist:cTF { @@_use_group_#1: }
{ {
\@@_undeclare_theorem_group_aux:n { #1 } \@@_undeclare_theorem_group_aux:n { #1 }
\@@_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 } \@@_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 }
@ -1332,7 +1332,7 @@
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_provide_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_provide_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\cs_if_exist:cF { @@_use_group_#1 } \cs_if_exist:cF { @@_use_group_#1: }
{ {
\@@_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 } \@@_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 }
} }
@ -1354,7 +1354,7 @@
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_declare_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_declare_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\cs_if_exist:cT { @@_use_group_#1 } \cs_if_exist:cT { @@_use_group_#1: }
{ {
\@@_undeclare_theorem_group_aux:n { #1 } \@@_undeclare_theorem_group_aux:n { #1 }
} }

View file

@ -48,7 +48,7 @@
} }
\msg_new:nnn { groupthm } { wrong ~ definition } \msg_new:nnn { groupthm } { wrong ~ definition }
{ {
Bad definition of #1 ~ '#2' ~ \msg_line_context:, #1 ~ is ~ #3 defined. Bad ~ definition ~ of ~ #1 ~ '#2' ~ \msg_line_context:, ~ #1 ~ is ~ #3 defined.
} }
\hook_new:n { __groupthm/prename } \hook_new:n { __groupthm/prename }
\hook_new:n { __groupthm/postname } \hook_new:n { __groupthm/postname }
@ -95,7 +95,6 @@
} }
\cs_new:Npn \__groupthm_set_normalized_keys:nnn #1 #2 #3 \cs_new:Npn \__groupthm_set_normalized_keys:nnn #1 #2 #3
{ {
\tl_show:x { Setting~normalized~keys~=~\{#1\}~with~subgroup~#2~and~fallback~#3}
\keys_set:nn { groupthm } { prename, name, postname, group, mapname, thmtools } \keys_set:nn { groupthm } { prename, name, postname, group, mapname, thmtools }
\keys_set_groups:nnn { groupthm } { #2 } { #1 } \keys_set_groups:nnn { groupthm } { #2 } { #1 }
\tl_if_eq:NnTF \l__groupthm_key_name_tl { \c_novalue_tl } \tl_if_eq:NnTF \l__groupthm_key_name_tl { \c_novalue_tl }
@ -132,7 +131,6 @@
} }
\cs_new:Npn \__groupthm_declare_theorem_group_aux:nnnnn #1#2#3#4#5 \cs_new:Npn \__groupthm_declare_theorem_group_aux:nnnnn #1#2#3#4#5
{ {
\tl_show:x {Declaring~new~theorem~group~named~#1,~pre~=~#2,~post~=~#3,~map~=~#4,~thmtools~=~#5}
\cs_new:cpn { __groupthm_use_group_#1: } \cs_new:cpn { __groupthm_use_group_#1: }
{ {
\hook_gput_code:nnn { __groupthm/prename } { #1 } \hook_gput_code:nnn { __groupthm/prename } { #1 }
@ -192,8 +190,7 @@
} }
\cs_new:Npn \groupthm_new_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_new_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\tl_show:x {NewTheorem~group~named~#1,~pre~=~#2,~post~=~#3,~map~=~#4,~thmtools~=~#5} \cs_if_exist:cTF { __groupthm_use_group_#1: }
\cs_if_exist:cTF { __groupthm_use_group_#1 }
{ {
\msg_error:nnnnn { groupthm } { wrong ~ definition } \msg_error:nnnnn { groupthm } { wrong ~ definition }
{ group } { #1 } { already } { group } { #1 } { already }
@ -205,7 +202,7 @@
\cs_generate_variant:Nn \groupthm_new_theorem_group:nnnnn { n V V V V } \cs_generate_variant:Nn \groupthm_new_theorem_group:nnnnn { n V V V V }
\cs_new:Npn \groupthm_renew_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_renew_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\cs_if_exist:cTF { __groupthm_use_group_#1 } \cs_if_exist:cTF { __groupthm_use_group_#1: }
{ {
\__groupthm_undeclare_theorem_group_aux:n { #1 } \__groupthm_undeclare_theorem_group_aux:n { #1 }
\__groupthm_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 } \__groupthm_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 }
@ -218,7 +215,7 @@
\cs_generate_variant:Nn \groupthm_renew_theorem_group:nnnnn { n V V V V } \cs_generate_variant:Nn \groupthm_renew_theorem_group:nnnnn { n V V V V }
\cs_new:Npn \groupthm_provide_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_provide_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\cs_if_exist:cF { __groupthm_use_group_#1 } \cs_if_exist:cF { __groupthm_use_group_#1: }
{ {
\__groupthm_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 } \__groupthm_declare_theorem_group_aux:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 }
} }
@ -226,7 +223,7 @@
\cs_generate_variant:Nn \groupthm_provide_theorem_group:nnnnn { n V V V V } \cs_generate_variant:Nn \groupthm_provide_theorem_group:nnnnn { n V V V V }
\cs_new:Npn \groupthm_declare_theorem_group:nnnnn #1 #2 #3 #4 #5 \cs_new:Npn \groupthm_declare_theorem_group:nnnnn #1 #2 #3 #4 #5
{ {
\cs_if_exist:cT { __groupthm_use_group_#1 } \cs_if_exist:cT { __groupthm_use_group_#1: }
{ {
\__groupthm_undeclare_theorem_group_aux:n { #1 } \__groupthm_undeclare_theorem_group_aux:n { #1 }
} }
@ -235,7 +232,6 @@
\cs_generate_variant:Nn \groupthm_declare_theorem_group:nnnnn { n V V V V } \cs_generate_variant:Nn \groupthm_declare_theorem_group:nnnnn { n V V V V }
\cs_new:Npn \groupthm_new_theorem_group_by_keys:nn #1#2 \cs_new:Npn \groupthm_new_theorem_group_by_keys:nn #1#2
{ {
\tl_show:x {NewTheorem~group~by~keys~named~#2,~keys=#1}
\__groupthm_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \__groupthm_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_new_theorem_group:nVVVV { #2 } \groupthm_new_theorem_group:nVVVV { #2 }
\l__groupthm_prename_tl \l__groupthm_prename_tl
@ -272,7 +268,6 @@
} }
\NewDocumentCommand{\NewTheoremGroup}{ O{} m } \NewDocumentCommand{\NewTheoremGroup}{ O{} m }
{ {
\tl_show:x {NewTheoremGroupp~with~name~#2,~keys=#1}
\groupthm_new_theorem_group_by_keys:nn { #1 } { #2 } \groupthm_new_theorem_group_by_keys:nn { #1 } { #2 }
} }
\NewDocumentCommand{\RenewTheoremGroup}{ O{} m } \NewDocumentCommand{\RenewTheoremGroup}{ O{} m }