如何将 LaTeX 代码嵌入到 R-Shiny 应用程序中

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

我正在创建一个 R-Shiny 应用程序,用户将从下拉菜单中选择一个选项,并根据所选内容显示一组不同的 LaTeX 输出。 我正在尝试使用 withMathJax() 函数,但它没有以所需的设置向我输出文本。这是它在我的 R-Shiny 应用程序中如何显示的片段:

这就是文本在我的代码中的保存方式:

var1 = "\\subsection{Normal Linear Regression}
\\subsubsection{Conditions}
\\begin{itemize}
    \\item Independence of observations. All data used must be independent of one another (something which is \\textbf{not true} in time series data)
    \\item Linearity between predictor variables and response variable
    \\item Error term is normally distributed with mean 0 and constant variance
    \\item Little or no collinearity between predictors
\\end{itemize}"

这就是它作为 ui 的一部分存储的方式:

fluidRow(
          column(width = 6,
                 uiOutput("ContinuousShow1")
                 ),

这就是它在服务器功能中的显示方式:

output$ContinuousShow1 <- renderUI({
    withMathJax(
      helpText(var1)
    )
  })

关于如何使其正确显示的任何想法?

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