4

The footnote should look like thisenter image description here

But unfortunately it looks like this: enter image description here

So, it adds an comma every time I use a prefix in \footcite

my preamble looks like this:

\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}

so and my bib. is like:

@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}}

I don't know what's the mistake here. Could anyone please help me?

  • Welcome to TeX SX! Could you post a full compilable small code reproducing the problem? – Bernard Nov 11 '18 at 20:44
  • hey, thanks for your answer. I edited the main post and added the bib. also. – dolornow Nov 11 '18 at 20:57
4

Using the textcite macro in \footcite can have some weird side-effects, this is one of them. It can be avoided by using \printunit instead of \setunit in the definition of the prenote bibmacro.

\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}

The footnote reads "Vgl. Sigfridsson & Ryde (1998), S. 3 f."

Note that the hyperref package should usually be loaded last. Additionally, sorting=nty does not really work well for style=apa since the APA style is an author-year style, so one would expect the bibliography to be sorted by author and year and not by author and title.


Since you seem to customise biblatex-apa quite a bit, you may want to consider whether it might not be more appropriate to use a different style altogether. biblatex-apa was specifically designed to implement the requirements of the APA manual, so it can be quite hard to achieve certain customisations even if they 'should be easy'. That's why I usually recommend to start from one of the standard styles when more changes are expected.

Here is an example that implements a style similar to the status quo of your style using my biblatex-ext bundle.

\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}
  • thanks for your help. For some reason it keeps saying "! Undefined control sequence. \DeclareInnerCiteDelims" and "! LaTeX Error: Missing \begin{document}." Even if I use your code in a new document. – dolornow Nov 13 '18 at 20:27
  • @dolornow Do you get other errors as well (before that)? Are you using the newest version of biblatex (3.12 or 3.11) and biblatex-ext (0.5a)? – moewe Nov 13 '18 at 20:34
  • Wow, I just have to say: THANKS A LOT. You're the real goat. I hope your advices will improve my Latex knowledge since I just started using it. I really really appreciate your help. – dolornow Nov 14 '18 at 16:29
  • @dolornow Baa-baa? Glad I could help. – moewe Nov 14 '18 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.