# move example Sweave article and associated files to a temporary directory
example_dir <- system.file("examples", "sweave_article", package = "texor")
file.copy(from = example_dir, to = tempdir(), recursive = TRUE)
article_dir <- file.path(tempdir(), "sweave_article")
# convert example Sweave article to Rmd
rnw_to_rmd(file.path(article_dir, "example.Rnw"),
output_format = "bookdown",
clean_up = TRUE,
autonumber_eq = TRUE,
autonumber_sec = FALSE)
# convert Rmd to HTML (comment this step to avoid failure on R CMD Check)
# rmarkdown::render(file.path(article_dir, "example.Rmd"))
# browseURL(file.path(article_dir, "example.html"))
# remove temporary files
unlink(article_dir, recursive = TRUE)
Run the code above in your browser using DataLab