I'm trying to get references working in a knitr Rnw document using ESS, AUCTex, TeXLive, and natbib.
Here is a minimal example:
\documentclass{article}
\usepackage{natbib}
\begin{document}
<<setup, include=FALSE, cache=FALSE>>=
library(knitr)
@
<<normal-sample, echo=FALSE>>=
x <- rnorm(100)
plot(x)
@
The moon in June is like a big balloon \citep{smith2012}.
\bibliographystyle{apalike}
\bibliography{/path/to/my/references/refs}
\end{document}
When I run ess-swv-knit then ess-swv-PDF with M-n r then M-n P, I see errors like:
Package natbib Warning: Citation Smith2014 on page 23 undefined on input line 374
This is what I think is going on. Running ess-swv-PDF simply calls pdflatex, but to get the citations right, the correct number of bibtex and pdflatex commands need to be run.
Is there an way to do this by simply running M-n r then M-n P?
natbiband notbiblatex. You can find information about Emacs andbiblatexwith Biber at Biblatex with Biber: Configuring my editor to avoid undefined citations maybe some of that is applicable to BIbTeX as well. – moewe Sep 15 '15 at 05:30;-)– Romain Picot Sep 15 '15 at 06:40