解决“BibLaTeX:版本在年份前面显示上标,但年份在作者后面显示”不起作用的问题

解决“BibLaTeX:版本在年份前面显示上标,但年份在作者后面显示”不起作用的问题

我正在尝试将参考书目格式化为与问题。

但当我测试平均能量损失Moewe 建议作为答案,我没有得到预期的结果,版本仍然出现在最后,甚至没有上标。

唯一的区别是,我使用我自己的.bib 文件。

我究竟做错了什么?

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

在此处输入图片描述

答案1

此宏在 3.8 版中date+extrayear重命名为。请参阅date+extradate变化.md以及更新日志biblatexGitHub 维基维基页面名称变更https://github.com/plk/biblatex/issues/700

我也对其他一些东西进行了现代化改造。sorting=nyt是默认的style=authoryear,因此可以将其删除。

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

在此处输入图片描述

相关内容