biblatex: 모든 편집자 정보 주위에 괄호를 넣습니다.

biblatex: 모든 편집자 정보 주위에 괄호를 넣습니다.

나는 biblatex를 사용하여 컬렉션 참조의 모든 편집자 정보 주위에 괄호를 넣고 싶습니다. 내 현재 참조는 다음과 같이 나타납니다.

Gotelli, NJ 및 콜웰, RK(2010). 종 풍부도 추정. 안에:생물학적 다양성: 측정 및 평가의 최전선. (eds) Magurran, AE & McGill, BJ Oxford University Press, 옥스퍼드, 영국, 39–54.

그러나 나는 이 참조가 모든 편집자 정보를 괄호 안에 표시하고 마침표를 붙이고 싶습니다.

Gotelli, NJ 및 콜웰, 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]편집자를 인쇄하는 블록 주변에 추가했습니다 . editoras 또는 translators등이 있는 경우 몇 가지 단점이 있을 수 있습니다.

MWE

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

여기에 이미지 설명을 입력하세요

관련 정보