Closed dmenne closed 11 years ago
Just to be clear, this workaround is directly based on what RStudio does. The stripped down Mathjax version is the same one found with RStudio. Here is the pruning script that RStudio uses https://github.com/rstudio/rstudio/blob/master/dependencies/tools/prune-mathjax.
Hi Dieter,
Ramnathv has the right idea -- you'd want to copy the "pruned" MathJax to the same directory as your R Markdown document and then change the MathJax URL within your document to point to the local copy (unless it's possible to point to an absolute file path -- not sure whether this would work).
Another thing to note: the RStudio Preview HTML window does use a local copy of MathJax embedded in RStudio. So if you display your documents as RStudio previews rather than in a standalone browser they should work fine offline.
J.J.
Thanks to both of you. From the MathJax page, and from Yihui's message that the never has tried it, I got the impression that this is an unstable configuration. But if the Preview used it, this should be fine.
Alas, using the RStudio preview is not an option in the normal case where you are supposed to deliver you presentation as one file on an USB stick. Back to beamer.
If it is presentations you are looking for, take a look at an R package I am developing, Slidify, that helps create html presentations from R markdown. It supports the local fallback for Mathjax that I highlighted in my comments here.
Clearly I know that package; as you mentioned it I noted that I used it already with formulae without thinking. The problem only turned up now when I had to write report-style, and wanted to show some parts of it in a hospital.
@dmenne Although not documented, Slidify can do report-style documents too. For instance, the website http://slidify.org was generated by Slidify. It just requires a template to be defined. Another example is here.
Buzz me on the Slidify issues page and I can help get you set up, if you are interested.
In hospitals and when visiting customers, I rarely have Internet access during a presentation and cannot rely on the cache of my computer.
Is there a chance to optionally use Ramnath's workaround with a markdown option? In know that MathJax is supposed to be used online, but we do not all work in IT departments.
https://groups.google.com/forum/?fromgroups=#!topic/knitr/uXjfuiue08Q
Dieter