I am writing a document using the memoir
class, pdflatex and biber. Now both my Bibliography at the end of the document and the citations in the text sort alphabetically, but I would like the citations to sort by year. How can i achieve this?
In my preamble I have this:
\usepackage[style=authoryear,backend=biber]{biblatex}%
\renewcommand*{\nameyeardelim}{\addcomma\space}
and I have made a config file that looks like this:
\ExecuteBibliographyOptions{dashed=false, block=space, firstinits, maxcitenames=2,maxbibnames=99, sortcites, sorting=nyt, uniquelist=false}
\DeclareFieldFormat[article]{title}{#1\isdot}
\DeclareFieldFormat[incollection]{title}{#1\isdot}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{postnote}{#1}
\DeclareNameAlias{sortname}{last-first}
\renewbibmacro{in:}{}
\renewbibmacro*{volume+number+eid}{
\printfield{volume}
\setunit*{\addnbthinspace}
\printfield{number}
\setunit{\addcomma\space}
\printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
As far as I understand the sorting option does half the trick as it changes both bib and cite order. Suggestions?
Best Answer
biblatex
'ssorting
option can be applied globally (that is in the package loading options, or via\ExecuteBibliographyOptions
). The global sorting scheme is then used to sort citations - ifsortcites
is used - , it is furthermore employed to sort all bibliographies and lists of shorthands printed via\printbibliography
or\printshorthands
.If you want to sort a bibliography using a different sorting scheme than the global one, you can specify that sorting scheme in the optional argument to
\printbibliography
:\printbibliography[sorting=nty]
.In your case, you would probably want the global sorting scheme
sorting=ynt
, so loadbiblatex
with\usepackage[sorting=ynt]{biblatex}
, or\ExecuteBibliographyOptions{sorting=ynt}
. Your bibliography sorting scheme would besorting=nty
, so you print your bibliography via\printbibliography[sorting=nty]
.