rstudio / markdown

The first generation of Markdown rendering for R (born in 2012), based on commonmark. Note that this package is markdown, not *rmarkdown*.
https://cran.r-project.org/package=markdown
Other
84 stars 78 forks source link

MathJax embedded option #22

Closed dmenne closed 11 years ago

dmenne commented 11 years ago

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

ramnathv commented 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.

jjallaire commented 11 years ago

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.

dmenne commented 11 years ago

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.

ramnathv commented 11 years ago

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.

dmenne commented 11 years ago

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.

ramnathv commented 11 years ago

@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.