Tag Info

Hot answers tagged

40

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

If you define this new command \newcommand{\creflastconjunction}{, and\nobreakspace} you will get Oxford comma everywhere you use multiple references like those. MWE: \documentclass{article} \usepackage[standard]{ntheorem} \usepackage{cleveref} \newcommand{\creflastconjunction}{, and\nobreakspace} \begin{document} \begin{proposition}\label{thm:roses} ...


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} \begin{equation} ...


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


15

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} \begin{equation} \label{eq:test} a=b. \end{equation} \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} ...


13

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


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

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


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

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


11

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


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


11

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


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


10

As a workaround you may define a plural equation label: \documentclass{article} \usepackage{amsmath} \usepackage{cleveref} \crefname{pluralequation}{eqs.}{eqs.} \Crefname{pluralequation}{Eqs.}{Eqs.} \crefformat{equation}{#2eq.~(#1)#3} \Crefformat{equation}{#2Eq.~(#1)#3} \begin{document} \begin{subequations} ...


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

The command \eqref is meant for printing references to equations in the same format as used for numbering the equations (and always in upright type). This is not always appropriate for other cross references. For example, items are usually numbered without parentheses and it could be difficult for the reader to interpret the cross reference "In (1, 2)". But ...


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

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

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


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

Yes, it is possible. You need to set \captionsetup[subfigure]{subrefformat=simple,labelformat=simple,listofformat=subsimple} \renewcommand\thesubfigure{(\alph{subfigure})} and to use \subref*. A complete example: \documentclass{article} \usepackage[demo]{graphicx} \usepackage[format=hang,singlelinecheck=0,font={sf,small},labelfont=bf]{subfig} ...


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



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