
我使用 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}
此範例目前輸出以下內容:
史密斯、約翰. 2012.《論文標題》2012 年 ACM 計算系統中的人為因素年會論文集,937–946。氣'12。美國紐約州紐約市:ACM。
相反,我想更改條目的輸出inproceedings
,以便將booktitle
和 series
字段分組在一起,如下所示:
史密斯、約翰. 2012.《論文標題》2012 年 ACM 計算系統人為因素年會論文集 — CHI '12,937–46。美國紐約州紐約市:ACM。
一個重要的警告是,並非所有inproceedings
條目都有一個series
欄位。
biblatex-chicago 可以做到這一點嗎?
答案1
建議使用其他解決方案booktitleaddon
代替series
.就我個人而言,我認為這series
不是正確的使用領域。例如,考慮計算機科學系列中的施普林格講義、計算機科學會議的出版論文集。每本書都有其標題(通常與會議標題不同),但會議記錄透過會議名稱(通常是其縮寫)來了解。然後通常會包含 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 發布了不同的解決方案。可以將其中的一部分合併到此處,這樣您就不需要重寫您的號碼布條目。但是,我仍然認為預設情況下映射到booktitleaddon
是更好的字段,因為書籍比需要放入該字段的書目資訊更有可能有副標題titleaddon
。
答案3
我認為短標題(您的領域)的位置series
是 的booksubtitle
,所以我們可以做的是:
我們只需將series
欄位更改為@inproccedings
to 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}