2

In my MWE below, I sort my bibliography with the nyt option (name-year-title), cf. the biblatex manual under 3.1.2.1 General. Then I also include sortcites = true, which according to the manual will "sort citations if multiple entry keys are passed to a citation command. If this option is enabled, citations are sorted according to the global sorting order of the bibliography."

Since the "global sorting order of the bibliography" in my case is name-year-title, I'd expect my citations to be sorted first by name, then by year, and finally by title. But as the MWE below demonstrates, my citations are simply printed in the order given in the cite command. I was expecting "Lennon" to appear before "McCartney" since l preceeds m, but this does not happen. I am either not understanding what sortcites is supposed to do, or I am setting the options incorrectly. What do I need to do to automatically sort my citations by name?

\documentclass{article}
\usepackage[style = authoryear-comp, sorting = nyt, sortcites = true]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{mccartney1965,
    author = "Paul McCartney",
    title = "Yesterday",
    year = "1965"}
@book{lennon1967,
    author = "John Lennon",
    title = "Lucy in the sky with diamonds",
    year = "1967"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cites{mccartney1965}{lennon1967}
\printbibliography
\end{document}

enter image description here

Sverre
  • 20,729
  • The \cites multicite commands are not designed to sort their arguments, but Audrey has found a way to make them do it anyway Sorting citations using \cites command in biblatex. BTW: Didn't you ask this before? – moewe Feb 17 '15 at 15:23
  • I have tried, and I obtained "Lennon" before McCartney. Did you run biber after changing the option? it's biber which make the sorting. So must run. – Maïeul Feb 17 '15 at 15:24
  • @moewe But aren't multicite commands the only command where "multiple entry keys are passed to a citation command"? Does this mean that sortcites is simply an vacant command? – Sverre Feb 17 '15 at 15:25
  • @moewe that is true if you don't use sorting like nty. – Maïeul Feb 17 '15 at 15:25
  • 2
    sortcites is not vacant, you can use \cite{mccartney1965,lennon1967} where the citations are then sorted accordingly, but you will lose the possibility to specify a post/pre-note for each citation separately. For \cites commands though sortcites does nothing. – moewe Feb 17 '15 at 15:26
  • @Maïeul I'm compiling with latexmk, and it does run biber. I haven't changed my option at all - I set sorting = nyt, sortcites = true from the start. – Sverre Feb 17 '15 at 15:28
  • @Sverre I assure that I obtain "Lennon" before "Mc Cartney". Which version of biber and biblatex do you use? – Maïeul Feb 17 '15 at 15:30
  • biber log should says what sorting it use. "INFO - Sorting list 'nyt' of type 'entry' with scheme 'nyt' and locale 'en-US'" – Maïeul Feb 17 '15 at 15:31
  • 1
    Mhhhh.... I get McCartney before Lennon in the citation as well. Just as one would expect knowing that \cites does not support sortcites. – moewe Feb 17 '15 at 15:32
  • @Maïeul Biber version 1.9, biblatex version 2.9a. I also get INFO - Sorting list 'nyt' of type 'entry' with scheme 'nyt' and locale 'en-US'. But still McCartney before Lennon. – Sverre Feb 17 '15 at 15:34
  • hum, strange, same version than my. Open .the bbl file and look at the order. I also suggest to delete .pdf, .bbl and .pdf file and try again. There is no rease to have this difference between you and me. – Maïeul Feb 17 '15 at 15:38
  • @Maïeul My .bbl does indeed put Lennon before McCartney. Does this mean that latexmk is not running biber enough times or something? – Sverre Feb 17 '15 at 15:40
  • no, the .bbl is produce by biber. So I think it's latex which is not run enough. Try manually :) – Maïeul Feb 17 '15 at 15:42
  • The order in the .bbl file should be the same as the order in the bibliography. Since \cites cannot sort its arguments, though, that is irrelevant. – moewe Feb 17 '15 at 15:43
  • @Maïeul I always get McCartney before Lennon, also when running biber manually. Since moewe also gets that, it seems to be a mystery why you get something else. But as @mowew points out, I have indeed asked this question before (I couldn't find it by searching), so I'm voting to close my question as a duplicate. – Sverre Feb 17 '15 at 15:51
  • also look at the .log file on LaTeX to be sur that the good .bbl file is loaded... and not any file in the tex path. – Maïeul Feb 17 '15 at 16:00
  • As a workaround, you may use \cites{mccartney1965,lennon1967}... – Paul Gaborit Feb 17 '15 at 16:35
  • @PaulGaborit That won't work for reasons given in the comments to my duplicate question. – Sverre Feb 17 '15 at 16:38
  • @Sverre Exact: if prenote or postnote is required, this workaround can't work... You may add this remark to your question. – Paul Gaborit Feb 17 '15 at 16:45

0 Answers0