Since at some point I had trouble with a conflict between knitr and the latex package textpos, I used the lesser Sweave in Another Experiment with R and Sweave. I ran the Sweave2knitr command and discovered that textpos and knitr play well together now. Here is the result using knitr (go to https://www.box.com/s/4nftk6qpa0cugapmncsn if the embed does not show below):
Thanks a lot for sharing!
ReplyDeletegot it to work right away with the following:
### Delete these 3 lines from onepager+with+knitR.Rnw
<>=
opts_chunk$set(concordance=TRUE)
@
Execute the following in R:
### Load the knitr package
library(knitr)
### Set knitr options
opts_chunk$set(echo=FALSE, concordance=TRUE)
### Create a dated file name for the output file
onepagereportdated <- paste0("onepager+with+knitR_",format(Sys.time(),"%Y%m%d"),".tex")
### Run knitr on the .Rnw file to produce a .tex file
knit("onepager+with+knitR.Rnw",output=onepagereportdated)
### Run texi2pdf on the .tex file within R or process it from your latex system
tools::texi2pdf(onepagereportdated)
Playing around with this and your previous post on sweave, I discovered that:
ReplyDelete\section*{\Huge etc. --> okay
\section{\Huge etc. --> not okay
Omitting the star led to uninformative error messages and failure to compile altogether.
It's most likely related to the tufte class, which I'm not familiar with.