add sorting of group names
This commit is contained in:
parent
7b136e0a65
commit
b3982c64b7
1 changed files with 45 additions and 0 deletions
|
@ -1138,6 +1138,51 @@
|
|||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \begin{macro}{\@@_add_to_sort_hook:n}
|
||||
% \begin{syntax}
|
||||
% \cs{@@_add_to_sort_hook:n}\ma{theorem group}
|
||||
% \end{syntax}
|
||||
%
|
||||
% Adds the theorem group into the sort hook to be restored later from it.
|
||||
% This already uses the assumption, that we want to use the \cs{l_@@_group_clist}
|
||||
% variable (which we do).
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\cs_new:Npn \@@_add_to_sort_hook:n #1
|
||||
{
|
||||
\hook_gput_code:nnn { @@/groupsort }
|
||||
{ #1 }
|
||||
{
|
||||
\clist_put_left:Nn \l_@@_group_clist { #1 }
|
||||
}
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
% \begin{macro}{\@@_sort_theorem_group_names:}
|
||||
%
|
||||
% As explained briefly before, we first insert all theorems
|
||||
% into the hook, clear the list, and then use the hook again.
|
||||
%
|
||||
% This then sorts the \cs{l_@@_group_clist} variable,
|
||||
% which is also assumed to hold only defined theorem group names.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\cs_new:Npn \@@_sort_theorem_group_names:
|
||||
{
|
||||
\hook_gremove_code:nn { @@/groupsort }{*}
|
||||
\clist_map_function:NN \l_@@_group_clist \__add_to_sort_hook:n
|
||||
\clist_clear:N \l_@@_group_clist
|
||||
\hook_use:n { @@/groupsort }
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
% \begin{macro}{\@@_declare_theorem_group_aux:nnnnn}
|
||||
% \begin{syntax}
|
||||
% \cs{@@_declare_theorem_group_aux:nnnnn}\{\meta{theorem group}\}\{\meta{prename tl}\}
|
||||
|
|
Loading…
Reference in a new issue