我想在闪亮的面板中显示 -LaTeX 格式的 - 公式,但我找不到组合的方法textOutput
with withMathJax
。我尝试了以下方法,但没有成功。任何帮助将不胜感激。
--ui.r
...
tabPanel("Diagnostics", h4(textOutput("diagTitle")),
withMathJax(textOutput("formula")),
),
...
--服务器.r
...
output$formula <- renderText({
print(paste0("Use this formula: $$\\hat{A}_{\\small{\\textrm{M€}}} =", my_calculated_value,"$$"))
})
...
Use uiOutput
在 UI 端和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)
更多示例:http://shiny.leg.ufpr.br/daniel/019-mathjax/ http://shiny.leg.ufpr.br/daniel/019-mathjax/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)