我想要 biblatex 3.0 中博士论文和硕士论文的单独参考书目。
bib-keys @phdthesis 和 @masterthesis 将像 @thesis 一样被 biblatex 处理(带有额外的 bib-field “类型”)。
因此
\printbibliography[type=thesis, heading=subbibliography, title={Theses}]
收集各种论文。并且
\printbibliography[type=phdthesis, heading=subbibliography, prefixnumbers=P, title={Doctoral Theses}]
\printbibliography[type=mastersthesis, heading=subbibliography, prefixnumbers=M, title={Master's Theses}]
发出警告
Package biblatex Warning: Type 'phdthesis' not found ...
我该怎么做才能自动区分 phdtheses 和 masterstheses?是否可以通过 bib-field“type”(而不是 bib-key)进行过滤?
答案1
而不是,您可以直接在 bibcheck 中keywords
使用字段。当 Biber 将和转换为 时,该字段会自动填充正确的字符串。(转换以这样的方式进行,除了 字段之外, Biber 或 的和之间没有区别。)type
type
@phdthesis
@mathesis
@thesis
type
@phdthesis
@mathesis
biblatex
\documentclass{article}
\usepackage[defernumbers,backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\defbibcheck{phdthesis}{%
\iffieldequalstr{type}{phdthesis}
{}
{\skipentry}}
\defbibcheck{mathesis}{%
\iffieldequalstr{type}{mathesis}
{}
{\skipentry}}
\begin{document}
\cite{geer,loh}
\newrefcontext[labelprefix=P]
\printbibliography[check=phdthesis, heading=subbibliography, title={Doctoral Theses}]
\newrefcontext[labelprefix=M]
\printbibliography[check=mathesis, heading=subbibliography, title={Master's Theses}]
\end{document}
答案2
我猜你可以用源映射来做到这一点。将thesis
类型字段复制到keywords
字段,然后根据该字段进行过滤。请注意,此代码适用于biblatex 3.0
您指定的版本。对于较新版本的版本,biblatex
您无法使用该prefixnumbers
选项。但源映射的想法是一样的。
\documentclass{article}
\usepackage[defernumbers,backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\pagestyle{empty}
% copy the thesis type field to the keywords field
\DeclareSourcemap{
\maps{
\map[overwrite]{
\pertype{thesis}
\step[fieldsource=type, final]
\step[fieldset=keywords, origfieldval]
}
}
}
\begin{document}
\cite{geer,loh}
\printbibliography[keyword=phdthesis, heading=subbibliography, prefixnumbers=P, title={Doctoral Theses}]
\printbibliography[keyword=mathesis, heading=subbibliography, prefixnumbers=M, title={Master's Theses}]
\end{document}
对于较新的版本,biblatex
您可以像这样打印您的参考书目(我认为):
\newrefcontext[labelprefix=P]
\printbibliography[keyword=phdthesis, heading=subbibliography, title={Doctoral Theses}]
\newrefcontext[labelprefix=M]
\printbibliography[keyword=mathesis, heading=subbibliography, title={Master's Theses}]