biblatex: поместите скобки вокруг всей информации о редакторе

biblatex: поместите скобки вокруг всей информации о редакторе

Я хотел бы поместить скобки вокруг всей информации редактора в ссылку incollection с помощью biblatex. Моя текущая ссылка выглядит следующим образом:

Готелли, Н. Дж. и Колвелл, Р. К. (2010). Оценка видового богатства. В:Биологическое разнообразие: границы измерения и оценки. (ред.) Магурран, А.Е. и Макгилл, Б.Дж. Издательство Оксфордского университета, Оксфорд, Соединенное Королевство, 39–54.

Однако я бы хотел, чтобы эта ссылка отображалась со всей информацией о редакторе в скобках, за которой следует точка:

Готелли, Н. Дж. и Колвелл, Р. К. (2010). Оценка видового богатства. В:Биологическое разнообразие: границы измерения и оценки. (редакторы Мэгерран, А.Е. и Макгилл, Б.Дж.). Oxford University Press, Оксфорд, Соединенное Королевство, 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]вокруг блока печати редакторов. Могут быть некоторые недостатки, если у вас также есть editoras или translatorsи т. д.

МВЭ

\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}

введите описание изображения здесь

Связанный контент