I have recently installed LaTeX on my Mac using the standard MacTeX package. I have 2 documents (my thesis and a paper I'm writing) and I have tried to compile both.
Neither will compile the references or the bibliography… I keep getting the same error
Citation undefined,
Undefined references,
I have the following code
testDoc.tex
:
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[applemac]{inputenx}
\begin{document}
This is my first document with a bibliography generated by Bib\TeX. Now I cite an article by Duffie\cite{Duffie2001}.
\bibliographystyle{plain}
\bibliography{foo}
\end{document}
In the same folder I have a foo.bib
file.
foo.bib
@BOOK{Duffie2001,
title = {{Dynamic Asset Pricing Theory}},
year = {2001},
author = {Duffie, Darrell},
edition = {3}
}
Please note that this is just a simple example. My thesis has 100 references and my paper has 48.
When I compile that simple document it gives me the error :
LaTeX Warning: Citation `Duffie2001' on page 1 undefined on input line 7.
No file testDoc.bbl.
However I have not referenced a file testDoc.bib
but foo.bib
If I rename foo.bib
to testDoc.bib
I get that same error.
Things I have tried
- I have tried 3 different editors each has the same error, Texmaker is my favourite and is the one I'm trying to get working
- I have checked the settings to ensure that Texmaker is pointing at the
bibtex
program, it is (I think)/usr/local/texlive/2012/bin/x86_64-darwin/bibtex %.aux
Could anyone point me in the right direction?
Best Answer
Seems like you din’t run
bibtex
but only(pdf)latex
, right?LaTeX cares for typsetting the bib but you need another program (
bibtex
) to preprocess your.bib
to be used bypdflatex
. That means that you’ll need the following steps to get a bibliographytex
file and thebib
file.\bibliography
pdflatex mydoc.tex
to get a first version of your document knowing which entries of your bib are neededbibtex mydoc
to letbibtex
do the preprocessing based on theaux
file. That’ll generatemydoc.bbl
including all information thatpdflatex
needspdflatex mydoc.tex
again to get the newbbl
file included in your documentFor further information please consult any (good) book about LaTeX this is a basic topic and should be explained there.
Pleas note that
bibtex
is kind of outdated. The better way is to usebiber
in combination with the packagebiblatex
, which provides a great tool to format your citations and bibliography.