我必须处理两个独立的参考书目。我发现使用biblatex
withbiber
并添加关键字是一个非常方便的选择。但我还想使用一些参考集,为此我使用了命令\mcite
。为了让它更有趣,我还有一个引用规范文件的命令。
我的问题是\mcite
或\parencitetitle
没有得到正确管理:它们没有出现在参考书目中。我认为这是由于添加了关键字,或者更确切地说,由于这两个命令生成的参考资料中没有添加任何关键字。
因此,我的问题是:如何向\mcite
或\parencitetitle
命令生成的参考中添加关键字?
MWE 可以是:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[hyperindex=false]{hyperref}
\usepackage[citestyle=alphabetic,
bibstyle=alphabetic,
mcite=true,
subentry,
backend=biber
]{biblatex}
\addbibresource[datatype=bibtex]{biblio.bib}
\addbibresource[datatype=bibtex]{references.bib}
\DeclareBibliographyDriver{standard}{\usedriver{\newblock}{manual}%
\usebibmacro{pageref}%
\finentry}
\DeclareCiteCommand{\parencitetitle}[\mkbibparens]
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexfield{indextitle}}
{}%
%\printfield[citetitle]{labeltitle}}
\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareSourcemap{
\maps[datatype=bibtex, overwrite]{
\map{
\perdatasource{./biblio.bib}
\step[fieldset=KEYWORDS, fieldvalue=primary, append]
}
\map{
\perdatasource{./references.bib}
\step[fieldset=KEYWORDS, fieldvalue=secondary, append]
}
}
}
\usepackage{notes2bib}
\bibnotesetup{keyword-entry={secondary,}}
\begin{document}
Eurocode: \parencitetitle{en1998}
\mcite{set1,*Boncella1984,*Tilley1982} This is some nice text I want to cite as a set.
\bibnote{some added text:\mcite{set1,*Boncella1984,*Tilley1982}}
Here I cite a single paper from the previous set.\cite{Tilley1982} This is how it should look like with included note.\bibnote{more added text: \fullcite{set1}}
Another set cite\mcite{set2,*Tilley1982,*Boncella1984}
And a reference from the second file.\cite{NE1}
\printbibliography[keyword=primary]
\newrefcontext[sorting=none]
\printbibliography[title=References, keyword=secondary]
\end{document}
文件biblio.bib
:
@STANDARD{en1998,
shorttitle = {EN 1998},
title = {EN 1998, Eurocode 8: contruction norms},
organization = {CEN},
address = {Brussels, Belgium},
year = {2005},
}
@article{Boncella1984,
author = {Boncella, James M. and Andersen, Richard A.},
journal = {Inorg. Chem.},
pages = {432--437},
volume = {23},
year = {1984}
}
@article{Tilley1982,
author = {Tilley, T. Don and Andersen, Richard},
journal = {J. Am. Chem. Soc.},
pages = {1772--1774},
volume = {104},
year = {1982}
}
以及references.bib
文件:
@report{NE1,
author = {Doe, Joe},
title = {A super document},
year = {2017},
}
我认为 pdflatex 或其他编译器给出的警告有助于理解问题。
PS:可选问题是关于警告:“Biber 中的集合成员条目中不再需要字段‘entryset’”,我该如何正确修复它?这是由生成的子条目编号\bibnote{more added text: \fullcite{set1}}
不正确的原因吗(a、b、...)?
答案1
keyword
您的参考书目通过s进行过滤。s 通过文件和字段keyword
附加到条目。在您的情况下,这是由基于文件的源映射自动完成的。.bib
keywords
.bib
您\mcite{set1,*Boncella1984,*Tilley1982}
创建一个条目set1
(本质上是在文档中即时创建的),该条目不属于任何.bib
文件,因此没有关键字。因此,set1
当您使用特定关键字筛选条目时,该条目不会出现在参考书目中。
使用当前界面似乎无法修复keyword
,set1
但从理论上讲,通过一些低级黑客技术,这可能是可能的。然而,我不认为你必须走那么远。
使用notkeyword
您实际上并不需要primary
关键字,您可以用它notkeyword=secondary
来排除所有次要条目,这将允许集合进入“主要”书目。
\printbibliography[notkeyword=secondary]
\newrefcontext[sorting=none]
\printbibliography[title=References, keyword=secondary]
使用书目类别
如上所述,keyword
s 非常静态,因为它们通常来自数据源本身(在您的例子中,由于源映射,它们稍微更具动态性,但最终它们.bib
也依赖于文件)。关键字过滤的动态/动态对应项是类别过滤。参考书目类别是在文档中动态创建的,就像来自的设置条目一样\mcite
。
\DeclareBibliographyCategory{primary}
\addtocategory{primary}{set1,set2}
\defbibfilter{primary}{keyword=primary or category=primary}
\begin{document}
\mcite{set1,*Boncella1984,*Tilley1982} This is some nice text I want to cite as a set.
\bibnote{some added text:\mcite{set1,*Boncella1984,*Tilley1982}}
Here I cite a single paper from the previous set.\cite{Tilley1982} This is how it should look like with included note.\bibnote{more added text: \fullcite{set1}}
Another set cite\mcite{set2,*Tilley1982,*Boncella1984}
And a reference from the second file.\cite{NE1}
\printbibliography[filter=primary]
\newrefcontext[sorting=none]
\printbibliography[title=References, keyword=secondary]
\end{document}
将通过keyword
s 和\mcite
s 的类别过滤主要来源。