posit-dev / r-shinylive

https://posit-dev.github.io/r-shinylive/
Other
147 stars 15 forks source link

Mathjax not rendering #57

Closed EinMaulwurf closed 5 months ago

EinMaulwurf commented 5 months ago

Problem: Mathjax is not rendering when inside a shinylive-r app.

Minimum Reproducible Example:

ui <- fluidPage(
  titlePanel("Example"),
  withMathJax(),
  helpText('An irrational number \\(\\sqrt{2}\\)')
)

server <- function(input, output) {}

shinyApp(ui = ui, server = server)

running as a "normal" shiny app works fine, but when it's inside a shinylive-r environment it does not render properly.

Bildschirmfoto 2024-02-22 um 18 40 32
georgestagg commented 5 months ago

This is a duplicate of #49, and the same underlying problem as #51.

Should be fixed by https://github.com/posit-dev/shinylive/pull/112.

EinMaulwurf commented 5 months ago

Thanks.

I fixed it by including

library(shiny)
options(shiny.mathjax.url = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js")