### R code from vignette source 'Sweave.Rnw'

###################################################
### code chunk number 1: Sweave.Rnw:143-145
###################################################
rnwfile <- system.file("Sweave", "example-1.Rnw", package = "utils")
Sweave(rnwfile)


###################################################
### code chunk number 2: Sweave.Rnw:147-151
###################################################
rnwfileb <- basename(rnwfile)
texfileb <- sub("Rnw$", "tex", rnwfileb)
pdffileb <- sub("Rnw$", "pdf", rnwfileb)
plotfileb <- sub("\\.tex$", "-003.pdf", texfileb)


###################################################
### code chunk number 3: Sweave.Rnw:156-157
###################################################
tools::texi2pdf("example-1.tex")


###################################################
### code chunk number 4: Sweave.Rnw:393-394
###################################################
SweaveSyntConv(rnwfile, SweaveSyntaxLatex)


###################################################
### code chunk number 5: Sweave.Rnw:521-522 (eval = FALSE)
###################################################
## help("Sweave")


###################################################
### code chunk number 6: Sweave.Rnw:531-532 (eval = FALSE)
###################################################
## help("RweaveLatex")


###################################################
### code chunk number 7: Sweave.Rnw:544-547
###################################################
rnwfile <- system.file("Sweave", "example-2.Rnw", package = "utils")
Sweave(rnwfile)
tools::texi2pdf("example-2.tex")


###################################################
### code chunk number 8: Sweave.Rnw:549-551
###################################################
rnwfileb <- basename(rnwfile)
pdffileb <- sub("Rnw$", "pdf", rnwfileb)


###################################################
### code chunk number 9: Sweave.Rnw:600-603
###################################################
rnwfile <- system.file("Sweave", "example-3.Rnw", package = "utils")
Sweave(rnwfile)
tools::texi2pdf("example-3.tex")


###################################################
### code chunk number 10: Sweave.Rnw:605-607
###################################################
rnwfileb <- basename(rnwfile)
pdffileb <- sub("Rnw$", "pdf", rnwfileb)


###################################################
### code chunk number 11: Sweave.Rnw:702-703 (eval = FALSE)
###################################################
## options(prompt = "MyR> ", continue = "...")


###################################################
### code chunk number 12: Sweave.Rnw:749-750 (eval = FALSE)
###################################################
## help("Rtangle")


###################################################
### code chunk number 13: Sweave.Rnw:789-790
###################################################
Stangle(rnwfile, split = TRUE, annotate = FALSE, chunk.sep = "\n")


###################################################
### code chunk number 14: Sweave.Rnw:792-793
###################################################
rfile <- sub("\\.Rnw$", "-main.R", rnwfileb)
