# Tag Info

1

amsmath does all sorts of tricks with the labels in its environments. You need to restore the standard definition which is stored in \ltx@label and the syntax here is a little non-standard (as you will discover if you try a simple \let): \documentclass{article} \usepackage{amsmath,cleveref} \newcounter{exampleCtr} \setcounter{exampleCtr}{0} \...

1

You need to ensure that the hyperref destination name is unique. hyperref uses (if it exists) a \theH<counter> command. As your codebox has no counter, one must number the labels: \documentclass{article} \usepackage{clrscode3e} \usepackage{hyperref} \usepackage{cleveref} \crefname{codelinenumber}{code}{code} %adapt \newcounter{codelabel} \newcommand\...

1

The problem seems to be, that \crefname doesn't define global commands. A workaround is to use the capability of cleveref to read a file cleveref.cfg befor compilation. By writing the \crefname directives to that file, the desired solution is achieved. MWE: Note that the command hanling has been altered, which however is not the actual point of the ...

2

The problem with commands in section titles is that they must either be expandable or robust. Both \Cref and \hypersetup are neither. Since \hypersetup will change the setting only when typesetting text, it doesn't need to be expandable (and it's impossible to make it so). Thus you make it robust with: \let\ORGhypersetup\hypersetup \protected\def\...

Top 50 recent answers are included