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.

Filter by
Sorted by
Tagged with
4 votes
0 answers
31 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}{}{ }{\...
13 votes
1 answer
639 views

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

LaTeX manuals are full of examples such as Fig.~5 or Thm.~10. The tilde prohibits a line break after the abbreviation completely, to make sure that the reader doesn't see a period at the end of a ...
1 vote
1 answer
83 views

nameref, ref, and other issues with referencing back

I amm having issues with \nameref and \ref not returning the desired output. I would like to have definitions referred to by Definition 0.0.1 (see below). I do not want the result of \nameref{defn1} ...
1 vote
1 answer
13 views

newcounter, crefname, crefformat: Multiple cross-references in cref not showing name, ?? instead

After defining a newcounter (I named it "cases"), crefname, crefformat, and crefrangeformat, I incremented the counter with refstepcounter and labeled it with label. I can reference single ...
3 votes
1 answer
67 views

Wrong figure caption and number, attempt to implement APA 7 style

I'm trying to adjust the figure formatting style to the APA 7 style. So far I'm doing well, but now I got an issue. When cross-referencing a figure in the text, it appears as "Figure 1a" ...
1 vote
1 answer
95 views

crefrange with different reference types in Cleveref

I am using the Cleveref package and in my document defined multiple new cross-reference types that all refer to figures, i.e., \Crefname{figure}{Fig.}{Figs.} \Crefname{fig_a}{Fig.}{Figs.} \...
0 votes
1 answer
115 views

Using cleveref with mdpi template

I would like to use the \cref command provided by the cleveref package in a project using the MDPI template. However, I can't seem to do so without getting an error. Because I'm working from the ...
1 vote
1 answer
11 views

How to prevent cleveref from picking up the separator in enumerate environments?

I am defining a new label class with cleveref, which I name "Cases". I also define a custom enumerate environment with enumitem. Among other things, I make sure that after the numeral in my ...
0 votes
0 answers
32 views

cleveref, list of figures/tables and multiple languages in titlepage

There seems to be a bug in a combination of referencing another figure or table using cleveref in a figure/table caption, using multiple languages in \maketitle and the list of tables or figures. I ...
0 votes
0 answers
20 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 ...
4 votes
1 answer
867 views

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

I'm having issues getting cleveref to recognize references when using revtex4-2. When compiling, all references give a warning "LaTeX Warning: cref reference format for label type `' undefined on ...
0 votes
0 answers
14 views

SIAM template breaks algorithm line references

I'm making a SIAM submission, and after applying the template the algorithm line references simply refer to the algorithm itself, instead of the specific line. Oddly, according to the template manual, ...
0 votes
0 answers
32 views

cleveref is not using right language selected using polyglossia

Problem using polyglossia and cleveref (vanilla install). It is not using the main/selected language. Example document: \documentclass{article} \usepackage{polyglossia} \setmainlanguage[variant=...
7 votes
1 answer
150 views

Referring to two or many corollaries in LateX

I am using \thref{cor1, cor2} to cite two corollaries, and it provides instead of Corollaries 3.3.9 and 3.3.10. (It gives "Corollarys" as the plural of Corrolary). If I have the following ...
0 votes
0 answers
58 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 ...
1 vote
1 answer
18 views

Loss of nameref when changing documentclass

The following MWE compiles fine \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{theorems} \usepackage{hyperref} \usepackage{cleveref} \newtcbtheorem{thm}{Theorem}{#1}{thm} \begin{...
0 votes
1 answer
27 views

How to make hyperlink to solution in theorem/problem name cover the counter

After Ulrike Fischer helped me out at this thread, I just had one troubling aspect remaining while getting the formatting together for some textbooks that I have written. I was thinking of ignoring it,...
4 votes
2 answers
954 views

How to remove parentheses from single cref references?

I am using cleveref to cross-reference everything. Sometimes I write the reference inline like eq.(1). That is fine. But when it is enclosed in parenthesis it turns out like (eq.(2)). Which is not so ...
1 vote
2 answers
61 views

Specifying a "fallback" for undefined references in \ref and \cref (plain LaTeX and cleverref)

I am using some of my LaTeX files in multiple documents. And thus in some documents my references will be defined and in others not. I would like to have a way to make \ref degrade gracefully. Thus (...
0 votes
0 answers
31 views

Reference subequations without parentheses with cleveref

Is there a possibility to reference subequations with cleveref without parentheses? MWE: \documentclass{scrartcl} \usepackage{amsmath} \usepackage{cleveref} %\crefformat{subequations}{eq.~#2#1#3}% ...
5 votes
1 answer
40 views

How to add a hint (arrow up/down) at the reference for direction in which to look for the referenced figure/float?

In LaTex it is common for figures to be placed by LaTex and not right at the definition of the figure in the text. This is fine. Yet, the referencing text might name a figure that will come on the ...
1 vote
1 answer
25 views

Cleveref and Algorithm2e: typesetting procedure name

I am making use of the procedure environment of algorithm2e, but I am unable to get it to work with cleveref. I would like to have a different reference for procedures and algorithms, but they seem to ...
0 votes
0 answers
38 views

Making hyperref, cleveref, and answers work together

I am using the following packages in a math textbook that I am writing: The answers package to be able to put solutions to problems at the end of the book The hyperref package to be able to link ...
3 votes
1 answer
1k views

Cross-reference to appendix sections in elsarticle document class

I am trying to reference a result given in the appendix, but cleveref is giving "Appendix Appendix" (doubling it). A way to solve this problem is to add \def\appendixname{} Not surprisingly, this ...
1 vote
0 answers
29 views

How to create a cross-reference to a section in the appendix? [duplicate]

I want to cross-reference an appendix in my LaTeX document. The appendix is defined as follows: \usepackage{cleveref} \appendix \section{title1} \label{label1} \section{title2} \label{label2} How to ...
1 vote
1 answer
50 views

cleveref not supporting a language

I want a document where you can select between two languages and use cleveref. However, cleveref does not support the second language nynorsk. I still want to be able to use the english version, so I ...
1 vote
1 answer
104 views

Skipping non-numeric part of counter label in local Cross-referencing

When quoting linguistic examples from authors inside a quotation, I like to use a special label specifying the name of the author. (I enclose it between square brackets but it will not appear here ...
2 votes
0 answers
34 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{...
1 vote
1 answer
30 views

\crefname with multiple language definitions

I am making a LaTeX template with 2 languages, and use \selectlanguage{english} to set the document language after \begin{document}. This works fine for the cleveref package, except that I have made a ...
0 votes
1 answer
184 views

Advanced Cross-Referencing with Linguex/Philex: Skipping and Stripping

\documentclass{report} \usepackage{philex} % Includes linguex. Only loading it for \phildashes. \usepackage{cleveref} % Referring to Subexample Ranges \crefname{ExNo}{}{} \crefname{SubExNo}{}{} \...
0 votes
2 answers
204 views

How to adapt \crefrangelabelformat to subexample formatting?

I would like to be able to redefine something which is supposed to be defined in the preamble. In this example and in relation to this question : Cross-referencing: more sublevels, and presets, I want ...
0 votes
0 answers
26 views

Named Equations with cleveref

I have a strange problem, where using a tag with an equation creates a warning (that obviously later leads to some unwanted behavior, though not in the context of this question) I use to import two ...
3 votes
2 answers
2k views

Cross-reference to equation with cleveref

How can I get cleveref to produce the following: Inserting Equation (1) into (2) yields ... i.e., I don't want the word "Equation" to pop up before (2), which i have when simply using ...
4 votes
0 answers
223 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 ...
0 votes
0 answers
15 views

How to access algorithm caption and procedure name

I would like to be able to access an algorithm's caption and procedure name in a similar way I can reference the algorithm number; i.e. using something like \ref{somelabel}. Is there a straightforward ...
0 votes
2 answers
54 views

Incorrect label type using threeparttable and cleveref

I'm having an issue with the threeparttable package label type, causing cleverref to not be able to refer correctly to the table. Compiling on Overleaf produces the following warning: "cref ...
2 votes
1 answer
20 views

Autonum wrong behaviour

I get the wrong behaviour with this code, using autonum. When one clicks on the hyperlink to the equation it jumps to the beginning of the page. Minimal (not) working example: \documentclass{book} \...
1 vote
1 answer
72 views

Hyperlink prints OK but jumps to wrong target

When I use pdflatex to process a book-length document, in chapter 6 a couple of isolated links to theorem-like environments in that same chapter appear printed correctly in the pdf output, but ...
0 votes
1 answer
86 views

Non-ascii characters in label with cleveref in Overleaf

I'm collaboratively working in a LaTeX document in Overleaf and some team members use German umlauts (ä, ö, ü, Ä, Ö, Ü) in their labels. It works with \ref: \documentclass{scrartcl} \usepackage[utf8]{...
0 votes
1 answer
46 views

Obtain (1)‒(3) style when referring to ranges of examples, when default \crefrangelabelformat has no parentheses

I need \crefrangelabelformat to be without parentheses, so I can type 1‒3 when in an "already between parentheses" context, as in (for this issue, see 1–3 and following examples). But then, ...
0 votes
0 answers
30 views

Best practices for class authors: configurable names / translations

How should I suggest document authors rename elements that my class provides, either because they're not writing in English, or because they need to change a word or two? Here are three tools, each ...
0 votes
1 answer
26 views

Hyperlink jumping to incorrect location for \newtcolorbox labeling in compilation LaTeX -> dvi -> ps -> pdf

By compiling the following sample code: \documentclass{report} \usepackage{lipsum} \usepackage{amsthm} \usepackage[many]{tcolorbox} \usepackage[dvips,colorlinks,bookmarks]{hyperref} \usepackage[...
2 votes
1 answer
115 views

Adding `UsedOn` option to cleveref's \cref to mimic hyperref's \backcite

I am trying to overload \label and \cref, so that the following happens (similar in spirit to backref's \backcite): In some preliminary chapter, I define in Theorem A a label \label{thm:A}. Later in ...
0 votes
1 answer
66 views

MPDI article with cleveref

I need to write an article using the MDPI template. The latest version of this template is available on Overleaf or directly on MDPI website. This template is said to be compatible with cleveref ...
1 vote
1 answer
52 views

cleveref conflicts with polyglossia when required in a class

When I run the following MWE (with xelatex): % File myclass.cls \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myclass} \LoadClass[12pt]{article} \RequirePackage{polyglossia} \RequirePackage{cleveref} % ...
1 vote
1 answer
43 views

Custom counter for cross-referencing is incorrect when used inside tabularray

I would like share with something. I have created a custom counter to cross-reference sub figures. For some reason, the counter is wrong if I use it inside tblr environment (the one defined in ...
3 votes
2 answers
116 views

Cleveref and caption-based command - wrong references

I am trying to create a caption command that highlights the first sentence and also uses the first sentence as a short caption for the table of *. Let's call it kaption. This is done using the ...
4 votes
1 answer
1k views

Cross referencing tcolorbox with cleveref-package

Thanks to Thomas F. Sturm (https://tex.stackexchange.com/a/124688/15907), I have a little environment for creating nice-looking source code in LaTeX. I started my environment with this here: \begin{...
5 votes
3 answers
1k views

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

I use cleveref for in-document references, and find it to be clever. However, I typically want to refer to figures (for example) within parentheses. What I do now is this \usepackage{cleveref} ... X ...
2 votes
3 answers
204 views

Refer to a range of subsubexamples

I use Cleveref to refer to subexamples such as "2a–c". Now I want to use crefrange to refer to 1ai–ii as well. \documentclass[a4paper,12pt]{report} \usepackage{philex} \usepackage{cleveref} ...

1
2 3 4 5
17