Adding a function to convert an Rmd to a single latex fragment

This commit is contained in:
Louis Lacoste 2023-07-01 18:09:48 +02:00
parent aedc1c8bcc
commit d886ad0d8a

7
Rmd2Latex-fragment.R Normal file
View file

@ -0,0 +1,7 @@
require("knitr")
create_latex <- function(f) {
knitr::knit(f, "/tmp/tmp-outputfile.md")
newname <- paste0(tools::file_path_sans_ext(f), ".tex")
mess <- paste("pandoc -f markdown -t latex -p -o", shQuote(newname), "/tmp/tmp-outputfile.md")
system(mess)
}