问题
I have a .Rnw file (Test.Rnw) in RStudio with citations. The .bib file is in the same folder as the .Rnw file, but when I compile the .Rnw file, no .bbl file is written out and I get the error:
There were undefined citations
And checking the log, I find, as expected:
No file Test.bbl
This is the code I'm trying to compile:
\documentclass[12pt, oneside]{article}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage[sort,comma,numbers,super]{natbib}
\usepackage{url}
\usepackage{enumitem}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper, top=1in, bottom=1in, right=1in, left=1in]{geometry}
\begin{document}
\title{Analysis}
\author{Amanda E. Gentry}
\date{April 7, 2019}
\maketitle
\section{Introduction}
Some text\citep{Hoerl70}. More text\citep{Tibshirani96}. Even more text\citep{Zou05}.
Code section below:
<<loading, echo=FALSE, eval=TRUE, message=F, warning=F>>=
x <- seq(1:10)
summary(x)
@
\bibliography{Refs}
\bibliographystyle{plain}
\end{document}
I have searched the web for answers but found nothing that directly relates to this issue or how to fix it so far.
Interestingly enough, this same code will compile properly in RStudio version 1.1.143 (which I have installed on another machine) but will not compile in the newest version of RStudio nor on any of the older versions (going back about 3 versions) and 1.1.143 is not an archived version currently available for download.
I have posted this issue to the RStudio Community board without luck so far.
Edits: Here is the .bib file I'm using
@Article{Hoerl70,
author={Arthur E. Hoerl and Robert W. Kennard},
title={Ridge Regression: Biased Estimation for Nonorthogonal Problems},
journal={Technometrics},
volume={12},
number={1},
year={1970},
pages={55-67}
}
@article{Tibshirani96,
author={Robert Tibshirani},
title={Regression Shrinkage and Selection via the Lasso},
journal={Journal of the Royal Statistical Society, Series B},
volume={58},
number={1},
year={1996},
pages={267-288}
}
@Article{Zou05,
author={Hui Zou and Trevor Hastie},
title={Regularization and variable selection via the elastic net},
journal={Journal of the Royal Statistical Society Series B-Statistical Methodology},
volume={67},
number={Part 2},
pages={301-320},
year={2005}
}
And this is a screen grab of the error messages:

来源:https://stackoverflow.com/questions/55682811/rstudio-will-not-write-a-bbl-file-when-compiling-rnw-file-with-citations-in-na