add theorem group parent implemented

This commit is contained in:
Maximilian Keßler 2022-01-21 14:10:13 +01:00
parent b934e14708
commit 7f1132b898
2 changed files with 50 additions and 0 deletions

View file

@ -1842,6 +1842,46 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \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} % \subsection{Iterating over powersets}
% For generating the different variants of a theorem family, % For generating the different variants of a theorem family,
% we need to iterate over over the powerset of some list. % we need to iterate over over the powerset of some list.

View file

@ -369,6 +369,16 @@
{ {
\groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4} \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 \clist_new:N \l__powerset_copied_clist
\seq_new:N \l__powerset_saved_seq \seq_new:N \l__powerset_saved_seq
\cs_generate_variant:Nn \clist_remove_all:Nn { N V } \cs_generate_variant:Nn \clist_remove_all:Nn { N V }