Hen*_*ndy 5 r mathjax knitr shiny
我对MathJax和 的行为很奇怪shiny。我已经修改了包01_hello中的示例以shiny通过. 我所做的修改如下:.RmdincludeMarkdown()ui.R
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot"),
includeMarkdown("mathjax-test.Rmd")
)
Run Code Online (Sandbox Code Playgroud)
我的测试文件()的内容mathjax-test.Rmd如下:
## mathjax test
Document used as is in .Rmd format.
Here's an inline equation with dollar signs: $a + b = c$
Here's 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
\]
Run Code Online (Sandbox Code Playgroud)
当我编织.Rmd文件时,我得到了预期的结果:
当我使用时runApp()我得到这个:
我尝试过的事情:
withMathJax()之后添加titlePanelui.RincludeMarkdown()在里面withMathJax()library(shiny)and放入文件withMathJax()顶部的代码块中.RmdincludeMarkdown()在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>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?