4

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 printed instead. Instead of page numbers, the reference labels are printed.

This is for version 0.21.4 and the pre-release 0.21.5.

The error is not present when using \cref.


Has anyone come across this error before?

I have tried looking into the code, but it is beyond me!

Does anyone else have a fix?


Example:

\documentclass[12pt,a4paper]{article}

\usepackage{cleveref}

\begin{document}

% Figures on the same page
\begin{figure}
        \caption{Caption Fig. 1}\label{fig:fig1}
\end{figure}

\begin{figure}
    \caption{Caption Fig. 2}\label{fig:fig2}
\end{figure}

\begin{figure}
    \caption{Caption Fig. 3}\label{fig:fig3}
\end{figure}

\clearpage

% Figure on a different page
\begin{figure}
    \caption{Caption Fig. 4}\label{fig:fig4}
\end{figure}

\clearpage


\section{cref}
% -- These options work as expected --------------------------------------------
\noindent F1: \cref{fig:fig1} \\ 
F2: \cref{fig:fig2} \\
F3: \cref{fig:fig3} \\
F4: \cref{fig:fig4} \\

\noindent F1,F2: \cref{fig:fig1,fig:fig2} \\
F1,F3: \cref{fig:fig1,fig:fig3} \\
F1,F4: \cref{fig:fig1,fig:fig4} \\

\noindent F1,F2,F3: \cref{fig:fig1,fig:fig2,fig:fig3} \\
F1,F2,F4: \cref{fig:fig1,fig:fig2,fig:fig4} \\
F1,F2,F3,F4: \cref{fig:fig1,fig:fig2,fig:fig3,fig:fig4} \\

\section{cpageref}
% -- These options work as expected --------------------------------------------
\noindent F1: \cpageref{fig:fig1} \\ 
F2: \cpageref{fig:fig2} \\
F3: \cpageref{fig:fig3} \\
F4: \cpageref{fig:fig4} \\

\noindent F1,F2: \cpageref{fig:fig1,fig:fig2} \\
F1,F3: \cpageref{fig:fig1,fig:fig3} \\
F1,F4: \cpageref{fig:fig1,fig:fig4} \\
\noindent F1,F2,F3: \cpageref{fig:fig1,fig:fig2,fig:fig3} \\

% -- These options do not work as expected -------------------------------------
\noindent {\Large ERROR:}\\
% Output -- F1,F2,F4: fig:fig1fig:fig4
F1,F2,F4: \cpageref{fig:fig1,fig:fig2,fig:fig4} \\ 
% Output -- F1,F2,F3,F4: fig:fig1fig:fig4
F1,F2,F3,F4: \cpageref{fig:fig1,fig:fig2,fig:fig3,fig:fig4} \\

\end{document}
3
  • 2
    The issue isn't about ranges. It is the fact that the output (as indicated in the example) has not been converted into pages at all. It returns the reference labels.
    – Haydon
    Jun 24 '19 at 13:31
  • For the record, I'm also having the same problem. :-(
    – gusbrs
    Jul 1 at 19:37
  • Anyone interested in this may wish to check tex.stackexchange.com/q/603514/105447 as well.
    – gusbrs
    Jul 3 at 10:01

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.