Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [cleveref]

{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.

101 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
251 views

What is the recommended maintained modern (>= TexLive 2023) alternative to cleveref?

Cleveref has seems to be unmaintained as it produces broken references with TexLive 2023 and had its last release in 2018. It has been pointed out that it "might be not supported anymore". ...
Flow's user avatar
  • 1,017
7 votes
0 answers
54 views

\crefstripprefix not working for 10 or more cross-refs

The following MWE gives an error; if the number of cross-referenced equations is reduced to below 10, the error disappears. The \crefrangeformat is totally standard and is taken from many answers on ...
bjorne's user avatar
  • 647
6 votes
0 answers
97 views

Show appendix as "Appendix A" instead of "Chapter A" in references

Here's a ConTeXt document that uses Aditya's solution to "Cleveref-like command in ConTeXt": \definereferenceformat[cref][label=*] \setuplabeltext[chapter=Chapter~,appendix=Appendix~] \...
Ram's user avatar
  • 61
6 votes
0 answers
153 views

Incorrect \cpageref result with multiple (3+) references that span a page range

I have noticed that using \cpageref for more than 2 references fails when the references span more than one page. Instead of getting the page range, the references that define the page range are ...
Haydon's user avatar
  • 213
5 votes
0 answers
68 views

Cross-reference expl3 integers with cleveref

Suppose I implement numbered document elements using expl3 integers. Suppose further that I would like to cross-reference these elements using cleveref. What is the best way to do this? I came up with ...
cfr's user avatar
  • 201k
5 votes
0 answers
61 views

Context sensitive cross reference using Cleveref and Varioref

I am blocked to make a command (called \pref{<cross-reference>}) for cross-references using cleveref and varioref. I would like it to be able to adapt to the context : First, I would like to be ...
Bastien's user avatar
  • 449
5 votes
0 answers
262 views

Cleveref and polyglossia problems with crefname

I am having problems with polyglossia and cleveref. The following snippet works as intended: \documentclass{book} %\usepackage{polyglossia} %\setdefaultlanguage[variant=us]{english} \usepackage[...
bonanza's user avatar
  • 2,171
5 votes
0 answers
989 views

Prefix for \externaldocument references in \cleveref

The question Special case for last element with \foreach manually changed the references, and added the ability to have a prefix on references. Can I do the same thing using \cleveref? (Note: This ...
jlperla's user avatar
  • 570
4 votes
0 answers
55 views

How to get "Theorems 1 to 6" when Theorems 3 to 6 are in the appendix rather than in the main body?

Consider the following MWE: \documentclass[]{article} % PACKAGES LOADING \usepackage{amsthm} % THEOREM DEFINITION \makeatletter \newtheoremstyle{style1}{\topsep}{}{\itshape}{}{\scshape}{}{ }{\...
EoDmnFOr3q's user avatar
  • 2,301
4 votes
0 answers
285 views

Cross-referencing: more sublevels, and presets

I'm typing a lot of linguistic examples and I would like label formatting to gain flexibility, i.e. setting up presets would be great. That is, I'd like to be able to have ready-to-use setups ...
Vincent Krebs's user avatar
4 votes
0 answers
133 views

Cleveref: Multiple letters inside parentheses for subfigures

I am using cleveref with crefmultiformat to reference a list of subfigures. I would like to have the letters referencing the subfigure of the main figure listed inside parentheses, like so: figs. 1(a,...
luege's user avatar
  • 41
4 votes
0 answers
234 views

Cleveref not working with Greek/Xetex

I've been having some issues with cleveref; Whenever I include it it throws the following error: $ xelatex mwe.tex ... ! Undefined control sequence. \@begindocumenthook ...sname extras\cref@language ...
svart's user avatar
  • 149
3 votes
0 answers
144 views

Conflict with hyperref's draft option, cleveref's \cref and... \textbf in \caption

The following MCE compiles like a charm. \documentclass{article} \usepackage{hyperref} \usepackage{cleveref} \hypersetup{draft} \begin{document} \begin{figure} \caption{% foo% % \textbf{...
Denis Bitouzé's user avatar
3 votes
0 answers
84 views

Strange incompatibility between several packages (options)

The compilation of the following MCE fails with the error: ! Incomplete \iffalse; all text was ignored after line 29. <inserted text> \fi Interestingly, as soon as: one of the ...
Denis Bitouzé's user avatar
3 votes
0 answers
140 views

How to cross reference nested enumeration lists?

Within theorems, I have nested enumeration lists: 1.1, 1.2, 1.3, 1.4, etc. 2.1, 2.2, 2.3, 2.4, etc. For referencing to 1.1 to 1.3 and 2.4 I tried to use the usual command \cref{en1-1,en1-2,en1-3,...
Jack's user avatar
  • 314
3 votes
0 answers
63 views

Incompatibility of thmtools, IEEEtrantools, and cleveref in Tex Live 2018-2019

Using TeX Live 2018 or 2019, IEEEtrantools, thmtools and cleveref are incompatible. I.e., if one loads these packages together, the project does not compile. Here is a minimal example: \documentclass{...
MatteoBianchetti's user avatar
3 votes
0 answers
636 views

Change the style of cleveref references to sections of other chapters

When I use cleveref-based cross-references to, say, sections in another chapter, these references just print Section n. It's then difficult to distinguish references to a section of another chapter ...
Jason Hemann's user avatar
3 votes
0 answers
96 views

cleveref refers to appendix as chapter when titlesec is used

I use titlesec to adjust chapter headings for the report class (no page breaks in main report, but with page breaks in appendix). However, cleveref now refers to the appendix as "chapter A" instead of ...
Solstrand's user avatar
3 votes
0 answers
208 views

babel causing cref mistakes to labels when compiled with htlatex

Update: I'd be very interested to know what babel does to that enables the advanced hungarian accents to be loaded. The comments below indicate that it should really have no affect. Given the ...
EngBIRD's user avatar
  • 3,985
3 votes
0 answers
839 views

Parenthesized subfigure references except when already in parenthesis

I would like to style my subfigure references as Fig. 1(a) in running text and (Fig. 1a) when parenthetical. The subfigure labels are created using this code. (I would prefer to use subcaption like in ...
Elliott Sales de Andrade's user avatar
2 votes
0 answers
51 views

Wrong order of references when combining subequations with cleveref

Could you please help identify what its wrong with my code (see below)? It uses subequations and cleveref. The result is that some of the references appear in a wrong order. What I get is (1.1a) and (...
Ann's user avatar
  • 21
2 votes
0 answers
65 views

Error resulting from hyperref-cleveref-ntheorem interaction: No counter '[' defined

I am on a Linux system running TeX Live 2023 installed manually (not through the distro's repo), and up to date at the time of this writing (2023-04-21). The following short document has started ...
grobber's user avatar
  • 181
2 votes
0 answers
445 views

Remove parentheses for only one reference

I need to reference some items from an enumerate environment. I can do this by adding a label at the beginning of each \item (see MWE at the bottom). So far, so good. Each item in the enumerate has a ...
GioMott's user avatar
  • 195
2 votes
0 answers
74 views

Multi-referencing with cleveref: is \cpageref compression bugged, or am I using it wrong?

I am running into problems using \cpageref in cleveref. It seems like if it tries to "compress" pages as part of a 3+ input \cpageref, something goes horribly wrong and it just prints the ...
Filip Sufitchi's user avatar
2 votes
0 answers
86 views

Cleveref in section's name does not work in book header

I have a book format document with a theorem's reference in one of the section names. I use cleveref to make this reference, it shows perfectly in the section's name and even the table of contents, ...
Rolf's user avatar
  • 229
2 votes
0 answers
263 views

grade table with question/parts/subparts

I am trying to modify the code I have obtained from sykora so that, I can add \question and subparts points to the grade table. So far I have modified the code as. My MWE \documentclass[addpoints]{...
Tesla's user avatar
  • 21
2 votes
0 answers
64 views

Why `\crefname` command generates error?

Does anybody know why \crefname{thm}{AAAA}{AAAAs} command generates error? \documentclass{article} \usepackage{amsthm} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage[...
user avatar
2 votes
0 answers
67 views

How to redefine label such that it recognizes its environment

How to redefine label command such that if it is inside a environment (e.g. theorem) then \label{thm:2} becomes \label[Theorem]{thm:2}? \documentclass{article} \usepackage{amsthm} \usepackage{amsmath}...
user avatar
2 votes
0 answers
108 views

How do I define and link to a labelled list?

I want to define a labeled list and refer to the items by name, with hyperlinks. My first thought was to use the description environment, put a \label in each item and retrieve the values with \...
shmuel's user avatar
  • 1,449
2 votes
0 answers
145 views

Showkeys: Omit optional argument of \label

I use cleveref and mathtools together with the showkeys package. However, since for some labels I'm using my own type, labels can get pretty long (in the following example the label will be [mytype]{...
dba's user avatar
  • 516
2 votes
0 answers
53 views

Issue with ASL class file and equation numbering/referencing

This is a (delayed) follow-up to this question. I am having two issues with equation numbering and referencing when using the ASL class file: Issue 1 Despite the command \nonumber in the definition ...
dwolfeu's user avatar
  • 473
2 votes
0 answers
131 views

easylist and cleveref

I'm trying to reference an item in an easylist using cleveref's \cref. Here's a MWE: \documentclass{article} \usepackage[at, 5]{easylist} \usepackage{cleveref} \begin{document} \section{S1} \begin{...
blalterman's user avatar
2 votes
0 answers
74 views

Incompatibility between `floatrow` and `cleveref`

Consider the following MWE. If you comment out the line \usepackage{cleveref}, it works fine. However, if this line is not commented, the pdflatex command just stalls (no error is shown). Any ...
Sadeq Dousti's user avatar
  • 4,390
1 vote
0 answers
118 views

Converting cleveref macros to standard LaTeX

My goal is to create a function in Emacs Lisp to interactively convert macros provided by the cleveref package (\cref, \Cref, etc.) into standard LaTeX: For example: \cref{sec:1} --> section~\ref{...
Gabriele's user avatar
  • 1,935
1 vote
0 answers
69 views

Check if floats appear before the page where they are first referred

In the 2017 I asked: Get the "exact" page of a \ref command in .log or .aux files. I still need to check if a float appears before the page where that float is first referred. I have a ...
Gabriele's user avatar
  • 1,935
1 vote
2 answers
41 views

Cleveref names in small caps

I want to have every name cleveref prints to be a link writing in small caps. Currently I do this manually for every name I can think of using \crefname and \Crefname, but this is not an elegant ...
Pedro G. Mattos's user avatar
1 vote
1 answer
51 views

Old style numbers on cross-references and links

I am writing a document and want to have old style numbers whenever hyperref creates a links to something inside my document that is numbered. This includes references to numbered sections, pages (...
Pedro G. Mattos's user avatar
1 vote
0 answers
58 views

Cleveref not compressing equation refs with subequations

Consider this example: \documentclass[ reprint, nofootinbib, amsmath, floatfix, superscriptaddress, longbibliography ]{revtex4-2} \usepackage[utf8]{inputenc} \usepackage{...
HerpDerpington's user avatar
1 vote
0 answers
20 views

pseudocode, clever-ref. display (algorithm number, line of code)

I have several algorithms and want to be able to have clever-ref automatically generate citations like \cref{alg1-line1}: Algorithm 1, Line 1 \cref{alg2-line44}: Algorithm 2, Line 44 preferably with ...
Alek Westover's user avatar
1 vote
0 answers
28 views

How to customize the reference ranges for both \cref and \labelcref simultaneously?

Feeding pdflatex with \documentclass{article} \pagestyle{empty} \usepackage{mathtools} \usepackage[capitalize]{cleveref} %% customizing: “Formula” instead of “Eq.”, “Formulas” instead of “Eqs.”, and ...
user avatar
1 vote
0 answers
56 views

How the cross-reference system works?

I'd like to know how packages like cleveref actually work. As far as I know, \ref gives back the value of the counter that was incremented through \refstepcounter. However, it can only give the value ...
OrthoPole's user avatar
  • 113
1 vote
0 answers
64 views

How to display the reference suggestions in TeXstudio when using cref and tcolorbox?

Edit: this question is now this feature request on TXS Github. Very picky question. I am happily using TeXstudio, the tcolorbox package and cleveref. In TXS, typing cref triggers a popup menu where ...
germinael's user avatar
1 vote
0 answers
129 views

How to make the keywords in \cref compatible in the enumerate environment

My problem is as follows, \documentclass[12pt]{article} \usepackage{mathtools} \usepackage{amssymb,amsthm} \usepackage[inline]{enumitem} \usepackage{hyperref} \usepackage{cleveref} \newcommand{\...
hmeng's user avatar
  • 147
1 vote
0 answers
68 views

Custom equation environment using cleveref gives wrong numbering

I want to make a custom environment for important equation and use separate numbering for these. I got it working as shown in my "MWE": \documentclass{article} \usepackage[utf8]{inputenc} \...
FireDuckz's user avatar
1 vote
0 answers
406 views

How do I make \cref used in section titles work in headings?

I have a section whose title is "Proof of theorem 1" which I get by typing \section{Proof of \cref{myTheorem}} which works fine in the section title itself, however where the section title ...
David Sheard's user avatar
1 vote
0 answers
100 views

How to format ref name for section with cleverref?

Say I have a section 1.11 and I want to format its ref name as: Chapter 1 Section 11. I have tried the following: \creflabelformat{section}{#2 Chapter #1 #3}% and it yields Chapter 1.11. What should ...
KaiserKatze's user avatar
1 vote
0 answers
173 views

math tools and cleveref gives no equation number

Using the following \documentclass{scrartcl} \usepackage{amsmath} \usepackage[tbtags]{mathtools} \mathtoolsset{% showonlyrefs = true ,showmanualtags = true } \usepackage{varioref} \...
Ulrich's user avatar
  • 937
1 vote
1 answer
183 views

cleveref does not work together in sv classes with envcountsame option

I posted once before about this issue, here, but would like to start a new thread with more information and a MWE. I hope that's OK. (In the old post I did not very adequately explain the situation, ...
Skeptic's user avatar
  • 3,025
1 vote
0 answers
85 views

Strange output (possibly related to tcolorbox)

I use the tcolorbox package to highlight certain theorem environments. I occasionally get very strange behaviour when placing hyperlinks (MWE below). The problem does only seem to occur on macOS. If I ...
220284's user avatar
  • 209
1 vote
0 answers
247 views

Combine cleveref and subcaption to have separate commands for figure captions and references to subfigures in text

**Update I am trying to refer to multiple subfigures in a figure caption as well as in the body of the text. The issue is that when I call \labelcref{... I am still getting the figure number in the ...
Christopher Creveling's user avatar