R Shiny App with Tabset and Equations in Rmarkdown

Viewed 66

How can you output tabsets and equations together within an rmarkdown file, render and include within a Shiny app (without rendering to HTML).

app.R

library(shiny)
library(knitr)

# Render beforehand
knit("example.Rmd")

ui <- fluidPage(

  uiOutput("rmarkdown")
  
)

server <- function(input, output) {

  output$rmarkdown <- renderUI({
    
    renderUI(withMathJax(includeMarkdown("example.md")))
    
  })
  
  
}

shinyApp(ui = ui, server = server)

example.Rmd

---
title: "example"
output: html_document
date: '2022-08-05'
---

## Test 1 {.tabset}

A B C D

### TAB 1

$$
E(X)
$$
### TAB 2

$$
E(Y)
$$

NOTE: If I render to html and use renderUI(includeHTML(app_sys("app/www/transistor_definitions.html"))), equations and tabs are working but it breaks the UI of an app with tabsetPanel in app.R. Therefore I would prefer not to use this.

0 Answers
Related