3

When citing multiple theorems, cleveref sometimes uses an Oxford Comma (also known as a Serial Comma, apparently), and sometimes doesn't. I would like for it not to.

Note that there is a very similar question on tex.SE: Can cleveref be made to use the Oxford comma for multiple citations?. I tried using \newcommand{\creflastconjunction}{ and~} (this can be un/commented from the MWE below to see its affect), but it did not work. In fact, if one has it, then one can see there is a double space in the first list.

MWE

\documentclass[]{article}

\usepackage{amsthm} \usepackage{cleveref}

\newtheorem{thm}{Theorem} \crefname{thm}{Theorem}{Theorems} \newtheorem{prop}[thm]{Proposition} \crefname{prop}{Proposition}{Propositions} \newtheorem{lem}[thm]{Lemma} \crefname{lem}{Lemma}{Lemmas}

\newcommand{\creflastconjunction}{ and~}

\begin{document}

\begin{thm} \label{thm1} Thm 1 \end{thm}

\begin{prop} \label{prop} Prop 1 \end{prop}

\begin{thm} \label{thm3} Thm 3 \end{thm}

\begin{lem} \label{lem} Lem 1 \end{lem}

\begin{thm} \label{thm5} Thm 5 \end{thm}

\cref{thm1,prop,lem}

\cref{thm1,thm3,thm5}

\end{document}

A fix, of course, is to just write \cref{thm1}, \cref{thm3} and \cref{thm5}, but this is removing beneficial functionality.

Sam OT
  • 1,329

1 Answers1

4

You need to define also \creflastgroupconjunction as mentioned at the end of section 8.1.1 of the manual (p. 14).

\documentclass[]{article}

\usepackage{amsthm} \usepackage{cleveref}

\newtheorem{thm}{Theorem} \crefname{thm}{Theorem}{Theorems} \newtheorem{prop}[thm]{Proposition} \crefname{prop}{Proposition}{Propositions} \newtheorem{lem}[thm]{Lemma} \crefname{lem}{Lemma}{Lemmas}

\newcommand{\creflastconjunction}{ and~} \newcommand{\creflastgroupconjunction}{ and~}

\begin{document}

\begin{thm} \label{thm1} Thm 1 \end{thm}

\begin{prop} \label{prop} Prop 1 \end{prop}

\begin{thm} \label{thm3} Thm 3 \end{thm}

\begin{lem} \label{lem} Lem 1 \end{lem}

\begin{thm} \label{thm5} Thm 5 \end{thm}

\cref{thm1,prop,lem}

\cref{thm1,thm3,thm5}

\end{document}

enter image description here

egreg
  • 1,121,712
  • Perfect, thanks! I had a search in the manual, but didn't spot this part. It's very strange how it defaults to having the Oxford Comma for one but not the other! – Sam OT Jun 24 '20 at 17:52