1

I am trying to find a way to get a "retractable" TOC of my rnotebook as a left sidebar (by this I mean the TOC should totally disappear).

The idea being that the basic TOC takes too much room on the left side of my document.

I found an example for instance here or the amazing toc2 from jupyter extensions

Is there anything that already exists or how can I use something else (like the one I linked to above)

Here is a tiny example (for example purposes as it is not what I want) that uses a "static" TOC, I would like a way to make the TOC "retractable"

---
title: "Example"
author: you
output:
  html_notebook:
    toc: true
    toc_depth: 3
    toc_float:
      collapsed: true
      smooth_scroll: true
---

# Title
## Sub title

```{r}
library(data.table)
library(ggplot2)
set.seed(1L)
data <- data.table(x = -5:4, y = -5:4 + runif(10))
ggplot(data, aes(x, y)) + geom_line() + geom_point()
```
statquant
  • 13,672
  • 21
  • 91
  • 162
  • Yes it should totally disappear `collapsed` only hide sub-sections but the TOC is always there and takes some room on the left – statquant Jan 31 '21 at 12:13
  • Why are you saying I do not want any TOC ? As I clearly say in the question I want a TOC and I want thos TOC to be retractable like TOC2 in jupyter notebook – statquant Jan 31 '21 at 12:26

0 Answers0