I have some custom cross-references that need labels that are not naturally linked to counters.
My macros therefore set \@currentlabel
directly instead of using \refstepcounter
.
This works fine but cleveref
is not able to understand the type of these references (unless one specifies a custom type for each affected \label
).
I have seen questions where redefining \cref@currentlabel
managed to get cleveref
informed of the right format to use but it is not clear what is the arguments specification that the package is expecting to be used.
From bits and pieces, the redefinition seems to follow a scheme similar to
\protected@edef\cref@currentlabel{%
[type][???][\cref@result]%
The typeset label}
So my question is: how is one supposed to communicate to cleveref
that the current label is a custom one, with custom type mytype
?
How is \cref@currentlabel
supposed to be redefined?
cleverref
always complains about unknown types, i.e. the if you usefoo
as type, and do not specify the corresponding\crefformat{foo}{#2#1#3}
it will choke otherwise your approach should work\refstepcounter
?