I just posted a question regarding equation wrapping with shinydashboard here. The answer presented worked, but my actual example is more complicated and includes tabItems. Unfortunately, including the MathJax config at the beginning of the dashboardBody does not wrap the equation when the box is in a tabItem. MWE:
library(shinydashboard)
library(shiny)
# UI
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
menuItem( "TEST", tabName = "test", selected = T)
),
dashboardBody(
tags$head(tags$script(type = "text/x-mathjax-config", 'MathJax.Hub.Config({
"HTML-CSS": { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } }
});')),
tabItems(
tabItem(tabName = "test",
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)
The preceding code yields:
I have tried placing the MathJax config at the beginning of tabItems and tabItem to no avail. Can anyone explain where to place the MathJax config? A brief explanation of MathJax config more generally would be quite helpful.


