Adding sorting=nyt
to the biblatex
options will fix it:
\documentclass{article}
\usepackage{filecontents}
\usepackage[
style=alphabetic,
sorting=nyt,
firstinits=true
]{biblatex}
\begin{filecontents}{references.bib}
@report{example1,
author={{Archibald Author}},
title={Archies first report}
}
@report{example2,
author={{Archibald Author}},
sortname={Author, Archibald},
title={Archies second report}
}
@report{example3,
author={Archibald Author},
sortname={Author, Archibald},
title={Archies third report}
}
@report{example4,
author={Buthor, Baltasar},
title={Balties report}
}
@report{example5,
author={Cuthor, Charlie},
title={Charlies report}
}
\end{filecontents}
\bibliography{references.bib}
\begin{document}
% lorem~\cite{example2}
\nocite{*}
\printbibliography
\end{document}
See section 3.3.2 and section 3.1.2.1 of the biblatex documentation:
alphabetic
: This style will set the following package options at load time:
labelalpha=true
, sorting=anyt
.
anyt
will sort by label, then name, then year, then title, which should be ok, as the label is also in alphabetic order, but for some reason (maybe a bug?) it does not work as expected.
I'm not a regexp person, really, so I suspect many people could improve on this. But there are two different approaches: a more 'manual' one, which is easier (for me) to fine-tune the final sorting scheme; and a fancier one that may cause havoc if you have many van
and von
entries with names otherwise identical to other people. (The worst case scenario would be to have a Ludwig Beethoven
, Ludwig van Beethoven
, and Ludwig von Beethoven
--- not sure if it would ever get that bad, but there you have it.) So:
Manual fine-tuning:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,useprefix=true,style=authortitle]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{aaa,
author = {Adams, Ludwig},
title = {Title},
journal = {Sort this one under Adams},
date = 1998,
}
@article{ccc,
author = {Curtius, Ludwig},
title = {Title},
journal = {Sort this one under Curtius},
date = 1998,
}
@article{sss,
author = {Smith, Ludwig},
title = {Title},
journal = {Sort this one under Smith},
date = 1998,
}
@article{www,
author = {Williams, Ludwig},
title = {Title},
journal = {Sort this one under Williams},
date = 1998,
}
@article{van,
author = {van Beethoven, Ludwig},
title = {Title},
journal = {Sort this one under Beethoven},
date = 1998,
}
@article{von,
author = {von Beethoven, Ludwig},
title = {Another Title},
journal = {Sort this one under Beethoven},
date = 1999,
}
@article{nosort,
author = {van~Beethoven, Ludwig},
title = {Another Title},
journal = {Don't Sort this One via DeclareSourceMap, thanks to the Tilde},
date = 2001
}
@article{override,
author = {van Beethoven, Ludwig},
title = {Title},
journal = {Sortname is: ZZZ -- Will be Overwritten!},
date = 2000,
sortname = {ZZZ},
}
@article{beethoven,
author = {Beethoven, Ludwig},
title = {Title},
journal = {Sort this one under Beethoven but
before the von/van entries (to pinpoint final sort)},
date = 1998,
}
@article{beZthoven,
author = {Bezthoven, Ludwig},
title = {Title},
journal = {Sort this one under BeZthoven (to pinpoint final sort)},
date = 1998,
}
\end{filecontents*}
\DeclareSourcemap{%
\maps[datatype=bibtex]{
\map[overwrite=true]{
\perdatasource{\jobname.bib}
\step[fieldsource=author, final]
\step[fieldset=sortname, origfieldval]
\step[fieldsource=sortname,
match=\regexp{van\s(Beethoven,)\s(Ludwig)*},
replace={BeethovenY, Ludwig}]
\step[fieldsource=sortname,
match=\regexp{von\s(Beethoven,)\s(Ludwig)*},
replace={BeethovenZ, Ludwig}]
}% The disadvantage is clear: you need to add manual sorting
}% rules for each individual. But the advantage is that it is
}% easier to control the final sorting scheme
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Trying to be clever with REGEXP:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,useprefix=true,style=authortitle]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
% well, just use the same entries as above
\end{filecontents}
\DeclareSourcemap{%
\maps[datatype=bibtex]{
\map[overwrite=true]{
\perdatasource{\jobname.bib}
\step[fieldsource=author, final]
\step[fieldset=sortname, origfieldval]
\step[fieldsource=sortname,
match=\regexp{(v.n)\s(\w+,)\s(\w+)*},
replace={$2}]
}% the problem: 'von' will be sorted before 'van' IFF the title
}% of the 'von' entry is alphabetically prior to the title of
}% the 'van' entry. Worse(?): a regular 'Beethoven, Ludwig' will
% also be sorted among the 'van's and 'von's based solely on their
% titles.
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Best Answer
Don't forget that many options in biblatex/biber are per-entry so you can just add:
to the entry. Table 2 in the Biber manual and Appendix C of the BibLaTeX manual detail which options have which scope - with Biber, many options can have global, per-entrytype or per-entry scope. This actually makes quite a few surprising things possible.