write all definitions of theorems to aux file at end of document

This commit is contained in:
Maximilian Keßler 2022-01-31 19:55:03 +01:00
parent 32daab8d20
commit f878e66cdf

View File

@ -851,6 +851,16 @@
{ {
\tl_log:n { Declaring ~ thmtools ~ theorem ~ #2 } \tl_log:n { Declaring ~ thmtools ~ theorem ~ #2 }
\declaretheorem [ #1 ] { #2 } \declaretheorem [ #1 ] { #2 }
\bool_if:NT \g_@@_cache_bool
{
\hook_gput_code:nnn { enddocument / afterlastpage } { groupthm }
{
\iow_now:cn { @auxout }
{
\declaretheorem [ #1 ] { #2 }
}
}
}
} }
\cs_generate_variant:Nn \@@_thmtools_declare_theorem:nn { V n } \cs_generate_variant:Nn \@@_thmtools_declare_theorem:nn { V n }
% \end{macrocode} % \end{macrocode}
@ -858,6 +868,7 @@
% %
% %
% %
%
% It also comes in handy to have a stronger version of the % It also comes in handy to have a stronger version of the
% hook role setting mechanism: % hook role setting mechanism:
% \begin{macro}{\@@_hook_gset_rule_foreach:nNnn} % \begin{macro}{\@@_hook_gset_rule_foreach:nNnn}
@ -2676,6 +2687,30 @@
% \end{macrocode} % \end{macrocode}
% %
% %
% \begin{macro}{\@@_fake_declare_theorem:w}
% \begin{syntax}
%
% \end{syntax}
%
% This is a fake version of the \cs{declaretheorem} macro
% that accepts the arguments but does nothing.
%
% \begin{macrocode}
\NewDocumentCommand { \@@_fake_declare_theorem:w }{ o m }
{
\relax
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macrocode}
\hook_gput_code:nnn { enddocument / afterlastpage } { groupthm }
{
\let \declaretheorem \@@_fake_declare_theorem:w
}
% \end{macrocode}
% %
% %
% \begin{macrocode} % \begin{macrocode}