Monday, July 24, 2017

Biblatex, citations and bibliography sorting

"I want to sort in-text citations by year, but bibliography by name."  So begins one of the questions at a Stackexchange.  That's just what I want too.

I want to put multiple references in a \cite{} command without caring about their sequence, and have them automatically print in year-order.  Then, I want my bibliography to be ordinary, i.e., printed in author-date order.

The discussion at the above site is tricky, but the answer by moewe works.

In a nutshell here's what you actually do:
\begin{document}
\usepackage[sorting=ynt,sortcites=true]{biblatex}
\AtBeginDocument{\assignrefcontextentries[]{*}}
\begin{document}
Hello world!\footcites{ref1,ref3,ref0,ref4}
\newrefcontext[sorting=nyt]
\printbibliography

\end{document}
This will print your footnoted citations in ascending order of year, and your bibliography in ascending order of author.