在参考文献列表、biblatex、authoryear bibstyle 中格式化编辑卷信息

在参考文献列表、biblatex、authoryear bibstyle 中格式化编辑卷信息

我正在为一家期刊格式化参考书目,该期刊坚持对标准样式进行许多愚蠢的更改,使用 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 的回答这里

直接插入pagesvia\printfield和 above \setunit(这会以某种方式覆盖标准\newunit\newblock)是一种 hack。肯定有一种更优雅的方法来编辑,bibmacro我现在没有时间去追踪。但对于你的情况,这似乎有效。

新参考

相关内容