0

I'm trying to use natbib to get a bibliography, but it's not working. I tried compiling a sample tex-file, which worked fine, but in my document it's not happening. My document looks like this:

\listfiles
\documentclass[12pt]{ociamthesis}
\usepackage[square]{natbib}
\usepackage{amssymb}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{tabulary}
\usepackage{listings}
\usepackage{color}
\usepackage{eurosym}
\usepackage[]{graphicx}
\usepackage{subfigure}
\usepackage{textcomp}
\begin{document}
---content with citations---
\bibliographystyle{plainnat}
\bibliography{refs}
\end{document}

My bib-file looks like this:

@book{goossens93,
  author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
  title = "The Latex Companion",
  year = "1993",
  publisher = "Addison-Wesley",
  address = "Reading, Massachusetts"
  }

It just completely ignores the bibliography, there's no headline or anything. Where I put the citations, it prints ?. I even tried stripping the document until only

\documentclass[12pt]{ociamthesis}
\usepackage{natbib}
\begin{document}
\cite{goossens93}
\bibliographystyle{plainnat}
\bibliography{refs}
\end{document}

remained, but it didn't help. When I created a new .tex-file in another directory with the same contents, it worked fine. Deleting everything but the *.tex-file also didn't help. Does anyone have an idea what I'm doing wrong?

Vince
  • 101

2 Answers2

1

Simply loading the natbib citation management package does not generate a formatted bibliography. The natbib package provides various citation-related commands and provides several bibliography styles, such as plainnat.

To actually generate the bibliography and correctly-formatted citation call-outs (to entries in the bibliography), you need to run BibTeX (after having first run LaTeX, of course) and then rerun LaTeX twice more.

Mico
  • 506,678
0

Found the solution in an answer to this question: BibTeX bibliography not printing

I don't know why it wouldn't work otherwise for my document, because it worked fine for a fresh document, but it worked.

Vince
  • 101
  • The information content of an observation such as "it worked fine for a fresh document" is nearly impossible to evaluate. For sure, there's an unlimited number of potential "fresh" documents, and without access to a specific such document it's not meaningful to speculate as to what is going on. – Mico Aug 05 '16 at 07:31