In rmd bookdown files there is the possibility to hide the toc in html output automatically when not used.
But this behavior does not work with quarto qmd -> html output. Is there something similar available?
Rmd file:
---
title: "My Title"
author: "My Name"
output:
bookdown::html_document2:
keep_tex: true
toc: true
toc_float: true
toc_depth: 5
---
```{r setup, include=FALSE}
require(Hmisc)
```
`r Hmisc::hidingTOC(hidden=TRUE,levels=0)`
# Header 1
## Sub header 1
# Header 2
## Sub header 2
Hmisc::hidingTOC() is here the function for auto hiding.
toc
when the output format ishtml
but show thetoc
when output format is anything else, say,pdf
? – InsensatehidingTOC()
function is documented to work on Rmd files, and doesn't mention Quarto. I think you'll need to update it. What it does is to insert some Javascript and CSS into the document; you need to figure out what has changed, and make it Quarto compatible. The source is pretty well documented, so this should be doable. – StonecutterhidingTOC
hasn't been updated in some time. If anyone wants to work on it the source code is here. – Sulphuryl