因此,每次我在 \footcite 中使用前缀时,它都会添加一个逗号
我的序言如下:
\documentclass[a4paper,12pt,article]{scrartcl}
\usepackage[hidelinks]{hyperref} %anklickbares Inhaltsverzeichnis
\usepackage[ngerman]{babel} %Silbentrennung deutsche Rechtschreibung
\usepackage[utf8]{inputenc} % Codierung
\usepackage[T1]{fontenc}
\usepackage{times} % Schriftart Times New Roman
\setkomafont{disposition}{\normalfont\bfseries} %Times New Roman überall
\renewcommand{\footnotesize}{\normalsize} %Fußnotengröße
\usepackage[backend=biber, sortcites = true, sorting=nty, style=apa]{biblatex}%zum Fußnote zitieren + Einstellungen wie Fußnote aussehen wird
\addbibresource{Literaturverzeichnis.bib}
\renewcommand{\labelnamepunct}{\addcolon\space} % : bei Literaturverzeichnis
\makeatletter
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\bibsentence
\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{textcite}}
{}
{\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}%
\usebibmacro{postnote}%
\usebibmacro{cite:post}}
\DeclareDelimFormat[footcite]{finalnamedelim}
{\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space}
\makeatother
\begin{document}
\newpage
\section{Einleitung}
\pagenumbering{arabic}
It keeps adding a coma\footcite[Vgl.][3\psq]{jhull} after the prefix of footcite
\newpage
\printbibliography
\end{document}
所以我的围兜是这样的:
@article{jhull,
Author = {John C. Hull},
Date-Added = {2018-11-11 11:56:27 +0100},
Date-Modified = {2018-11-11 12:15:03 +0100},
Title = {Optionen, Futures und andere Derivate},
Volume = {8},
Year = {2012}}
我不知道这里出了什么错误。有人能帮我吗?
答案1
使用textcite
中的宏\footcite
可能会产生一些奇怪的副作用,这是其中之一。可以通过在 bibmacro的定义中使用\printunit
而不是 来避免这种情况。\setunit
prenote
\documentclass[a4paper,12pt,article]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, sortcites = true, style=apa]{biblatex}
\usepackage[hidelinks]{hyperref}
\addbibresource{biblatex-examples.bib}
\renewcommand{\labelnamepunct}{\addcolon\space}
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\bibsentence
\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{textcite}}
{}
{\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}%
\usebibmacro{postnote}%
\usebibmacro{cite:post}}
\renewbibmacro*{prenote}{%
\iffieldundef{prenote}
{}
{\printfield{prenote}%
\printunit{\prenotedelim}}}
\DeclareDelimFormat[footcite]{finalnamedelim}
{\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space}
\begin{document}
It keeps adding a comma\footcite[Vgl.][3\psq]{sigfridsson} after the prefix of footcite
\printbibliography
\end{document}
请注意,该hyperref
包通常应最后加载。此外,由于 APA 格式是作者-年份格式,因此sorting=nty
实际效果并不好,style=apa
因此人们会期望参考书目按作者和年份排序,而不是按作者和标题排序。
由于您似乎进行了biblatex-apa
很多自定义,您可能需要考虑是否更适合使用完全不同的样式。biblatex-apa
是专门为实现 APA 手册的要求而设计的,因此即使某些自定义“应该很容易”,实现起来也可能非常困难。这就是为什么当预计会有更多更改时,我通常建议从标准样式之一开始。
下面是一个使用我的捆绑包实现与您的风格现状类似的风格的示例biblatex-ext
。
\documentclass[a4paper,12pt,article]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
backend=biber, style=ext-authoryear, giveninits=true, uniquename=init,
articlein=false, innamebeforetitle=true,
]{biblatex}
\usepackage[hidelinks]{hyperref}
\DeclareInnerCiteDelims{footcite}{\bibopenparen}{\bibcloseparen}
\DeclareNameAlias{sortname}{family-given}
\DeclareDelimFormat{finalnamedelim}
{\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}
\DeclareDelimFormat[bib]{nametitledelim}{\addcolon\space}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}
\renewcommand*{\intitlepunct}{\addspace}
\renewcommand*{\volnumdelim}{}
\DeclareFieldFormat[article,periodical]{volume}{\mkbibemph{#1}}
\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\addbibresource{biblatex-examples.bib}
\nocite{nussbaum,worman,geer,westfahl:space,gaonkar:in}
\begin{document}
Lorem\footcite[Vgl.][3\psq]{sigfridsson}
\printbibliography
\end{document}