0

I am using the MWE from enter link description here where I need to cite a book chapter in an edited book

I need to change from:

(Eds.)

to

eds.

I had checked:

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

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

@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}
\DeclareNameAlias{sortname}{family-given}


\DeclareNameAlias{editorin}{last-first}

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


book done \parencite{deborah123}.

\printbibliography

\end{document}
aan
  • 2,663

1 Answers1

2

Future readers of this question, please note that biblatex-ext offers an easier solution to moving around names that does not involve having to patch entry drivers. See the already linked Move names of editors followed by (Ed./Eds.) and a comma before title in biblatex.

The parentheses are added (quite clumsily, I must admit) in the bibmacro byeditor:in. A slightly better definition that also does what you want would be

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

In total

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

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

Lewis, D., O’Boyle-Duggan, M. & Poultney, S. (2017). Communication skills education and training in pre-registeration BSc Nursing. In Kissane, D. W., Bultz, B. D., Butow, P. N., Bylund, C. L., Noble, S. & Wilkinson, S., eds. Oxford Textbook of Communication in Oncology and Palliative Care. 2nd edn. Oxford: Oxford University Press. 149–154.

moewe
  • 175,683
  • thanks. I am just curious. Where is the place to change eds? Is it a built-in for editorstrg? – aan Sep 20 '19 at 13:53
  • 1
    @aan The strings are defined in english.lbx, you can change them with \DefineBibliographyStrings{english}{ editor = {blub}, editors = {blab}, }. The bibmacro editorstrg just prints these bibstrings, you can find its definition in biblatex.def. – moewe Sep 20 '19 at 14:00
  • thanks. Where is the file english.lbx located? – aan Sep 20 '19 at 14:01
  • 1
    @aan You can find its location on your PC if you type kpsewhich english.lbx in the command line. It should be in $TEXMF/tex/latex/biblatex/lbx, you can find the file online at https://github.com/plk/biblatex/blob/master/tex/latex/biblatex/lbx/english.lbx – moewe Sep 20 '19 at 14:05
  • thanks. if I am using Overleaf, is that the file store in my PC too? – aan Sep 20 '19 at 14:07
  • 1
    @aan If you are only using Overleaf without a local TeX installation, then you won't have english.lbx on your machine at all. Everything will be compiled on Overleaf's system. In that case just browse the files at https://github.com/plk/biblatex/blob/master/tex/latex/biblatex/lbx/english.lbx if you are interested. But I urge everyone who seriously wants to learn about (La)TeX to also install a full TeX system locally instead of relying on a cloud-based web service. It is much easier to see some details and things like this on a local system that is fully under your control. – moewe Sep 20 '19 at 14:09
  • thanks for your suggestion. What tools do you use to run a full TeX for windows? – aan Sep 20 '19 at 14:10
  • 1
    @aan The two big TeX systems for Windows are TeX live and MikTeX. They both have their pros and cons, I suggest you browse this site to find out which system is the better fit for you. – moewe Sep 20 '19 at 14:12