接下来, 如何将 inbook 的分页改为小写. 如何在页面字段前插入换行符?
我试过
\DeclareFieldFormat{pages}{\newline\mkpageprefix[pagination]{#1}}
但@inbook
这样做会导致多了一个换行符。真正的问题可能是:如何将“页面”变成一个块,以便自动“换行” block=npar
。
\documentclass{article}
\usepackage[block=nbpar]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{refs.bib}
@article{foo,
author = "Foo Bar",
title = "Baz",
journal = "A. B. C.",
volume = "1",
issue = "2",
pages = "100-200",
}
@inbook{bar,
author = "Foo Bar",
booktitle = "Qux",
title = "Baz",
pages = "100-200",
}
\end{filecontents*}
\addbibresource{refs.bib}
\newtoggle{blockterm}
\preto{\newblockpunct}{\ifterm{\toggletrue{blockterm}}{\togglefalse{blockterm}}}
\appto{\newblockpunct}{\iftoggle{blockterm}{}{\midsentence}}
\DeclareFieldFormat{pages}{\newline\mkpageprefix[pagination]{#1}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
问题在于,正如您正确推测的那样,article
驱动程序之前没有包含新块pages
,而却包含新块。inbook
删除对页面字段格式的更改,并在前言中包含以下内容以更改article
驱动程序。恐怕我对修补命令不够熟悉,无法弄清楚如何在驱动程序中间放置这样的补丁,因此尽管我们所做的只是添加一个命令,但我不得不给你整个驱动程序。被更改的行标有注释。
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit\newblock% <--- THIS LINE CHANGED HERE
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}}