I have strange behavior with MathJaxand shiny. I changed the example 01_hellofrom the package shinyto add the file .Rmdthrough includeMarkdown(). All I changed was ui.Ras follows:
mainPanel(
plotOutput("distPlot"),
includeMarkdown("mathjax-test.Rmd")
)
The content of my test file ( mathjax-test.Rmd) looks like this:
Document used as is in .Rmd format.
Here an inline equation with dollar signs: $a + b = c$
Here an inline equation with slashes/parentheses: \(a + b = c\)
Display format wth double dollar signs:
$$a + b = c$$
Display format with slashes/square brackets:
\[
a + b = c
\]
When I knit a file .Rmd, I get the expected results:

When I use runApp(), I get the following:

Things I tried:
- adding
withMathJax()after titlePanelin ui.Rfor this RStudio page - wrapping
includeMarkdown()insidewithMathJax() - put
library(shiny)and withMathJax()in the code block at the top of the file.Rmd - , ,
includeMarkdown() mainPanel ui.R:
tags$script(src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML")
, ! <head> shiny :
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
?