如何使用多个关键词打印主题书目?

如何使用多个关键词打印主题书目?

我的文件中有 1278 个条目.bib。我打算为这些条目添加关键字,以便打印主题书目。但似乎不支持多个关键字,只能支持一个关键字。这里据说我可以放多个关键字,所以我假设我可以打印多个关键字。

这是 MWE 尝试打印第 1 册和第 3 册。

\documentclass[a4paper]{article}
\usepackage[romanian]{babel}
\usepackage[backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}

@book{anania:greul,
 author = {Anania, Valeriu},
 year = {1982},
 title = {Greul pămîntului},
 publisher = {{Editura Eminescu}},
 series = {Teatru comentat},
 subtitle = {O pentalogie a mitului românesc},
 location = {București},
 keywords = {mitologie,anania}
}

@inbook{anania:greul:pol,
 author = {Anania, Valeriu},
 title = {Greul pământului},
 publisher = {Polirom},
 isbn = {978-973-46-1065-5},
 series = {Seria de autor Valeriu Anania},
 booktitle = {Teatru},
 year = {2008},
 volumes = {2},
 volume = {2},
 location = {Iași},
 note = {Cronologie de Ștefan Iloaie},
 keywords = {teatru, anania}
}

@book{anania:memorii,
 author = {Anania, Valeriu},
 year = {2011},
 title = {Memorii},
 publisher = {Polirom},
 isbn = {978-973-46-1175-1},
 location = {Iași},
 keywords = {memorii, societate}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}

\nocite{*}
\printbibliography[keyword={mitologie,societate},title={Carti}]

\end{document}

答案1

keyword选项仅接受单个关键字作为参数。您可以使用多个keyword选项,但它们将以 AND 连接,因此不会显示任何引用。

如果要将多个keywords 与逻辑或组合在一起,则需要定义一个书目过滤器

\documentclass[a4paper]{article}
\usepackage[romanian]{babel}
\usepackage[backend=biber, defernumbers=true]{biblatex}

\defbibfilter{mitologieORsocietate}{%
  keyword=mitologie
  or
  keyword=societate
}

\begin{filecontents}{\jobname.bib}
@book{anania:greul,
  author    = {Anania, Valeriu},
  year      = {1982},
  title     = {Greul pămîntului},
  publisher = {{Editura Eminescu}},
  series    = {Teatru comentat},
  subtitle  = {O pentalogie a mitului românesc},
  location  = {București},
  keywords  = {mitologie,anania}
}
@inbook{anania:greul:pol,
  author    = {Anania, Valeriu},
  title     = {Greul pământului},
  publisher = {Polirom},
  isbn      = {978-973-46-1065-5},
  series    = {Seria de autor Valeriu Anania},
  booktitle = {Teatru},
  year      = {2008},
  volumes   = {2},
  volume    = {2},
  location  = {Iași},
  note      = {Cronologie de Ștefan Iloaie},
  keywords  = {teatru, anania}
}
@book{anania:memorii,
  author    = {Anania, Valeriu},
  year      = {2011},
  title     = {Memorii},
  publisher = {Polirom},
  isbn      = {978-973-46-1175-1},
  location  = {Iași},
  keywords  = {memorii, societate}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography[filter=mitologieORsocietate,title={Carti}]
\end{document}

两条记录。

答案2

您使用的选项的语法keyword是错误的。这是正确的语法,但它仅打印包含两个关键字的条目:

\printbibliography[keyword=memorii,keyword=societate]

为了达到您的目的,您应该定义一个过滤器。例如,要打印包含以下关键字之一的条目:societatemitologieteatru,您需要:

\defbibfilter{example}{%
  keyword=societate or keyword=mitologie or keyword=teatru
}
\printbibliography[filter=example,title={Carti}]

相关内容