
我需要根據大學的指導方針格式化我的學士論文的參考文獻清單。在我的文件中,我使用 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}
具有以下圍兜條目:
@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。卡爾漢瑟等
我怎樣才能實現這個目標?
答案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}