`\theHcounter` definition doesn't expand commands in counter name
u-fischer opened this issue · 1 comments
u-fischer commented
When setting up the \theHcounter
representation hyperref doesn't expand commands in the counter name at definition time (differently to the kernel):
\documentclass[11pt]{article}
\usepackage{hyperref}
%\makeatletter
%\def\@definecounter#1{%
% \H@definecounter{#1}%
% \expandafter
% \gdef\csname theH#1\expandafter\endcsname\expandafter
% {\expandafter\@arabic\csname c@#1\endcsname}}%
%\makeatother
\def\blub{duck}
\newcounter{\blub}
\show\theduck
\show\theHduck
\begin{document}
\refstepcounter{duck}
xxx
\end{document}
gives
> \theduck=macro:
->\@arabic \c@duck .
l.199 \show\theduck
?
> \theHduck=macro:
->\arabic {\blub }.
This is a problem if temporary commands are used which have changed their meaning when the counter is actually used. See https://tex.stackexchange.com/questions/709519/hyperref-conflicting-with-enumitem
u-fischer commented
resolved in 7.01i