I'm writing a report for which I need to add citations from the literature. When I add more than one citation in the entire body of the text, only one appears as it should and the others turn into (?,?).
Here are my Overleaf packages
\documentclass[12pt, oneside]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{array}
\usepackage{amssymb}
\usepackage[font=small,skip=-10pt]{caption}
\usepackage{subcaption}
\usepackage[a4paper, inner=1.5cm, outer=1.5cm, top=2.3cm, bottom=2.3cm]{geometry}
\usepackage{newtxtext,newtxmath,amsmath}
\usepackage{apacite}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{threeparttable}
\usepackage{setspace}
\usepackage[table,xcdraw]{xcolor}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\usepackage{ulem}
Here's how I cite papers in the body of the text
This is a cool citation \cite{sirin_socioeconomic_2005} and this is another cool citation \cite{angrist_perils_2014}
Here's how the citations look in the .bib file
@article{angrist_perils_2014,
title = {The {Perils} of {Peer} {Effects}},
volume = {30},
url = {https://www.researchgate.net/publication/263319266_The_Perils_of_Peer_Effects},
doi = {10.1016/j.labeco.2014.05.008},
urldate = {2021-02-10},
journal = {Labour Economics},
author = {Angrist, Joshua},
year = {2014},
file = {Full Text:C\:\\Users\\User\\Zotero\\storage\\4UIR33RD\\Angrist - 2014 - The Perils of Peer Effects.pdf:application/pdf},
}
@article{sirin_socioeconomic_2005,
title = {Socioeconomic {Status} and {Academic} {Achievement}: {A} {Meta}-{Analytic} {Review} of {Research}},
volume = {75},
issn = {0034-6543},
shorttitle = {Socioeconomic {Status} and {Academic} {Achievement}},
url = {https://doi.org/10.3102/00346543075003417},
doi = {10.3102/00346543075003417},
language = {en},
number = {3},
urldate = {2022-05-23},
journal = {Review of Educational Research},
author = {Sirin, Selcuk R.},
month = sep,
year = {2005},
note = {Publisher: American Educational Research Association},
keywords = {achievement, meta-analysis, SES, social class, socioeconomic status},
pages = {417--453},
}
Here's how I call the bibliography at the end of my main.tex
\bibliographystyle{apacite}
\bibliography{Thesis.bib}
I made sure that the .bib file is indeed named Thesis.bib, in fact I know it is correct because when I add only one citation it appears correctly both in the body of the text where I call it but also at the bottom of the document.
Additionally, I have two error messages that show up. One next to where I cite the reference, which says:
Citation '...' undefined on line N
And one next to the \bibliography{Thesis.bib} that says:
runaway argument ?
I've done that dozens of times and never encountered such a problem.
MWE as asked in the comments:
\documentclass[12pt, oneside]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{array}
\usepackage{amssymb}
\usepackage[font=small,skip=-10pt]{caption}
\usepackage{subcaption}
\usepackage[a4paper, inner=1.5cm, outer=1.5cm, top=2.3cm, bottom=2.3cm]{geometry}
\usepackage{newtxtext,newtxmath,amsmath}
\usepackage{apacite}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{threeparttable}
\usepackage{setspace}
\usepackage[table,xcdraw]{xcolor}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\usepackage{ulem}
\graphicspath{ {./Images/} }
\setstretch{1.25}
\begin{document}
\section{Introduction}
This is a cool citation \cite{sirin_socioeconomic_2005} and this is another cool citation \cite{angrist_perils_2014}
\clearpage
\bibliographystyle{apacite}
\bibliography{Thesis.bib}
\end{document}
Edit : I've also noticed a final error message next to \end{document}:
LaTeX Error: \begin{thebibliography} on input line 1 ended by \end{document}
.bibin\bibliography. – Unknown May 23 '22 at 14:53\cite? – David Carlisle May 23 '22 at 15:30main.bblfile? However, first try to delete themain.bbland recreate your document. – Unknown May 23 '22 at 16:00.bblfile that is generated by bibtex, so if you add a new\citeyou need to regenerate it. You must have run bibex at least once on this document if you have a.bblfile with\begin{thebibliography}– David Carlisle May 23 '22 at 16:19.blg) that will have an error mssage saying why it failed, also "clear cache" to delete the broken one – David Carlisle May 23 '22 at 19:42