![更改 Biblatex 中地址和出版商的顺序](https://linux22.com/image/287155/%E6%9B%B4%E6%94%B9%20Biblatex%20%E4%B8%AD%E5%9C%B0%E5%9D%80%E5%92%8C%E5%87%BA%E7%89%88%E5%95%86%E7%9A%84%E9%A1%BA%E5%BA%8F.png)
我需要更改参考书目中字段的顺序。目前,我拥有的任何书籍条目都显示为:
城市: 出版商。
我想将其更改为
出版者: 城市。
给定一个 tex 文件如下:
\documentclass{article}
\usepackage[style=numeric, firstinits=true, maxbibnames=99, minbibnames=1, backend=bibtex8]{biblatex}
\bibliography{mybib}
\begin{document}
hello world \cite{Ab_Steg}
\printbibliography
\end{document}
.bib文件如下:
@BOOK{Ab_Steg,
author = "M. Abramowitz and I. A. Stegun",
title = {Handbook of mathematical functions},
publisher = "Dover publications",
year = "1965",
language="English",
address="New York"
}
结果是:
我想要将“Dover publications”和“New York”的位置互换。
答案1
加载 biblatex 后插入此内容:
% let "publisher" and "location" change place
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\iflistundef{location}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
这是来自standard.bbx
Biblatex 的,只有这两个互换了。
如果只book
影响 s,一种直接的方法就是不更改上述宏,而是定义一个新的宏,\newbibmacro{location+publisher+date}
其定义与上述相同。然后将整个\DeclareBibliographyDriver{book}
部分复制standard.bbx
到文件中,但交换调用\usebibmacro
以使用替代宏。
答案2
我们可以使用\ifentrytype{book}
来仅改变宏@books
。
\renewbibmacro*{publisher+location+date}{%
\ifentrytype{book}
{\printlist{publisher}%
\iflistundef{location}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{location}}
{\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}}
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
平均能量损失
\documentclass{article}
\usepackage[style=numeric, firstinits=true, maxbibnames=99, minbibnames=1, backend=biber]{biblatex}
\renewbibmacro*{publisher+location+date}{%
\ifentrytype{book}
{\printlist{publisher}%
\iflistundef{location}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{location}}
{\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}}
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
\bibliography{biblatex-examples.bib}
\begin{document}
\cite{cicero,wilde}
\printbibliography
\end{document}