对于我的论文,我使用的是biblatex
风格oxnotes
,这种风格与详细风格非常相似并使用脚注。
如果我使用\footcite
带有指定后记的命令,对于带有页码的条目(例如书籍章节),脚注将打印两个都页码和附注。我想告诉您biblatex
在有附注时隐藏脚注中的页码。
目前,\footcite
像这样:
\footcite[1-5]{barkan2003}
...将产生脚注
Barkan,‘标题’,期刊名称(2003),1-20 至 1-5。
我想在\footcite
指定后记的命令中隐藏页面(即“1-20”),如下所示
Barkan,‘标题’,期刊名称(2003),1-5。
我尝试过以下命令,但它会抑制引文和参考书目中的页面字段。
\DeclareFieldFormat{pages}{%
\iffieldundef{pages}{}{\iffieldundef{postnote}{}{\clearfield{pages}}}}
有没有办法告诉biblatex
隐藏页面字段仅有的在\footcite
命令中,而不是在参考书目中?
如能提供任何解决方案方面的帮助,我们将不胜感激!
\documentclass{article}
\usepackage[style=oxnotes]{biblatex}
\RequireBibliographyStyle{oxref}
\begin{filecontents*}{document.bib}
@article{barkan2003,
title = {Title},
journaltitle = {Journal Title},
date = {2003},
pages = {1-20},
author = {Barkan},
}
\end{filecontents*}
\addbibresource{document.bib}
\begin{document}
Text.\footcite[1-5]{barkan2003}
\end{document}
答案1
biblatex-oxref
的oxnotes
引用样式基于verbose.cbx
并支持其所有选项。特别是,您可以使用选项citepages
,该选项记录在verbose
样式示例。(在早期版本中,biblatex-oxref
某些方面有点citepages
违反直觉,但在 1.1 版中得到了改进,请参阅https://github.com/alex-ball/biblatex-oxref/issues/8。
-default
oxnotes
为citepages=separate
您提供Wolfgang A. Herrmann 等人,“碳环卡宾作为 C–C 偶联反应的有效催化配体”,Angew. Chem. Int. Ed.45/23 (2006),第 3859–62 页,第 3860–1 页。
如果后记为数字,则自动省略该
citepages=omit
字段pages
Wolfgang A. Herrmann 等人,“碳环卡宾作为 C–C 偶联反应的有效催化配体”,Angew. Chem. Int. Ed.45/23 (2006), 3860–1。
citepages=suppress
pages
即使后记不是数字,也会省略该字段。citepages=permit
(标准verbose
样式的默认设置)将只显示两个字段Wolfgang A. Herrmann 等人,“碳环卡宾作为 C–C 偶联反应的有效催化配体”,Angew. Chem. Int. Ed. 45/23 (2006), 3859–62, 3860–1.
So you could try
\documentclass{article}
\usepackage[style=oxnotes, citepages=omit]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
Text.\footcite[3860-3861]{herrmann}
\printbibliography
\end{document}
The \DeclareFieldFormat
idea did not work because \iffieldundef{pages}{}{\iffieldundef{postnote}{}{\clearfield{pages}}}
is not a command that prints anything. It only tells biblatex
to delete pages
in a certain situation. But \DeclareFieldFormat
should be used to tell biblatex
how to print stuff, compare with the default
\DeclareFieldFormat{pages}{\mkpageprefix[bookpagination]{#1}}
or the simpler
\DeclareFieldFormat{title}{\mkbibemph{#1}}
A \DeclareFieldFormat
should always involve a #1
.
In essence this definition deletes the field in the case you want (and it would not delete the field in the bibliography, because \iffieldundef{postnote}
would be true there), but it overwrites the definition that tells biblatex
how to print the pages
field in the first place, which means that it is always dropped in the output.
Deleting a field only in \DeclareFieldFormat
could cause spurious punctuation because biblatex
thinks it printed something when it didn't.
So I would not try and pursue that particular approach any further here.
Note that the
\RequireBibliographyStyle{oxref}
was not required. In general you shouldn't have to use \RequireBibliographyStyle
or \RequireCitationStyle
in a document. The style is loaded via biblatex
's style
option (or separately via bibstyle
and citestyle
).