Move names of editors followed by (Ed./Eds.) and a comma before title in biblatex
Shameless plug: The styles of the
biblatex-ext
bundle have a slightly more sophisticated version of this implemented as an option. Loadext-<standardstyle>
, e.g.ext-authoryear-comp
and set the optioninnamebeforetitle
totrue
.\documentclass[british]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \usepackage{csquotes} \usepackage[backend=biber, style=ext-authoryear, innamebeforetitle=true]{biblatex} \DeclareFieldFormat{editortype}{\mkbibparens{#1}} \DeclareDelimFormat{editortypedelim}{\addspace} \DeclareFieldAlias{translatortype}{editortype} \DeclareDelimAlias{translatortypedelim}{editortypedelim} \addbibresource{biblatex-examples.bib} \begin{document} \cite{sigfridsson,gaonkar:in,westfahl:space,vizedom:related} \printbibliography \end{document}
This is really where biblatex
is not that flexible.
We can use xpatch
to patch the drivers for @inbook
, @incollection
and @inproceedings
\xpatchbibdriver{inbook}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{byeditor:in}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{}{}
\xpatchbibdriver{incollection}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{byeditor:in}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor}}
{}{}
\xpatchbibdriver{inproceedings}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{byeditor:in}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{}{}
We also redefine byeditor:in
\newbibmacro*{byeditor:in}{%
\ifnameundef{editor}
{}
{\printnames[editorin]{editor}%
\addspace\bibsentence%
\mkbibparens{\usebibmacro{editorstrg}}%
\clearname{editor}%
\printunit{\addcomma\space}}}
and a new name format
\DeclareNameAlias{editorin}{first-last}
MWE
\documentclass{article}
\usepackage{xpatch}
\usepackage[style = authoryear-comp, maxnames = 99]{biblatex}
\renewcommand*{\finalnamedelim}{\addspace\&\space}
\renewcommand*{\intitlepunct}{\space}
\DeclareFieldFormat[article, incollection, unpublished]{pages}{#1}
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1}
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@incollection{lennon1965,
author = {John Lennon},
booktitle = {A book with articles},
editor = {Paul McCartney and John Lennon and George Harrison and Richard Starkey},
title = {This is my article in this book},
year = {1965},
location = {Liverpool},
pages = {65--87},
publisher = {Cavern Club},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\DeclareNameAlias{editorin}{first-last}
\newbibmacro*{byeditor:in}{%
\ifnameundef{editor}
{}
{\printnames[editorin]{editor}%
\addspace\bibsentence%
\mkbibparens{\usebibmacro{editorstrg}}%
\clearname{editor}%
\printunit{\addcomma\space}}}
\xpatchbibdriver{inbook}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{byeditor:in}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{}{}
\xpatchbibdriver{incollection}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{byeditor:in}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor}}
{}{}
\xpatchbibdriver{inproceedings}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{byeditor:in}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{}{}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Guidos way, or - without another package, but with a lot of more code lines - you can change the bibliography-driver for @incollection
from standard.bbx
, to display the data in your wanted order; change the byeditor+others
-macro from biblatex.def
to put parencites around the editor data; and change the editorstrg
from biblatex.def
to use the capitalized version \bibcpstring
instead of \bibstring
.
\documentclass{article}
\usepackage[style = authoryear-comp, maxnames = 99]{biblatex}
\renewcommand*{\finalnamedelim}{\addspace\&\space} % use '&' before last author in citations and bibliography
\renewcommand*{\intitlepunct}{\space} % remove colon after "In:" for articles in books
\DeclareFieldFormat[article, incollection, unpublished]{pages}{#1} % no word 'pages' for articles in the bibliography (print as is)
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1} % no quotes for article titles (print as is)
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}} % colon between volume and page ranges for journal articles, period plus space for articles in books
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{lennon1965,
AUTHOR = "John Lennon",
BOOKTITLE = "A book with articles",
EDITOR = "Paul McCartney and John Lennon and George Harrison and Richard Starkey",
TITLE = "This is my article in this book",
YEAR = "1965",
LOCATION = "Liverpool",
PAGES = "65--87",
PUBLISHER = "Cavern Club"}
\end{filecontents}
\addbibresource{\jobname.bib}
\renewbibmacro*{editorstrg}{%from biblatex.def
\printtext[editortype]{%
\iffieldundef{editortype}
{\ifboolexpr{
test {\ifnumgreater{\value{editor}}{1}}
or
test {\ifandothers{editor}}
}
{\bibcpstring{editors}}%changed
{\bibcpstring{editor}}}%changed
{\ifbibxstring{\thefield{editortype}}
{\ifboolexpr{
test {\ifnumgreater{\value{editor}}{1}}
or
test {\ifandothers{editor}}
}
{\bibcpstring{\thefield{editortype}s}}%changed
{\bibcpstring{\thefield{editortype}}}}%changed
{\thefield{editortype}}}}}
\renewbibmacro*{byeditor+others}{%from biblatex.def
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\addspace%added
\mkbibparens{\usebibmacro{editorstrg}}%added
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\DeclareBibliographyDriver{incollection}{%from standard.bbx
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%changed
\usebibmacro{byeditor+others}%changed
\setunit{\addcomma\addspace}\newblock%changed
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Output:
EDIT fixed the issue of multi-volume (with maintitle
) and single editor.
A possibility is to abuse the biblatex in:
macro to to format and print the information as desired.
\xpatchbibmacro{editorstrg}{\bibstring}{\bibcpstring}{}{}
\xpatchbibmacro{editorstrg}{\bibstring}{\bibcpstring}{}{}
\renewbibmacro*{in:}{
\ifentrytype{incollection}{%
\DeclareNameAlias{editor}{first-last}
\printtext{In}
\ifnameundef{editor}
{}
{\printnames{editor}%
\addspace
\mkbibparens{\usebibmacro{editorstrg}}
\setunit{\addcomma\addspace}%
}%
\usebibmacro{maintitle+booktitle}
\clearfield{maintitle}
\clearfield{booktitle}
\clearfield{volume}
\clearfield{part}
\clearname{editor}
}
{}%
}
In this case the "simple" in:
contains the directives to print the editors and the book title.
The tricks are: (1) use a guard, \ifentrytype{incollection}
, to restrict the modification to the specific entrytype; (2) delete the content of the fields booktitle
and editor
, thus they are no longer a available in the rest of directive in the driver for incollection
, and (3) define a new directive to switch last name and first name for the editors: this can be specifying that editor
is an "alias" for the predefined name format first-last
, i.e., \DeclareNameAlias{editor}{first-last}
.
Notice that the excellent and convenient xpatch
package (i.e., include \usepackage{xpatch}
) is used to modify how the biblatex string editor(s) is printed. Notice that we need to patch it twice one: the first for the plural version, and the second for the singular case (only one editor).
Here is the outcome: