Biblatex – Resolving APA Style Bibtex Citations Display Issues

apa-stylebiblatexciting

I am writing my thesis and got a custom LaTeX template for it from my institute. It has its own document class and a main.tex file. My problem is that I tried to changed the citation style in my .cls file to APA but, when I use the \cite command, it displays wrong and it does not link to the bibliography. In fact, it does not create an entry at all. If it is of relevance, I am using TexMaker as the editor for this.

This is my relevant code in the .cls file:

% Configuration of Bibliography (General) ------------------------
% Load the csquotes package for nice quotation symbols
% (recommended by biblatex)
\RequirePackage[autostyle=true]{csquotes}
% Loads the biblatex package for citations
\RequirePackage[
   % Use the newest backend: biber
   backend=biber,
   % Use alphabetic style
   style=apa,
   % Add an entry to the ToC
   bibtotoc
]{biblatex}
\DeclareLanguageMapping{american}{american-apa}

Just in case, here is the entry in the .bib file:

@article{sitaram_closed-loop_2017,
    title = {Closed-loop brain training: the science of neurofeedback},
    volume = {18},
    issn = {1471-003X, 1471-0048},
    shorttitle = {Closed-loop brain training},
    url = {http://www.nature.com/articles/nrn.2016.164},
    doi = {10.1038/nrn.2016.164},
    language = {en},
    number = {2},
    urldate = {2022-03-17},
    journal = {Nature Reviews Neuroscience},
    author = {Sitaram, Ranganatha and Ros, Tomas and Stoeckel, Luke and Haller, Sven and Scharnowski, Frank and Lewis-Peacock, Jarrod and Weiskopf, Nikolaus and Blefari, Maria Laura and Rana, Mohit and Oblak, Ethan and Birbaumer, Niels and Sulzer, James},
    month = feb,
    year = {2017},
    pages = {86--100},
    file = {Eingereichte Version:files/8/Sitaram et al. - 2017 - Closed-loop brain training the science of neurofe.pdf:application/pdf},
}

Here is how I cite it:

\cite[]{sitaram_closed-loop_2017}

I of course also print the bibliography in my main.tex file:

\printbibliography[
heading=bibintoc,
titel{Bibliography}
]
%An additional problem here is, that it doesn't actually create an 
%entry in my table of contents, so maybe someone could help here too. 

And this is how it shows up:

sitaram_closed-loop_2017

I would very much appreciate any help and feel free to ask me about additional info.

Best Answer

bibtotoc is not an option biblatex recognises. So

\RequirePackage[
   % Use the newest backend: biber
   backend=biber,
   % Use alphabetic style
   style=apa,
   % Add an entry to the ToC
   bibtotoc
]{biblatex}

will error and should be corrected to

\RequirePackage[
   backend=biber,
   style=apa,
]{biblatex}

Furthermore titel{Bibliography} in

\printbibliography[
heading=bibintoc,
titel{Bibliography}
]

looks like a typo for title={Bibliography}, so you probably want

\printbibliography[
heading=bibintoc,
title={Bibliography}
]

With those two issues fixed the following example

\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}

\usepackage[autostyle=true]{csquotes}
\usepackage[
   backend=biber,
   style=apa,
]{biblatex}

\begin{filecontents}{\jobname.bib}
@article{sitaram_closed-loop_2017,
  title      = {Closed-loop brain training},
  subtitle   = {the science of neurofeedback},
  volume     = {18},
  issn       = {1471-003X, 1471-0048},
  url        = {http://www.nature.com/articles/nrn.2016.164},
  doi        = {10.1038/nrn.2016.164},
  language   = {en},
  number     = {2},
  urldate    = {2022-03-17},
  journal    = {Nature Reviews Neuroscience},
  author     = {Sitaram, Ranganatha and Ros, Tomas and Stoeckel, Luke
                and Haller, Sven and Scharnowski, Frank
                and Lewis-Peacock, Jarrod and Weiskopf, Nikolaus
                and Blefari, Maria Laura and Rana, Mohit 
                and Oblak, Ethan and Birbaumer, Niels and Sulzer, James},
  month      = feb,
  year       = {2017},
  pages      = {86--100},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\tableofcontents

\section{Lorem}
\autocite{sitaram_closed-loop_2017}

\printbibliography[
heading=bibintoc,
title={Bibliography}
]
\end{document}

compiles fine for me

(Sitaram et al., 2017)
Bibliography
Sitaram, R., Ros, T., Stoeckel, L., Haller, S., Scharnowski, F., Lewis-Peacock,
J., Weiskopf, N., Blefari, M. L., Rana, M., Oblak, E., Birbaumer, N., &
Sulzer, J. (2017). Closed-loop brain training: The science of neurofeed-
back. Nature Reviews Neuroscience, 18(2), 86–100. https://doi.org/10.
1038/nrn.2016.164

even with the desired ToC entry.

Note that you need to compile this document with LaTeX, Biber, LaTeX, LaTeX (where "LaTeX" can be your favourite flavour of LaTeX, in this case pdfLaTeX). You may have to configure your editor to run Biber for you Biblatex with Biber: Configuring my editor to avoid undefined citations. (Question mark or bold citation key instead of citation number explains why we need to run Biber in the first place.)


Note that you won't need the \DeclareLanguageMapping{american}{american-apa} unless your system is ancient (in which case you won't even get current 7th edition APA style from biblatex-apa).