Tagged Questions

{cleveref} is a package that enhances LaTeX's {cross-referencing} features, allowing the format of references to be determined automatically according to the type of reference.

learn more… | top users | synonyms

3
votes
0answers
84 views

Reference source code line in minted environment with cleveref

I'd like to reference lines in the minted environment (solved here for regular \ref) using cleveref. MWE: % !TEX TS-program = arara % arara: pdflatex: { shell: yes } % arara: pdflatex: { shell: yes ...
4
votes
2answers
275 views

tcolorbox: \newtcbtheorem referencing

Using \newtcbtheorem, how do we reference the created environment? \documentclass{article} \usepackage[most]{tcolorbox} \tcbuselibrary{theorems} \usepackage{cleveref} \crefname{exa}{example}{Example} ...
6
votes
2answers
116 views

Referencing label with conditional page info

I would like to have an easy way to reference a label and if that label is not on the current page then its page should be printed in the reference like "See example 2.3 (p.4)". I tried the varioref ...
1
vote
1answer
144 views

Pagerefo on cref? Multiple pages?

I am using \cref to refer to different figures in the appendix: \cref{figure1,figure2,...} Now I want to create a \pageref{} to it, but I don't know how I can achieve this with multiple pages? So ...
5
votes
2answers
259 views

enumitem: referencing items in enumerate

Say we have a huge document with many sections, subsections, and subsubsections. In a few of these sections, we have enumerated environments. The package I am using is enumitem. One of the ...
11
votes
1answer
192 views

Strip section number from equation range reference

