document grouped theorem commands latex3 layer properly

This commit is contained in:
Maximilian Keßler 2022-01-18 02:18:10 +01:00
parent df78bdd30d
commit 396005cc44
2 changed files with 200 additions and 40 deletions

View file

@ -694,13 +694,13 @@
% %
% \begin{function} % \begin{function}
% { % {
% \groupthm_new_theorem_group_by_keys:nn, % \groupthm_new_theorem_group_from_keys:nn,
% \groupthm_renew_theorem_group_by_keys:nn, % \groupthm_renew_theorem_group_from_keys:nn,
% \groupthm_provide_theorem_group_by_keys:nn, % \groupthm_provide_theorem_group_from_keys:nn,
% \groupthm_declare_theorem_group_by_keys:nn % \groupthm_declare_theorem_group_from_keys:nn
% } % }
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_new_theorem_group_by_keys:nn}\ma{keys}\ma{theorem group} % \cs{groupthm_new_theorem_group_from_keys:nn}\ma{keys}\ma{theorem group}
% \end{syntax} % \end{syntax}
% %
% \LaTeX3 versions of \cs{NewTheoremGroup}, \cs{RenewTheoremGroup}, % \LaTeX3 versions of \cs{NewTheoremGroup}, \cs{RenewTheoremGroup},
@ -727,11 +727,14 @@
% \end{syntax} % \end{syntax}
% %
% Non-keyval versions of % Non-keyval versions of
% \cs{groupthm_new_theorem_group_by_keys:nn}, % \cs{groupthm_new_theorem_group_from_keys:nn},
% \cs{groupthm_renew_theorem_group_by_keys:nn}, % \cs{groupthm_renew_theorem_group_from_keys:nn},
% \cs{groupthm_provide_theorem_group_by_keys:nn} % \cs{groupthm_provide_theorem_group_from_keys:nn}
% and % and
% \cs{groupthm_declare_theorem_group_by_keys:nn} % \cs{groupthm_declare_theorem_group_from_keys:nn}
%
% These take the individual values of the keyval keys directly, in the order
% indicated by the syntax specification.
% %
% \end{function} % \end{function}
% %
@ -747,12 +750,11 @@
% \end{function} % \end{function}
% %
% %
% \subsection{Grouped theorems}
% %
% % \begin{function}{\groupthm_new_grouped_theorem_from_keys:nn, \groupthm_provide_grouped_theorem_from_keys:nn}
% \begin{function}{\groupthm_new_grouped_theorem:nnnn, \groupthm_provide_grouped_theorem:nnnn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_provide_grouped_theorem:nnnn}\ma{environment name} % \cs{groupthm_provide_grouped_theorem_from_keys:nn}\ma{keys}\ma{environment name}
% \ma{groups clist}\ma{theorem name}\ma{thmtools keys}
% \end{syntax} % \end{syntax}
% %
% \LaTeX3 version of \cs{NewGroupedTheorem}, \cs{ProvideGroupedTheorem} % \LaTeX3 version of \cs{NewGroupedTheorem}, \cs{ProvideGroupedTheorem}
@ -762,12 +764,11 @@
% %
% \begin{function} % \begin{function}
% { % {
% \groupthm_new_grouped_theorem_star:nnnn, % \groupthm_new_grouped_theorem_star_from_keys:nn,
% \groupthm_provide_grouped_theorem_star:nnnn % \groupthm_provide_grouped_theorem_star_from_keys:nn
% } % }
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_new_grouped_theorem_star:nnnn}\ma{environment name} % \cs{groupthm_new_grouped_theorem_star_from_keys:nn}\ma{keys}\ma{environment name}
% \ma{groups clist}\ma{theorem name}\ma{thmtools keys}
% \end{syntax} % \end{syntax}
% %
% %
@ -778,10 +779,9 @@
% %
% %
% %
% \begin{function}{\groupthm_new_theorem:nnnn, \groupthm_provide_theorem:nnnn} % \begin{function}{\groupthm_new_theorem_from_keys:nn, \groupthm_provide_theorem_from_keys:nn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_provide_theorem:nnnn}\ma{environment name} % \cs{groupthm_provide_theorem_from_keys:nn}\ma{keys}\ma{environment name}
% \ma{groups clist}\ma{theorem name}\ma{thmtools keys}
% \end{syntax} % \end{syntax}
% %
% \LaTeX3 version of \cs{NewTheorem}, \cs{ProvideTheorem} % \LaTeX3 version of \cs{NewTheorem}, \cs{ProvideTheorem}
@ -789,10 +789,9 @@
% %
% \end{function} % \end{function}
% %
% \begin{function}{\groupthm_new_theorem_star:nnnn, \groupthm_provide_theorem_star:nnnn} % \begin{function}{\groupthm_new_theorem_star_from_keys:nn, \groupthm_provide_theorem_star_from_keys:nn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_new_theorem_star:nnnn}\ma{environment name} % \cs{groupthm_new_theorem_star_from_keys:nn}\ma{keys}\ma{environment name}
% \ma{groups clist}\ma{theorem name}\ma{thmtools keys}
% \end{syntax} % \end{syntax}
% %
% %
@ -802,6 +801,26 @@
% \end{function} % \end{function}
% %
% %
% \begin{function}
% {
% \groupthm_new_grouped_theorem:nnnn,
% \groupthm_provide_grouped_theorem:nnnn
% \groupthm_new_grouped_theorem_star:nnnn,
% \groupthm_provide_grouped_theorem_star:nnnn,
% \groupthm_new_theorem:nnnn,
% \groupthm_provide_theorem:nnnn,
% \groupthm_new_theorem_star:nnnn,
% \groupthm_provide_theorem_star:nnnn
% }
% \begin{syntax}
% \cs{groupthm_new_theorem:nnnn}\ma{keys}\ma{environment name}
% \end{syntax}
%
% Non-keyval versions of above macros.
%
% \end{function}
%
%
% %
% %
% \begin{implementation} % \begin{implementation}
@ -1425,13 +1444,13 @@
% With the \cs{@@_set_normalized_keys:nnn} macro at hand, % With the \cs{@@_set_normalized_keys:nnn} macro at hand,
% it is also easy to provide key-value interfaces for these commands: % it is also easy to provide key-value interfaces for these commands:
% %
% \begin{macro}{\groupthm_new_theorem_group_by_keys:nn} % \begin{macro}{\groupthm_new_theorem_group_from_keys:nn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_new_theorem_group_by_keys:nn}\ma{keys}\ma{theorem group} % \cs{groupthm_new_theorem_group_from_keys:nn}\ma{keys}\ma{theorem group}
% \end{syntax} % \end{syntax}
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_new_theorem_group_by_keys:nn #1#2 \cs_new:Npn \groupthm_new_theorem_group_from_keys:nn #1#2
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_new_theorem_group:nVVVV { #2 } \groupthm_new_theorem_group:nVVVV { #2 }
@ -1445,13 +1464,13 @@
% %
% %
% %
% \begin{macro}{\groupthm_renew_theorem_group_by_keys:nn} % \begin{macro}{\groupthm_renew_theorem_group_from_keys:nn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_renew_theorem_group_by_keys:nn}\ma{keys}\ma{theorem group} % \cs{groupthm_renew_theorem_group_from_keys:nn}\ma{keys}\ma{theorem group}
% \end{syntax} % \end{syntax}
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_renew_theorem_group_by_keys:nn #1#2 \cs_new:Npn \groupthm_renew_theorem_group_from_keys:nn #1#2
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_renew_theorem_group:nVVVV { #2 } \groupthm_renew_theorem_group:nVVVV { #2 }
@ -1465,13 +1484,13 @@
% %
% %
% %
% \begin{macro}{\groupthm_provide_theorem_group_by_keys:nn} % \begin{macro}{\groupthm_provide_theorem_group_from_keys:nn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_provide_theorem_group_by_keys:nn}\ma{keys}\ma{theorem group} % \cs{groupthm_provide_theorem_group_from_keys:nn}\ma{keys}\ma{theorem group}
% \end{syntax} % \end{syntax}
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_provide_theorem_group_by_keys:nn #1#2 \cs_new:Npn \groupthm_provide_theorem_group_from_keys:nn #1#2
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_provide_theorem_group:nVVVV { #2 } \groupthm_provide_theorem_group:nVVVV { #2 }
@ -1485,13 +1504,13 @@
% %
% %
% %
% \begin{macro}{\groupthm_declare_theorem_group_by_keys:nn} % \begin{macro}{\groupthm_declare_theorem_group_from_keys:nn}
% \begin{syntax} % \begin{syntax}
% \cs{groupthm_declare_theorem_group_by_keys:nn}\ma{keys}\ma{theorem group} % \cs{groupthm_declare_theorem_group_from_keys:nn}\ma{keys}\ma{theorem group}
% \end{syntax} % \end{syntax}
% %
% \begin{macrocode} % \begin{macrocode}
\cs_new:Npn \groupthm_declare_theorem_group_by_keys:nn #1#2 \cs_new:Npn \groupthm_declare_theorem_group_from_keys:nn #1#2
{ {
\@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 } \@@_set_normalized_keys:nnn { #1 } { theoremgroup } { #2 }
\groupthm_declare_theorem_group:nVVVV { #2 } \groupthm_declare_theorem_group:nVVVV { #2 }
@ -1512,7 +1531,7 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand{\NewTheoremGroup}{ O{} m } \NewDocumentCommand{\NewTheoremGroup}{ O{} m }
{ {
\groupthm_new_theorem_group_by_keys:nn { #1 } { #2 } \groupthm_new_theorem_group_from_keys:nn { #1 } { #2 }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1524,7 +1543,7 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand{\RenewTheoremGroup}{ O{} m } \NewDocumentCommand{\RenewTheoremGroup}{ O{} m }
{ {
\groupthm_renew_theorem_group_by_keys:nn { #1 } { #2 } \groupthm_renew_theorem_group_from_keys:nn { #1 } { #2 }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1536,7 +1555,7 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand{\ProvideTheoremGroup}{ O{} m } \NewDocumentCommand{\ProvideTheoremGroup}{ O{} m }
{ {
\groupthm_provide_theorem_group_by_keys:nn { #1 } { #2 } \groupthm_provide_theorem_group_from_keys:nn { #1 } { #2 }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1548,7 +1567,7 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand{\DeclareTheoremGroup}{ O{} m } \NewDocumentCommand{\DeclareTheoremGroup}{ O{} m }
{ {
\groupthm_declare_theorem_group_by_keys:nn { #1 } { #2 } \groupthm_declare_theorem_group_from_keys:nn { #1 } { #2 }
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1953,6 +1972,147 @@
% \end{macro} % \end{macro}
% %
% We now provide the corresponding key-valued interfaces around these. % We now provide the corresponding key-valued interfaces around these.
% All of these work in the same way:
% We set the normalized keys, and then pass these by value to the
% previously defined macros
%
%
% \begin{macro}{\groupthm_new_grouped_theorem_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_new_grouped_theorem_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_new_grouped_theorem:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\groupthm_provide_grouped_theorem_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_provide_grouped_theorem_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_provide_grouped_theorem:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\groupthm_new_grouped_theorem_star_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_new_grouped_theorem_star_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_new_grouped_theorem_star:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\groupthm_provide_grouped_theorem_star_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_provide_grouped_theorem_star_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_provide_grouped_theorem_star:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\groupthm_new_theorem_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_new_theorem_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_new_theorem:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\groupthm_provide_theorem_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_provide_theorem_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_provide_theorem:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\groupthm_new_theorem_star_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_new_theorem_star_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_new_theorem_star:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\groupthm_provide_theorem_star_from_keys:nn}
% \begin{macrocode}
\cs_new:Npn \groupthm_provide_theorem_star_from_keys:nn #1 #2
{
\@@_set_normalized_keys { #2 } { groupedtheorem } { #1 }
\groupthm_provide_theorem_star:nVVV
{ #1 }
\l_@@_key_group_clist
\l_@@_name_tl
\l_@@_key_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
%
%
%
%
%
%
%
% %
% %
% %

Binary file not shown.