【问题标题】:R shiny with mathjax conditional casesR 在 mathjax 条件案例中闪闪发光
【发布时间】:2018-11-11 03:54:12
【问题描述】:

您好,我知道您可以使用 withMathJax 函数在 R-shiny 应用程序中创建内联方程,但据我所知,它是简单的数学方程,您可以像在 Rshiny 示例 here 中一样使用。我想知道是否有任何新的如何添加条件案例,就像您在乳胶中使用以下代码一样

f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}

这会产生以下内容,干杯

【问题讨论】:

    标签: r shiny conditional mathjax


    【解决方案1】:

    我认为这就是你想要的还是?

    library(shiny)
    
    ui <- {fluidPage(
      title = 'MathJax Examples',
      withMathJax(),
      uiOutput('ex4')
      )}
    
    server <- function(input, output, session) {
      output$ex4 <- renderUI({
        withMathJax(
          helpText('$$f(n)=\\begin{cases}
                   n/2,  & \\text{if $n$ is even} \\\\
                   3n+1, & \\text{if $n$ is odd}
                   \\end{cases}\\!$$'))
      })
    }
    shinyApp(ui, server)
    

    【讨论】:

      【解决方案2】:

      how to acheive conditional output based on tab selection in shiny app

      我认为上面的链接可以为您提供有关如何编写条件案例的良好信息。它还有一个链接,其中包含应用条件案例的适当教程。希望对您有所帮助。

      【讨论】:

      • 我认为问题是关于 MathJax 风格的条件案例,而不是闪亮的条件面板。
      • 这对问题有一点帮助,因为它在标签条件案例中提到,它并不总是关于 ezact ans 而是 somethime ref。也工作 SeGa 6 先生
      • 我认为这个问题很清楚并且很好地说明了。不过,条件标签可能有点混乱。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-07
      • 2015-04-19
      • 1970-01-01
      • 1970-01-01
      • 2016-04-10
      • 2014-06-16
      • 1970-01-01
      相关资源
      最近更新 更多