fix @counteralias usage of thmtools

This commit is contained in:
Maximilian Keßler 2022-06-27 15:32:53 +02:00
parent 004413d674
commit c939483b42

View File

@ -237,10 +237,21 @@
% \cs{counter_alias:nn}\marg{counter_1}\marg{counter_2}
% \end{syntax}
%
%
% Note that since 2022-06-02, the implementation of \cs{@counteralias}
% in \pkg{thmtools} has changed.
% Before, aliasing an already existing counter did not throw an error,
% which is considered a bug now
% (\href{https://github.com/muzimuzhi/thmtools/issues/28}{https://github.com/muzimuzhi/thmtools/issues/28}).
% Since \pkg{!!} relies on the old functionality,
% we adapt this here by undefining \cs{c@\meta{countername}} before calling
% \cs{@counteralias}.
%
% \begin{macrocode}
\cs_set_eq:Nc \counter_alias:nn { @counteralias }
\cs_new:Npn \counter_alias:nn #1 % trailing #2
{
\cs_undefine:c { c@ #1 }
\use:c { @counteralias } { #1 } % implicit #2
}
\cs_generate_variant:Nn \counter_alias:nn { n x }
% \end{macrocode}
% \end{macro}