如何使用 Biblatex 更改参考书目中的编辑器字段?

如何使用 Biblatex 更改参考书目中的编辑器字段?

编辑:我根据@moewe 的建议将其修改为单独的问答。

在我的参考书目中,如何将“编辑”字段缩写、小写并放在括号中?我需要它像这样:

(A. Poole 编辑)。

而不是喜欢

编辑:A. Poole

梅威瑟:

\documentclass[twocolumn]{article}
\usepackage[style=authoryear,maxcitenames = 2,mincitenames = 1,maxbibnames = 99,minbibnames = 1,dashed = false,firstinits=true,backend=biber]{biblatex}  
% !BIB TS-program = biber     
%^ line above is necessary to tell TeXShop to use Biblatex rathern than traditional BibTex.
\usepackage[utf8]{inputenc}    % utf8 support       
\usepackage[T1]{fontenc}       % code for pdf file  % w/out these two lines, I get the warning, "WARN - The entry '_______' has characters which cannot be encoded in 'ascii'. Recoding problematic characters into macros.

\usepackage{filecontents}
\begin{filecontents}{Test.bib}
@incollection{johnson2000brown,
Location = {Ithaca, NY},                                 % Edit (Changed)
Publisher = {Cornell Lab of Ornithology},                % Edit (Changed)
Author = {Johnson, Richard E. and Hendricks, P. and Pattie, D. L. and Hunter, K. B.},
Editor = {Poole, A.},
Booktitle = {The birds of North America online},
Title = {Brown-capped rosy-finch (\textit{{Leucosticte} australis})},
url = {http://bna.birds.cornell.edu/bna/species/536},
Year = {2000}} 
\end{filecontents}
\addbibresource{Test.bib}

%% ===== Diversity and Distributions Bibliography Style===================
% Remove space between First and Middle Initials.  % Added
\renewrobustcmd*{\bibinitdelim}{\,}
% Remove the "In" prior to item.                   % Added
\renewbibmacro{in:}{}     
% Have "Available at:" written prior to URL and "accessed" date written (for other citations not in this particular example).       % Added
\DefineBibliographyStrings{english}{%          
urlseen = {accessed}
}
\DefineBibliographyStrings{english}{%
urlseen = {accessed},
url = {Available at:}
}
\DeclareFieldFormat{url}{\bibstring{url}\space\url{#1}}



%Remove any punctuation after the Year in parentheses.
\renewcommand{\labelnamepunct}{\addspace}

% Add comma after journal title
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1\addcomma}}

% Always get last name in bibliography prior to first name being printed.
\DeclareNameAlias{sortname}{last-first} 

% Changes "and" to "&" in Bibliography.
\renewcommand*{\finalnamedelim}{\addspace\&\space} 

% Removes quotations around the following titles.        
\DeclareFieldFormat[article,book,collection,incollection,manual,
misc,periodical,proceedings,report,thesis,software,unpublished]
{title}{#1} 

% removes pages abbreviation (pp)
\DeclareFieldFormat[article,incollection]{pages}{#1}

% bolds journal volume   --> http://tex.stackexchange.com/questions/153597/customizing-bibliography-with-biblatex
\DeclareFieldFormat  
[article]
{volume}{\textbf{#1}}  

% Prevent Italics for booktitle in these data types 
\DeclareFieldFormat
[article,book,manual,misc,software,unpublished]
{booktitle}{#1}

% removes number of article issue from bibliography ---> http://tex.stackexchange.com/questions/32930/is-it-possible-to-suppress-a-specific-field-from-bibtex-bbl-in-biblatex    
\AtEveryBibitem{\clearfield{number}} 

%% =================================================
\begin{document}

Test cite \parencite{johnson2000brown}.

\nocite{*}
\printbibliography

\end{document} 

结果有以下书目项目:

Johnson, RE, Hendricks, P., Pattie, DL & Hunter, KB (2000) 棕顶玫瑰雀 (澳洲白点藻)。北美鸟类在线。A. Poole 编。纽约州伊萨卡:康奈尔鸟类学实验室。可从以下网址获取:http://bna.birds.cornell.edu/bna/species/536

我希望项目是这样的:

Johnson, RE, Hendricks, P., Pattie, DL & Hunter, KB (2000) 棕顶玫瑰雀 (澳洲白点藻)。北美鸟类在线(A. Poole 编)。纽约州伊萨卡:康奈尔鸟类学实验室。可从以下网址获取: http://bna.birds.cornell.edu/bna/species/536

答案1

byeditor+others下面的代码应该可以满足您的要求。我们只需要稍微调整一下宏,在必要时添加括号。幸运的是,\setunit\printunit可以用来实现这一点。

\renewbibmacro*{byeditor+others}{%
  \setunit{\space(}% <---- this is new ...
  \ifnameundef{editor}
    {}
    {\usebibmacro{byeditor+othersstrg}%
     \setunit{\addspace}%
     \printnames[byeditor]{editor}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}%
  \printunit*{)\newunitpunct}}% <---- and this

平均能量损失

\documentclass{article}
\usepackage[style=authoryear,maxcitenames = 2,mincitenames = 1,maxbibnames = 99,minbibnames = 1,dashed = false,firstinits=true,backend=biber]{biblatex}  
% !BIB TS-program = biber     
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@incollection{johnson2000brown,
Location = {Ithaca, NY},                                 % Edit (Changed)
Publisher = {Cornell Lab of Ornithology},                % Edit (Changed)
Author = {Johnson, Richard E. and Hendricks, P. and Pattie, D. L. and Hunter, K. B.},
Editor = {Poole, A.},
Booktitle = {The birds of North America online},
Title = {Brown-capped rosy-finch (\textit{{Leucosticte} australis})},
url = {http://bna.birds.cornell.edu/bna/species/536},
Year = {2000}} 

@incollection{johnson2000brown1,
Location = {Ithaca, NY},                                 % Edit (Changed)
Publisher = {Cornell Lab of Ornithology},                % Edit (Changed)
Author = {Johnson, Richard E. and Hendricks, P. and Pattie, D. L. and Hunter, K. B.},
Booktitle = {The birds of North America online},
Title = {Brown-capped rosy-finch (\textit{{Leucosticte} australis})},
url = {http://bna.birds.cornell.edu/bna/species/536},
Year = {2000}} 

@incollection{johnson2000brown2,
translator = {Poole, A.},
Location = {Ithaca, NY},                                 % Edit (Changed)
Publisher = {Cornell Lab of Ornithology},                % Edit (Changed)
Author = {Johnson, Richard E. and Hendricks, P. and Pattie, D. L. and Hunter, K. B.},
Booktitle = {The birds of North America online},
Title = {Brown-capped rosy-finch (\textit{{Leucosticte} australis})},
url = {http://bna.birds.cornell.edu/bna/species/536},
Year = {2000}} 
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\renewrobustcmd*{\bibinitdelim}{\,}
\renewbibmacro{in:}{}     
\DefineBibliographyStrings{english}{%          
urlseen = {accessed}
}
\DefineBibliographyStrings{english}{%
urlseen = {accessed},
url = {Available at:}
}
\DeclareFieldFormat{url}{\bibstring{url}\space\url{#1}}

\renewcommand{\labelnamepunct}{\addspace}

\DeclareFieldFormat{journaltitle}{\mkbibemph{#1\addcomma}}

\DeclareNameAlias{sortname}{last-first} 

\renewcommand*{\finalnamedelim}{\addspace\&\space} 

\DeclareFieldFormat[article,book,collection,incollection,manual,
misc,periodical,proceedings,report,thesis,software,unpublished]
{title}{#1} 

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

\DeclareFieldFormat  
[article]
{volume}{\textbf{#1}}  

\DeclareFieldFormat
[article,book,manual,misc,software,unpublished]
{booktitle}{#1}

\AtEveryBibitem{\clearfield{number}} 


\renewbibmacro*{byeditor+others}{%
  \setunit{\space(}%
  \ifnameundef{editor}
    {}
    {\usebibmacro{byeditor+othersstrg}%
     \setunit{\addspace}%
     \printnames[byeditor]{editor}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}%
  \printunit*{)\newunitpunct}}

\begin{document}
Test cite \parencite{johnson2000brown,johnson2000brown1,johnson2000brown2}.

\printbibliography
\end{document} 

在此处输入图片描述

答案2

我只想修改前一个答案中的一件事,但它需要一些解释,所以我不能只编辑 Moewe 的帖子,而且相对于biblatex原始帖子中指定的选项来说是完美的。

这是为了与ext-authoryearinnamebeforetitle选项兼容,对于那些仍然想要(编辑)对于期刊编辑来说,特别是如果你不喜欢期刊名称之前articlein选项设置为错误的)。

问题是,如果编辑器已定义但已被打印,则手动添加的右括号可能会显得麻烦。

考虑以下 MWE:


\documentclass{article}

\usepackage[backend=biber,style=ext-authoryear,innamebeforetitle=true,articlein=false,natbib=true]{biblatex} % "ext-authoryear" features the convenient "innamebeforetitle" option

\nocite{*}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}} % (ed(s).)
\DeclareDelimFormat{editortypedelim}{\addspace} % No comma before (ed.)
\DeclareDelimFormat[bib,biblist]{innametitledelim}{\addcomma\space} % Comma after Editor Name(s).


     \begin{filecontents*}{biblio.bib}
    @incollection{johnson2000brown,
     Location = {Ithaca, NY},                                
     Publisher = {Cornell Lab of Ornithology},               
     Author = {Johnson, Richard E. and Hendricks, P. and Pattie, D. L. and Hunter, K. B.},
     Editor = {Poole, A.},
     Booktitle = {The birds of North America online},
     Title = {Brown-capped rosy-finch (\textit{{Leucosticte} australis})},
     url = {http://bna.birds.cornell.edu/bna/species/536},
     Year = {2000}}
    
    @inproceedings{VILDES,
     Author    = {Villoing, Florence and Desmets, Marianne},
     Booktitle = {Proceedings of the 16th International Conference on Head-Driven Phrase Structure Grammar},
     Date      = {2009},
     Title     = {French {VN} Lexemes: Morphological Compounding in {HPSG}},
     Editor    = {Müller, Stefan},
     Location  = {Stanford},
     Publisher = {CSLI},
     Pages = {89--109},
     Venue     = {Georg-August-Universität, Göttingen}}
      
    @Article{RAPLEV92,
     Author       = {Rappaport Hovav, Malka and Levin, Beth},
     Year         = {1992},
     Journaltitle = {Syntax and Semantics},
     Title        = {\textit{-er} Nominals: Implications for the Theory of Argument Structure},
     Editor       = {Stowell, Tim and Wehrli, Eric},
     Issuetitle   = {Syntax and the Lexicon},
     Pages        = {127--153},
     Volume       = {26}}
    \end{filecontents*}
 \addbibresource{biblio.bib}
  
  
   \renewbibmacro*{byeditor+others}{%
        \setunit{\space(}%
        \ifnameundef{editor}
          {}
          {\usebibmacro{byeditor+othersstrg}%
           \setunit{\addspace}%
           \printnames[byeditor]{editor}%
           \clearname{editor}%
           \newunit}%
        \usebibmacro{byeditorx}%
        \usebibmacro{bytranslator+others}%
        \printunit*{)\newunitpunct}}%


\begin{document}

\printbibliography

\end{document}

现在看看结果(我用红色圈出了寄生的右括号):

在此处输入图片描述

我的卑微​​贡献只是建议我们最好使用\printtext[parens]{}


\documentclass{article}

\usepackage[backend=biber,style=ext-authoryear,innamebeforetitle=true,articlein=false,natbib=true]{biblatex}
\nocite{*}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}} % (ed(s).)
\DeclareDelimFormat{editortypedelim}{\addspace} % No comma before (ed.)
\DeclareDelimFormat[bib,biblist]{innametitledelim}{\addcomma\space} % Comma after Editor Name(s).


    \begin{filecontents*}{biblio.bib}
    @incollection{johnson2000brown,
     Location = {Ithaca, NY},                                
     Publisher = {Cornell Lab of Ornithology},               
     Author = {Johnson, Richard E. and Hendricks, P. and Pattie, D. L. and Hunter, K. B.},
     Editor = {Poole, A.},
     Booktitle = {The birds of North America online},
     Title = {Brown-capped rosy-finch (\textit{{Leucosticte} australis})},
     url = {http://bna.birds.cornell.edu/bna/species/536},
     Year = {2000}}
    
    @inproceedings{VILDES,
     Author    = {Villoing, Florence and Desmets, Marianne},
     Booktitle = {Proceedings of the 16th International Conference on Head-Driven Phrase Structure Grammar},
     Date      = {2009},
     Title     = {French {VN} Lexemes: Morphological Compounding in {HPSG}},
     Editor    = {Müller, Stefan},
     Location  = {Stanford},
     Publisher = {CSLI},
     Pages = {89--109},
     Venue     = {Georg-August-Universität, Göttingen}}
      
    @Article{RAPLEV92,
     Author       = {Rappaport Hovav, Malka and Levin, Beth},
     Year         = {1992},
     Journaltitle = {Syntax and Semantics},
     Title        = {\textit{-er} Nominals: Implications for the Theory of Argument Structure},
     Editor       = {Stowell, Tim and Wehrli, Eric},
     Issuetitle   = {Syntax and the Lexicon},
     Pages        = {127--153},
     Volume       = {26}}
    \end{filecontents*}
 \addbibresource{biblio.bib}

  
   \renewbibmacro*{byeditor+others}{%
      \setunit{\space}%  I have removed the opening parenthese.
      \ifnameundef{editor}
          {}
          {\printtext[parens] % This is for enclosing the desired string between parentheses.
             {\usebibmacro{byeditor+othersstrg}%
                \setunit{\addspace}%
                \printnames[byeditor]{editor}%
                \clearname{editor}%
                \newunit}%
              \usebibmacro{byeditorx}} % Closing curly bracket must be put here, not above, or only “ed. by” will be enclosed.
           \usebibmacro{bytranslator+others}%
           \newunitpunct} % Now, \newunit is removed, and no parasitic parenthese is printed.


\begin{document}

\printbibliography

\end{document}


结果如下:

在此处输入图片描述

现在我们可以检查一下原始设置是否一切正常:


\documentclass{article}

\usepackage[backend=biber,style=authoryear,natbib=true]{biblatex}

\nocite{*}

    \begin{filecontents*}{biblio.bib}
    @incollection{johnson2000brown,
     Location = {Ithaca, NY},                                
     Publisher = {Cornell Lab of Ornithology},               
     Author = {Johnson, Richard E. and Hendricks, P. and Pattie, D. L. and Hunter, K. B.},
     Editor = {Poole, A.},
     Booktitle = {The birds of North America online},
     Title = {Brown-capped rosy-finch (\textit{{Leucosticte} australis})},
     url = {http://bna.birds.cornell.edu/bna/species/536},
     Year = {2000}}
    
    @inproceedings{VILDES,
     Author    = {Villoing, Florence and Desmets, Marianne},
     Booktitle = {Proceedings of the 16th International Conference on Head-Driven Phrase Structure Grammar},
     Date      = {2009},
     Title     = {French {VN} Lexemes: Morphological Compounding in {HPSG}},
     Editor    = {Müller, Stefan},
     Location  = {Stanford},
     Publisher = {CSLI},
     Pages = {89--109},
     Venue     = {Georg-August-Universität, Göttingen}}
      
    @Article{RAPLEV92,
     Author       = {Rappaport Hovav, Malka and Levin, Beth},
     Year         = {1992},
     Journaltitle = {Syntax and Semantics},
     Title        = {\textit{-er} Nominals: Implications for the Theory of Argument Structure},
     Editor       = {Stowell, Tim and Wehrli, Eric},
     Issuetitle   = {Syntax and the Lexicon},
     Pages        = {127--153},
     Volume       = {26}}
    \end{filecontents*}
 \addbibresource{biblio.bib}

  
    \renewbibmacro*{byeditor+others}{%
      \setunit{\space}%  I have removed the opening parenthese.
      \ifnameundef{editor}
          {}
          {\printtext[parens] % This is for enclosing the desired string between parentheses.
             {\usebibmacro{byeditor+othersstrg}%
                \setunit{\addspace}%
                \printnames[byeditor]{editor}%
                \clearname{editor}%
                \newunit}%
              \usebibmacro{byeditorx}} % Closing curly bracket must be put here, not above, or only “ed. by” will be enclosed.
           \usebibmacro{bytranslator+others}%
           \newunitpunct} % Now, \newunit is removed, and no parasitic parenthese is printed.


\begin{document}

\printbibliography

\end{document}

结果:

在此处输入图片描述

我们可以看到,一切正常。

相关内容