2

What is the best practice to use a different conjunction for a single reference with cleveref?

Background: I would like to produce something like "Theorem~1, Lemma~2 and [external reference]".

If I use

\cref{th:1,lem:2} and \cite{ext}

I get "Theorem~1 and Lemma~2 and [...]", since cleveref sees only the pair of references and not the following \cite.

My current workaround:

{\renewcommand\crefpairgroupconjunction{, }\cref{th:1,lem:2}} and \cite{ext}

(Note that I used \crefpairgroupconjunction instead of \crefpairconjunction since both references have a different type)

Is there a better workaround?

1 Answer 1

3

Cleveref is clever, not omniscient. It knows nothing about the citation following the cross-reference. One way or another, you're going to have to tell cleveref that you want to make an exception to the normal typesetting for this specific cross-reference.

You gain nothing by trying to automate a one-off exception. Just typeset it as you want it to appear "manually":

\cref{th:1}, \cref{lem:2} and \cite{ext}

No point trying to be too clever here :-)

2
  • Your approach does not work if lem:2 will be promoted to a theorem later on.
    – gerw
    Commented Aug 10, 2016 at 20:49
  • Good point! I would down-vote my own answer...but SE won't let me. The solution in your question is better in this respect. The general point about not trying to automate absolutely everything in LaTeX, particularly in cases where doing it manually is less effort, is always worth bearing in mind though. Commented Aug 16, 2016 at 16:40

You must log in to answer this question.

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