1

I'm having trouble implementing my citations in my Latex document on overleaf. I'm using the following preamble-options:

\documentclass[
    a4paper,
    man,
    british
]{apa6}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{epstopdf}
\usepackage{ragged2e}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{dcolumn}
\usepackage{setspace}
\usepackage{threeparttable}
\usepackage{amsmath}
\usepackage{array}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{eurosym}
\usepackage{xcolor}
\usepackage{soul}
\clubpenalty=10000 
\widowpenalty=10000
\usepackage[colorlinks=true,linkcolor=black, citecolor=black,filecolor=black, urlcolor=black]{hyperref}
\usepackage{filecontents}

% for back reference in bibliography
\usepackage[style=apa,backend=biber,backref=true]{biblatex}
\addbibresource{ref.bib}
\DeclareLanguageMapping{english}{english-apa}

% maps apacite commands to biblatex commands
\let \citeNP \cite
\let \citeA \textcite
\let \cite \parencite

%%%
% Apa Bib - enable reprint according to apa
%%%

\input{enable-reprint}
\raggedbottom
\bibliography{./ref}

I uploaded a ref.bib file containing all my bibliography-information. I can also access the various objects of my ref.bib file by using the \cite{Green.2016} call. However, in the pdf it does print the reference key "Green.2016" instead of the authors name and year. I would really appreciate any hints on how to solve the problem.


Screenshot of Input and logs/output

migrated from stackoverflow.com Aug 14 at 8:54

This question came from our site for professional and enthusiast programmers.

  • \addbibressource{ref.bib} seems to be missing in your code – CarLaTeX Aug 14 at 11:23
  • You are loading quite a number of packages in your preamble. Do you need all of them? Do you know what each package does (at least roughly)? – moewe Aug 14 at 15:51
  • Copying my comments from under the now deleted post in the answer section: Screenshots of code and log files are always a bit tricky to work with. And the digest of the error messages provided by Overleaf does not show everything that is relevant. Please turn your code in the question into a compilable example document with \begin{document}...\end{document} etc.(tex.meta.stackexchange.com/q/228/35864) and post the complete .log and .blg files (you can upload the .log to a text-sharing website such as pastebin.com, since it will likely be too long for the question). – moewe Aug 15 at 15:21
  • ... See tex.stackexchange.com/q/462314/35864 for details on how to obtain the .log and .blg file (the post shows it for the .bbl file, but the method is the same). – moewe Aug 15 at 15:22
1

The apa6 documentclass has a special option to enable biblatex, use this option instead of loading the package yourself.

With biblatex you should use \printbibliography instead of \bibliography{...}

Unrelated to the bibliograpy, but \shorttitle{...} was missing in your document and you should not load the same package more than once

\documentclass[
    a4paper,
    man,
    british,
    biblatex
]{apa6}

\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{epstopdf}
\usepackage{ragged2e}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{tabularx}
%\usepackage{dcolumn}
\usepackage{setspace}
\usepackage{threeparttable}
\usepackage{amsmath}
%\usepackage{array}
%\usepackage{longtable}
%\usepackage{pdflscape}
\usepackage{eurosym}
\usepackage{xcolor}
\usepackage{soul}
\clubpenalty=10000 
\widowpenalty=10000
\usepackage[colorlinks=true,linkcolor=black, citecolor=black,filecolor=black, urlcolor=black]{hyperref}
\usepackage{filecontents}

% for back reference in bibliography
%\usepackage[style=apa,backend=biber,backref=true]{biblatex}

\addbibresource{ref.bib}
\DeclareLanguageMapping{english}{english-apa}

% maps apacite commands to biblatex commands
\let \citeNP \cite
\let \citeA \textcite
\let \cite \parencite

\title{text}
\shorttitle{dd}
\begin{document}
\cite{knuth}

%%%
% Apa Bib - enable reprint according to apa
%%%

%\input{enable-reprint}
\raggedbottom
%\bibliography{./ref}
\printbibliography

\end{document}

For the special case of the ancient texlive version of overleaf, the following should work:

\documentclass[
    a4paper,
    man,
    british,
    biblatex,
]{apa6}

%\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{epstopdf}
\usepackage{ragged2e}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{array}
\usepackage{textcomp}
\usepackage{multirow}
%\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{tabularx}
%\usepackage{dcolumn}
\usepackage{setspace}
\usepackage{threeparttable}
\usepackage{amsmath}
%\usepackage{array}
%\usepackage{longtable}
%\usepackage{pdflscape}
\usepackage{eurosym}
\usepackage{xcolor}
\usepackage{soul}
\clubpenalty=10000 
\widowpenalty=10000
\usepackage[colorlinks=true,linkcolor=black, citecolor=black,filecolor=black, urlcolor=black]{hyperref}
\usepackage{filecontents}

% for back reference in bibliography
%\usepackage[style=apa,backend=biber,backref=true]{biblatex}
\DeclareLanguageMapping{english}{english-apa}
\addbibresource{ref.bib}


% maps apacite commands to biblatex commands
\let \citeNP \cite
\let \citeA \textcite
\let \cite \parencite

\title{text}
\shorttitle{dd}
\begin{document}
\cite{1992JEEEA..12..103F}

%%%
% Apa Bib - enable reprint according to apa
%%%

%\input{enable-reprint}
\raggedbottom
%\bibliography{./ref}
\printbibliography

\end{document}

(https://www.overleaf.com/read/qwqgydyqfjyr)

enter image description here

  • Thanks for the quick answer. Unfortunately, using the biblatex-option in the documentclass specification and deleting the load of the package itself does not solve the Problem. Any other ideas? – Jan Aug 13 at 14:41
  • @Jan Can you add a link to your overleaf project? – user36296 Aug 13 at 14:42
  • @Jan Did you also replace \bibliography? – user36296 Aug 13 at 14:43
  • 1
    @Jan Argggg, overleaf seems to have an ancient version of biblatex – user36296 Aug 13 at 14:47
  • @Jan Best course of action: write to overleaf support and complain about their outdated texlive installation. maybe they will finally update if enough user complain – user36296 Aug 13 at 14:51

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.