Skip to main content
40 votes

cleveref and algorithm2e

You only need to load algorithm2e before cleveref.
xuhdev's user avatar
  • 1,143
17 votes
Accepted

What's the convention for label prefixes?

What are the modern conventions for prefixes? I want to use cleveref. The good news is that cleveref imposes no stylistic conventions and only two absolute constraints on how the arguments of \label ...
Mico's user avatar
  • 515k
17 votes
Accepted

Cleveref mistakenly showing filename in external references

Edit 2023-03-28 A firstaid for cleveref has been added to LaTeX which contains the redefinitions mentioned in the answer. With the next LaTeX release and with the latex-dev released today the ...
Ulrike Fischer's user avatar
16 votes
Accepted

Omit round brackets around equation numbers with cleveref

Using \creflabelformat as follows \creflabelformat{equation}{#2\textup{#1}#3} helps. \documentclass{scrreprt} \usepackage{mathtools} \usepackage{hyperref} \usepackage{cleveref} % see: https://tex....
TeXnician's user avatar
  • 33.7k
15 votes
Accepted

Cleveref: Change behaviour of \Cref to use the abbreviated form

From the (deleted) answer and comment by @Christian Hupfer and my own search, there are three possibilities: \renewcommand{\Cref}[1]{\cref{#1}} This does not work together with the poorman option ...
Hotschke's user avatar
  • 5,320
15 votes
Accepted

Can \cref be made to ignore spaces?

Normalization with removal of spaces before and after label names and removing of empty entries. The following example uses the comma parser of package kvsetkeys for parsing the label name list of ...
Heiko Oberdiek's user avatar
13 votes
Accepted

cleveref -- using both abbreviated and full form references?

Here is another approach requiring less delving in to the innards of cleveref. The idea is to change the name locally using \crefname. \documentclass{scrartcl} \usepackage[demo]{graphicx} \...
Andrew Swann's user avatar
  • 96.3k
13 votes

How I can change "Figs. 1 and 3" to "Figs. 1 et 3"?

The cleveref package is babel-aware, so it suffices to load babel and add french to the cleveref options. In this example I've turned off the : shorthand defined for French because your labels have : ...
Alan Munn's user avatar
  • 220k
12 votes
Accepted

texlive 2016 hyperref/cleverref incompatibility

UPDATE This is fixed in hyperref release 6.83q 2016-06-24 The change to hyperref was to fix this issue https://github.com/ho-tex/hyperref/issues/11 which I have just re-opened, pointing here. ...
David Carlisle's user avatar
12 votes
Accepted

Capacity exceeded error while using cleveref package with svjour3 (Springer) class

One way would be to tell svjour3 to set up the chapter counter via the numbook option. \documentclass[twocolumn,numbook]{svjour3} % twocolumn \usepackage{cleveref} \begin{document} \...
David Carlisle's user avatar
11 votes

Cleveref isn't sorting nested lists properly

Turns out @Karalga's explanation of the cause of this bug points in the right direction, but doesn't get to the bottom of the problem. Sorting of nested list labels was broken for two completely ...
Toby Cubitt's user avatar
  • 2,072
11 votes

What's the convention for label prefixes?

They are just conventions. They keep you from inadvertently reusing labels: you can have equation eq:pythagoras in section sec:pythagoras. \usepackage{showlabels} while writing helps you remember ...
Ethan Bolker's user avatar
  • 9,423
11 votes

Redefine \cref for non-English languages

You can just surround the \cref command with e.g. \foreignlanguage, provided you have passed your languages to both babel and cleveref: \documentclass{book} \usepackage[T1]{fontenc} \usepackage[...
Andrew Swann's user avatar
  • 96.3k
10 votes
Accepted

"Extra \else" error when combining breqn, thm-restate, and cleveref

Wow, that's a nice finding (if you can call it that). . . The order doesn't matter, but all three packages play a role in this (though cleveref is innocent). First, breqn redefines ...
Phelype Oleinik's user avatar
9 votes
Accepted

'cleveref' package & captions besides figures

Setting the label in the caption argument works for me: \begin{captionbeside} {caption1\label{fig:fig_1}} Here is a twosided example, but I am not sure how the pictures and the captions should be ...
esdd's user avatar
  • 86.1k
9 votes
Accepted

revtex4-2: cref reference format for label type `' undefined

Not a full solution, but hopefully a satisfactory work-around: Load hyperref before cleveref. (If you don't want colored hyperlinks, load hyperref with the options colorlinks and allcolors=black.) I ...
Mico's user avatar
  • 515k
9 votes

cleveref and customized refname

You asked, Is it possible with cleveref to customize on the fly the name in the clickable link? Short answer: Yes. Longer answer: Your typographic objective may be achieved using cleveref's ...
Mico's user avatar
  • 515k
9 votes
Accepted

Cleveref not working with multiple references

Probably your problem is caused by the space inside your \Cref-command. Compare the output: \documentclass{article} \usepackage{cleveref} \begin{document} \begin{equation}\label{a} 1+1=2 \...
Οὖτις's user avatar
  • 2,927
9 votes

Any elegant way to tell LaTeX that a line break after an abbreviation is bad but not impossible?

You can use \nolinebreak[3], that issues \@highpenalty, whose standard value is 301. I don't think that 5000 is a good value, but you can experiment with higher values than 301. \documentclass{article}...
egreg's user avatar
  • 1.1m
9 votes
Accepted

Current best practice re. cross-references to last page

There is not really a need to set an anchor as hyperref adds anchors to all pages anyway: \documentclass{book} \usepackage{kantlipsum} \usepackage{bookmark} \usepackage{cleveref} \makeatletter \...
Ulrike Fischer's user avatar
8 votes

Can \cref be made to ignore spaces?

Almost self-explaining code: \begin{filecontents}{\jobname.bib} @misc{1, author="One Author", year=2000} @misc{2, author="Another Writer", year=2010} \end{filecontents} \documentclass{...
egreg's user avatar
  • 1.1m
8 votes
Accepted

Different enumitem \ref, \cref results to item for direct enumerate vs. defined newlist

When you define a new enumerated list environment called romcases via a \newlist instruction, the counter associated with level-1 items is called romcasesi. Similarly, the counter associated with ...
Mico's user avatar
  • 515k
8 votes
Accepted

Cleveref format for enumerate

Instead of manipulating the low-level macros \labelenumi, \labelenumii, and \labelenumiii directly, I suggest you (a) load the enumitem package, (b) create a custom enumerated list called myenum and ...
Mico's user avatar
  • 515k
8 votes

Is there a way to make cleveref distinguish two environments with the same counter?

No need for any programming contortions -- just load either the amsthm or the ntheorem package before both hyperref and cleveref, and then define the theorem-like environments the usual way. In ...
Mico's user avatar
  • 515k
8 votes
Accepted

How can I get cleveref to surround references with parentheses automatically?

I would not modify the workings of \cref and friends directly. Instead, I would create a new macro called \pcref -- short for "parenthetic \cref", I suppose -- as follows: \newcommand\pcref[1]{(\cref{...
Mico's user avatar
  • 515k
8 votes
Accepted

Use the cleveref package to refer to enumerate items without the prefix "item"

You asked, Is there a relatively simple way to reference only "(b)" and not "item (b)" Short answer: "Yes". Long answer: Use \labelcref instead of \cref. \...
Mico's user avatar
  • 515k
7 votes
Accepted

Can Cref also provide the title of the tcolorbox?

One solution would be to add the title as part of the number using the number freestyle option: \documentclass{article} \usepackage{varioref} \usepackage{cleveref} \usepackage{tcolorbox} \...
Thomas F. Sturm's user avatar
7 votes
Accepted

How to change the style of the cross reference in cleveref package?

If the numbers and the surrounding parentheses should be typeset in bold, add the instructions \crefdefaultlabelformat{#2\bfseries\upshape(#1)#3} \creflabelformat{equation}{#2\bfseries\...
Mico's user avatar
  • 515k
7 votes

Combining cleveref and subref

A work around is to define your own 'partially-clever' command by adding this to the preamble: \newcommand{\csubref}[2]{\namecref{#1}~\subref{#1:#2}} However this requires a strict labelling scheme ...
Matthias Arras's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible