biblatex:如果有多个编辑者,则将“ed.”更改为“eds。”

biblatex:如果有多个编辑者,则将“ed.”更改为“eds。”

如果 biblatex 中 @inproceedings 有多个编辑者,我想将“ed.”改为“eds.”

以下是 MWE:

 \documentclass{article} 
 
 % required for \xpatchbibmacro
\usepackage{xpatch}
 
 \usepackage{csquotes}
 
 \usepackage[
backend=biber, 
defernumbers=true, 
style=numeric, 
autocite = superscript,
date=year, 
]
{biblatex}

% Some general changes for reference format
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\bibinitdelim}{}
\renewbibmacro*{in:}{%
    \iffieldequalstr{entrytype}{inproceedings}{%
        \printtext{\bibstring{in}\addspace}%
    }{}%
}


% Changes for Book
\csletcs{abx@macro@publisher+location+date@orig}{abx@macro@publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
    \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}


% Changes for inproceedings
\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\xpatchbibmacro{byeditor+others}{%
    \usebibmacro{byeditor+othersstrg}%
    \setunit{\addspace}%
    \printnames[byeditor]{editor}%
    \clearname{editor}%
}{%
    \printnames[byeditor]{editor}%
    \clearname{editor}
    \addcomma\addspace
    \bibstring{editor}
    \setunit{\addspace}%
}{}{}

\begin{filecontents}[force]{\jobname.bib}

@inproceedings{moraux,
  author       = {Moraux, Paul},
  editor       = {Lloyd, G. E. R. and Owen, G. E. L.},
  title        = {Le \emph{De Anima} dans la tradition gr{\`e}cque},
  date         = 1979,
  booktitle    = {Aristotle on Mind and the Senses},
  subtitle     = {Quelques aspects de l'interpretation du trait{\'e}, de
                  Theophraste {\`a} Themistius},
  booktitleaddon= {Proceedings of the Seventh Symposium Aristotelicum},
  eventdate    = 1975,
  publisher    = cup,
  location     = {Cambridge},
  pages        = {281-324},
  keywords     = {secondary},
  langid       = {french},
  indexsorttitle= {De Anima dans la tradition grecque},
  indextitle   = {\emph{De Anima} dans la tradition gr{\`e}cque, Le},
  shorttitle   = {\emph{De Anima} dans la tradition gr{\`e}cque},
  annotation   = {This is a typical \texttt{inproceedings} entry. Note the
                  \texttt{booksubtitle}, \texttt{shorttitle},
                  \texttt{indextitle}, and \texttt{indexsorttitle} fields. Also
                  note the \texttt{eventdate} field.},
}

@inproceedings{salam,
  author       = {Salam, Abdus},
  editor       = {Svartholm, Nils},
  title        = {Weak and Electromagnetic Interactions},
  date         = 1968,
  booktitle    = {Elementary particle theory},
  booksubtitle = {Relativistic groups and analyticity},
  booktitleaddon= {Proceedings of the {Eighth Nobel Symposium}},
  eventdate    = {1968-05-19/1968-05-25},
  venue        = {Aspen{\"a}sgarden, Lerum},
  publisher    = {Almquist \& Wiksell},
  location     = {Stockholm},
  pages        = {367-377},
}
    
\end{filecontents}


\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

输出如下:

在此处输入图片描述

我想将其更改G. E. R. Lloyd and G. E. L. Owen, ed.G. E. R. Lloyd and G. E. L. Owen, eds.,同时保持Nils Svartholm, ed.原样。

(如果可以同时改为幸福,但我明白这应该是一个单独的问题。Nils Svartholm, ed.N. Svartholm, ed.

非常感谢!

编辑

@moewe 提供的解决方案对于我提供的 MWE 来说无疑是成功的。

不幸的是,我的 MWE 太过简单(?supramimimal)并且省略了参考书目的一个重要方面,即bibstyle=authoryear

bibstyle=authoryear下面显示了结合@moewe 解决方案的新 MWE 及其引起的新问题。

\documentclass{article}
\usepackage{xpatch}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=numeric,
  bibstyle=authoryear,
  defernumbers=true,
  autocite = superscript,
  date=year,
]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\bibinitdelim}{}
\renewcommand*{\intitlepunct}{\addspace}
\renewbibmacro*{in:}{%
  \ifentrytype{inproceedings}
    {\bibstring{in}%
     \printunit{\intitlepunct}}
    {}%
}




\letbibmacro{publisher+location+date@orig}{publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
  \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}

\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\letbibmacro{byeditor+others}{editor+others} % gives double title

\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{moraux,salam,baez/article}
\printbibliography
\end{document}

相关输出为: 在此处输入图片描述

问题在于:

(1)@article 现在有两个标题和日期。我想保留Author (Date). Title等(不是第二次出现的Title (Date),

(2)在@article中,标题用引号括起来。

(3)在@inproceedings 中,编辑的名字用破折号代替。

(4)在@inproceedings中,ed.已成为Ed.,并且eds.已成为Eds.

谢谢你!

答案1

补丁byeditor+others仅包含显式\bibstring{editor},并且不检查是否有多个编辑器。这可以通过从editor+othersbibmacro 复制相关位来更改,但由于这只会复制byeditor+otherseditor+others我们可以直接使用\letbibmacro来复制。

\documentclass{article}
\usepackage{xpatch}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=numeric,
  defernumbers=true,
  autocite = superscript,
  date=year,
]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\bibinitdelim}{}
\renewcommand*{\intitlepunct}{\addspace}
\renewbibmacro*{in:}{%
  \ifentrytype{inproceedings}
    {\bibstring{in}%
     \printunit{\intitlepunct}}
    {}%
}

\letbibmacro{publisher+location+date@orig}{publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
  \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}

\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\letbibmacro{byeditor+others}{editor+others}

\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{moraux,salam}
\printbibliography
\end{document}

Paul Moraux。《论希腊传统中的灵魂》。《泰奥弗拉斯特对忒米斯提乌斯的性格解释的几个方面》。《亚里士多德论心灵与感官》,《第七届亚里士多德研讨会论文集》(1975 年)。GER Lloyd 和 GEL Owen 编(剑桥:剑桥大学出版社,1979 年),第 281-324 页。Abdus Salam。《弱相互作用与电磁相互作用》。《基本粒子理论。相对论群与解析性》,《第八届诺贝尔研讨会论文集》(Aspenäsgarden,Lerum,1968 年 5 月 19-25 日)。Nils Svartholm 编(斯德哥尔摩:Almquist & Wiksell,1968 年),第 367-377 页。


如果您使用authoryearauthortitle(或任何其他支持该dashed选项的样式)作为参考书目样式,则必须手动将的标准定义复制editor+others到中byeditor+others,因为这些样式会editor+others用实现破折号的定义覆盖,而我们不希望破折号出现在我们的条目中间。

\documentclass{article}
\usepackage{xpatch}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=authoryear,
  defernumbers=true,
  autocite = superscript,
  date=year,
]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\bibinitdelim}{}
\renewcommand*{\intitlepunct}{\addspace}
\renewbibmacro*{in:}{%
  \ifentrytype{inproceedings}
    {\bibstring{in}%
     \printunit{\intitlepunct}}
    {}%
}

\letbibmacro{publisher+location+date@orig}{publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
  \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}

\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\renewbibmacro*{byeditor+others}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\printdelim{editortypedelim}}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{moraux,salam}
\printbibliography
\end{document}

相关内容