I am trying to adjust equation range numbering from (1.10)-(1.15) to (1.10-15). By calling this in the preamble: \crefrangelabelformat{equation}{(#3#1#4-#5#2#6)} and then this in the document: ...
3
votes
2answers
271 views

cleveref doesn't use correct capitalized name if used with amsthm?

It seems that the cleveref package does not capitalize properly when referring to a newtheorem if both \crefname and \Crefname have been defined. Or is it just me? Here is my MWE: ...
6
votes
1answer
121 views

What is the DRY way to get Theorem 1(a)?

I am typesetting a document with the memoir class and the cleveref package. Often I have a numbered theorem and enumerated parts. I would like to be able to refer to a part of a theorem as simply as ...
4
votes
1answer
107 views

Cleveref doesn't find the label

The following code gives me as reference the section and not the signpost. It is probably a beginner's mistake. \documentclass{article} \usepackage{tikz} \usepackage{mdframed} ...
2
votes
1answer
229 views

new command for including a custom string into \cref

In this thread here: Subfigure labelling for a single figure I suggested a solution how to include a custom string into the hyperlink created by the \cref command. I'd like to create a compact new ...
4
votes
1answer
185 views

Cross referencing tcolorbox with cleveref-package

Thanks to Thomas F. Sturm (http://tex.stackexchange.com/a/124688/15907) I have a little environment for creating nice looking source code in LaTeX. I started my enviroment with this here: ...
3
votes
1answer
132 views

Name formatting with cleveref - question about types

I want to customize the text that appears when I do a \cref{}, so for example, I want to make a link to section 0.1 but I want the text to say 'Summary' not section 0.1. I had this part working with ...
15
votes
1answer
219 views

Strange behaviour of \sbox

This question consists of two related parts. I already solved the original problem but still don't understand where it came from or why the solution works. I use the subcaption package so I can place ...
0
votes
1answer
76 views

Defaulting to clever references

I would like to redefine \ref to behave like \cref while still allowing \ref* to be used for the standard behavior of \ref. Here is my attempt to achieve this; I would like to use the commented lines ...
3
votes
1answer
99 views

Using a half-space with abbreviations in cleveref?

I'm using cleveref with abbreviated forms such as Fig. 1, and would like to have them typeset using a thin space/half-space rather than the ordinary non-breaking space. However, I'd only want this ...
2
votes
1answer
505 views

Defining cross-reference names for custom theorem environments in cleveref

I am concerned with the difference between this working example \documentclass{article} \usepackage{amsthm} \usepackage[capitalise]{cleveref} \newtheorem{thm}{Theorem} \begin{document} ...
9
votes
2answers
239 views

How to strip “eq.” from cleveref?

How can I make cleveref output (1) instead of eq. (1) when referencing equations only?
5
votes
1answer
59 views

How to disable sorting in cleveref for one instance?

I can disable reference sorting globally using the nosort or the compress package options, that's described in the docs. The same chapter explains how to disable compression for one instance of \cref. ...
10
votes
1answer
701 views

cleveref and appendix packages: appendix referenced as section

Using this example: \documentclass{scrartcl} \usepackage{lipsum} \usepackage{appendix} \usepackage{cleveref} \begin{document} \section{The first section}\label{sec:1} \lipsum[2] \section{The second ...
7
votes
1answer
516 views

Cleveref: AUCTeX and RefTeX set-up

How can I set up cleveref to work with AUCTeX and RefTeX? I have tried the advice on Emacs, RefTeX and Cleveref – can they work together? but it didn't work. Additionally, when I hit enter, \ref{} ...
3
votes
1answer
214 views

Cleveref: cleveref appears to not be so clever (sorry for the pun but I couldn't help myself)

This didn't happen when I wasn't using cleveref. \documentclass{article} \usepackage{amsmath} \usepackage[retainorgcmds]{IEEEtrantools} \usepackage{hyperref} \usepackage[noabbrev]{cleveref} ...
7
votes
1answer
138 views

Using the cleveref package with hebrew and babel

I am trying to use the cleveref package with babel and Hebrew. I get the following error (on the second run of Latex): ERROR: Missing number, treated as zero. --- TeX said --- <to be read ...
2
votes
2answers
440 views

Extra “appendix” when referencing using cleveref in elsarticle

How do I get rid of the extra "appendix" appearing when I cross-reference an appendix section? Example output is "...see appendix Appendix A". MWE as follows: \documentclass[preprint,3p]{elsarticle} ...
1
vote
1answer
90 views

What is the counter name for verbments?

I'm trying to use the verbments package with the cleveref package. I need to find the name of the counter which is usually used for \ref{listing_label} to be able to define the name cleveref uses for ...
0
votes
0answers
28 views

Cleveref reference table as section [duplicate]

I am using cleveref for my references, and I just noticed that a reference to a table is actually resolved by cleveref into “section”. Is that indended behaviour? Is there maybe something wrong with ...
5
votes
1answer
71 views

Setting minimal number of references for cleveref's compression feature

I am using cleveref for cross-referencing. The default sort&compress option compresses three or more consecutive references into a range. I would like to get this compression already for two ...
4
votes
1answer
62 views

Automatic switching of arrows in references

I would like to use references in a way that an arrow is in front of the referenc and points in the direction depending on whether the referenced instance is a above or below the reference (→ chapter ...
4
votes
1answer
1k views

cleveref fails to reference algorithms

In the following example document, both \autoref and plain ref will correctly link and number an algorithm reference, but cleveref fails that task. It will just insert question marks instead. In ...
0
votes
0answers
35 views

Problem when using hyperref together with cleveref [duplicate]

As it says in the cleveref documentation hyperref must be loaded before cleveref. But at me I have to load at least one package between them and I would really like to know why. The not working ...
7
votes
1answer
137 views

Collapse “on page”s for multiple references in \vref

The code at the bottom produces See equations (1) and (2) on page 6 and on page 11. What I'd like is See equations (1) and (2) on pages 6 and 11. Otherwise it looks quite strange in my ...
14
votes
3answers
680 views

Cleveref and named theorems

Is it possible with Cleverref to reference not only the number of an environment but the "name" (the thing that is passed to it in square brackets? In the following example I want to replace the line ...
10
votes
2answers
201 views

Two colors in one hyperlink

As usual writing a few documents. As one can see having too much color and gloss in a document is never good. Therefore having boxes, and a myriad of colors in the hyperlinks is a bad idea. I really ...
9
votes
1answer
5k views

Tex capacity exceeded sorry input stacksize=5000

I am getting this error while trying to build my tex file. As soon as I include the cleveref package, I get this error and it shows cleveref.sty with the cursor at the bolded part of the file. ...
10
votes
1answer
122 views

Kerning in \Cref of cleveref

When I use the \Cref command of cleveref package, it doesn't apply the corresponding kerning: Here is a minimal example: \documentclass{scrartcl} \usepackage[thref]{ntheorem} \usepackage{cleveref} ...
3
votes
1answer
75 views

cleveref: \lcnamecref fails to work with theorem names that are not pre-defined

I'm using cleveref with the capitalise option, and I'd like to use the \lcnamecref command to give the name of one of my theorems in the text. But if this is not one of the theorem types pre-defined ...
9
votes
3answers
541 views

algorithm2e + cleveref: problem with wrong reference to line numbers

For some reason I do not understand, cleverefproduces wrong references to line numbers of listings produces with the algorithm2e package. I hope that I did not miss a simple solution ... My example ...
5
votes
1answer
600 views

cref reference format for label type `' undefined

I have this error that I suspect comes from the fact that my tables and figures are in a slave file. It seems that cleveref does not manage to see the "class" of my float. I tried with varioref and I ...
2
votes
0answers
35 views

Problem with hyperref/cleveref interaction and specially tagged equations [duplicate]

I would like to resolve the infamous warning destination with the same identifier (name{equation.0.1}) has been already used, duplicate ignored in my MWE below. Reading around this site, the package ...
5
votes
1answer
363 views

\crefname for several layers of an enumerate: problem with enumitem

I want to use the \crefname macro from the cleveref package to set the label names on several layers of an enumerate environment. The following code works very well: \documentclass{article} ...
1
vote
1answer
768 views

\autoref with links that include only the number, but not the text, and have counter-dependent colors

I would like the functionality of hyperref's \autoref, but in a way that the link border box covers only the number and not the preceding text (e.g. "section"). This is normally possible with the ...
6
votes
1answer
542 views

Multiple labels in Cref

Following is a simple code to show my problem with the cleveref package. When using multiple labels it breaks on the second label... \documentclass[11pt]{article} ...
3
votes
1answer
100 views

Switch off “on page” for varioref

For referencing I'm using the three packages \usepackage{varioref} \usepackage{hyperref} \usepackage{cleveref} In the text I cite with \vref, which is redefined by cleveref and does its job very ...
6
votes
1answer
807 views

Lightweight equivalent of \cref and \Cref

I'm trying to convert my LaTeX document to HTML using HeVeA and I'm facing a problem with cleveref package -- my LaTeX file uses \cref and \Cref heavily, but hevea doesn't support this package by ...
14
votes
1answer
159 views

Using babel and cleveref causes unnecessary horizontal space in header

Update This bug has been fixed with version 0.18.9 of cleveref, which is currently on ctan. Question Babel and cleveref do not seem to work flawlessy together when they share the same language ...
3
votes
1answer
138 views

Using cleveref with newenvironment

I am trying to refer to a newenvironment using cref from the cleveref package. Here is a MWE that demonstrates what I am trying to do. \documentclass{article} \usepackage{cleveref} % define a ...
8
votes
1answer
356 views

Making refcheck work with cleveref

It seems that refcheck does not recognize references made by cleveref: \documentclass{article} \usepackage{amsmath} \usepackage{cleveref} \usepackage{refcheck} \begin{document} \begin{align} a ...
8
votes
1answer
217 views

cleveref doesn't print correct caption for listings

I want to set the caption for referenced listings: \documentclass{scrbook} \usepackage{listings} \usepackage{varioref} \usepackage{hyperref} \usepackage{cleveref} \begin{document} ...
5
votes
1answer
205 views

cleveref & varioref : Missing \endcsname inserted

I read the excellent question Difference between ref, varioref and cleveref. Decision for a thesis and various doc on the net (the varioref package documentation) and tried to use it... but with many ...
40
votes
1answer
2k views

Difference between ref, varioref and cleveref. Decision for a thesis

How can one make a quick decision what the best "ref" for a thesis in pdflatex with hyperref is? After a few hours reading I do not know more than ref is used by everyone who does not know about ...
6
votes
4answers
306 views

cleveref: configure symbol §/§§ for all sectioning types once time

I want to configure the section symbol § (singular and plural form §§) indistinctly for all types of sections (part, chapter, section, subsection, paragraph and so on). I use the cleveref package, but ...