我正在使用 mathjax 和 Shiny 来显示方程。但在我看来,输出文本的质量不是很高。如果有意义的话,如何提高输出的 dpi 或分辨率,它看起来是暗淡或透明的黑色,或者不是完全的“亮度”?
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)
helpText
只是 span(class = "help-block", ...
的包装,而 .help-block
具有灰色,这是造成低“亮度”的原因。因此,您只需添加一个 style
参数并应用任意 CSS
即可按照您的意愿显示文本,例如,使用黑色:
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;"
)