添加日期以消除 biblatex 中同名书籍的歧义

添加日期以消除 biblatex 中同名书籍的歧义

我正在撰写博士论文,并使用biblatex。现在我有几本由同一作者撰写的书,书名完全相同(但出版年份不同)。当我引用这些作品时,读者无法知道我指的是哪部作品。

我意识到我可以编辑它们的shorttitle字段以包含日期,但这样日期就会和标题一起变成斜体。然后我可以取消斜体,等等。但我希望有一个更简单/更智能/更优雅的解决方案。

附件是一个最小的例子:

\documentclass[11pt,oneside]{memoir}

\usepackage[
    style=authortitle,
    hyperref,
    useprefix=false,
    maxnames=2,
    firstinits=true,
    sortcites=true,
    uniquename=init,
    abbreviate=true
]{biblatex}

\begin{filecontents}{\jobname.bib}
@book{tom1,
  author = {Author, A.},
  year = {2001},
  title = {This is a very long title that I definitely do not want in a footnote},
  shorttitle = {A better title},
}
@book{tom2,
  author = {Author, A.},
  year = {1999},
  title = {This is a very long title that I definitely do not want in a footnote},
  shorttitle = {A better title},
}
\end{filecontents}

\addbibresource{\jobname.bib}


\begin{document}
Lorem ipsum dolor sit amet.\footnote{\Cite{tom1}, \Cite{tom2}.}

\end{document}

答案1

两个书目条目有相同的作者和标题autortitle相当不常见,这似乎是样式系列(据我所知)缺少类似于 字段的“额外标题”功能authoryear的原因extrayear。虽然应该可以添加这样的功能,但这超出了我的能力。我有一个建议,至少可以省去手动shorttitle向参考书目添加定制字段的麻烦:

  • 在主文档中声明一个新的书目类别“ambigtitle”,并将相应的条目添加到此类别中;

  • 定义一个 bibmacro dateifambigtitle,它将打印属于“ambigtitle”类别的条目的日期字段的内容;

  • 将上述bibmacro添加到字段的格式定义中citetitle


\documentclass{article}

\usepackage[style=authortitle]{biblatex}

\DeclareBibliographyCategory{ambigtitle}
\addtocategory{ambigtitle}{A01,A02}

\newbibmacro*{dateifambigtitle}{%
  \ifcategory{ambigtitle}{%
    \addspace
    \printtext[parens]{\usebibmacro{date}}%
  }{%
  }%
}

\DeclareFieldFormat{citetitle}{\mkbibemph{#1}\usebibmacro{dateifambigtitle}}
\DeclareFieldFormat
    [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
    {citetitle}{\mkbibquote{#1\isdot}\usebibmacro{dateifambigtitle}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A02,
  author = {Author, A.},
  year = {2002},
  title = {Alpha},
}
@misc{C03,
  author = {Cuthor, C.},
  year = {2003},
  title = {Charlie},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text \parencite{A01}.

Some text \parencite{A02}.

Some text \parencite{C03}.

\printbibliography

\end{document}

在此处输入图片描述

答案2

labelname作者-标题样式中的引文标签由和字段组成labeltitlenamehash字段唯一标识 中的名称列表labelname

使用钩子,您可以计算每个值\AtDataInput的条目数。然后可以将年份添加到宏中的模糊引用标签中。namehashlabeltitlecite:title

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=authortitle-comp]{biblatex}
\usepackage{hyperref}

\makeatletter

\AtDataInput{%
  \iftoggle{blx@skiplab}{}
  {\csnumgdef{cbx@\strfield{namehash}@\strfield{labeltitle}}
    {\csuse{cbx@\strfield{namehash}@\strfield{labeltitle}}+1}}}

\renewbibmacro*{cite:title}{%
  \printtext[bibhyperref]{%
    \printfield[citetitle]{labeltitle}%
    \ifnumgreater{\csuse{cbx@\strfield{namehash}@\strfield{labeltitle}}}{1}
      {\addspace\printfield[parens]{year}}
      {}}}

\makeatother

\begin{filecontents}{\jobname.bib}
@book{key1,
  author = {Author, A.},
  year = {2001},
  title = {Original title},
  shorttitle = {Title}}
@book{key2,
  author = {Author, A.},
  year = {1999},
  title = {Title}}
@book{key3,
  author = {Author, A. and Buthor, B.},
  year = {1998},
  title = {Book title}}
@book{key4,
  author = {Author, A. and Buthor, B. and Cuthor, C. and Duthor, D.},
  year = {1998},
  title = {Book title}}
\end{filecontents}

\addbibresource{\jobname.bib}
\begin{document}
\textcite{key1,key2,key3,key4}
\printbibliography
\end{document}

在此处输入图片描述

这种方法对于每种变体来说都足够通用authortitle。它还可以用作biber后端以及与minnames/maxnameslabelname消歧义 ( uniquename, uniquelist) 相关的各种选项设置。

可以进行改进,以在参考章节之间独立执行消歧。钩子\AtDataInput对辅助文件中的每个条目执行其代码bbl。因此,消歧不会忽略从参考书目中过滤掉的条目。可以有选择地添加年份,但这取决于过滤器。

答案3

这不是一个全自动的解决方案:它确实需要您输入一个额外的字段。

cite:title在序言中重新定义如下:

\renewbibmacro*{cite:title}{%
\printtext[bibhyperref]{%
\printfield[citetitle]{labeltitle}%
\iffieldundef{usera}
  {}
  {\printtext{\addspace\mkbibparens{\printfield{usera}}}}}}

现在包括一个usera您想要使用的年份的字段:

@book{tom1,
  author = {Author, A.},
  year = {2001},
  title = {This is a very long title that I definitely do not want in a footnote},
  shorttitle = {A better title},
  usera = {2001},
}
@book{tom2,
  author = {Author, A.},
  year = {1999},
  title = {This is a very long title that I definitely do not want in a footnote},
  shorttitle = {A better title},
  usera = {1999},
}

然后产生了作者,更好的标题(2001 年)和作者,更好的标题(1999)。仅当字段存在时才会添加额外的年份usera。有点不合时宜,但比实际将其添加到短标题字段中要好。

相关内容