3

Sometimes I would like \cref{item1,,item2,,item3} to write "Item 1, Item 2, or Item 3" instead of "Item 1, Item 2, and Item 3".

Can this be done on an ad-hoc basis?

1 Answer 1

1

It can be done, but it's not simple. Take a look at sections 8.1.1 and 8.2.3 of the documentation. This question has a simpler answer than mine below (but take note of the last comment under the question). In my answer you need to specify the counter as well:

\usepackage{etoolbox}
\usepackage{cleveref}
\makeatletter
\newcommand{\crefor}[2]{%
  \crefmultiformat{#1}{\csuse{cref@#1@name}~##2##1##3}%
    { or~\csuse{cref@#1@name}~##2##1##3}%
    {, \csuse{cref@#1@name}~##2##1##3}%
    {, or~\csuse{cref@#1@name}~##2##1##3}%
  \cref{#2}%
  \crefmultiformat{#1}{\csuse{cref@#1@name@plural}~##2##1##3}%
    { and~##2##1##3}{, ##2##1##3}{, and~##2##1##3}%
}
\makeatother

You use it as \crefor{<counter>}{item1,,item2,,item3}. You'd also need to create one for \Cref, and maybe add in \crefrangemultiformat and \Crefrangemultiformat as well. If you want parentheses around equation numbers it will get even more complicated.

I'll let you decide if you want to use the Oxford comma.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .