I have document that uses a LaTeX Beamer template and passes this code around the beginning of the actual document
\usepackage{Sweave}
\begin{document}
\SweaveOpts{concordance=TRUE}
The document compiles just fine using RStudio (0.97.248) with R-2.15.2. After I finish composition, to insure reproducibility, I like to generate the entire analysis from a cmd file (and use ghostscript to compress the PDF). The relevant parts are
R CMD Sweave MyDoc
pdflatex MyDoc
bibtex MyDoc
pdflatex MyDoc
pdflatex MyDoc
This fails with the error message
! LaTeX Error: File `MyDoc-concordance.tex' not found.
Which suggests that Sweave is not generating the concordance from the command line. A can't find a command line switch and my Google searches have not been helpful... I would greatly appreciate any pointers...
Typically you wil run into this problem when parsing .Rnw files on the command line that were first created in RStudio. The RStudio Sweave template has the \SweaveOpts{concordance=TRUE}
option as a default in the .Rnw file.
This seems to be an issue with Sweave that has not had much attention. Occasionally I run into this when working on the command line and the only work-around I have found is to set:
\SweaveOpts{concordance=FALSE}
in the file itself, delete all temporary latex and then run R CMD Sweave
again to create a new .tex file. The resulting file will work with either pdflatex
or xelatex
.
Apparently it is not possible to pass the request for a concordance file to Sweave (I tried R CMD Sweave MyDoc.Rnw --options=concordance=TRUE
as I mentioned in the comments).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With