# Unable to read citations from bibliography file

I am using a latex file to write a report. The said latex file requires me to have different chapters and plots in different folders. When I try to generate a pdf output from this latex file, I encounter errors which say Citation 'citation name' on page 1 undefined.. In short, the latex compilation fails to read entries of my bibliography file (references.bib).

This is a skeleton of the said latex file (test.tex)

\include{macpap2}

\documentclass[12pt]{ociamthesis}

\usepackage{amsfonts,amssymb}
\usepackage{amsmath,graphics}
\usepackage{import}
\usepackage[pdftex]{graphicx}
\usepackage{booktabs}

\usepackage{wrapfig}
\usepackage{appendix}
\usepackage[nottoc]{tocbibind}
\usepackage[sort]{natbib}
\usepackage[biblabels]{authorindex}
\usepackage{minitoc}
\setcounter{minitocdepth}{3}

\title{Title Name}
\author{Firstname Lastname}
\college{College Name}
\renewcommand{\submittedtext}{\textit{Write something.}}
\degree{Degree name}
\degreedate{December 2018}
\renewcommand{\crest}{\beltcrest}

\begin{document}

\baselineskip=18pt plus1pt

\begin{frontpages}
\setcounter{secnumdepth}{1}
\setcounter{tocdepth}{2}

\maketitle

\end{frontpages}
\begin{romanpages}
\tableofcontents
\end{romanpages}

\input{chapter/chapter1}

%% BIBLIOGRAPHY %%
%
%\citeindexfalse % to stop indexing citations
%uncommnent next line to change bibliography name to references
%\renewcommand{\bibname}{References}
%\begin{flushleft} % This is to left-justify the bibliography

\bibliography{references.bib} % Full path to bibtex bibliography file (e.g. "references.bib")
%   \adjustmtc %! To prevent tocbibind interfering with minitoc
%\bibliographystyle{agsm} % This one is modeled on the standard year/date referencing standard
%\end{flushleft}

\end{document}


This file has only one chapter (chapter1.tex). This is the skeleton of chapter1.tex.

chapter{\label{ch:chapter1}Chapter1}

\section{Preliminaries}
I want to cite these: \citep[][]{Caldwell2002, Daly2003}

\begin{figure}
\includegraphics[width=0.41\textwidth]{Plots/dino2.png}
\includegraphics[width=0.41\textwidth]{Plots/dino2.png}
\caption{Two dinos.}
\label{fig:Dinos}
\end{figure}


My bibliography file (references.bib) is given underneath.

@article{Caldwell2002,
title = "A phantom menace? Cosmological consequences of a
dark energy component with super-negative equation of state",
journal = "Physics Letters B",
volume = "545",
number = "1",
pages = "23 - 29",
year = "2002",
issn = "0370-2693",
doi = "https://doi.org/10.1016/S0370-2693(02)02589-3",
url = "http://www.sciencedirect.com/science/article/pii/S0370269302025893",
author = "R.R Caldwell"
}

@article{Daly2003,
author={Ruth A. Daly and S. G. Djorgovski},
title={A Model-Independent Determination of the Expansion and Acceleration Rates of the Universe as a Function of Redshift and Constraints on Dark Energy},
journal={The Astrophysical Journal},
volume={597},
number={1},
pages={9},
url={http://stacks.iop.org/0004-637X/597/i=1/a=9},
year={2003},
abstract={abstract.}
}


I am using Texmaker 4.5. All files (*.tex, *.bib, *.cls, figures etc) used by this latex package can be found here.

What am I doing wrong? How can I make this latex package read and execute the contents of my bibliography file?

• does removing the .bib extension help? i.e.: \bibliography{references}. When you run Bibtex, what are the error messages that you get?
– Troy
Dec 21 '18 at 23:14
• @Troy : I tried your suggestion. Unfortunately, it didn't help. This is the message that I get when when I run Bibtex on test.tex : Citation 'Caldwell2002' on page 1 undefined . In the subsequent line of the message, I see this: Citation 'Daly2003' on page 1 undefined . Dec 22 '18 at 0:09
• Even though it was not the main issue here, you should follow Troy's advice and write \bibliography{references} without file extension. This is the officially supported syntax that can be guaranteed to work. Some systems are more forgiving when you include the .bib extension, but this is not guaranteed. My MikTeX system (on Win 10) will not process files if the .bib extension is included in the \bibliography call. Dec 22 '18 at 7:07
• @moewe : I tried your suggestion. It works. Thanks. Dec 22 '18 at 16:47

To produce a bibliography with bibtex the source file should specify (1) at least one bib file, and (2) the bibliography style to be used (e.g., \bibliographystyle{plainnat}). The \bibliographystyle{...} instruction is missing.