cssrtextshinymathjax

How to increase quality of mathjax output?


I am using mathjax and Shiny to display equations. But the output text doesn't seem to me to be of very high quality. How do I increase the dpi or the resolution of the output, which seems to be a dull or transparent black or isn't at it's full "brightness", if that makes sense?

library(shiny)
library(mathjaxr)

ui <- fluidPage(
      title = 'MathJax Examples',
      uiOutput('ex3'))

server <- function(input, output, session){
                   output$ex3 <- renderUI({
                   withMathJax(
                       helpText(        
    "$$\\log_{10}p_w = \\frac{-1.1489t}{273.1+t}-1.330\\text{e-}05t^2 + 9.084\\text{e-}08t^3 - 1.08\\text{e-}09t^4 +\\log_{10}p_i\\\\[15pt]
               \\log_{10}p_i=\\frac{-2445.5646}{273.1+t}+8.2312\\log_{10}\\left(273.1+t\\right)-0.01677006\\left(273.1+t\\right)+1.20514\\text{e-}05\\left(273.1+t\\right)^2-6.757169\\\\[15pt]
               p_i=saturated\\space vapor\\space pressure\\space over\\space ice\\space \\left(mmHg\\right)$$"               
  ))    
})}

shinyApp(ui = ui, server = server)

Solution

  • helpText is only a wrapper for span(class = "help-block", ... and .help-block has a grey color which is responsible for the low "brightness". Hence, you just can add a style argument and apply arbitrary CSS in order to display the text as you wish, e.g., with black color:

    helpText(
            "$$\\log_{10}p_w = \\frac{-1.1489t}{273.1+t}-1.330\\text{e-}05t^2 + 9.084\\text{e-}08t^3 - 1.08\\text{e-}09t^4 +\\log_{10}p_i\\\\[15pt]
                   \\log_{10}p_i=\\frac{-2445.5646}{273.1+t}+8.2312\\log_{10}\\left(273.1+t\\right)-0.01677006\\left(273.1+t\\right)+1.20514\\text{e-}05\\left(273.1+t\\right)^2-6.757169\\\\[15pt]
                   p_i=saturated\\space vapor\\space pressure\\space over\\space ice\\space \\left(mmHg\\right)$$"
            ,
            style = "color: black;"
          )
    

    enter image description here