css 在Shiny中对齐Mathjax

kupeojn6  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(71)

我已经找到了在我闪亮的应用程序中左对齐所有Mathjax方程的方法,但我想把几个方程居中。有没有一种方法可以区别地应用这个CSS?

tags$style(HTML("div.MathJax_Display{text-align: left !important;}"))),

有没有办法指定“text-align:当我把方程发送到输出时,“中心”是什么意思?

withMathJax(tags$p(equation))
yyyllmsg

yyyllmsg1#

你可以按如下方式使用CSS类:

library(shiny)

ui <- fluidPage(
  withMathJax(),
  tags$style(HTML(
    "p.mjleft div.MathJax_Display{text-align: left !important;}",
    "p.mjcenter div.MathJax_Display{text-align: center !important;}"
  )),
  br(),
  tags$p("$$\\int_0^1$$", class = "mjleft"),
  tags$p("$$\\int_0^1$$", class = "mjcenter")
)

server <- function(input, output) {}

shinyApp(ui, server)

相关问题