Skip to content

Instantly share code, notes, and snippets.

@rs77
Created December 12, 2012 00:08
Show Gist options
  • Save rs77/4263616 to your computer and use it in GitHub Desktop.
Save rs77/4263616 to your computer and use it in GitHub Desktop.
Global RStudio IDE .Rprofile file that enables Pandoc to output HTML with LaTeX images using Google Charts API. The resulting output allows for pasting into learning management systems that have rich-text editors. More details on the workflow here: http://www.webed.com.au/34/my-workflow-for-teaching-mathematics-online/
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
system(paste("pandoc", shQuote(inputFile), "-s --webtex=http://chart.apis.google.com/chart?cht=tx\\&chf=bg,s,FFFFFF00\\&chl= --self-contained -o", shQuote(outputFile)))
}
)
print("Global (or Local) .Rprofile file has been loaded.") // change to Local if .Rprofile is stored in project
// there needs to be a blank file here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment