Quoting from the pgfSweave manual:
How do I set subdirectories for gures and caches? This is straight out of the Sweave and cacheSweave manuals (nothing new here). For a figures subdirectory use the prefix.string option:
\SweaveOpts{prefix.string=figs/fig}
For a caching subdirectory use a code chunk at the beginning or your document like:
<<setup,echo=F>>=
setCacheDir("cache")
@
I find it annoying that the two options are in different places, R code vs. latex directive. Is there a way to set the prefix.string
option with R code, perhaps before Sweave
is called?
Sweave options can be set globally either by using \SweaveOpts
or in the call to Sweave
, like this:
Sweave("tmp.Rnw", prefix.string="figs/figs")
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