0

This question already has an answer here:

I'm trying to include the references directly into the main file. The problem is that citations are undefined and only the reference key will appear.

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{gladwell,
    author = {Malcom Gladwell},
    title = {The Tipping Point},
    publisher = {Little, Brown and Company},
    year = {2002}
}
\end{filecontents*}

\documentclass[a4paper,man,12pt]{apa6}

\let\Citeauthor\relax

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}

\let\biblabelsep\relax
\let\bibparsep\relax
\let\bibhang\relax
\let\citename\relax
\let\bibfont\relax
\let\Citeauthor\relax

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

\title{Title}
\shorttitle{Short}
\author{Some Random Guy}
\affiliation{School}

\addbibresource{\jobname}

\begin{document}

\maketitle

\renewcommand{\baselinestretch}{1.5}

\setcounter{secnumdepth}{3}

\section{Bla}

\parencite{gladwell}

\subsection{Blubb}

\subsubsection{Lalala}

%\bibliographystyle{apacite}
%\bibliography{jobname}
\printbibliography

\end{document}

marked as duplicate by moewe biblatex Mar 18 '16 at 17:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Did you run biber and then recompile at least once more? – cfr Mar 15 '16 at 0:59
  • 2
    Please check Question mark instead of citation number and Biblatex with Biber: Configuring my editor to avoid undefined citations. For biblatex-apa you are missing the language mapping \DeclareLanguageMapping{english}{english-apa} (see here). The correct call to \addbibresource includes the .bib file extensions \addbibresource{\jobname.bib}, this is a problem with some platforms while others are more forgiving. Finally check tex.stackexchange.com/q/286706 – moewe Mar 15 '16 at 6:44
  • Did the above work for you? If not, what errors/warnings do you get from Biber (.blg) and biblatex (.log file)? What versions are you running? – moewe Mar 17 '16 at 7:36
  • @moewe I am new to StackExchange and did not want to spam the comment section (so I only voted up your comment to show that it worked and thank you). \DeclareLanguageMapping{english}{english-apa} was the missing part in this piece of code. The working code is posted as an answer now in order to help others. – Jan Spörer Mar 18 '16 at 17:14
  • Ahhh, with up-votes you can never be sure who voted. A short feedback is always appreciated and that would not qualify as spamming the comments. With answers it is a different story, since they can be accepted by the OP. (Still I would say that the approach to comments taken on this site is a very lenient one.) Since you say that it was the language mapping that was missing, I will vote to close your question as a duplicate of the one I linked as reference. – moewe Mar 18 '16 at 17:18
0
\DeclareLanguageMapping{english}{english-apa}

The command above was the missing piece here (see moewe's comment).

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{gladwell,
    author = {Malcom Gladwell},
    title = {The Tipping Point},
    publisher = {Little, Brown and Company},
    year = {2002}
}

\end{filecontents*}

\documentclass[a4paper,man,12pt]{apa6}

\let\Citeauthor\relax

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}

\usepackage{polyglossia}
\setmainlanguage{english} 
\setotherlanguage{russian}

\let\biblabelsep\relax
\let\bibparsep\relax
\let\bibhang\relax
\let\citename\relax
\let\bibfont\relax
\let\Citeauthor\relax

\usepackage[backend=biber,style=apa]{biblatex}
\DeclareLanguageMapping{english}{english-apa}

\title{Title}
\shorttitle{Short}
\author{Author}
\affiliation{School
}

\addbibresource{\jobname.bib}

\begin{document}

\maketitle

\renewcommand{\baselinestretch}{1.5}

\setcounter{secnumdepth}{3}

\section{Recommendations}

\parencite{gladwell}

\printbibliography

\end{document}

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