biblatex: すべてのエディター情報を括弧で囲みます

biblatex: すべてのエディター情報を括弧で囲みます

biblatex を使用して、インコレクション参照内のすべてのエディター情報を括弧で囲みたいと思います。現在の参照は次のようになります。

Gotelli, NJ & Colwell, RK (2010)。種の豊富さの推定。生物多様性:測定と評価の最前線(編)Magurran, AE & McGill, BJ Oxford University Press、オックスフォード、イギリス、39–54。

ただし、この参照では、すべてのエディター情報が括弧で囲まれ、その後にピリオドが続くように表示したいと思います。

Gotelli, NJ & Colwell, RK (2010)。種の豊富さの推定。生物多様性:測定と評価の最前線(編者:Magurran, AE & McGill, BJ)。オックスフォード大学出版局、オックスフォード、イギリス、39–54。

現在の解決策は、\xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext[parens]}{}{} を使用することですが、この解決策ではエディターの略語が括弧内に置かれるだけです。

私のMWEは次のとおりです。

\documentclass[12pt,Bold]{report}

\usepackage[backend=bibtex,url=false, isbn=false, doi=false, style=authoryear,citestyle=authoryear, sorting=nyt,dashed=FALSE, maxcitenames=2, maxbibnames=100]{biblatex}
\usepackage{xpatch}
\usepackage{filecontents}


%Last names first in bibliography
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

%italics for book titles
\DeclareFieldFormat[incollection]{title}{#1}
\DeclareFieldFormat[incollection]{booktitle}{\textit{#1}}


\DeclareFieldFormat[article,incollection]{pages}{#1}

\renewbibmacro*{volume+number+eid}{%
 \printfield{volume}%
  %\setunit*{\adddot}% DELETED
%  \setunit*{\addcolon}% ADDED
 % \printfield{number}%
  %\setunit{\space}%
  \printfield{eid}}

\renewbibmacro*{name:andothers}{% Based on name:andothers from biblatex.def
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring[\emph]{andothers}}
    {}}
\renewcommand*{\finalnamedelim}{%
  \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \addspace\&\space}

%change order and punctuation between publisher and location
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \iflistundef{location}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcomma\space}}%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}


%change editor abbrevation
\DefineBibliographyStrings{english}{%
  byeditor = {\lowercase{ed}},%
  byeditor = {\lowercase{eds}},%
}

\xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext[parens]}{}{}

\begin{filecontents*}{editor.mwe.bib}

@incollection{magurran_estimating_2010,
    address = {Oxford, United Kingdom},
    title = {Estimating species richness},
    shorttitle = {Estimating species richness},
    booktitle = {Biological diversity: frontiers in measurement and     assessment},
publisher = {Oxford University Press},
author = {Gotelli, N.J. and Colwell, R.K.},
editor = {Magurran, A.E. and McGill, B.J.},
year = {2010},
pages = {39--54},
}


\end{filecontents*}
\addbibresource{editor.mwe.bib}

\begin{document}

\parencite{magurran_estimating_2010}

\printbibliography
\end{document}

数週間にわたって解決策を探していたので、どんな助けでも大歓迎です。

答え1

私は次のように再定義することを提案します

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\printtext[parens]{\usebibmacro{byeditor+othersstrg}%
     \setunit{\addspace}%
     \printnames[byeditor]{editor}}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}

\printtext[parens]エディターを印刷するブロックの周りに を追加しました。editoratranslatorsなども使用している場合は、いくつかの欠点がある可能性があります。

ムウェ

\documentclass{article}
\usepackage[backend=bibtex,url=false, isbn=false, doi=false, style=authoryear,citestyle=authoryear, sorting=nyt,dashed=FALSE, maxcitenames=2, maxbibnames=100]{biblatex}
\usepackage{xpatch}
\usepackage{filecontents}

%Last names first in bibliography
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

%italics for book titles
\DeclareFieldFormat[incollection]{title}{#1}
\DeclareFieldFormat[incollection]{booktitle}{\textit{#1}}


\DeclareFieldFormat[article,incollection]{pages}{#1}

\renewbibmacro*{volume+number+eid}{%
 \printfield{volume}%
  %\setunit*{\adddot}% DELETED
%  \setunit*{\addcolon}% ADDED
 % \printfield{number}%
  %\setunit{\space}%
  \printfield{eid}}

\renewbibmacro*{name:andothers}{% Based on name:andothers from biblatex.def
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring[\emph]{andothers}}
    {}}
\renewcommand*{\finalnamedelim}{%
  \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \addspace\&\space}

%change order and punctuation between publisher and location
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \iflistundef{location}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcomma\space}}%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}


%change editor abbrevation
\DefineBibliographyStrings{english}{%
  byeditor = {\lowercase{ed}},%
  byeditor = {\lowercase{eds}},%
}

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\printtext[parens]{\usebibmacro{byeditor+othersstrg}%
     \setunit{\addspace}%
     \printnames[byeditor]{editor}}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}


\begin{filecontents*}{\jobname.bib}

@incollection{magurran_estimating_2010,
    address = {Oxford, United Kingdom},
    title = {Estimating species richness},
    shorttitle = {Estimating species richness},
    booktitle = {Biological diversity: frontiers in measurement and     assessment},
publisher = {Oxford University Press},
author = {Gotelli, N.J. and Colwell, R.K.},
editor = {Magurran, A.E. and McGill, B.J.},
year = {2010},
pages = {39--54},
}


\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}

\parencite{magurran_estimating_2010}

\printbibliography
\end{document}

ここに画像の説明を入力してください

関連情報