Tag Info

38

You can certainly load both the varioref and the cleveref with hyperref provided that you load them in the following order \usepackage{varioref} \usepackage{hyperref} \usepackage{cleveref} They all play very nicely together. The varioref and cleveref weren't around when I did my thesis, but I'm working on a multi-chapter document at the moment in which ...

26

Load varioref first, then hyperref, then cleveref. See section 12.1 of the cleveref manual. \documentclass[ngerman]{scrartcl} \usepackage{babel} \usepackage{varioref} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \section{Erster Abschnitt}\label{sec} \begin{figure} \rule{\textwidth}{1cm} \caption{bild}\label{bild} \end{figure} Siehe ...

24

The cleveref package sorts and compresses cross-references. It also automatically determines the format of references, so that you don't have to type "section" in the source. \documentclass{article} \usepackage{cleveref} \begin{document} \section{winter}\label{winter} \section{spring}\label{spring} \section{summer}\label{summer} ...

24


22

There is a bug in thm-autoref.sty. Part of the set-up for cleverefs magic is left to the start of the document. So cleveref maintains a list of all the label types that it has been told about so that when it gets to the \begin{document} hook, it can iterate through them and finish the necessary configuration. Examining this list for your document (well, ...

16

Pass the nameinlink option to the cleveref package \usepackage[nameinlink]{cleveref} A MWE follows, just for demonstration- see Section 6.2 of the documentation for details \documentclass{article} \usepackage{hyperref} \usepackage[nameinlink]{cleveref} \begin{document} \section{Here is a section}\label{sec:mysection} ...

15

I recommend to use the cleveref package which enhances LaTeX's cross-referencing features determining types of cross-references and context. In your case, \cref{my new result} would output proposition 1. If you then change this particular environment into a lemma environment, the same \cref{my new result} would output lemma 1. You could even change the ...

14

There is a new pre-release version (v0.18) of cleveref which supports a noabbrev option which does this automatically. The new version is not yet on CTAN but can be downloaded on the package author's website: http://www.dr-qubit.org/latex.php#cleveref

14

Underfull \hbox The problem is package cleveref that sets an unwanted space. The line starts with an object that fills the complete line. Usually the following \caption calls \par that ends the previous paragraph and removes the latest space in the process. However, if there is a space in \caption by some code of \cleveref before, then only one space gets ...

13

#1 and #2 of \crefrangelabelformat contains the formatted equation number. The following example expands them and stores them in \eq@ref@a and \eq@ref@b. Then both are analyzed, whether the equation numbers have a dot separator. If yes, then the first parts are compared and omitted in \eq@ref@b, if the first parts are equal. \documentclass{report} ...

13

Use \crefformat (notice that the same formatting can be achieved simply using \eqref from amsmath): \documentclass{article} \usepackage{amsmath} \usepackage{cleveref} \crefformat{equation}{(#2#1#3)} \begin{document} \ref{eq:test}\eqref{eq:test}\cref{eq:test} $$\label{eq:test} a=b.$$ \end{document} You might also want to ...

13

Section 2.3 of the documentation details that you can use \labelformat{equation}{(#1)} so that \vref works as you would want it to for equations. In fact, following egreg's comment, one should have the reference typeset upright, even if it is contained in environment that is (for example) italic. A complete MWE follows. \documentclass{article} ...

12

Well, let's see, first the manual of cleveref, in the non-bugs section, cleveref will not work properly with the standard LaTeX eqnarray environment. There is no intention to fix this. The eqnarray environment is poorly implemented, making it difficult to get it to work properly with cleveref, and it's broken any way. You're far better off using ...

12

This solution works by redefining \@@setcrefrange. For a hyperref solution, this will need extra work. Also the numbering-scheme of the subequations (which is actually the equation counter) is not saved with the label (neither is the scheme of the equations (which is actually the parentequation counter)). The problem is that not a, b and so on is stored ...

12

You can do this without hacking any cleveref internals. The beauty of the \cref<x>format commands is that you're really defining the body of a LaTeX macro, not merely a pattern with placeholders to be filled in. This lets you do arbitrarily complex things to the label text before it gets typeset. To produce equation range references of the form (1a-e) ...

11

It's a bug in cleveref. If I change line 4516 of cleveref.sty from 4516 \PackageInfo{cleveref}{loaded spanish' language definitions} into 4516 \PackageInfo{cleveref}{loaded spanish' language definitions}% the space disappears. This is common with all the other languages and should require a bug fix. As a temporary workaround you can say ...

11

This is a known issue that is associated with hyperref and is discussed/answered in the UK TeX FAQ. In answer to your "bonus question": This stems from the fact that you're using the same counter to reference two different things by virtue of \newtheorem{thm}{Theorem} \newtheorem{lem}[thm]{Lemma} This tells LaTeX that you want a new environment called ...

10

use this order of the packages: \usepackage{hyperref}  \usepackage{amsthm}  \usepackage{cleveref}

10

My money is on a name clash of \@result. There's a suspicious \@call #1#2->\let \@cont =#2\bgroup \@result ={}#1 #1<-\@subtree #2<-\@Tree {\let} {begin-group character {} \@result -> {the character =} Missing character: There is no = in font nullfont! {begin-group character {} {end-group character }} in the log. Without having checked right ...

10

cleveref is at version 0.18.4 at the moment. The noabbrev option was introduced in version 0.18 (from December 2011, announcement at comp.text.tex), so this is most likely a versioning issue. EDIT: According to your log file, you are using cleveref 0.17.9, so you need to switch to a more recent version.

10

Try with the latest version v0.18.5. The changelog says Fix listings and algorithm package support, broken by change to local rather than global \cref@currentlabel denitions.... From Gonzalo Medina's comment it seems that this solved it, but if it hadn't I'd say you should write to Toby Cubitt, author of cleveref with your MWE. He is very helpful ...

10

Macro \hyperref also knows an optional argument. Then it expects a label name and the only mandatory argument contains the text: \hyperref[labelname]{text made to link} Because we have now a link, we do not need another link inside causing by \ref to the same location. Therefore \ref (and also \pageref) have a star form if hyperref is used. With star the ...

10

In \Crefrangeformat you have to refer to a valid counter, in your case equation and not eq. Also, you can insert "eqs." inside it not to have to specify it every time. Moreover, it is better to define \crefrangeformat and leave \Crefrangeformat undefined, so when you use \crefrange you get the non-capitalised version and when you use \Crefrange you get the ...

9

I tried to look for other questions with the same problem and found none. So here's an answer: load cleveref last. From the documentation: The cleveref package is loaded in the usual way, by putting the line \usepackage{cleveref} in your document’s preamble. However, care must be taken when using cleveref in conjunction with other packages that ...

9

In its current version, the autonum package breaks support for special characters in label names. Thus, characters like the colon or digits are not allowed at the moment and must be changed. The technical reason is, that the label name is used as part of a newly created command when an equation is referenced. This command is saved into the aux file and ...

9

Use \crefname{listing}{Quelltext}{Quelltext} \Crefname{listing}{Quelltext}{Quelltext} There is an alias from lstlisting to listing, but apparently it doesn't work. \documentclass{scrbook} \usepackage{listings} \usepackage{varioref} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \crefname{listing}{Quelltext}{Quelltext} ...

9

refcheck doesn't know about \cref and \Cref. We can add a macro that makes the package aware of other reference commands: \documentclass{article} \usepackage{amsmath} \usepackage{cleveref} \usepackage{refcheck} %%% Infrastructure \makeatletter \newcommand{\refcheckize}[1]{% \expandafter\let\csname @@\string#1\endcsname#1% ...

9

It's not to be considered a bug. The capitalization is obtained by applying \MakeUppercase, so detaching the first letter. Just teach cleveref what's your preferred capitalised form: \documentclass{scrartcl} \usepackage{ntheorem} \usepackage{cleveref} \newtheorem{thm}{Teorema} \Crefname{thm}{Teorema}{Teoremi} \begin{document} \begin{thm}\label{thm} ...

9

You are already formatting your links with \crefformat. Thus it is easy to add coloring. The linked text is surrounded by #2 and #3. Now the first letter is not auto-detected any more and \Crefformat is also needed to get the upper cased form. Hyperref's coloring for inner document links is disabled by linkcolor={}. The example also fixes the issues with ...

9

Loading thmtools and nameref will give you this feature. You will have to use \nameref instead of \cref, but I think most of the time it is you who is the best to decide whether it is the theorem's name or number you want to reference. EDIT Code added with commands \myref and \Myref for single references to automatically add the name in brackets when ...

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