我使用 biblatex-chicago 作为参考文献。我的 bib 文件包含许多从 ACM 数字图书馆导入的会议论文参考文献。这些会议的缩写通常比会议本身的全名更为人所知。因此,对于inproceedings
条目,我使用字段包含了缩写series
。我想将booktitle
和series
字段组合在一起。
\documentclass{article}
\usepackage[
authordate,
backend=biber,
]{biblatex-chicago} % biblatex setup
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{paper2012,
author = {Smith, John},
date = {2012},
title = {Paper Title},
booktitle = {Proceedings of the 2012 ACM annual conference on Human Factors in Computing Systems},
series = {CHI '12},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
此示例当前输出以下内容:
Smith, John。2012 年。“论文标题”2012 年 ACM 计算机系统人为因素年会论文集, 937–946。CHI '12。纽约,纽约州,美国:ACM。
相反,我想改变条目的输出inproceedings
,以便booktitle
和 series
字段像这样组合在一起:
Smith, John。2012 年。“论文标题”2012 年 ACM 计算机系统人为因素年会论文集 — CHI '12, 937–46。纽约,纽约州,美国:ACM。
一个重要的警告是,并非所有inproceedings
条目都有series
字段。
使用 biblatex-chicago 可以实现这个吗?
答案1
其他解决方案建议使用booktitleaddon
而不是series
。我个人认为这series
不是正确的使用字段。例如,考虑 Springer 计算机科学讲义系列,出版计算机科学会议论文集。每本书都有自己的标题(通常与会议标题不同),但论文集通常以会议名称或缩写形式为人所知。然后,通常会包含对 LNCS 系列的引用和该系列中的编号。
Biblatex 与 一起使用时biber
,提供了创建新字段的可能性。我建议添加 字段acronym
。
这可以通过
\begin{filecontents}{biblatex-dm.cfg}
\DeclareDatamodelFields[type=field,datatype=literal,skipout=false]{acronym}
\end{filecontents}
它创建一个本地 biblatex 配置文件。
然后我们必须给出如何排版新字段的说明(斜体表示in proceedings
)
\DeclareFieldFormat[inproceedings]{acronym}{\textit{#1}}
最后一步是修改适当的bibmacro
,在这种情况下btitle+bstitle
。
\newbibmacro*{btitle+bstitle}{%
\iffieldundef{booktitle}
{}
{\ifthenelse{\ifentrytype{audio}\OR\ifentrytype{music}\OR%
\ifentrytype{video}}%
{}%
{\usebibmacro{cms-in:}}%
\printtext{%
\printfield{booktitle}%
\setunit{\addcolon\addspace}%
\printfield[booktitle]{booksubtitle}}%
\setunit{\addspace---\addspace}%
\ifentrytype{inproceedings}
{\printfield{acronym}}
{}%
\newcunit
\printfield{booktitleaddon}%
\setunit*{\addcomma\addspace}}}
请注意,我们\ifentrytype{inproceedings}
仅将更改本地化到此条目类型。
以下是完整的 MWE
\documentclass{article}
\usepackage[
authordate,
backend=biber,
]{biblatex-chicago} % biblatex setup
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{paper201x,
author = {Smith, John},
date = {2012},
title = {Paper Title},
booktitle = {Long Title of the Confererence},
acronym = {CONF'2012},
pages = {937-946},
series = {LNCS},
number = {1234},
location = {Heidelberg},
publisher = {Springer},
}
@inproceedings{paper2012a,
author = {Smith, John},
date = {2012},
title = {Paper Title},
booktitle = {Proceedings of the 2012 ACM annual conference on Human Factors in Computing Systems},
series = {CHI '12},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
@inproceedings{paper2012b,
author = {Smith, John},
date = {2012},
title = {Paper Title},
booktitle = {Proceedings of the 2012 ACM annual conference on Human Factors in Computing Systems},
acronym = {CHI '12},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
\end{filecontents}
\begin{filecontents}{biblatex-dm.cfg}
\DeclareDatamodelFields[type=field,datatype=literal,skipout=false]{acronym}
\end{filecontents}
\DeclareFieldFormat[inproceedings]{acronym}{\textit{#1}}
\newbibmacro*{btitle+bstitle}{% InIn fix from N&B
\iffieldundef{booktitle}
{}
{\ifthenelse{\ifentrytype{audio}\OR\ifentrytype{music}\OR%
\ifentrytype{video}}%
{}%
{\usebibmacro{cms-in:}}%
\printtext{%
\printfield{booktitle}%
\setunit{\addcolon\addspace}%
\printfield[booktitle]{booksubtitle}}%
\setunit{\addspace---\addspace}%
\ifentrytype{inproceedings}
{\printfield{acronym}}
{}%
\newcunit
\printfield{booktitleaddon}%
\setunit*{\addcomma\addspace}}}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
答案2
我的建议是使用booktitleaddon
字段,因为它已经设计为打印在您想要的位置。但是,这些类型的字段通常在驱动程序中非常“深”,因此您需要小心确保您的更改仅影响inproceedings
条目,因为它使用与其他“in-
我会这样做:创建新的 bibmacros 并使用该xpatch
包来替换所需的内容。
\documentclass{article}
\usepackage[
authordate,
backend=biber,
]{biblatex-chicago} % biblatex setup
\usepackage{xpatch}
\usepackage{xcolor}
\newcommand{\diff}[1]{\textcolor{red}{#1}}% <-- just to highlight differences
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}% we need more entries...
@inproceedings{paper2012,
author = {Smith, John},
date = {2012},
title = {Paper Title},
booktitle = {Proceedings of the 2012 ACM annual conference on Human Factors in Computing Systems},
booktitleaddon = {\diff{CHI '12}},
number = 33,
series = {\diff{This is the series}},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
@inproceedings{paper2013,
author = {Smith, John},
date = {2013},
title = {Different Paper Title},
booktitle = {Proceedings of the 2012 ACM annual conference on Human Factors in Computing Systems},
booksubtitle = {\diff{With a Subtitle}},
booktitleaddon = {CHI '12},
number = 34,
series = {\diff{This is the series}},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
@inproceedings{paper2011,
author = {Smith, John},
date = {2011},
title = {Another Paper Title},
booktitle = {Proceedings of the 2012 ACM annual conference on Human Factors in Computing Systems},
booksubtitle = {\diff{With a Subtitle \& No Booktitleaddon}},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
@incollection{paper2014,
author = {Doe, Jane},
date = {2014},
title = {Jane's Paper Title},
booktitle = {Collected Essays},
booksubtitle = {\diff{With a Series and a Booktitleaddon}},
series = {CHI '13},
booktitleaddon = {\diff{This is the booktitleaddon (which is preceded by the normal comma)}},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
\end{filecontents*}
% we need our own bibmacros
\newbibmacro*{INP-btitle+bstitle}{%
\iffieldundef{booktitle}
{}
{\printtext{%
\printfield{booktitle}%
\setunit{\addcolon\addspace}%
\printfield[booktitle]{booksubtitle}}%
\newcunit
\setunit{\addspace ---\addspace}%
\printfield{booktitleaddon}}}
\newbibmacro*{INP-mtitle+mstitle+vol+part+btitle+bstitle}{%
\usebibmacro{INP-btitle+bstitle}%
\iffieldundef{booktitle}
{\setunit{\addperiod\addspace}}% Fix customc?
{\setunit{\addcomma\addspace}}%
\iffieldundef{maintitle}
{}
{\iffieldundef{volume}
{\printtext{%
\printfield{maintitle}%
\setunit{\addcolon\addspace}%
\printfield[maintitle]{mainsubtitle}}%
\newcunit
\printfield{maintitleaddon}}
{\printfield{volume}%
\printfield{part}%
\setunit{\addspace}
\bibstring{ofseries}%
\setunit{\addspace}
\printtext{%
\printfield{maintitle}%
\setunit{\addcolon\addspace}%
\printfield[maintitle]{mainsubtitle}}%
\newcunit
\printfield{maintitleaddon}}}}
\addbibresource{\jobname.bib}
% this puts the booktitleaddon field in 'italics' only for @inproceedings entry types
\DeclareFieldFormat[inproceedings]{booktitleaddon}{\emph{#1}}
% this replaces a portion of the default inproceedings bibdriver with the macrs we defined above.
\xpatchbibmacro{inproceedings}{mtitle+mstitle+vol+part+btitle+bstitle}{INP-mtitle+mstitle+vol+part+btitle+bstitle}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
... 而且,在我写这篇文章的时候,我看到 moewe 发布了另一种解决方案。其中的一部分可以在这里合并,这样你就不需要重写你的 bib 条目了。但是,我仍然认为映射到booktitleaddon
是默认使用的更好的字段,只是因为书籍更有可能有副标题,而不是需要放在字段中的书目信息titleaddon
。
答案3
我认为简称(您的series
领域)的职位是booksubtitle
,因此我们可以做以下事情:
我们只需将series
字段更改为@inproccedings
。booksubtitle
当然,这仅在没有实际具有正确条目的条目时才有效series
,并且也booksubtitle
需要为空。
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\pertype{inproceedings}
\step[fieldsource=series, fieldtarget=booksubtitle]
}
\map{
\pertype{proceedings}
\step[fieldsource=series, fieldtarget=subtitle]
}
}
}
平均能量损失
\documentclass{article}
\usepackage[
authordate,
backend=biber,
]{biblatex-chicago} % biblatex setup
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@inproceedings{paper2012,
author = {Smith, John},
date = {2012},
title = {Paper Title},
booktitle = {Proceedings of the 2012 ACM annual conference on Human Factors in Computing Systems},
series = {CHI '12},
pages = {937-946},
location = {New York, NY, USA},
publisher = {{ACM}},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\nocite{*}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\pertype{inproceedings}
\step[fieldsource=series, fieldtarget=booksubtitle]
}
\map{
\pertype{proceedings}
\step[fieldsource=series, fieldtarget=subtitle]
}
}
}
\begin{document}
\printbibliography
\end{document}