Вы можете использовать katex .
library(shiny)
choices <- c("less", "more", "equal")
choicesNames <- c("\\\\\\mu_0 \\leq 3",
"\\\\\\mu_0 \\geq 3",
"\\\\\\mu_0 = 3")
choices <- setNames(choices, choicesNames)
ui <- shinyUI(
fluidPage(
tags$head(
tags$link(rel="stylesheet",
href="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css", integrity="sha384-9tPv11A+glH/on/wEu99NVwDPwkMQESOocs/ZGXPoIiLE8MU/qkqUcZ3zzL+6DuH",
crossorigin="anonymous"),
tags$script(src="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.js", integrity="sha384-U8Vrjwb8fuHMt6ewaCy8uqeUXv4oitYACKdB0VziCerzt011iQ/0TqlSlv8MReCm",
crossorigin="anonymous")
),
selectizeInput(
"ID",
"LABEL",
choices,
options = list(render = I("
{
item: function(item, escape) {
var html = katex.renderToString(item.label);
return '<div>' + html + '</div>';
},
option: function(item, escape) {
var html = katex.renderToString(item.label);
return '<div>' + html + '</div>';
}
}"))
)
)
)
server <- function(input, output, session){
# server side code here...
}
shinyApp(ui = ui, server = server)