将方程式放在闪亮仪表板的方框中 [英] Wrap equations in box in Shiny Dashboard

查看:0
本文介绍了将方程式放在闪亮仪表板的方框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在shinydashboard中遇到了一个问题,在box中,我正在编写的方程式在放入box时没有换行。这些方程正在超出box的限制。MWe:

library(shinydashboard)
library(shiny)

# UI
ui <- dashboardPage(
    dashboardHeader(),

    dashboardSidebar(),

    dashboardBody(
        fluidRow(
            column(width = 6,
                   box("Long Equation", width = 12,

                       h3(withMathJax("$$ \alpha  + \beta + \gamma + \delta + \alpha  + \beta + \gamma + \delta + \alpha  + \beta + \gamma + \delta + $$")))

                       )  
        )
    )
)

# Server
server <- function(input, output) {

}

# Run the application 
shinyApp(ui = ui, server = server)

此示例生成:

我在boxes中也遇到过同样的数据帧问题,但在网上找不到任何答案。有谁有解决方案来确保box内容不会超出box的边界?

推荐答案

以下是要使用的MathJAX配置:

  dashboardBody(
    tags$head(tags$script(type = "text/x-mathjax-config", 
                          'MathJax.Hub.Config({
  "HTML-CSS": { linebreaks: { automatic: true } },
         SVG: { linebreaks: { automatic: true } }
});')),
    fluidRow(......

这篇关于将方程式放在闪亮仪表板的方框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