Biblatex,以特定方式对参考文献进行排序

Biblatex,以特定方式对参考文献进行排序

我需要按字母顺序排列参考书目。但是,同一第一作者的作品必须按以下顺序排列:
1º 一位作者的作品,按时间顺序排列。2º
两位作者的作品,按时间顺序排列。3º
三位作者的作品,按时间顺序排列。

我的序言如下:

\usepackage[autostyle=true]{csquotes}  
\usepackage[backend=biber,style=authoryear,style=bwl-FU,natbib=true,hyperref=true,maxbibnames=100,maxcitenames=2,sorting=nyt,uniquelist=false,uniquename=false]{biblatex}%para bibliografía  
\addbibresource{BibM.bib}
\DeclareSourcemap{  
  \maps[datatype=bibtex]{  
    \map{  
      \step[fieldsource=author, match=\regexp{(.*?)\s+and\s+}]  
      \step[fieldset=sortname, fieldvalue={$1}]  
       }  
  }  
}  

以下是我的 .bib 中的一些条目:

@article{Takahashi2007, 
author = {Takahashi, K. and Tanabe, K. and Ohnuki, M. and Narita, M. and Ichisaka, T. and Tomoda, K. and Yamanaka, S.},  
journal = {Cell}, 
pages = {861--872},  
title = {{Induction of Pluripotent Stem Cells from Adult Human Fibroblasts by Defined Factors}},  
volume = {131},  
year = {2007}  
}  
@article{Takahashi2016a,  
author = {Takahashi, K. and Yamanaka, S.}, 
journal = {Nature Reviews Molecular Cell Biology},  
pages = {183--193}, 
title = {{A decade of transcription factor-mediated reprogramming to pluripotency}},  
volume = {17},  
year = {2016}  
}  
@article{Takahashi2006,  
author = {Takahashi, K. and Yamanaka, S.},  
journal = {Cell},  
pages = {663--676}, 
title = {{Induction of Pluripotent Stem Cells from Mouse Embryonic and Adult Fibroblast Cultures by Defined Factors}},    
volume = {126},  
year = {2006}  
}  

这样 LaTex 确实会按年份对同一第一作者的作品进行排序。但是,我不知道如何让它按作者数量进行优先排序: 错误排序作品示例

抱歉,如果我的问题很乱,我对 Latex 和网站都很陌生。
非常感谢!

答案1

结合 PLK 的回答如何使用 Biblatex 根据作者数量对参考文献列表进行排序?我的回答是Biblatex 排序无法正常工作我们可以得到

\documentclass{article}
\usepackage{csquotes}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{AuthorA2010,
  title={Titlea},
  author={Author, Alan},
  journal={Journala},
  volume={10},
  pages={1--3},
  year={2010},
  publisher={Publishera}
}
@article{AuthorAC2005,
  title={Titleac},
  author={Author, Alan and Cuthor, Carla},
  journal={Journalac},
  volume={10},
  pages={1--3},
  year={2005},
  publisher={Publisherac}
}
@article{AuthorAD1990,
  title={Titlead},
  author={Author, Alan and Duthor, David},
  journal={Journalad},
  volume={10},
  pages={1--3},
  year={1990},
  publisher={Publisherad}
}
@article{AuthorAD2000,
  title={Titlead two},
  author={Author, Alan and Duthor, David},
  journal={Journalad two},
  volume={10},
  pages={1--3},
  year={2000},
  publisher={Publisherad two}
}
@article{AuthorABD2000,
  title={Titleabd},
  author={Author, Alan and Bill Buthor and Cuthor, Carla},
  journal={Journalabd},
  volume={10},
  pages={1--3},
  year={2000},
  publisher={Publisherabd}
}
@article{Takahashi2007,
author = {Takahashi, K. and Tanabe, K. and Ohnuki, M. and Narita, M. and Ichisaka, T. and Tomoda, K. and Yamanaka, S.},
journal = {Cell},
pages = {861--872},
title = {{Induction of Pluripotent Stem Cells from Adult Human Fibroblasts by Defined Factors}},
volume = {131},
year = {2007}
}
@article{Takahashi2016a,
author = {Takahashi, K. and Yamanaka, S.},
journal = {Nature Reviews Molecular Cell Biology},
pages = {183--193},
title = {{A decade of transcription factor-mediated reprogramming to pluripotency}},
volume = {17},
year = {2016}
}
@article{Takahashi2006,
author = {Takahashi, K. and Yamanaka, S.},
journal = {Cell},
pages = {663--676},
title = {{Induction of Pluripotent Stem Cells from Mouse Embryonic and Adult Fibroblast Cultures by Defined Factors}},
volume = {126},
year = {2006}
}
\end{filecontents}
\usepackage[style=authoryear,firstinits=true, dashed=false,sorting=custsort]{biblatex}
\addbibresource{\jobname.bib}

\DeclareSortingScheme{custsort}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{usera}
  }
  \sort{
    \field{sortyear}
    \field{year}
  }
}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=author, match=\regexp{(.*?)\s+and\s+}]
      \step[fieldset=sortname, fieldvalue={$1}]
    }
    \map{
      \step[fieldsource=author]
      \step[fieldset=usera, origfieldval]
      \step[fieldsource=usera, match=\regexp{.+?\sand\s}, replace=\regexp{and}]
      \step[fieldsource=usera, match=\regexp{((?:and)*).+}, replace=\regexp{$1}]
    }
  }
}

\begin{document}

\nocite{*}
\printbibliography
\end{document}

在此处输入图片描述

请注意年份如何打破作者和合著者作品之间的排序关系。此外,高桥与山中合作创作的作品列在与田边等人合作创作的作品之前,尽管如果按字母顺序排列,如果考虑所有姓名进行排序,情况会有所不同。

那么这是如何实现的呢?

第一个\map确保列表中只有第一个名字进入。第二个映射通过从字段 到 中sortname提取 来计算合著者的数量(它将只包含每个合著者一个)。然后,排序方案按名称(仅包含主要作者)和(作者数量)进行排序,最后按 进行排序。andauthoruseraandsortnameuserayear

相关内容