我在修改 authoryear-icomp 样式时遇到了问题。请参见下面的屏幕截图:
BibLaTeX 在年份 (2017b) 后添加了一个字母,尽管它是该编辑在特定年份的唯一出版物。有什么办法可以解决这个问题吗?我希望它像这样显示:
Krajewski, C. (2017b):“城市旅游和城市文化”。引自:Heineberg, H. (Hrsg.) (2017):Stadtgeographie。 5. 奥夫拉帕德博恩,S.413–421(=UTB 2166)。
梅威瑟:
\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}