Open muzimuzhi opened 1 week ago
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.
Linking to
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
.https://github.com/latex3/latex2e/blob/716dec2c019175dda8efba108942b3f25c170aee/required/firstaid/latex2e-first-aid-for-external-files.dtx#L729-L738
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
Actual