對於我的期末論文,我需要使用 APA 風格的稍微修改版本。在詳細介紹之前,我想向您展示一個 MWE:
\documentclass[12pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[%
backend=biber,
style=authoryear-comp,
bibstyle=apa]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\DefineBibliographyStrings{ngerman}{andothers={et\ \addabbrvspace al\adddot}}
\usepackage{filecontents}
\begin{filecontents}{literatur.bib}
@book{XYZ2010,
author = {Andrew Alphason and Bertram Betason and Christian Gammason},
year = {2010},
title = {{Ein Testbuch}},
publisher = {Springer},
address = {Stuttgart}
}
@book{XYZ2011,
editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
year = {2011},
title = {{Ein Sammelwerk}},
publisher = {Springer},
address = {Stuttgart},
}
@incollection{XYZ2012,
title = {{Meine kleine Testdatei}},
author = {Dirk Deltason},
editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
year = {2012},
booktitle = {{Ein Sammelwerk}},
publisher = {Springer},
address = {Stuttgart},
}
@incollection{XYZ2013,
title = {{Meine kleine Testdatei}},
author = {Dirk Deltason},
editor = {Andrew Alphason and Bertram Betason},
year = {2013},
booktitle = {{Ein Sammelwerk}},
publisher = {Springer},
address = {Stuttgart},
}
@book{XYZ2014a,
author = {Phil Phison and Bertram Betason},
year = {2014},
title = {{Ein Testbuch}},
publisher = {Springer},
address = {Stuttgart},
}
@book{XYZ2014b,
author = {{Fictional Institution}},
year = {2014},
title = {{Ein Testbuch}},
publisher = {Springer},
address = {Stuttgart},
}
@incollection{XYZ2014c,
title = {{Meine kleine Testdatei}},
author = {Dirk Deltason and Ezra Epsilonson},
editor = {Andrew Alphason and Bertram Betason},
year = {2014},
booktitle = {{Ein Sammelwerk}},
publisher = {Springer},
address = {Stuttgart},
}
\end{filecontents}
\bibliography{literatur}
\begin{document}
\parencite{XYZ2010,XYZ2011,XYZ2012,XYZ2013,XYZ2014a,XYZ2014b,XYZ2014c}
\printbibliography
\end{document}
我需要改變的是:
- 若參考書目條目的初始位置有 2 位和 2 位以上作者/編輯,則「&」前應有一個逗號。
- 如果編輯者出現在後面,如 MWE 中的第 3 和第 4 條,則「&」之前只應有一個逗號,以防編輯者數量超過 2 個。這裡只有 2 位編輯,沒有逗號。別問我為什麼,我就是要這麼做!
- APA 通常在作者/編輯/機構和年份之間列印句點(在括號中)。我不允許在那裡插入句號。我怎麼刪除它?在這個範例中,不允許在條目 2 中使用「(Hrsg.)」之後的句點。
我已經插入了輸出的圖像。我用紅色表示錯誤,用綠色表示正確。
編輯資訊:我添加了更多範例來演示我正在討論的問題。
答案1
給你;
\documentclass[12pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[%
backend=biber,
style=authoryear-comp,
bibstyle=apa]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\DefineBibliographyStrings{ngerman}{andothers={et\ \addabbrvspace al\adddot}}
\usepackage{filecontents}
\begin{filecontents}{literatur.bib}
@book{XYZ2010,
author = {Andrew Alphason and Bertram Betason and Christian Gammason},
year = {2010},
title = {{Ein Testbuch}},
publisher = {Springer},
address = {Stuttgart}
}
@book{XYZ2011,
editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
year = {2011},
title = {{Ein Sammelwerk}},
publisher = {Springer},
address = {Stuttgart},
}
@incollection{XYZ2012,
title = {{Meine kleine Testdatei}},
author = {Dirk Deltason},
editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
year = {2012},
booktitle = {{Ein Sammelwerk}},
publisher = {Springer},
address = {Stuttgart},
}
@incollection{XYZ2013,
title = {{Meine kleine Testdatei}},
author = {Dirk Deltason},
editor = {Andrew Alphason and Bertram Betason},
year = {2013},
booktitle = {{Ein Sammelwerk}},
publisher = {Springer},
address = {Stuttgart},
}
\end{filecontents}
\addbibresource{literatur.bib}
\usepackage{xpatch}
\DefineBibliographyExtras{ngerman}{\def\finalandcomma{\addcomma}}
\xpatchbibmacro{editorinauthpos}{%
\clearname{editor}%
\setunit{\adddot\addspace}%
}{%
\clearname{editor}%
\setunit{\addspace}%
}{}{}
\begin{document}
\parencite{XYZ2010,XYZ2011,XYZ2012,XYZ2013}
\printbibliography
\end{document}