From 7f1132b898ad52c1ca1af9c5498e5679d242afe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 21 Jan 2022 14:10:13 +0100 Subject: [PATCH] add theorem group parent implemented --- doc/environments/groupthm/groupthm.dtx | 40 ++++++++++++++++++++++++++ doc/environments/groupthm/groupthm.sty | 10 +++++++ 2 files changed, 50 insertions(+) diff --git a/doc/environments/groupthm/groupthm.dtx b/doc/environments/groupthm/groupthm.dtx index 8f53e02..0002ac8 100644 --- a/doc/environments/groupthm/groupthm.dtx +++ b/doc/environments/groupthm/groupthm.dtx @@ -1842,6 +1842,46 @@ % \end{macrocode} % \end{macro} % +% +% +% \begin{macro}{\groupthm_add_parent:nn} +% \begin{syntax} +% \cs{groupthm_add_parent:nn}\marg{theorem group_1}\marg{theorem group_2} +% \end{syntax} +% +% Declares \meta{theorem group_2} as a parent of \meta{theorem group_1} +% +% \begin{macrocode} +\cs_new:Npn \groupthm_add_parent:nn #1 #2 + { + \@@_ensure_group_exists:n { #1 } + \@@_ensure_group_exists:n { #2 } + \clist_gput_left:cn { g_@@_parents_group__#1__clist } { #2 } + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\AddTheoremGroupParent} +% \begin{syntax} +% \cs{AddTheoremGroupParent}\marg{theorem group_1}\marg{theorem group_2} +% \end{syntax} +% +% Document command version of \cs{groupthm_add_parent:nn} +% +% \begin{macrocode} +\NewDocumentCommand { \AddTheoremGroupParent } { m m } + { + \groupthm_add_parent:nn { #1 } { #2 } + } +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% % \subsection{Iterating over powersets} % For generating the different variants of a theorem family, % we need to iterate over over the powerset of some list. diff --git a/doc/environments/groupthm/groupthm.sty b/doc/environments/groupthm/groupthm.sty index 349a4af..cd68056 100644 --- a/doc/environments/groupthm/groupthm.sty +++ b/doc/environments/groupthm/groupthm.sty @@ -369,6 +369,16 @@ { \groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4} } +\cs_new:Npn \groupthm_add_parent:nn #1 #2 + { + \__groupthm_ensure_group_exists:n { #1 } + \__groupthm_ensure_group_exists:n { #2 } + \clist_gput_left:cn { g__groupthm_parents_group__#1__clist } { #2 } + } +\NewDocumentCommand { \AddTheoremGroupParent } { m m } + { + \groupthm_add_parent:nn { #1 } { #2 } + } \clist_new:N \l__powerset_copied_clist \seq_new:N \l__powerset_saved_seq \cs_generate_variant:Nn \clist_remove_all:Nn { N V }