![在参考文献列表、biblatex、authoryear bibstyle 中格式化编辑卷信息](https://linux22.com/image/469569/%E5%9C%A8%E5%8F%82%E8%80%83%E6%96%87%E7%8C%AE%E5%88%97%E8%A1%A8%E3%80%81biblatex%E3%80%81authoryear%20bibstyle%20%E4%B8%AD%E6%A0%BC%E5%BC%8F%E5%8C%96%E7%BC%96%E8%BE%91%E5%8D%B7%E4%BF%A1%E6%81%AF.png)
我正在为一家期刊格式化参考书目,该期刊坚持对标准样式进行许多愚蠢的更改,使用 biblatex。最接近他们想要的是 AuthorYear,所以我从那里开始。我已经完成了大部分工作,但还有两件事。我将它们放在不同的问题中,因为它们足够不同。
对于 InCollection 条目,我目前获得:
Eaton, AW (2016)。《身体品味与肥胖压迫》。身体美学. Sherri Irvin 编。牛津大学出版社,37–59。
我需要的是:
Eaton, AW (2016)。《身体品味与肥胖压迫》。Sherri Irvin(编辑),身体美学(37–59)。牛津大学出版社。
我如何才能正确获取编辑卷信息?(我意识到他们在这里想要的是更接近 APA 而不是 AuthorYear,但是对于大多数条目,他们想要的是更接近 AuthorYear 而不是 APA)
以下是 MWE:
\documentclass{article}
\usepackage[bibstyle=authoryear, citestyle=authoryear]{biblatex}
%deletes colon from in for collections
\renewcommand*{\intitlepunct}{%
\ifentrytype{incollection}
{\addspace}
{\addcolon\space}}
%deletes location from books
\AtEveryBibitem{\clearlist{location}}
\usepackage{filecontents}
\begin{filecontents}{ref.bib}
@InCollection{eaton2016,
author = {A. W. Eaton},
date = {2016},
title = {Taste in Bodies and Fat Oppression},
booktitle = {Body Aesthetics},
editor = {Sherri Irvin},
location = {Oxford},
pages = {37--59},
publisher = {Oxford University Press},
crossref = {irvin2016},
}
}
\end{filecontents}
\addbibresource{ref.bib}
\begin{document}
\textcite{eaton2016}
\printbibliography
\end{document}
答案1
你可以用它xpatch
来修补incollection
驱动程序。
\documentclass{article}
\usepackage[bibstyle=authoryear, citestyle=authoryear]{biblatex}
\usepackage{xpatch}
%deletes colon from in for collections
\renewcommand*{\intitlepunct}{%
\ifentrytype{incollection}
{\addspace}
{\addcolon\space}}
%deletes location from books
\AtEveryBibitem{\clearlist{location}}
\newbibmacro*{byeditor:in}{%
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\addspace\bibsentence%
\mkbibparens{\usebibmacro{editorstrg}}%
\clearname{editor}%
\printunit{\addcomma\space}}}
\xpatchbibdriver{incollection}{
\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
}{
\usebibmacro{in:}%
\usebibmacro{byeditor:in}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
}{}{}
\DeclareFieldFormat[incollection]{pages}{\mkbibparens{#1}}
\renewbibmacro*{chapter+pages}{%
\printfield{chapter}%
\setunit{\bibpagespunct}%
\printfield{eid}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\newunit}
\xpatchbibdriver{incollection}{
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
}{
\setunit{\addspace}
\printfield{pages}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
}{}{}
\begin{filecontents*}[overwrite]{ref.bib}
@InCollection{eaton2016,
author = {A. W. Eaton},
date = {2016},
title = {Taste in Bodies and Fat Oppression},
booktitle = {Body Aesthetics},
editor = {Sherri Irvin},
location = {Oxford},
pages = {37--59},
publisher = {Oxford University Press},
crossref = {irvin2016},
}
\end{filecontents*}
\addbibresource{ref.bib}
\begin{document}
\textcite{eaton2016}
\printbibliography
\end{document}
定义新的 bibmacro 的想法byeditor:in
借鉴了 moewes 的回答这里。
直接插入pages
via\printfield
和 above \setunit
(这会以某种方式覆盖标准\newunit\newblock
)是一种 hack。肯定有一种更优雅的方法来编辑,bibmacro
我现在没有时间去追踪。但对于你的情况,这似乎有效。