1

i'm facing a problem with my modified authoryear-icomp style. See screenshot below: biblatexproblem

BibLaTeX adds a letter after the year (2017b), even though it's the only publication with that editor in that particular year. Is there any way to circumvent this? I want it to display like so:

Krajewski, C. (2017b): „Städtetourismus und Stadtkultur“. In: Heineberg, H. (Hrsg.) (2017): Stadtgeographie. 5. Aufl. Paderborn, S. 413–421 (=UTB 2166).

MWE:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[ngerman]{babel}
\usepackage[babel]{csquotes}
\usepackage{xpatch}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}

@article{KrajewskiMetropoleRuhrWandel2017,
  langid = {german},
  title = {Metropole Ruhr – Wandel durch Freizeit, Kultur und Tourismus},
  number = {2},
  journaltitle = {Praxis Geographie},
  author = {Krajewski, Christian},
  date = {2017},
  pages = {36--41}
}

@incollection{KrajewskiStadtetourismusundStadtkultur2017,
  langid = {german},
  location = {{Paderborn}},
  edition = {5},
  title = {Städtetourismus und Stadtkultur},
  isbn = {978-3-8252-4708-9},
  number = {2166},
  booktitle = {Stadtgeographie},
  series = {UTB},
  author = {Krajewski, Christian},
  editor = {Heineberg, Heinz},
  date = {2017-10-10},
  pages = {413--421}
}
\end{filecontents*}

\usepackage[%
    backend=biber,
    style=authoryear-icomp,
    autopunct=true,
    giveninits=true,
    uniquename=mininit,
    maxcitenames=2,
    maxbibnames=10,
    isbn=false,
    % url=false,
    doi=false,
    eprint=false,
    dashed=false,
]{biblatex}
\addbibresource{\jobname.bib}

% colon after year
\renewcommand{\labelnamepunct}{\addcolon\space}

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

% no comma before editor
\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{editor}%
        \setunit{\addspace}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{editor}%
     \setunit{\printdelim{nameyeardelim}}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\printdelim{nonameyeardelim}}}%
  \usebibmacro{date+extrayear}}

% change order of incollection
\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{editor+others}% %instead of byeditor+others
  \setunit{\printdelim{nametitledelim}}\newblock%
  \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}}


% Series & number at the end in parentheses
\renewbibmacro*{series+number}{%
  \iffieldundef{series}
    {}
    {\printtext[parens]{%
       \printtext{=\addnbthinspace}%
       \printfield{series}%
       \setunit*{\addspace}%
       \printfield{number}%
       \newunit}}}

\newcommand*\patchseries[1]{%
  \xpatchbibdriver{#1}
    {\usebibmacro{series+number}}
    {}
    {}
    {\typeout{Warning: Failed to remove series+number from driver #1.}}
  \xpatchbibdriver{#1}
    {\usebibmacro{chapter+pages}}
    {\usebibmacro{chapter+pages}%
     \setunit{\addspace}%
     \usebibmacro{series+number}}
    {}
    {\typeout{Warning: Failed to add series+number to driver #1.}}}

\patchseries{collection}\patchseries{incollection}

\begin{document}

\nocite{*}
\printbibliography

\end{document}
  • Well, the labelyear is disambiguated according to the author/editor which is being referred to (the same that will appear in cite commands), in this case Krajewski. And there are indeed two Krajewski's works in 2017 in your bibliography, thus the 'a'/'b'. – gusbrs Oct 9 '17 at 14:07
  • Still, the labeyear is called by your redefinition of the driver for incollection, in particular the line \usebibmacro{editor+others}% %instead of byeditor+others. That means you do need the date there, but don't want it to receive the "extrayear" part. Is that it? – gusbrs Oct 9 '17 at 14:15
  • Yes, I want the date after Heineberg, H. but without the extrayear part. – maaattes Oct 9 '17 at 14:22
3

The extrayear is called by your redefinition of the driver for incollection, in particular by the line:

\usebibmacro{editor+others}% %instead of byeditor+others

By substituting it with:

\printnames{editor}%
\setunit{\space}%
\usebibmacro{editor+othersstrg}%
\setunit{\space}%
\printfield[parens]{labelyear}%

in your bibliography driver for incollection you can get the desired result.

enter image description here

  • But using this approach I get “In: Hrsg. von” instead “(Hrsg.)” after the editor. This was the reason I replaced byeditor+others with editor+others in the first place. s1.postimg.org/1x4mje9c9r/biblatexproblem2.png – maaattes Oct 9 '17 at 15:16
  • @schmattes Well, I had thought of that as a bonus, for then your incollection would receive homogeneous treatment with other similar entrytypes, such as inbook. But, once it seems that is what you really want, I updated the answer. – gusbrs Oct 9 '17 at 16:57
  • Thank you very much. I use inbookvery rarely so i can live with that. – maaattes Oct 10 '17 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.