[Tex/LaTex] Citation Undefined

citingnatbibundefined

Errors:

Citation 'Mosconi' on page 1 undefined

and

There were undefined citations.

Problems: References do not load and the citation is undefined (but this problem persisted once before even after the references successfully loaded).

What i've already done:

  • Set my quick build to contain the PdfLaTeX + Bib(la)tex + PdfLaTeX (x2) + View Pdf
  • Made sure the bib file and latex file are in the same folder.

LaTeX body:

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[margin=3.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{multicol}
\usepackage{natbib}

\begin{document}
\title{\textbf{Literature Review}}
\author{James A. Walsh}
\maketitle

\begin{multicols}{2}
ah \cite{Mosconi}

\bibliography{readcube_export}
\bibliographystyle{plain}

\end{multicols}
\end{document}

Then the bib file (readcube_export.bib):

@article{Mosconi,
  volume={117},
  year={2013},
  doi={10.1021/jp4048659},
  journal={J Phys Chem C},
  number={27},
  abstract={  We computationally investigate organometal {CH3NH3PbX3} and mixed halide {CH3NH3PbI2X} perovskites {(X} = Cl, Br, I), which are key materials for high efficiency solid-state solar cells. {CH3NH3PbX3} perovskites exhibited the expected absorption blue shift along the I → Br → Cl series. The mixed halide systems surprisingly showed the {CH3NH3PbI3} and the {CH3NH3PbI2Cl} (or {CH3NH3PbI3–xClx)} perovskites to have similar absorption onset at ∼800 nm wavelength, whereas {CH3NH3PbI2Br} absorbs light below ∼700 nm. To provide insight into the structural and electronic properties of these materials, in light of their application as solar cell active layers, we perform periodic {DFT} calculations on the {CH3NH3PbX3} and {CH3NH3PbI2X} perovskites. We find a good agreement between the calculated band structures and the experimental trend of optical band gaps. For the mixed halide perovskites our calculations show the existence of two different types of structures with different electronic properties, whose relative stability varies by varying the X group. For these systems, the calculated formation energies decrease in the order I \{\textgreater\} Br \{\textgreater\} Cl, in line with the observed miscibility of {CH3NH3PbI3} and {CH3NH3PbBr3} compounds, while suggesting a comparatively smaller chlorine incorporation into {CH3NH3Pb(I1–xClx)3} compounds. We also show that Cl atoms preferentially occupy the apical positions in the {PbI4X2} octahedra, while Br atoms may occupy both apical and equatorial positions, consistent with reported lattice parameters. The interplay of the organic and inorganic components of the perovskites, possibly mediated by hydrogen bonding between the ammonium groups and the halides, seems to be the key to the observed structural variability.},
  pages={13902-13913},
  issn={1932-7447},
  author={Mosconi, Edoardo and Amat, Anna and Nazeeruddin, Md. K and Gr{\"a}tzel, Michael and Angelis, Filippo},
  file={C:\Users\James\Google Drive\2017\2017 Honours Project\Literature Review\jp4048659.pdf;C:\Users\James\Documents\ReadCube Media\Mosconi et al-2013-The Journal of Physical Chemistry C - supplement.pdf},
  title={{First-Principles} Modeling of Mixed Halide Organometal Perovskites for Photovoltaic Applications}
}

As you can see the bib file is already formatted correctly (I think) by the original exporter (ReadCube), the package is included, the citation is made to the correct ID and the file name is correct.

What could I be doing wrong?

Best Answer

The example does not use BibLaTeX, but package natbib. Therefore, the build should use BibTeX, the order of commands:

  1. pdflatex
  2. bibtex
  3. pdflatex
  4. pdflatex
Related Question