Biblatex:根据关键词创建类别

Biblatex:根据关键词创建类别

考虑一下这种情况:我想将文档中的参考书目细分为子参考书目。我发现类别的想法特别有吸引力。因此,我用注释了我的.bib文件keywords。但是,我非常不愿意为类别添加单个键。要做到这一点,我必须引用每个引文两次:一次在命令中\cite,另一次在文档的序言中使用\addtocategory。这似乎是多余的,而且如果我忘记其中一个,也非常危险。

由于类别信息已经存在于.bib文件中,是否可以通过关键字将项目添加到类别中?

答案1

乍一看,您所描述的听起来就像您想直接用keyword/过滤您的参考书目notkeyword

类别应该提供一种在当前文档中动态地对参考书目进行分类的方法,而关键字应该是静态的并附加到文件中的条目.bib

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

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

\begin{filecontents}[force]{\jobname.bib}
@book{aristotle:anima,
  author       = {Aristotle},
  title        = {De Anima},
  date         = 1907,
  editor       = {Hicks, Robert Drew},
  publisher    = {Cambridge University Press},
  location     = {Cambridge},
  keywords     = {primary},
}
@book{nussbaum,
  author       = {Nussbaum, Martha},
  title        = {Aristotle's \mkbibquote{De Motu Animalium}},
  date         = 1978,
  publisher    = {Princeton University Press},
  location     = {Princeton},
  keywords     = {secondary},
}
@article{sigfridsson,
  author       = {Sigfridsson, Emma and Ryde, Ulf},
  title        = {Comparison of methods for deriving atomic charges from the
                  electrostatic potential and moments},
  journaltitle = {Journal of Computational Chemistry},
  date         = 1998,
  volume       = 19,
  number       = 4,
  pages        = {377-395},
  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
\cite{sigfridsson,aristotle:anima,nussbaum}
\printbibliography[keyword=primary, title=Primary Sources]
\printbibliography[keyword=secondary, title=Secondary Sources]
\printbibliography[notkeyword=primary,notkeyword=secondary]
\end{document}

可以组合类别和关键字过滤选项,如果需要更复杂的逻辑,还可以组合参考书目过滤器(\defbibfilter)或参考书目检查(\defbibcheck)。

相关内容