I have an interactive RMarkdown document. The table-of-contents (TOC) works fine with rmarkdown::render(), but doesn't work with rmarkdown::run().

Here is my test code:

---
title: "Testing shiny Rmd"
output:
  html_document:
    toc: true
    toc_float: true
    number_sections: true
    theme: united
    highlight: textmate
runtime: shiny
---

# Section A

This is some text

# Section B

And some more text.

```{r,eval=FALSE}
data(iris)
plot(iris$Sepal.Length,iris$Sepal.Width)
```

Here is rmarkdown::render()

enter image description here

Here is rmarkdown::run()

enter image description here

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

rmarkdown_1.12
shiny_1.2.0 

0 Answers