mathjax/latex 在使用 renderUI() 时不起作用

问题描述 投票:0回答:0

我能够在我的 Shiny 应用程序中使用 LaTeX,如下所示:

  tags$head(
    tags$script(
      type = "text/javascript",
      src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
    )
  )

UI.R
的某个循环中,我写了:

radioButtons(paste0("answr", t), "", choices = df_solutions[[t]][["answers"]]),
 

df_solutions[[t]][["answers"]]
通常包含以下内容:
Solution 1 is: \\( e^x \\)
.

之前的代码包含在

UI.R
文件中。到目前为止一切顺利,这有效!

但是,由于其他一些原因,我还需要

server.R
中生成此列表(除其他外)。

我正在使用

renderUI()
元素并尝试在此函数中包含与上面相同的 radioButtons 代码。
output$questionList <- renderUI()
然后通过
UI.r
传递给
uiOutput("questionList")
但 LaTeX 代码不再呈现(仅纯文本)。

我试图将

tags$script()
包含在
renderUI()
中,但这并不能解决问题。

r shiny mathjax
© www.soinside.com 2019 - 2024. All rights reserved.