3

EDIT: I've revised this to be a single Q&A following @moewe's advice.

In my bibliography how do I get the "editor" field to be abbreviated, written in lowercase, and in parentheses? I need it to be like so:

(ed. by A. Poole).

rather than like

Ed. by A. Poole

MWE:

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

This results with the following bibliography items:

Johnson, R.E., Hendricks, P., Pattie, D.L. & Hunter, K.B. (2000) Brown-capped rosy-finch (Leucosticte australis). The birds of North America online. Ed. by A. Poole. Ithaca, NY: Cornell Lab of Ornithology. Available at: http://bna.birds.cornell.edu/bna/species/536.

I would like the items to be like this:

Johnson, R.E., Hendricks, P., Pattie, D.L. & Hunter, K.B. (2000) Brown-capped rosy-finch (Leucosticte australis). The birds of North America online (ed. by A. Poole). Ithaca, NY: Cornell Lab of Ornithology. Available at: http://bna.birds.cornell.edu/bna/species/536.

Edward
  • 329
  • 2
  • 5
  • 14
  • Please, please only ask one question at a time. Many parts of your question have been answered elsewhere on this site. Also please make your MWE truly minimal. The caption, geometry packages etc. have no bearing on the bibliography. (And make sure the code uses proper mark-up, it looks somewhat torn apart now.) – moewe Aug 13 '15 at 18:26
  • 1
    For (Cite 1) ad 1 see biblatex: Putting thin spaces between initials: \renewrobustcmd*{\bibinitdelim}{}. ad 2: Suppress “In:” biblatex. For 3 I cannot find a duplicate immediately: You could extract this question as fitted for the Q&A format and ask it separately. Ad 4 can be taken care of like Changing predefined words in a biblatex bibliography. Ad 5 is certainly possible (maybe slightly ugly), cannot find a duplicate now you could extract that one, too – moewe Aug 13 '15 at 18:33
  • 1
    For cite 2, ad 1 should be possible modifying the url+urldate macro, could be combined into a new question with ad 5 of cite 1 (both are URL-related). Ad 2 somehow contradicts ad 4 in cite 1. How do you propose to distinguish when to say what? – moewe Aug 13 '15 at 18:36
  • 1
    Note that you should not say addendum = {(accessed 01 September 2013)},, but give the access date in the urldate field like urldate = {2013-09-01}, biblatex will take care of all the formatting necessary (after you nudge it a bit). Also the first name initials in the .bib file would normally contain a full stop to signify we deal with initials here Editor = {Poole, A.}, (though you might dispute that that is necessary). Address = {Cornell Lab of Ornithology, Ithaca, NY}, seems a bit fishy, maybe publisher = {Cornell Lab of Ornithology}, location ={Ithaca, NY}, is better. – moewe Aug 13 '15 at 18:43
  • @moewe, I've changed my question and incorporated many of your answers. – Edward Aug 13 '15 at 20:32
  • 1
    Thank you very much! Now the question can be properly answered, and you even got a nice answer to the other question already. – moewe Aug 14 '15 at 04:51

2 Answers2

4

The following should do what you want. We just need to tweak the macro byeditor+others a bit to include parentheses if necessary. Fortunately, \setunit and \printunit can be used to get this.

\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

MWE

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

enter image description here

moewe
  • 175,683
  • 1
    I appreciate that you marked where you inserted the parentheses. Your example is helpful for learning how the code works! – Edward Aug 14 '15 at 14:32
0

I would just modify one thing in the previous answer, but it requires some explanation so I cannot just edit Moewe's post, which futhermore is perfect relatively to the biblatex options specified in the original post.

This is for compatibility with ext-authoryear's innamebeforetitle option, for those who still want (ed(s). by) for journal editors, especially if you don't like the in before journal title (articlein option set to false).

The problem is that the manually added closing parenthese may appear as a nuisance in case the editor is defined but has already been printed.

Consider the following 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}

Now look at the result (I've circled in red the parasitic closing parenthese):

enter image description here

My humble contribution is only to suggest we had better use \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}

Which gives the following result:

enter image description here

Now we can check that everything will remain fine with the original settings:


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

The result:

enter image description here

As we can see, everything is fine.