rstudio/markdown — pull request #44 by HenrikBengtsson (2013-11-24 01:51:51+00:00)
Title: Option 'mathjax_embed' for downloading and embedding the MathJax script

This is related to [Issue #22](https://github.com/rstudio/markdown/issues/22)

I've added a `.mathJax(url, embed)` function that makes it possible to download and insert the MathJax script into the HTML document rather than to link to it online. The downloaded Javascript is cached through-out the session. This should solve the problem of viewing the HTML document offline. It makes it is possible to create self-contained HTML documents. (BTW, should there be a global argument/option "embed" that forces insertion of MathJax, base64-encoding of images and more?)

The new feature can be controlled by a new HTML option ''mathjax_embed', e.g.

```
options(markdown.HTML.options=c(markdownHTMLOptions(default=TRUE), "embed"))
markdownToHTML('LoremIpsum.md')
```

I've prepared `.mathJax()` so one can use different URLs (http, https, or file), but it's not clear how to make it a user option, because `markdownHTMLOptions()` only supports "flags" and no values.