diff --git a/src/environments/fancythm/fancythm.dtx b/src/environments/fancythm/fancythm.dtx index 98fa61a..ab40892 100644 --- a/src/environments/fancythm/fancythm.dtx +++ b/src/environments/fancythm/fancythm.dtx @@ -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}