summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/thmtools
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-06-02 20:00:40 +0000
committerKarl Berry <karl@freefriends.org>2022-06-02 20:00:40 +0000
commit924aabd7fe0359d9fc6e837807f8eee7bf41717c (patch)
treeebf25b05b4cef44c420b7b8152ab517a0b210a22 /Master/texmf-dist/source/latex/thmtools
parentf389a72e268cfdfdf140742125a80c1a6a96e784 (diff)
thmtools (2jun22)
git-svn-id: svn://tug.org/texlive/trunk@63477 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/thmtools')
-rw-r--r--Master/texmf-dist/source/latex/thmtools/aliasctr.dtx20
-rw-r--r--Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx2
2 files changed, 18 insertions, 4 deletions
diff --git a/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx b/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx
index 3c75e11c98e..2d88038c083 100644
--- a/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/aliasctr.dtx
@@ -79,7 +79,7 @@
\csname ##2\endcsname
}%
\@ifundefined{c@#2}{\@nocounterr{#2}}{%
- \@ifdefinable{c@#1}{%
+ \expandafter\@ifdefinable\csname c@#1\endcsname{%
% \end{macrocode}
% Four values make a counter foo:
% \begin{itemize}
@@ -93,10 +93,24 @@
\@@gletover{c@#1}{c@#2}%
\@@gletover{the#1}{the#2}%
% \end{macrocode}
-% I don't see \@counteralias being called hundreds of times,
-% let's just unconditionally create |\theHctr|-macros for hyperref.
+% I don't see |\@counteralias| being called hundreds of times,
+% let's just unconditionally create |\theHctr|-macros for \pkg{hyperref}.
% \begin{macrocode}
\@@gletover{theH#1}{theH#2}%
+% \end{macrocode}
+% YkC: Compatibility with \pkg{cleveref}, copied from \pkg{cleveref}'s
+% support for \pkg{aliascnt}.
+% Here |\cref@resetby| requires its first argument to be the actual counter
+% name, not a macro storing the name. Thanks to Willie Wong.
+% \begin{macrocode}
+ \@ifpackageloaded{cleveref}{%
+ \edef\aliasctr@temp{%
+ \noexpand\cref@resetby{#2}{\noexpand\cref@result}}%
+ \aliasctr@temp
+ \ifx\cref@result\relax\else%
+ \cref@addtoreset{#1}{\cref@result}%
+ \fi
+ }{}%
\@@gletover{p@#1}{p@#2}%
\expandafter\global
\expandafter\def\csname cl@#1\expandafter\endcsname
diff --git a/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx b/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx
index cf84463c098..850d171046e 100644
--- a/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx
+++ b/Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx
@@ -33,7 +33,7 @@
\ifthmt@hassibling
\@counteralias{\thmt@envname}{\thmt@sibling}%
\@xa\def\@xa\thmt@autoreffix\@xa{%
- \@xa\let\csname the\thmt@envname\@xa\endcsname
+ \@xa\global\@xa\let\csname the\thmt@envname\@xa\endcsname
\csname the\thmt@sibling\endcsname
\def\thmt@autoreffix{}%
}%