Skip to content

Instantly share code, notes, and snippets.

Last active Dec 10, 2015
What would you like to do?
# to add latex equations to a Rmd file, enclose the equations using the $ $ syntax
# and run knit_equation on the Rmd file instead of knit
knit_equation = function(rmd, md) {
gist_url = ''
#gist_url = ''
tmp = tempfile()
knit(rmd, tmp)
f = file(md, "w")
header = getURL(gist_url, ssl.verifypeer = FALSE)
writeLines(header, f)
writeLines(readLines(tmp), f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment