我正在尝试使用 biblatex 引用一本书中的一章:
@inbook{ ,
crossref{X}
}
@book{X,
}.
这将产生以下布局的引用:
Authors. Title. [...] In: Title. Authors. [...]
我需要在“In:”引用中交换标题和作者,即获得
Authors. Title. [...] In: Authors. Title. [...]
有什么想法吗?谢谢。
答案1
解决方案取决于您使用的书目样式。如果它基于标准样式standard.bbx
,则驱动程序的相关部分@inbook
是:
\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
对于@incollection
和@inproceedings
:
\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
和
\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}%
书目宏bybookauthor
和byeditor+others
在中定义biblatex.def
。
要更改 之后的标题和名称列表的顺序in:
,您可以重新定义每个驱动程序,并使用bybookauthor
和的变体byeditor+others
来抑制“by”字符串。
或者,您可以重新定义in:
宏来打印和清除姓名列表。这种方法已被先前申请针对这种情况。下面是处理由或byeditor
打印的姓名列表的示例。byeditor+others
bybookauthor
\documentclass{article}
\usepackage{biblatex}
\renewbibmacro*{in:}{%
\printtext{\bibstring{in}\intitlepunct}%
\ifnameundef{bookauthor}
{\ifnameundef{editor}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}}
{\ifnamesequal{author}{bookauthor}
{}
{\printnames{bookauthor}%
\clearname{bookauthor}}}%
\newunit\newblock}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inbook{inbook,
crossref = {book},
author = {Smith, John},
title = {Inbook Title}}
@book{book,
author = {Doe, John and Brown, Bob},
title = {Book Title}}
@incollection{incollection,
crossref = {collection},
author = {Smith, John},
title = {Incollection Title}}
@collection{collection,
editor = {Doe, John and Brown, Bob},
translator = {Smith, Jane},
title = {Collection Title}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{inbook,incollection}
\printbibliography
\end{document}