在以下 MWE(使用pdflatex
、biber
和 再次编译pdflatex
)中,反向引用打印在“重印为”前面(见屏幕截图)。有没有办法将反向引用放在最后?
\documentclass{article}
\usepackage{filecontents}
\usepackage[backend=biber,backref]{biblatex}
\begin{filecontents}{references.bib}
@book{Kelly,
author = {Kelly, G.\ M.},
title = {Basic concepts of enriched category theory},
publisher = {Cambridge University Press},
address = {Cambridge},
series = {London Mathematical Society Lecture Notes Series},
number = {64},
year = {1982},
isbn = {978-0-521-28702-9},
related = {KellyNew},
relatedstring = {Reprinted as}
}
@article{KellyNew,
author = {Kelly, G.\ M.},
title = {Basic concepts of enriched category theory},
pages = {1–136},
volume = {10},
journal = {Repr.\ Theory Appl.\ Categ.},
volume = {10},
year = {2005}
}
\end{filecontents}
\bibliography{references.bib}
\begin{document}
\cite{Kelly}
\printbibliography
\end{document}
答案1
这些元素的顺序由书目驱动程序定义。所有标准驱动程序都以这样的方式结束
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
这意味着 backref 显示在相关条目之前。
最好的解决方案™ 是将pageref
调用移动到您希望它出现的位置。当然,这是繁琐且重复的,因为至少有 19 个驱动程序需要修改。我们可以通过使用xpatch
修补驱动程序和内部宏来循环遍历所有类型来简化这一过程。
\documentclass{article}
\usepackage[backend=biber,backref]{biblatex}
\usepackage{xpatch}
\newcommand*{\movepageref}[1]{%
\xpatchbibdriver{#1}
{\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}}
{}
{}
{}%
\xpatchbibdriver{#1}
{\usebibmacro{finentry}}
{\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}
\usebibmacro{finentry}}
{}
{}%
}
\makeatletter
\let\do\movepageref
\abx@doentrytypes
\makeatother
\begin{filecontents}{\jobname.bib}
@book{Kelly,
author = {Kelly, G. M.},
title = {Basic concepts of enriched category theory},
publisher = {Cambridge University Press},
address = {Cambridge},
series = {London Mathematical Society Lecture Notes Series},
number = {64},
year = {1982},
isbn = {978-0-521-28702-9},
related = {KellyNew},
relatedstring = {Reprinted as},
}
@article{KellyNew,
author = {Kelly, G. M.},
title = {Basic concepts of enriched category theory},
pages = {1–136},
volume = {10},
journal = {Repr. Theory Appl. Categ.},
volume = {10},
year = {2005},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Kelly}
\printbibliography
\end{document}
一个概念上不太令人满意但更短的解决方案是将 bibmacro 复制pageref
到一个新的宏中,重新定义pageref
为不执行任何操作并使用其中的副本finentry
。
\documentclass{article}
\usepackage[backend=biber,backref]{biblatex}
\letbibmacro*{orig:pageref}{pageref}
\renewbibmacro{pageref}{}
\renewbibmacro*{finentry}{%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{orig:pageref}%
\finentry}
\begin{filecontents}{\jobname.bib}
@book{Kelly,
author = {Kelly, G. M.},
title = {Basic concepts of enriched category theory},
publisher = {Cambridge University Press},
address = {Cambridge},
series = {London Mathematical Society Lecture Notes Series},
number = {64},
year = {1982},
isbn = {978-0-521-28702-9},
related = {KellyNew},
relatedstring = {Reprinted as},
}
@article{KellyNew,
author = {Kelly, G. M.},
title = {Basic concepts of enriched category theory},
pages = {1–136},
volume = {10},
journal = {Repr. Theory Appl. Categ.},
volume = {10},
year = {2005},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Kelly}
\printbibliography
\end{document}
答案2
我的尝试受到以下启发:我可以重新排序 biblatex 书目中的字段吗?。
\documentclass{article}
\usepackage{filecontents}
\usepackage[backend=biber,backref]{biblatex}
\usepackage{xpatch}
\newbibmacro*{addendum+pubstate+pageref+related}{%
\usebibmacro{addendum+pubstate}%
\clearfield{addendum}%
\clearfield{pubstate}%
\usebibmacro{related}%
\clearfield{related}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\clearlist{pageref}%
\newunit\newblock}
\xpretobibmacro{doi+eprint+url}{\usebibmacro{addendum+pubstate+pageref+related}}{}{}
\xpretobibmacro{eprint}{\usebibmacro{addendum+pubstate+pageref+related}}{}{}
\xpretobibmacro{url+urldate}{\usebibmacro{addendum+pubstate+pageref+related}}{}{}
\begin{filecontents}{references.bib}
@book{Kelly,
author = {Kelly, G.\ M.},
title = {Basic concepts of enriched category theory},
publisher = {Cambridge University Press},
address = {Cambridge},
series = {London Mathematical Society Lecture Notes Series},
number = {64},
year = {1982},
isbn = {978-0-521-28702-9},
related = {KellyNew},
relatedstring = {Reprinted as},
}
@article{KellyNew,
author = {Kelly, G.\ M.},
title = {Basic concepts of enriched category theory},
pages = {1–136},
volume = {10},
journal = {Repr.\ Theory Appl.\ Categ.},
volume = {10},
year = {2005}
}
\end{filecontents}
\addbibresource{references.bib}
%\bibliography{references.bib}
\begin{document}
\cite{Kelly}
\printbibliography
\end{document}