call mathjax bundled with Rstudio from shiny app

8 views
Skip to first unread message

Vincent

unread,
Jan 22, 2017, 1:15:30 AM1/22/17
to Shiny - Web Framework for R
Sys.getenv("RMARKDOWN_MATHJAX_PATH") gives the path to mathjax bundled with Rstudio. How would you use this from a shiny app (e.g., when off line)?

I tried the function below as an alternative to withMathJax but can't get math to render properly.

withMathJaxR <- function (...)  {
    path
<- paste0(Sys.getenv("RMARKDOWN_MATHJAX_PATH"),"/MathJax.js?config=TeX-AMS-MML_HTMLorMML")
    tagList
(tags$head(singleton(tags$script(src = path, type = "text/javascript"))),
           
..., tags$script(HTML("if (window.MathJax) MathJax.Hub.Queue([\"Typeset\", MathJax.Hub]);")))
}

Reply all
Reply to author
Forward
0 new messages