4

Biblatex, with the sortcite option, will sort multiple citations (see Sorting of multiple citations with biblatex). I want most of my multiple citations to be sorted, but occasionally I wish to deliberately put them in the wrong order. Is there a way to achieve this?

That is, I want a macro called something like \unsrtcite, so that the TeX below will produce the following

First: [1,2] Second: [1,2] Third: [2,1]

(Obviously I could use \cite{second} \cite{first}, rather than \cite{second,first} when I want them not to be sorted but that's not quite what I want).


main.tex

% main.tex
\documentclass[]{article}

\usepackage[sortcites]{biblatex} 

\bibliography{references}
\begin{document}


First: \cite{first,second} 
Second: \cite{second,first}
Third: \unsrtcite{second,first} 

\end{document}

references.bib

% references.bib
@misc{first,
  title={Reference A},
  author={Alice},
  year={1980}
}

@misc{second,
  title={Reference B},
  author={Bob},
  year={2000}
}
1
  • 1
    Welcome to TeX.sx, and thanks for adding a minimal document! – Alan Munn Jan 29 '20 at 15:37
3

You can use the \cites command for this, which doesn't sort.

\documentclass[]{article}
\begin{filecontents}{\jobname.bib}
@misc{first,
  title={Reference A},
  author={Alice},
  year={1980}
}

@misc{second,
  title={Reference B},
  author={Bob},
  year={2000}
}
\end{filecontents}
\usepackage[sortcites]{biblatex} 

\addbibresource{\jobname.bib}
\begin{document}


First: \cite{first,second} 
Second: \cite{second,first}
Third: \cites{second}{first} 

\end{document}

output of code

7
  • 1
    Who knew that the 'feature' that \cites doesn't sort citations would come in handy at some point? (github.com/plk/biblatex/issues/214, github.com/plk/biblatex/issues/817, tex.stackexchange.com/q/65809/35864) – moewe Jan 29 '20 at 17:10
  • @moewe I take it from reading the issues on the biblatex repo, that this is unlikely to change in the near future (if it is, I should probably add a disclaimer to the answer)? – Alan Munn Jan 29 '20 at 19:08
  • There are no plans at the moment to change that, but if someone comes along with an idea for the implementation I won't send them away. I don't think an explicit warning in the answer would make sense at the moment. – moewe Jan 29 '20 at 21:52
  • 1
    @KwekuA No, the whole point of the multicite commands is that they take each cite key as a separate argument so that they can be treated separately with their own pre- and post-notes, so you can't put them all in one comma separated list like the regular cite commands. – Alan Munn Jan 30 '20 at 12:10
  • 1
    @KwekuA Yes and no. Sorting with the default syntax is a global option, so you can either have it or not. If you don't turn it on, then of course the citations will appear in the order you enter them. But you can't turn off the global option on an individual case without using the alternative syntax. – Alan Munn Feb 2 '20 at 13:47

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.