类似地这问题,我想切换字段年份和页面,但对于@incollection
条目,字段年份始终是最后一个。
梅威瑟:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@incollection{schramm2017,
title = {Medizintechnische Anwendungen der additiven Fertigung},
booktitle = {Additive Fertigung von Bauteilen},
author = {Schramm, Britta and Rupp, Nicola and Risse, Lena and Br\"uggemann, Jan-Peter and Riemer, Andre and Richard, Hans Albert and Kullmer, Gunter},
editor = {Richard, Hans Albert and Schramm, Britta and Zipsner, Thomas},
date = {2017},
pages = {21--40},
publisher = {{Springer Vieweg}},
location = {{Wiesbaden}},
keywords = {3D,Medizin},
langid = {german}
}
\end{filecontents}
\usepackage[backend=biber, style=ext-numeric]{biblatex}
\addbibresource{test.bib}
\begin{document}
\autocite{schramm2017}
\printbibliography
\end{document}
答案1
没有biblatex
单一的方法来重新排列参考书目输出中的字段。最终,参考书目的格式由参考书目驱动程序决定。驱动程序通常会调用几个可重用的 bibmacros 来实际打印字段。如果要交换的两个字段由同一个 bibmacros 打印,那么通过重新定义该 bibmacros 就可以轻松地切换它们的顺序。但如果字段由不同的 bibmacros 打印,事情就会变得更加复杂:有时最好只是重新定义驱动程序并交换相关 bibmacros 的顺序,有时最好重新定义两个 bibmacros。无论如何,人们始终需要记住,不同的条目类型可能使用相同的 bibmacros,因此更改可能会同时影响几种类型。
在biblatex
标准样式和biblatex-ext
页面字段中chapter+pages
,大多数条目类型都会打印一个宏(最值得注意的例外是@article
)。年份打印在 bibmacro 中publisher+location+date
(可能变为institution+location+date
,organization+location+date
或者仅location+date
在适当的情况下)。
因此,一种方法是告诉 bibmacrochapter+pages
不执行任何操作,然后修改publisher+location+date
(和朋友)以打印页面(我们通过在覆盖它之前复制chapter+pages
with的原始定义来做到这一点\letbibmacro
)。
\documentclass{article}
\usepackage[backend=biber, style=ext-numeric]{biblatex}
\letbibmacro*{print:chapter+pages}{chapter+pages}
\renewbibmacro*{chapter+pages}{}
\newcommand*{\datedelim}{\newunitpunct}
\renewbibmacro*{pubinstorg+location+date}[1]{%
\printlist{location}%
\iflistundef{#1}
{\setunit*{\locdatedelim}}
{\setunit*{\locpubdelim}}%
\printlist{#1}%
\newunit
\usebibmacro{print:chapter+pages}%
\setunit*{\datedelim}%
\usebibmacro{date}%
\newunit}
\renewbibmacro*{location+date}{%
\printlist{location}%
\newunit
\usebibmacro{print:chapter+pages}%
\setunit*{\datedelim}%
\usebibmacro{date}%
\newunit}
\begin{filecontents}{\jobname.bib}
@incollection{schramm2017,
title = {Medizintechnische Anwendungen der additiven Fertigung},
booktitle = {Additive Fertigung von Bauteilen},
author = {Schramm, Britta and Rupp, Nicola and Risse, Lena
and Brüggemann, Jan-Peter and Riemer, Andre
and Richard, Hans Albert and Kullmer, Gunter},
editor = {Richard, Hans Albert and Schramm, Britta and Zipsner, Thomas},
date = {2017},
pages = {21--40},
publisher = {Springer Vieweg},
location = {Wiesbaden},
keywords = {3D,Medizin},
langid = {german}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{schramm2017}
\printbibliography
\end{document}