刚刚注意到,当您引用某个作者在特定年份出版的多篇文章时,添加的后缀存在问题。
在我的论文中,我引用了 Richard M. Dorson 的两篇文本,这两篇文本最初都是在 1959 年出版的。由于其中一篇文本我一直使用的是 1971 年印刷的版本,因此我添加了一个字段来origdate
显示该文本最初的出现时间以及我所使用的版本的来源。
MWE 将是:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,authordate,sorting=nyt,cmsdate=both,maxcitenames=2]{biblatex-chicago}
\addbibresource{bibliography.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
(正如您在上面的代码中看到的,我已设置cmsdate
为both
)
对于这个 MWE,我使用了这个 bib 文件:
@article{dorson1959,
title={A Theory for American Folklore},
volume={72},
number={285},
journal={The Journal of American Folklore},
author={Richard M. Dorson},
year={1959},
pages={197–-215},
}
@book{dorson1971a,
author={Richard M. Dorson},
title={American folklore},
publisher={University of Chicago Press},
address={Chicago},
year={1971},
origdate={1959},
}
@book{dorson1971b,
author={Richard M. Dorson},
title={Made-up Title},
publisher={University Press of Where-ever},
address={Somewhere},
year={1971},
}
引用所有三段文字(最后一段是编造的,只是为了显示问题的严重性)我认为会导致如下结果:
Dorson, Richard M. 1959. “美国民俗理论” [...]
-----。(1959) 1971a。美国民间传说[...]
-----.1971b.虚构头衔
我最终得到的是以下内容:
有什么方法可以使编译仅在字段中发现同一年份时添加后缀year
?
答案1
biblatex-chicago
的日期处理极其复杂,所以我决定不再尝试保留其复杂性,而是用一个简单的实现来覆盖它,希望它能满足您的要求。这意味着像 这样的选项cmsdate
将不再按预期工作。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,authordate,sorting=nyt,maxcitenames=2]{biblatex-chicago}
\newbibmacro*{erik:cmssortdate}{%
\iffieldundef{origyear}
{}
{\printtext[parens]{\printorigdate}%
\setunit{\addspace}}%
\printlabeldateextra}
\renewbibmacro{cmsbibsortdate}{%
\usebibmacro{erik:cmssortdate}%
\iffieldundef{labeldatesource}
{}
{\iffieldequalstr{labeldatesource}{year}
{\clearfield{year}}
{\clearfield{\thefield{labeldatesource}year}}}}
\letbibmacro{cmscitesortdate}{erik:cmssortdate}
\DeclareLabeldate{
\field{date}
\field{year}
\field{origdate}
\field{eventdate}
\field{urldate}}
\begin{filecontents}{\jobname.bib}
@article{dorson1959,
title = {A Theory for American Folklore},
volume = {72},
number = {285},
journal = {The Journal of American Folklore},
author = {Richard M. Dorson},
date = {1959},
pages = {197–-215},
}
@book{dorson1971a,
author = {Richard M. Dorson},
title = {American folklore},
publisher = {University of Chicago Press},
address = {Chicago},
year = {1971},
origdate = {1959},
}
@book{dorson1971b,
author = {Richard M. Dorson},
title = {Made-up Title},
publisher = {University Press of Where-ever},
address = {Somewhere},
year = {1971},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{dorson1959}
\cite{dorson1971a}
\cite{dorson1971b}
\printbibliography
\end{document}
如果出现\letbibmacro
未定义的错误,请替换
\letbibmacro{cmscitesortdate}{erik:cmssortdate}
和
\renewbibmacro{cmscitesortdate}{\usebibmacro{erik:cmssortdate}}