0

I am trying to create a bibliography, using natbib, but only one of the references can be cited in my tex file - the others appear as ? in the tex and not at all in the References section.

Here is the bib file

@misc{Bates2013,
   author = {Bates, Douglas and Maechler, Martin and Bolker, Ben},
   title = {lme4: Linear mixed-effects models using S4 classes},
   url = {http://CRAN.R-project.org/package=lme4},
   year = {2013},
   type = {Computer Program}
}

@article{Raghunathan2004,
   author = {Raghunathan, Trivellore E},
   title = {What do we do with missing data? Some options for analysis of incomplete    data},
   journal = {Annu. Rev. Public Health},
   volume = {25},
   pages = {99-117},
   ISSN = {0163-7525},
   year = {2004},
   type = {Journal Article}
}

Here is the bbl file

\begin{thebibliography}{1}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\expandafter\ifx\csname urlstyle\endcsname\relax
  \providecommand{\doi}[1]{doi: #1}\else
  \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi

\bibitem[Bates et~al.(2013)Bates, Maechler, and Bolker]{Bates2013}
Douglas Bates, Martin Maechler, and Ben Bolker.
\newblock lme4: Linear mixed-effects models using s4 classes, 2013.
\newblock URL \url{http://CRAN.R-project.org/package=lme4}.

\end{thebibliography}

And here is the blg file

This is BibTeX, Version 0.99dThe top-level auxiliary file: flex1.aux
The style file: plainnat.bst
Database file #1: flex1.bib

And in my tex file I have

%[preamble]

\usepackage[round]{natbib}

%[section]

\citep{Raghunathan2004, Bates2013}


\section{Bibliography}

\bibliographystyle{plainnat}
\bibliography{flex1}

\end{document}

This is displayed as

(? Bates et al., 2013)

and

References Douglas Bates, Martin Maechler, and Ben Bolker. lme4: Linear mixed-eects models using s4 classes, 2013. URL http://CRAN.R-project.org/package=lme4.

Could anyone let me know what I am doing wrong ?

Update, as per the comment by mafp, I have run pdflatex, bibtex, pdflatex, pdflatex, and this has magically solved the problem ! Could anyone explain why this is needed ?

Joe King
  • 193
  • Just to be really sure, run pdflatex, bibtex, pdflatex, pdflatex again. (This is the equivalent of turning the computer off and on again ;-)) – mafp Jul 03 '13 at 14:20
  • @mafp this has worked ! Could you convert your comment to an answer, so I can accept, along with an explanation of why this is needed ? – Joe King Jul 03 '13 at 15:14
  • On that basis, it's a dupe: I've marked as such – Joseph Wright Jul 03 '13 at 15:26
  • Cheers! A good explanation why this worked can be seen in the first answer to the duplicated question. – mafp Jul 03 '13 at 16:45

0 Answers0