I can't get mathjax to render in any situation no matter what I do.

For example, this doesn't work:

library(shiny)

ui <- fluidPage(
  withMathJax(p("$$x$$")),
  p("$y$")
)

server <- function(input, output) {}

shinyApp(ui = ui, server = server)

I expected it to render roughly as:

x

y

But what I got was:

$$x$$

$y$

This seems to happen wherever I try to use withMathJax. There are no errors and the server even claims to be loading mathjax, but it doesn't appear.

1 Answers

0
Anonymous On

Okay, I fixed it in the end. The issue is that using $$ and $ do not work by default: you are expected to use \[ \] and \( \) respectively, although you can change it so that dollar signs work. I haven't checked it in Chrome, so possibly this is a thing in some browsers but not others. But just something to be aware of.