diff --git a/Rmd2Latex-fragment.R b/Rmd2Latex-fragment.R index ffcdd30..02fcbb6 100644 --- a/Rmd2Latex-fragment.R +++ b/Rmd2Latex-fragment.R @@ -1,7 +1,11 @@ +#!/usr/bin/env Rscript 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) -} \ No newline at end of file +} +args <- commandArgs(trailingOnly = TRUE) + +create_latex(args) \ No newline at end of file