1

Suddenly, in a unique example that I can't seem to reproduce in a MWE, cleveref switches the order of my references.

Here's my configuration of cleveref and the theorems:

\usepackage[backref=page]{hyperref}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage[capitalize]{cleveref}
\Crefname{claim}{Claim}{Claims}
\declaretheorem[style=thm,parent=section]{theorem}
\declaretheorem[style=thm,sibling=theorem]{claim}

and then I have the following claims in Section 2 and Section 3 resp.:

\begin{claim}\label{cl:upperbound:lerw}
...
\end{claim}
\begin{claim}\label{cl:LB}
...
\end{claim}

and finally I reference these in Section 4 by:

... using \cref{cl:LB,cl:upperbound:lerw} ...

or by:

... using \cref{cl:upperbound:lerw,cl:LB} ...

and in both cases the same picture is produced:

cref claim order is wrong

If I move the \cref to Section 3, the same picture remains.

I tried to create a MWE like this:

\documentclass[11pt]{article}
\usepackage[backref=page]{hyperref}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage[capitalize]{cleveref}
\Crefname{claim}{Claim}{Claims}
\declaretheorem[style=thm,parent=section]{theorem}
\declaretheorem[style=thm,sibling=theorem]{claim}

\begin{document}
\section{Section 1}
\begin{claim}\label{cl:upperbound:lerw}
Foo.
\end{claim}
\section{Section 2}
\begin{claim}\label{cl:LB}
Bar.
\end{claim}
\section{Section 3}
Referencing \cref{cl:upperbound:lerw,cl:LB}.
\end{document}

but this MWE actually works as expected, so I can't really understand what is the cause for this issue. Any ideas?

By the way, when I've added another cl:test reference as the last one on the list (which is the label of Claim 3.4), the compiled picture was "Claims 3.1, 3.4 and 2.5".

  • 1
    What happens if you load hyperref after thmtools, but before cleveref? – cmhughes Aug 29 '18 at 15:15
  • Do you maybe have two commas between the items in the argument of \cref? – Mico Aug 29 '18 at 15:20
  • It seems that you have two files: one that works as expected (your mwe) and one that doesn't (your actual test case). it sounds like it'll be an iterative process: either start from actual test file, make a copy, and strip it down, compiling regularly until you have a mwe.tex that demonstrates the problem. alternatively, start from your mwe.tex, and build it up to your test case. it's frustrating, and slow, and requires patience, but it should work. good luck! – cmhughes Aug 30 '18 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.