1

Every time I compile my document and produce a PDF, it does not print my citations or references section. The preamble is copied below. I have a .bib file and all of the packages installed, the .bib file is in the same folder as the manuscript .tex file.

All the required packages are installed, and I have tried to fix this any number of ways, but with no luck. Does anyone have a suggestion? Note that I have tried to post a minimal working example in the code block. I am trying to get this to work on my own computer with the bibliography file I created from Zotero, rather than creating a new file contents on LaTeX, unless that is what you are supposed to do... I read the entire manual for biblatex but it does not explain clearly.

\documentclass[man]{apa7}
   \usepackage[english]{babel}
   \usepackage{kvoptions}
   \usepackage{url}
   \usepackage{csquotes}
   \usepackage{setspace}
   \usepackage{textcomp}
   \usepackage{amsmath}
   \usepackage{amssymb}
   \usepackage{amsthm}
   \usepackage{etoolbox}
   \usepackage{logreq}
   \usepackage[sortcites=true,sorting=nyt,backend=biber]{biblatex}
   \DeclareLanguageMapping{american}{american-apa}
 %%\addbibresource{C:/Users/meese/Box/Research/SeekingButDefensive/NewSelfZoo/NewSelfZooBibliography.bib}

\begin{filecontents}{bibliography.bib}

@article{karlsson_ostrich_2009, title = {The ostrich effect: Selective attention to information}, volume = {38}, doi = {https://doi.org/10.1007/s11166-009-9060-6}, pages = {95--115}, number = {2}, journaltitle = {Journal of Risk and uncertainty}, author = {Karlsson, Niklas and Loewenstein, George and Seppi, Duane}, date = {2009}, note = {Publisher: Springer}, } \end{filecontents} \addbibresource{bibliography.bib}

\begin{document}

cite{karlsson_ostrich_2009}

\printbibliography

\end{document}

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • You're writing to a file called \bibliography.bib, instead of bibliography.bib. That could be a problem. – Werner Mar 01 '21 at 04:21
  • thanks @werner. I see what you are saying, but I just wrote that up for the sake of a minimally workable example to post, I put the code I am actually using after the line with %%. In my code, I don't have the file defined using the filecontents package, I am just trying to add the .bib resource to the biblatex package from a local file on my computer contained within the same folder as my .tex file... – Will Meese Mar 01 '21 at 04:49
  • Did you process your bibliography using biber? – Werner Mar 01 '21 at 05:18
  • Hi @werner, thank you so much for checking back in! I think I did, I included it in the options for biblatex -- [backend = biber]{biblatex}... is there another way to use biber appropriately? Thank you so much! – Will Meese Mar 01 '21 at 05:27
  • Biber is an external program/tool that has to run on your document (not unlike LaTeX) in order to produce a bibliography and citations. You need to compile your document with at least a cycle of LaTeX, Biber, LaTeX, LaTeX (where "LaTeX" can be your favourite flavour of LaTeX: pdfLaTeX, LuaLaTeX, XeLaTeX, ...) for everything to resolve correctly. https://tex.stackexchange.com/q/63852/35864 explains brilliantly what Biber does. https://tex.stackexchange.com/q/154751/35864 helps you configure your editor to run Biber for you. – moewe Mar 01 '21 at 07:14
  • Completely unrelated to your actual question and very likely not the cause of your problems, but you do not need the line \DeclareLanguageMapping{american}{american-apa} and should remove it. That line was once needed in very old versions of biblatex-apa. It is no longer needed with newer versions of biblatex-apa and was never needed if you didn't load style=apa, (you don't). – moewe Mar 01 '21 at 07:16
  • Also unrelated to your problem, but the DOI given in the doi field should only contain the DOI, not the link portion https://doi.org/ or http://dx.doi.org/. So doi = {https://doi.org/10.1007/s11166-009-9060-6}, is wrong and should be doi = {10.1007/s11166-009-9060-6},. It is also extremely uncommon to give the publisher of a journal, so I would drop the note = {Publisher: Springer},. – moewe Mar 01 '21 at 07:32
  • Hi @moewe, thank you so much for your help! So, I should create a custom compilation in the typeset menu? I am using Miktex, should I be downloading another program to run biber, or is it installed through Miktex? Sorry if I sound super confused, the advice you have given so far is so helpful, and I am so grateful that you shared some of these extra details! – Will Meese Mar 01 '21 at 07:37
  • Also, @moewe, if you are still available, am I supposed to keep my bibliography file in a root directory somewhere? – Will Meese Mar 01 '21 at 07:38
  • What exactly you need to do depends on your editor (for most editors this is explained with pictures in https://tex.stackexchange.com/q/154751/35864). Biber is an external program that might have been installed automatically when you installed MikTeX. If it was not installed, you can install Biber via the MikTeX Console. – moewe Mar 01 '21 at 07:39
  • You don't have to keep your .bib file in a central location. It is fine to keep it in the same directory as your main .tex file. (There are ways to use one big central file and make it accessible from 'everywhere', but I would not worry about that at the moment. Put your .bib file in the same directory as your .tex file and see if you can get things going. Once things work, you can think about central .bib files: https://tex.stackexchange.com/q/6805/35864) – moewe Mar 01 '21 at 07:41
  • To check if Biber is installed correctly, open a terminal/console window (on Windows: hold Win+R, type in cmd, then hit enter) and type in biber --version and hit enter. After a while you should get a response like biber version: 2.16. If you have never used Biber before, this may take a while: Do not close the terminal window or do anything else to abort the Biber run in that case as that might lead to an incorrectly unpacked executable: Just wait. If Biber is not installed, you should get an error quickly. – moewe Mar 01 '21 at 07:44
  • @moewe, it just worked!!! Omg thank you so much!!! I appreciate your patience, the advice you gave was very helpful! I am trying to learn Latex, and spent maybe 6 hours trying to figure this out today... thank you for helping me resolve this!!!! – Will Meese Mar 01 '21 at 07:47

0 Answers0