Shiny应用程序中的MathJax方程在本地渲染,但是在部署到Shinyapps.io时会中断

问题描述

这是一个Shiny应用程序,可使用MathJax渲染LaTeX方程。在本地运行此应用程序时,将渲染所有三个方程式(出于测试目的,它们是n <- 85 setdiff(1:n,c(1,85,5)) renderTablerenderText中的方程式。)

但是,当部署到Shinyapps.io时,唯一呈现的方程式是p标记调用的方程式。

p

library(shiny) eq <- "$$ \\frac{numerator}{denominator} \\!$$" ui <- { fluidPage( withMathJax(),# simple tableOutput - not rendered tableOutput('table'),# simple textoutput - not rendered textoutput('text'),# no actual rendering required - works properly p(eq) ) } server <- function(input,output,session) { output$text <- renderText(eq) output$table <- renderTable({ data.frame( v1 = 'simple equation',v2 = eq) }) } shinyApp(ui,server) 标记中的方程式正确呈现的事实似乎排除了以下想法:对MathJax Javascript的GET请求到服务器存在一些问题(您可以看到请求通过了)。 / p>

我还从本地浏览器中删除了缓存的数据(在Firefox和Chrome上进行了测试),等式仍然可以正常显示

有趣的是,检查本地版本会显示包装在p中的相关HTML元素(例如,表的td),而在Shinyapps.io版本中找不到此div。

日志中没有弹出任何问题;这是日志信息(请注意R版本;我尚未能够在R 4.0.2上进行测试):

  • 服务器版本:1.8.4.1-20
  • LANG:en_US.UTF-8
  • R版本:3.6.0
  • 闪亮版本:1.5.0
  • rmarkdown版本:(无)
  • httpuv版本:1.5.4
  • 编织器版本:(无)
  • jsonlite版本:1.7.0
  • rjsonio版本:(无)
  • htmltools版本:0.5.0
  • 使用pandoc:/ opt / connect / ext / pandoc2
  • 使用jsonlite进行JSON处理

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)