2

I'm trying to format my bibliography pretty similar to how it has been asked for in this Question.

But when I test the MWE Moewe suggested as an answer, I don't get desired result, the edition still appears in the end and not even in superscript.

The only difference is, that I use my own .bib-file.

What am I doing wrong?

\documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear,sorting=nyt]{biblatex}

\begin{filecontents}{biblatex-examples.bib}
@book{K,
    author = {Kaschuba, Wolfgang},
    year = {2012},
    title = {Einf{\"u}hrung in die europ{\"a}ische Ethnologie},
    keywords = {V{\"o}lkerkunde;Volkskunde},
    address = {M{\"u}nchen},
    edition = {4},
}
\end{filecontents}

\addbibresource{biblatex-examples.bib}

\DefineBibliographyStrings{ngerman}{references={Bibliographie}}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
     \setunit{\addspace}%
     \usebibmacro{byeditor+othersstrg}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}
\renewbibmacro*{byeditor+othersstrg}{\usebibmacro{editor+othersstrg}}
\renewbibmacro*{bytranslator+othersstrg}{\usebibmacro{translator+othersstrg}}
\renewbibmacro*{bytypestrg}[2]{%
  \iffieldundef{#1type}
    {\bibstring{#2}}
    {\ifbibxstring{\thefield{#1type}}
       {\bibstring{\thefield{#1type}}}
       {\printtext{\thefield{#1type}}}}}

\renewcommand*{\multinamedelim}{/}
\renewcommand*{\finalnamedelim}{/}

\renewcommand*{\labelnamepunct}{\addcolon\space}
\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

\DeclareFieldFormat{superedition}{\textsuperscript{#1}}

\renewbibmacro*{date+extrayear}{%
  \iffieldundef{\thefield{datelabelsource}year}
    {}
    {\printtext[parens]{%
       \iffieldnum{edition}
         {\printfield[superedition]{edition}%
          \global\clearfield{edition}}
         {}%
       \iffieldsequal{year}{\thefield{datelabelsource}year}
         {\printdateextralabel}%
         {\printfield{labelyear}%
          \printfield{extrayear}}}}}%

\renewcommand*{\bibpagespunct}{\addcolon\space}
\DeclareFieldFormat{pages}{#1}

\DeclareNameAlias{sortname}{family-given}


\begin{document}
\nocite{K}
\printbibliography
\end{document}

enter image description here

1 Answers1

2

The macro date+extrayear was renamed to date+extradate in version 3.8. See CHANGES.md and the changelog at the biblatex GitHub Wiki as well as the name changes Wiki page and https://github.com/plk/biblatex/issues/700.

I have modernised a few other things as well. sorting=nyt is the default with style=authoryear, so it can be dropped.

\documentclass[a4paper,12pt,numbers=endperiod]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear]{biblatex}

\begin{filecontents}{biblatex-examples.bib}
@book{K,
    author = {Kaschuba, Wolfgang},
    year = {2012},
    title = {Einf{\"u}hrung in die europ{\"a}ische Ethnologie},
    keywords = {V{\"o}lkerkunde;Volkskunde},
    address = {M{\"u}nchen},
    edition = {4},
}
\end{filecontents}

\addbibresource{biblatex-examples.bib}

\DefineBibliographyStrings{german}{references={Bibliographie}}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
     \setunit{\addspace}%
     \usebibmacro{byeditor+othersstrg}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}
\renewbibmacro*{byeditor+othersstrg}{\usebibmacro{editor+othersstrg}}
\renewbibmacro*{bytranslator+othersstrg}{\usebibmacro{translator+othersstrg}}
\renewbibmacro*{bytypestrg}[2]{%
  \iffieldundef{#1type}
    {\bibstring{#2}}
    {\ifbibxstring{\thefield{#1type}}
       {\bibstring{\thefield{#1type}}}
       {\printtext{\thefield{#1type}}}}}

\DeclareDelimFormat{multinamedelim}{/}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcolon\space}

\renewcommand*{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

\DeclareFieldFormat{superedition}{\textsuperscript{#1}}

\renewbibmacro*{date+extradate}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[parens]{%
       \iffieldnum{edition}
         {\printfield[superedition]{edition}%
          \global\clearfield{edition}}
         {}%
       \iflabeldateisdate
         {\printdateextra}
         {\printlabeldateextra}}}}


\renewcommand*{\bibpagespunct}{\addcolon\space}
\DeclareFieldFormat{pages}{#1}

\DeclareNameAlias{sortname}{family-given}


\begin{document}
\nocite{K}
\printbibliography
\end{document}

enter image description here

moewe
  • 175,683