sweavepdf <-
function(file, ...) {
Sweave(file, ...)
textfile <- tools::file_path_sans_ext(file)
pdflatex(paste0(texfile,'.tex'))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.