You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When \labelformat is introduced to the kernel in the 2019 Autumn release, the \p@<counter> is extended to accept one argument, usually \the<counter>. The uses of \p@<counter> in the kernel code is accordingly adapted, by adding an \expandafter:
But the uses of \p@<counter> in cleveref.sty is never updated (due to lack of maintenance?), thus ctex patches uses of \p@<counter> in cleveref to insert the needed \expandafter.
Then in the most recent 2024-11-01 release, cleveref firstaid is extended with a pre-\labelformat use of \p@<counter> (see code line 736 below), which is missed by ctex's patches and causes problems when ctex is used with hyperref and cleveref.
What's the recommended way to continue here, update cleveref firstaid (which introduces inconsistent uses of \p@<counter>) or extend ctex patches for cleveref (which means to patch cleveref firstaid hmm)? Of course the best solution is to update cleveref.sty itself...
Minimal example showing the current behaviour
% \RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!\documentclass{article}
\usepackage[fontset=none, heading]{ctex}
\usepackage{hyperref,cleveref}
% \ShowHook{begindocument} % too long to be helpful\begin{document}
\section{title}
\makeatletter\show\cref@currentlabel\makeatother\end{document}
I added the missing \expandafter to the firstaid. But it will naturally not be released directly. Also I'm not sure if that catches everything -- we are not adapting \refstepcounter@optarg. So probably you will have to figure out some intermediate patches.
Of course the best solution is to update cleveref.sty itself...
Yes. Or to find someone who writes a compatible cleveref-new and then the firstaid could be restricted to load that instead of cleveref.
Brief outline of the enhancement
(First caught by a test in the
ctex
bundle, see log of its scheduled job.)When
\labelformat
is introduced to the kernel in the 2019 Autumn release, the\p@<counter>
is extended to accept one argument, usually\the<counter>
. The uses of\p@<counter>
in the kernel code is accordingly adapted, by adding an\expandafter
:But the uses of
\p@<counter>
incleveref.sty
is never updated (due to lack of maintenance?), thusctex
patches uses of\p@<counter>
incleveref
to insert the needed\expandafter
.Then in the most recent 2024-11-01 release,
cleveref
firstaid is extended with a pre-\labelformat
use of\p@<counter>
(see code line 736 below), which is missed byctex
's patches and causes problems whenctex
is used withhyperref
andcleveref
.latex2e/required/firstaid/latex2e-first-aid-for-external-files.dtx
Lines 729 to 738 in 716dec2
What's the recommended way to continue here, update
cleveref
firstaid (which introduces inconsistent uses of\p@<counter>
) or extendctex
patches forcleveref
(which means to patchcleveref
firstaid hmm)? Of course the best solution is to updatecleveref.sty
itself...Minimal example showing the current behaviour
Expected
> \cref@currentlabel=macro: ->[section][1][]1.
Actual
The text was updated successfully, but these errors were encountered: