diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/thmtools/aliasctr.dtx | 20 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/thmtools/thm-autoref.dtx | 2 |
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{}% }% |