Biblatex 参考文献按同一第一作者、不同年份条目排序

Biblatex 参考文献按同一第一作者、不同年份条目排序

我正在使用 biblatex 书目包,我需要先按名称对参考文献进行排序,然后按年份对具有相同第一作者的参考文献进行升序排序。在我的序言中,biblatex 包设置如下:

\documentclass{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[autostyle=true]{csquotes}

\usepackage[backend=biber,style=authoryear,natbib=true,sorting=nyt]{biblatex}

\addbibresource{library.bib}

\begin{document}

Text \citep{Jinek2012}, and more text \citep{Jinek2013}.

\printbibliography[title=References]

\end{document}

虽然在某些情况下它可能遵循 nyt 排序方案,但在其他情况下它会被覆盖。在我的 library.bib 中,两个有问题的条目如下所示:

@article{Jinek2013,
author = {Jinek, M. and Cheng, A. and Lin, S. and Ma, E. and Doudna, J. and 
East, A.},
journal = {eLIFE},
title = {{RNA-programmed genome editing in human cells}},
volume = {2},
year = {2013}
}

@article{Jinek2012,
author = {Jinek, M. and Chylinski, K. and Fonfara, I. and Hauer, M. and 
Doudna, J. and Charpentier, E.},
number = {6096},
pages = {816--821},
title = {{A programmable dual-RNA-guided DNA endonuclease in adaptive 
bacterial immunity}},
volume = {337},
year = {2012}
}

但结果却是:

在此处输入图片描述

然而,这个问题似乎并不适用于所有同一第一作者、不同年份的文章,比如这些:

在此处输入图片描述

有什么方法可以强制所有同一第一作者、不同年份的文章按作者排序后的年份升序排序?

提前致谢

答案1

biblatex按所有作者排序,而不仅仅是第一个作者,因此排序是符合预期的。

您可以通过使用 RegExp 提取它并将其写入来限制对第一作者的排序sortname

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

%\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Jinek2013,
author = {Jinek, M. and Cheng, A. and Lin, S. and Ma, E. and Doudna, J. and 
East, A.},
doi = {10.7554/eLife.00471.001},
journal = {eLIFE},
title = {{RNA-programmed genome editing in human cells}},
url = 
{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3557905/pdf/elife00471.pdf 
http://elife.elifesciences.org/content/2/e00471},
volume = {2},
year = {2013}
}
@article{Jinek2012,
author = {Jinek, M. and Chylinski, K. and Fonfara, I. and Hauer, M. and 
Doudna, J. and Charpentier, E.},
doi = {10.1126/science.1225829},
isbn = {6212011575},
issn = {10959203},
journal = {Science},
number = {6096},
pages = {816--821},
title = {{A programmable dual-RNA-guided DNA endonuclease in adaptive 
bacterial immunity}},
volume = {337},
year = {2012}
}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=author, match=\regexp{(.*?)\s+and\s+}]
      \step[fieldset=sortname, fieldvalue={$1}]
    }
  }
}

\begin{document}
\cite{sigfridsson,Jinek2013,Jinek2012}
\printbibliography
\end{document}

在此处输入图片描述

相关内容