我正在使用芝加哥作者/标题脚注引用系统,并希望从脚注和参考书目中删除出版商的地址(但不将其从我的图书馆中删除。)这是代码:
\usepackage[notes,backend=biber,hyperref=false,giveninits=true]{biblatex-chicago}
\AtEveryBibitem{\clearfield{month}}
\AtEveryCitekey{\clearfield{month}}
\AtEveryBibitem{\clearfield{address}}
\AtEveryCitekey{\clearfield{address}}
\AtEveryBibitem{\clearfield{doi}}
\AtEveryCitekey{\clearfield{doi}}
\AtEveryBibitem{\clearfield{url}}
\AtEveryCitekey{\clearfield{url}}
\AtEveryBibitem{\clearfield{issn}}
\AtEveryCitekey{\clearfield{issn}}
\AtEveryBibitem{\clearfield{isbn}}
\AtEveryCitekey{\clearfield{isbn}}
\AtEveryBibitem{\clearfield{number}}
\AtEveryCitekey{\clearfield{number}}
该命令\AtEveryBibitem
适用\AtEveryCitekey
于上述除地址之外的所有其他字段。
答案1
这里有两个问题
address
只是为了与 BibTeX 兼容而提供的便利别名。内部该字段被称为location
(由 Biberaddress
自动转换为location
),因此如果您想删除侧面的字段biblatex
,您需要删除location
而不是address
;location
(address
) 是一个列表,而不是普通字段,因此您需要使用\clearlist
而不是\clearfield
(biblatex
有三种字段类型:普通字段、列表和名称列表,每种类型都有自己的\clear...
命令:\clearfield
,\clearlist
,\clearname
,您可以在中查找字段的类型文档biblatex
,§2.2.2数据库指南>输入字段)。
所以
\AtEveryBibitem{\clearlist{location}}
\AtEveryCitekey{\clearlist{location}}
会工作。
然而,在这种情况下,我认为\clearfield
/\clearlist
方法不如其他删除字段的方法。
address
要么使用 Biber 源映射(它在->重新映射之前出现location
,因此需要删除address
和location
)
\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[notes, backend=biber, giveninits=true]{biblatex-chicago}
\DeclareSourcemap{
\maps{
\map{
\step[fieldset=month, null]
\step[fieldset=address, null]
\step[fieldset=location, null]
\step[fieldset=doi, null]
\step[fieldset=url, null]
\step[fieldset=isbn, null]
\step[fieldset=number, null]
}
}
}
\begin{filecontents}{\jobname.bib}
@book{Gardner2018a,
address = {Oxford},
author = {Gardner, John},
publisher = {Oxford University Press},
title = {From Personal Life to Private Law},
doi = {10.1093/oso/9780198818755.001.0001},
year = {2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson,Gardner2018a}
\printbibliography
\end{document}
.bbl
或者,当使用从文件读取字段时删除它们\DeclareFieldInputHandler
。
\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[notes, backend=biber, giveninits=true]{biblatex-chicago}
\DeclareFieldInputHandler{month}{%
\def\NewValue{}}
\DeclareFieldInputHandler{doi}{%
\def\NewValue{}}
\DeclareFieldInputHandler{url}{%
\def\NewValue{}}
\DeclareFieldInputHandler{isbn}{%
\def\NewValue{}}
\DeclareFieldInputHandler{number}{%
\def\NewValue{}}
\DeclareListInputHandler{location}{%
\def\NewValue{}}
\begin{filecontents}{\jobname.bib}
@book{Gardner2018a,
address = {Oxford},
author = {Gardner, John},
publisher = {Oxford University Press},
title = {From Personal Life to Private Law},
doi = {10.1093/oso/9780198818755.001.0001},
year = {2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson,Gardner2018a}
\printbibliography
\end{document}
输出是一样的。