3

I'm trying to reference two propositions together, in a document that I'm typesetting. From the cleveref documentation, I learned that \cref{label1,label2} is the correct syntax for doing so, but I'm running into trouble when I try. Here is a minimal working example:

\documentclass{article}
\usepackage{amsthm,cleveref}
\newtheorem{prop}{Proposition}

\begin{document}

\begin{prop}\label{a}
\end{prop}
\begin{prop}\label{b}
\end{prop}

\cref{a} \cref{b}\\

\cref{a,b}

\end{document}

The output is just fine for the single references, \cref{a} and \cref{b}, but \cref{a,b} produces an error message:

cref reference format for label type `prop' undefined

I find this strange, because everything works fine for single references. Am I messing something up, or is this a bug?

3

You need to tell cleveref what the plural name is:

\crefname{prop}{Proposition}{Propositions}

As a matter of good practice, you might also specify

\Crefname{prop}{Proposition}{Propositions}

so that \Cref and friends work as expected. Adjust as you see fit.

Here's a complete MWE:

% arara: pdflatex
% arara: pdflatex
\documentclass{article}
\usepackage{amsthm,cleveref}
\newtheorem{prop}{Proposition}
\crefname{prop}{Proposition}{Propositions}%<--- new bit!
\Crefname{prop}{Proposition}{Propositions}%<--- new bit!
\begin{document}

\begin{prop}\label{a}
\end{prop}
\begin{prop}\label{b}
\end{prop}

\cref{a} \cref{b}

\cref{a,b}

\end{document}
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.