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}
This problem is due to biblatex-apa
's (apa.bbx
's) apaauthor
name format; you might want to notify the author of this small bug.
The string and others
in the author list sets ifmorenames
to true. apaauthor
checks for this case whenever a name is printed, not just at the very end of the list; consequently it prints the andothers
string ("et al.") after each name.
The fix is to add the following lines to your preamble.
\DeclareNameFormat{apaauthor}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots\addspace}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\ifthenelse{\iffieldequalstr{doubtfulauthor}{true}}
{\mkbibbrackets{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}?}}
{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}}}}%
\ifthenelse{\value{listcount}=\value{listtotal}}% this test is new
{\ifmorenames{\andothersdelim\bibstring{andothers}}{}}{}}
The MWE
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{boker2011,
Author = {Boker, S. and Neale, M. and Maes, H. and Wilde, M. and
Spiegel, M. and Brick, T. and Spies, J. and Estabrook,
R. and Kenny, S. and Bates, T. and others},
Title = {Open{M}x: {A}n open source extended structural
equation modeling framework},
Journal = {Psychometrika},
Volume = {76},
Number = {2},
Pages = {306--317},
year = 2011
}
\documentclass{apa6}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,maxnames=999,sortcites=true,sorting=nyt,apabackref=true,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareNameFormat{apaauthor}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots\addspace}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\ifthenelse{\iffieldequalstr{doubtfulauthor}{true}}
{\mkbibbrackets{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}?}}
{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}}}}%
\ifthenelse{\value{listcount}=\value{listtotal}}
{\ifmorenames{\andothersdelim\bibstring{andothers}}{}}{}}
\shorttitle{IFA}
\begin{document}
OpenMx \parencite{boker2011,aksin,wilde,murray}
\printbibliography
\end{document}
then yields
Update 2013-10: This has been corrected in biblatex-apa
version 6.4 according to a comment below the question from user PLK.
Best Answer
Adding
sorting=nyt
to thebiblatex
options will fix it: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.