R 光泽面板中的乳胶配方

R 光泽面板中的乳胶配方,r,shiny,mathjax,R,Shiny,Mathjax,我想在一个闪亮的面板中显示一个-LaTeX formatted-公式,但我找不到将textOutput与withMathJax相结合的方法。我尝试了以下方法,但没有成功。任何帮助都将不胜感激 --用户界面 --服务器.r 。。。 输出$formula如何使用renderPrint() 最简单的工作示例: library(shiny) server <- function(input, output, session) { output$formula <- renderPrin

我想在一个闪亮的面板中显示一个-LaTeX formatted-公式,但我找不到将
textOutput
withMathJax
相结合的方法。我尝试了以下方法,但没有成功。任何帮助都将不胜感激

--用户界面

--服务器.r

。。。

输出$formula如何使用
renderPrint()

最简单的工作示例:

library(shiny)

server <- function(input, output, session) {

 output$formula <- renderPrint({
     print(paste0("Use this formula: $$\\hat{A}_{\\small{\\textrm{M€}}} =", 1,"$$"))
})

}

ui <- fluidPage(


  titlePanel("Hello Shiny!"),


  sidebarLayout(
    sidebarPanel(

    ),

    mainPanel(
      withMathJax(textOutput("formula"))
    )
    )
)

shinyApp(ui = ui, server = server)
库(闪亮)
服务器ui.R

服务器.R

output$formula <- renderUI({
    return(HTML(paste0("<p>", "Use this formula: $$\\hat{A}_{\\small{\\textrm{M€}}} =", my_calculated_value,"$$","</p>")))
})

output$formula在UI端使用
uiOutput
,在服务器端使用
renderUI
,用于动态内容

ui <- fluidPage(
  withMathJax(),
  tabPanel(
    title = "Diagnostics", 
    h4(textOutput("diagTitle")),
    uiOutput("formula")
  )
)

server <- function(input, output, session){
  output$formula <- renderUI({
    my_calculated_value <- 5
    withMathJax(paste0("Use this formula: $$\\hat{A}_{\\small{\\textrm{M€}}} =", my_calculated_value,"$$"))
  })
}

shinyApp(ui, server)

ui对我来说不起作用(R版本3.1.1,平台:i386-w64-mingw32/i386(32位),闪亮的{u 0.10.2.2)\hat{A}应该是这样的:输出仍然是这样的:使用以下公式:$$$\hat{A}{\small{\textrm{M}}}=1.69$$,奇怪的是,它在我的机器上运行得很好(我刚刚删除了
打印
,但应该不会有太大变化)。但是我有0.11.1。是这个脚本文件:
是的,在源代码页面我看到它被加载了。src=”“type=“text/javascript”TeX需要互联网环境。
tabPanel("Diagnostics", h4(textOutput("diagTitle")),
    withMathJax(uiOutput("formula")),
)
output$formula <- renderUI({
    return(HTML(paste0("<p>", "Use this formula: $$\\hat{A}_{\\small{\\textrm{M€}}} =", my_calculated_value,"$$","</p>")))
})
ui <- fluidPage(
  withMathJax(),
  tabPanel(
    title = "Diagnostics", 
    h4(textOutput("diagTitle")),
    uiOutput("formula")
  )
)

server <- function(input, output, session){
  output$formula <- renderUI({
    my_calculated_value <- 5
    withMathJax(paste0("Use this formula: $$\\hat{A}_{\\small{\\textrm{M€}}} =", my_calculated_value,"$$"))
  })
}

shinyApp(ui, server)