testfile <- system.file("examples", "example-extra.Rnw", package = "RweaveExtra")
oldwd <- setwd(tempdir())
## Check the contents of the file
if(interactive()) file.show(testfile)
## Weave, then tangle the file in the current working directory
Sweave(testfile, driver = RweaveExtraLatex())
Stangle(testfile, driver = RtangleExtra())
## View weaved and tangled files
if(interactive()) file.show("example-extra.tex")
if(interactive()) file.show("example-extra.R")
if(!interactive()) unlink("example-extra*")
setwd(oldwd)
Run the code above in your browser using DataLab