Adding a function to convert an Rmd to a single latex fragment
This commit is contained in:
parent
aedc1c8bcc
commit
d886ad0d8a
1 changed files with 7 additions and 0 deletions
7
Rmd2Latex-fragment.R
Normal file
7
Rmd2Latex-fragment.R
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue