0

Enter a comma between "Amsterdam" and "pp. 1423-1470"

As can be seen there is a comma missing between "Amsterdam" and "pp. 1423-..."

How can I add a comma in this place? The problem does not occur when using @article, only with @incollection.

@incollection{Slemrod.2002,
 author = {Slemrod, Joel and Yitzhaki, Shlomo},
 title = {Tax Avoidance, Evasion, and Administration},
 urldate = {22.06.2020},
 pages = {1423--1470},
 volume = {3},
 publisher = {{Elsevier/North Holland}},
 isbn = {9780444823144},
 series = {Handbooks in economics},
 editor = {Auerbach, Alan J. and Feldstein, M.},
 booktitle = {Handbook of public economics},
 year = {2002},
 address = {Amsterdam}
}

@book{Auerbach.2002,
 year = {2002},
 title = {Handbook of public economics: Volume 3},
 url = {https://www.elsevier.com/books/handbook-of-public-economics/feldstein/978-0-444-82314-4},
 address = {Amsterdam},
 urldate = {22.06.2020},
 edition = {1},
 volume = {3},
 publisher = {{Elsevier/North Holland}},
 isbn = {9780444823144},
 series = {Handbooks in economics},
 editor = {Auerbach, Alan J. and Feldstein, M.},
 file = {http://lib.myilibrary.com/detail.asp?id=501359},
 file = {http://www.sciencedirect.com/science/handbooks/15734420/5}
}

Thank you for any help!

Here is what I am doing so far:

\usepackage[style=authoryear, backend=bibtex, natbib=true, giveninits=true, isbn=false, doi=true, url=false, eprint=false, dashed=false, maxbibnames=99, maxcitenames=2]{biblatex}
\DeclareDelimFormat[cite,parencite,footcite]{finalnamedelim}{\space\&\space}

\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article]{title}{#1} 
\DeclareFieldFormat[article]{journaltitle}{#1}
\DeclareFieldFormat[book]{title}{#1} 

\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

\DeclareFieldFormat[incollection]{citetitle}{#1\midsentence}
\DeclareFieldFormat[incollection]{title}{#1\midsentence}
\DeclareFieldFormat[incollection]{title}{#1}

\DeclareNameAlias[collection]{author}{last-first}
\DeclareNameAlias[collection]{editor}{last-first}
\DeclareNameAlias[incollection]{editor}{last-first}

% Put editor string in parentheses
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}

% Like editor+others but without comma before editor string and dash checks
\newbibmacro*{ineditor+others}{%
  \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}} }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}

% Print editors before "in" title
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}%
  \usebibmacro{ineditor+others}%
  \newunit
  \clearname{editor}}

%Capitalize Editor
\DefineBibliographyStrings{english}{editor={Ed.}, editors={Eds.}}

% let "publisher" and "location" change place
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \iflistundef{location}
    {\setunit{\addcomma\space}}
    {\setunit*{\addcomma\space}}%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}
  
%Comma before page numbers collections

  

%Collection  Titel Non-Kursiv
\DeclareFieldFormat{booktitle}{#1\isdot}

%DOI in neue Zeile (unsicher ob Bedarf)
\newbibmacro*{bbx:parunit}{%
  \ifbibliography
    {\setunit{\bibpagerefpunct}\newblock
     \usebibmacro{pageref}%
     \clearlist{pageref}%
     \setunit{\adddot\par\nobreak}}
    {}}

\renewbibmacro*{doi+eprint+url}{%
  \usebibmacro{bbx:parunit}% Added
  \iftoggle{bbx:doi}
    {\printfield{doi}}
    {}%
  \iftoggle{bbx:eprint}
    {\usebibmacro{eprint}}
    {}%
  \iftoggle{bbx:url}
    {\usebibmacro{url+urldate}}
    {}}

\renewbibmacro*{eprint}{%
  \usebibmacro{bbx:parunit}% Added
  \iffieldundef{eprinttype}
    {\printfield{eprint}}
    {\printfield[eprint:\strfield{eprinttype}]{eprint}}}

\renewbibmacro*{url+urldate}{%
  \usebibmacro{bbx:parunit}% Added
  \printfield{url}%
  \iffieldundef{urlyear}
    {}
    {\setunit*{\addspace}%
     \printtext[urldate]{\printurldate}}}


%--> xpatch to implement journal volume, number and page setting <--

\xpatchbibmacro{journal+issuetitle}{%
  \setunit*{\addspace}%
  \iffieldundef{series}}
  {%
  \setunit*{\space}%
  \iffieldundef{series}}{}{}

%--> xpatch to change year setting from (year) to , year for all classes <--
\xpatchbibmacro{date+extradate}{%
  \printtext[parens]%
}{%
  \setunit{\addcomma\space}%
  \printtext%
}{}{}




\addbibresource{Literatur.bib}

\renewcommand\bibpagespunct{\ifentrytype{article}{\addcomma}{\addspace}\space}
\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}
  \printfield[parens]{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

% Remove "and" between last and second last author
\DefineBibliographyExtras{english}{%
  \renewcommand*{\finalnamedelim}{\addcomma\addspace}%
}
3
  • Please add a minimal latex example also. We do not know how you are using biblatex so this is not enough for us to help.
    – daleif
    Jun 22, 2020 at 14:01
  • 2
    Also don't ignore errors from biber. @incollection is missing the ending } and your urldate formats are not supported
    – daleif
    Jun 22, 2020 at 14:06
  • Thank you for the quick reply. I updated my request. Even though now it is very long..thanks a lot!
    – JoGa
    Jun 22, 2020 at 14:37

1 Answer 1

0

Your bibliography setup contains the line

\renewcommand\bibpagespunct{\ifentrytype{article}{\addcomma}{\addspace}\space}

which produces a comma and space for @articles and two spaces for all other entry types (e.g. @incollection). If you want a comma followed by a space for all entry types you'd say

\renewcommand\bibpagespunct{\addcomma\space}

but this is the default, so you don't need to redefine \bibpagespunct at all.


Here is a modernised version of your code based on ext-authoryear from my biblatex-ext bundle, which makes it easier to achieve some of the desired modifications. (I also use Biber instead of BibTeX, because you can only access biblatex's full feature set with Biber, but that is not essential for the code shown here.)

The .bib file in the example was fixed to use the correct format for urldate (dates must be given in ISO 8601, i.e. YYYY-MM-DD format) as suggested by daleif in the comments. The entries can be made considerably more compact by using crossref and its field inheritance.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber,
  style=ext-authoryear,
  maxbibnames=99, maxcitenames=2,
  giveninits=true, uniquename=init,
  articlein=false,
  innamebeforetitle=true,
  isbn=false, doi=true, url=false, eprint=false,
  dashed=false,
]{biblatex}

\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat[cite,parencite,footcite]{finalnamedelim}{\space\&\space}


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

\DeclareFieldFormat{editortype}{\mkbibparens{\bibsentence#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}

\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}

\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space}
\DeclareFieldFormat{biblabeldate}{#1}

\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{citetitle}{#1}
\DeclareFieldFormat*{journaltitle}{#1\isdot}
\DeclareFieldFormat*{booktitle}{#1}

\renewcommand*{\volnumdelim}{}
\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}

\renewbibmacro*{pubinstorg+location+date}[1]{%
  \printlist{#1}%
  \setunit*{\publocdelim}%
  \printlist{location}%
  \setunit*{\locdatedelim}%
  \usebibmacro{date}%
  \newunit}

%DOI in neue Zeile (unsicher ob Bedarf)
\newbibmacro*{bbx:parunit}{%
  \ifbibliography
    {\setunit{\bibpagerefpunct}\newblock
     \usebibmacro{pageref}%
     \clearlist{pageref}%
     \setunit{\adddot\par\nobreak}}
    {}}

\renewbibmacro*{doi+eprint+url}{%
  \usebibmacro{bbx:parunit}% Added
  \iftoggle{bbx:doi}
    {\printfield{doi}}
    {}%
  \iftoggle{bbx:eprint}
    {\usebibmacro{eprint}}
    {}%
  \iftoggle{bbx:url}
    {\usebibmacro{url+urldate}}
    {}}

\renewbibmacro*{eprint}{%
  \usebibmacro{bbx:parunit}% Added
  \iffieldundef{eprinttype}
    {\printfield{eprint}}
    {\printfield[eprint:\strfield{eprinttype}]{eprint}}}

\renewbibmacro*{url+urldate}{%
  \usebibmacro{bbx:parunit}% Added
  \printfield{url}%
  \iffieldundef{urlyear}
    {}
    {\setunit*{\addspace}%
     \printtext[urldate]{\printurldate}}}


\begin{filecontents}{\jobname.bib}
@incollection{Slemrod.2002,
  author    = {Slemrod, Joel and Yitzhaki, Shlomo},
  title     = {Tax Avoidance, Evasion, and Administration},
  urldate   = {2020-06-22},
  pages     = {1423-1470},
  crossref  = {Auerbach.2002},
}
@collection{Auerbach.2002,
  editor    = {Auerbach, Alan J. and Feldstein, M.},
  maintitle = {Handbook of Public Economics},
  year      = {2002},
  volume    = {3},
  edition   = {1},
  address   = {Amsterdam},
  publisher = {Elsevier/North Holland},
  isbn      = {9780444823144},
  series    = {Handbooks in Economics},
  url       = {https://www.elsevier.com/books/handbook-of-public-economics/feldstein/978-0-444-82314-4},
  urldate   = {2020-06-22},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}


\begin{document}
\autocite{sigfridsson,Slemrod.2002,Auerbach.2002}
\printbibliography
\end{document}

Slemrod, J., Yitzhaki, S., 2002. Tax Avoidance, Evasion, and Administration. In: Auerbach, A. J., Feldstein, M. (Eds.). Handbook of Public Economics. Vol. 3. 1st ed. Handbooks in Economics. Elsevier/North Holland, Amsterdam, pp. 1423–1470.

3
  • Thanks a lot! This is a large help it works and I am really happy! Thank you! I voted up but since my reputation is too low :( it is recorded but does not show publicly. Thank you!
    – JoGa
    Jun 22, 2020 at 19:09
  • @JoGa If the answer helped you, you may want to consider accepting it by clicking on the green checkmark below the voting buttons. You can accept answers even if you don't have enough reputation points to vote. See tex.stackexchange.com/help/someone-answers and meta.stackexchange.com/q/5234.
    – moewe
    Jun 22, 2020 at 19:11
  • Ah thank you, as you can tell I am very new to this. I voted! :) Thanks again!
    – JoGa
    Jun 22, 2020 at 20:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .