I want to have both: a floating TOC and a TOC at the start of the report (in Rmarkdown). I think it's only possible to have one.
Here, I have manually added a TOC.
---
title: "Report"
author: "Anon"
date: '2022-07-20'
output:
html_document:
toc: true
toc_float: true
toc_depth: 2
collapsed: true
smooth_scroll: true
---
## Table of Contents
- R Markdown
- Including Plots
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
## Including Plots
You can also embed plots, for example:
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
I followed this question but I can either have a floating TOC OR a TOC at the beginning. I want both. It's one of the requirement by a client.