33
votes
18
votes
Accepted
Change cross-reference name of enumerated items using cleveref
cleveref use the counters as type. The counters of enumerate are enumi, enumii, enumiii enumiv: (I wouldn't use spaces in label names, so I removed it)
\documentclass{article}
\usepackage{enumitem}
\...
17
votes
Accepted
cleveref and amsthm -- incorrect environment name
You just need to move the definitions of your theorem-like environments to after the loading of cleveref package:
\documentclass{memoir}
\usepackage{amsthm}
\usepackage[capitalise]{cleveref}
% ...
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 ...
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 ...
15
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....
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}
\...
13
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
...
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 : ...
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.
...
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 ...
11
votes
Accepted
cleveref hyperlink not working in beamer
As a bandaid fix you could redefine the \cref command and explictely add the hyperlink, which will give you the desired result.
\documentclass{beamer}
\usepackage{cleveref}
\let\chyperref\cref % ...
11
votes
Accepted
How to cross-reference an unnumbered theorem using hyperref and cleveref
You have two types of theorems in your document -- numbered ones, of type plain, and unnumbered ones, of type named. As you've already discovered and pointed out, it's easy to assign a \label to a ...
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 ...
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[...
11
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}
\...
10
votes
Automatically insert "in the next [chapter/section/subsection]" if reference is sequential
Here is a solution based on cleveref package. If the hyperref package is loaded, the word "section" (or chapter/subsection/...) is a clickable hyperlink.
\documentclass{article}
%\usepackage{...
10
votes
Accepted
Is there a way to divide ONE figure to reference the subparts of the figure?
I'd go with clipping the image and include it four times (this will have no impact on the final PDF size, because the resource will be loaded just once). With \clipbox* of the trimclip package you don'...
10
votes
Accepted
cleveref and ulem/soul compatibility
In these cases, add \mbox around the offending piece; it works also with soul.
\documentclass{article}
\usepackage{ulem}
\usepackage{cleveref}
\begin{document}
\uwave{\mbox{\cref{sec:A}}}
\section{...
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 ...
9
votes
Automatically insert "in the next [chapter/section/subsection]" if reference is sequential
Revised Attempt
In addition to \Unitref{<label>} which provides the unit name along with the ref, as in "section 2" or "subsection 1.1", etc. (see original attempt), I now also introduce \Ref{&...
9
votes
Accepted
How to get \cref to print "Fig." in emacs?
The issues you're experiencing are not related to emacs, and they are only indirectly related to cleveref. You need to do the following:
In the main figure, interchange the order of \caption and \...
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 ...
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
\...
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}...
8
votes
Accepted
Varioref and previous page
You understand varioref correctly, but cleveref overwrites some of its functions and does so incorrectly. It is a typical case of adding % characters to the end of every line and in some cases that is ...
8
votes
Accepted
Cleveref messes up theoremstyles
In my opinion the amsbook class takes the wrong approach about theorems: it defines a slightly different structure from amsthm and fakes this package being loaded, so putting cleveref at stake, ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cleveref × 905cross-referencing × 465
hyperref × 181
theorems × 47
equations × 41
amsthm × 38
varioref × 35
enumitem × 34
tcolorbox × 32
subfloats × 30
numbering × 29
labels × 28
amsmath × 27
babel × 25
subcaption × 23
captions × 22
floats × 21
appendices × 21
sectioning × 20
thmtools × 20
counters × 19
macros × 18
memoir × 18
listings × 15
lists × 15