From c939483b4283dd03bf86429cc23b66b6084ea090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Mon, 27 Jun 2022 15:32:53 +0200 Subject: [PATCH] fix @counteralias usage of thmtools --- src/environments/fancythm/fancythm.dtx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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}