Xaringan: mathjax="local" not working

Created on 25 Dec 2016  路  5Comments  路  Source: yihui/xaringan

I've tried to add mathjax="local" to moon_reader and I get an error:

pandoc: models_files/mathjax-local/MathJax.js?config=TeX-AMS-MML_HTMLorMML: openFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1

It doesn't seem to be a problem of pandoc because it worked with html_document()

question

All 5 comments

mathjax='local' is not supported in this package; you have to download a copy of MathJax, and point the option mathjax to the actual path of MathJax.js.

If you use this package in RStudio, you should not worry about MathJax. In theory, your math expressions can be rendered even if you don't have internet connection, since RStudio will use a local version of MathJax.

(I don't use RStudio)
you mean rmarkdown::render("testcss.Rmd",xaringan::moon_reader(mathjax='path here')) ?

Yes. Or specify the MathJax path in YAML (recommended), so you only need rmarkdown::render("testcss.Rmd").

sorry for the non-bugs! Now I feel like Peter and the Wolf.
I tried it here and I get this:

openFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
> 

A minimalistic example with html_document worked:

---
title: "Habits"
output:
  html_document:
    mathjax: "MathJax-2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
---

It seems this is a bug of either rmarkdown or Pandoc. I don't have the time to investigate it, and I just provided a workaround in xaringan, so that your example above should work now:

devtools::install_github('yihui/xaringan')
Was this page helpful?
0 / 5 - 0 ratings