我正在使用biblatex
Biber,并修改verbose
样式。我对版本的位置和格式感到困惑:版本应该紧挨着年份出现,不带任何“rd”、“th”等,版本和年份之间也没有空格。
我已经尝试解决这个问题一段时间了,如果有帮助的话,我可以发布一两个尝试过的解决方案的 MWE,但我担心它们会造成混淆而不是有帮助。
下面是一个纯粹的 MWE。相关的 bibmacros 似乎位于 中standard.bbx
。
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{foo,
author = {A. Author},
title = {Foo},
booktitle = {Book},
location = {North Pole},
date = {2013},
edition = {7},
}
\end{filecontents}
\usepackage[style=verbose, backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{foo}
\printbibliography
Should be: North Pole, \textsuperscript{7}2013
\end{document}
答案1
你可能想尝试以下方法
我们重新定义了版本格式,尽可能使用上标
\DeclareFieldFormat{edition}{%
\ifinteger{#1}
{\textsuperscript{#1}}
{#1\isdot\setunit{\addcomma\space}}}
然后我们让edition
出现在 之前date
。
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printfield{edition}%
\usebibmacro{date}%
\newunit}
然后我们删除该字段多余的第一次出现edition
。我们使用xpatch
它,它比重新输入整个驱动程序条目更容易。
\newcommand{\replaceedition}[1]{%
\xpatchbibdriver{#1}
{\printfield{edition}%
\newunit}
{}%
{}
{\typeout{failed to patch driver #1}}
}
\replaceedition{book}
\replaceedition{collection}
\replaceedition{inbook}
\replaceedition{incollection}
\replaceedition{manual}
数学家协会
\documentclass{article}
\begin{filecontents}{\jobname.bib}
@incollection{foo,
author = {A. Author},
title = {Foo},
booktitle = {Book},
location = {North Pole},
date = {2013},
edition = {7},
}
\end{filecontents}
\usepackage[style=verbose, backend=biber]{biblatex}
\usepackage{xpatch}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{edition}{%
\ifinteger{#1}
{\textsuperscript{#1}}
{#1\isdot\setunit{\addcomma\space}}}
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printfield{edition}%
\usebibmacro{date}%
\newunit}
\newcommand{\replaceedition}[1]{%
\xpatchbibdriver{#1}
{\printfield{edition}%
\newunit}
{}%
{}
{\typeout{failed to patch driver #1}}
}
\replaceedition{book}
\replaceedition{collection}
\replaceedition{inbook}
\replaceedition{incollection}
\replaceedition{manual}
\begin{document}
\nocite{foo}
\printbibliography
Should be: North Pole, \textsuperscript{7}2013
\end{document}
给我们