0

I am using the MWE from Move names of editors followed by (Ed./Eds.) and a comma before title in biblatex where I need to cite a book chapter in an edited book.

From:

Author A, Author B, and Author C

to:

Author A, Author B and Author C

I tried:

\setunit{\addcomma\space}%

Basically, from:

enter image description here

to

enter image description here

My full MWE:

\documentclass{article}
\usepackage{xpatch}
% \usepackage[style = authoryear-comp, maxnames = 99]{biblatex}

\usepackage[backend=biber, 
% style=authoryear, 
 style=authoryear-comp,
% citestyle=authoryear, 
dashed=false,
maxcitenames=2,
maxbibnames=99,
giveninits,
uniquename=init]{biblatex}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{csquotes}

\usepackage[unicode,colorlinks,citecolor=blue]{hyperref}

% \renewcommand*{\finalnamedelim}{\addspace\&\space}
% \renewcommand*{\intitlepunct}{\space}
\renewcommand{\labelnamepunct}{\space}


% \DeclareFieldFormat[article, incollection, unpublished]{pages}{#1}
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1}
% \renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}}

\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{editorin}{given-family}

\newbibmacro*{byeditor:in}{%
  \ifnameundef{editor}
    {}
    {\printnames[editorin]{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{editorstrg}%
     \clearname{editor}}}

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



\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},
}
@incollection{deborah123,
  author      = "Deborah Lewis and Marie O'Boyle-Duggan and Susan Poultney",
  title       = "Communication skills education and training in pre-registeration BSc Nursing",
  editor      = "David W. Kissane and Barry D. Bultz and Phyllis N. Butow and Carma L. Bylund and Simon Noble and Susie Wilkinson",
  booktitle   = "Oxford Textbook of Communication in Oncology and Palliative Care",
  publisher   = "Oxford University Press",
  address     = "Oxford",
  year        = 2017,
  pages       = "149-154",
  Edition = "2nd edn"
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
book done \parencite{deborah123}.

\printbibliography
\end{document}
aan
  • 2,663
  • 1
    See https://tex.stackexchange.com/q/415938/35864 (there are two answers I have a strong preference for one of the two, but I'll leave it for you to figure out which answer), same with https://tex.stackexchange.com/q/168591/35864. See also https://tex.stackexchange.com/q/443796/35864 – moewe Sep 20 '19 at 16:15
  • @Moewe, thanks for all the link. How you manage to find all this link (related questions)? Between, I had tried both methods. Adding \DeclareDelimFormat{finalnamedelim}{\addspace\bibstring{and}\space} will give Package biblatex Warning: Delimiter 'finalnamedelim' in ontext" already defined. However, I only have one finalnamedelim. Second method, added in \DefineBibliographyExtras{english}{% \let\finalandcomma\empty \let\finalandsemicolon\empty } working completely fine. Hope it will not create anymore changing in others citing – aan Sep 20 '19 at 16:26
  • The warning you get from \DeclareDelimFormat is benign and can be ignored, newer versions of biblatex do not produce this warning any more. But still I prefer the other solution, where \finalandcomma is redefined in \DefineBibliographyExtras. – moewe Sep 21 '19 at 05:19

0 Answers0