我需要根据大学的指导方针格式化我的学士论文的参考文献列表。在我的文档中,我使用 biblatex 和 biber。目前我有这个:(MWE)
\documentclass{article}
%
% biblatex, biber
%
\usepackage[backend=biber, style=authoryear, doi=false, natbib=true, maxcitenames=2, maxbibnames=15, firstinits=true]{biblatex}
\addbibresource{Literatur.bib}
\setlength\bibitemsep{1.8\itemsep}
\renewcommand{\cite}{\parencite}
\DeclareNameAlias{author}{last-first}
\DefineBibliographyStrings{ngerman}{andothers = {et al\adddot}}
\DeclareDelimFormat[parencite]{nameyeardelim}{\addspace}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat*{title}{#1}
\DeclareDelimFormat{yeartitledelim}{\addcomma\addspace}
\setlength{\bibhang}{0pt}
\usepackage{xpatch}
\xpatchbibmacro{date+extradate}{%
\printtext[parens]%
}{%
\setunit*{\addcomma\space}%
\printtext%
}{}{}
\DefineBibliographyExtras{ngerman}{
\renewcommand*{\finalnamedelim}{\addcomma\addspace}
}
\renewbibmacro*{publisher+location+date}{
\printlist{publisher}
\setunit*{\addcomma\space}
\printlist{location}
\setunit*{\addcomma\space}
\usebibmacro{date}
\newunit
}
\begin{document}
\noindent test \cite{RolfFischer}
\printbibliography
\end{document}
包含以下 bib 条目:
@book{RolfFischer,
author ={Fischer, Rolf},
title ={Elektrische Maschinen},
publisher ={Carl Hanser Verlag},
address ={{M{\"u}nchen}},
year ={2011},
isbn ={978-3-446-42554-5},
}
但是我需要在年份后面加一个逗号:Fischer, R., 2011, Elektrische Maschinen. Carl Hanser 等
我怎样才能实现这个目标?
答案1
此处的相关分隔符是nametitledelim
(在bib
上下文中)。(这是出于与所有其他书目样式的一致性原因,在这些样式中,年份不会移到作者之后的位置,因此该分隔符会出现在名称和标题之间,而不是像本例中那样出现在名称和标题之后的年份之间。在标准样式中yeartitledelim
不存在。)
\documentclass{article}
\usepackage[
backend=biber,
style=authoryear,
maxcitenames=2, maxbibnames=15, firstinits=true,
doi=false,
natbib=true,
]{biblatex}
\setlength\bibitemsep{1.8\itemsep}
\setlength{\bibhang}{0pt}
\DefineBibliographyStrings{ngerman}{andothers = {et al\adddot}}
\DeclareNameAlias{sortname}{family-given}
\DeclareDelimFormat{finalnamedelim}{\addcomma\space}
\DeclareDelimFormat[bib]{nametitledelim}{\addcomma\addspace}
\DeclareDelimFormat[parencite]{nameyeardelim}{\addspace}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat*{title}{#1}
\usepackage{xpatch}
\xpatchbibmacro{date+extradate}{%
\printtext[parens]%
}{%
\setunit*{\addcomma\space}%
\printtext%
}{}{}
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit
}
\begin{filecontents}[overwrite]{\jobname.bib}
@book{RolfFischer,
author = {Fischer, Rolf},
title = {Elektrische Maschinen},
publisher = {Carl Hanser Verlag},
address = {München},
year = {2011},
isbn = {978-3-446-42554-5},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
test \autocite{RolfFischer}
\printbibliography
\end{document}