How to add table of contents to R Markdown HTML file using pandoc but retain all the HTML formatting and header information?
E.g., If I had a file called test.html
, I tried:
pandoc -s -S --toc test.html -o test-toc.html
This adds the table of contents but it removes the existing header information which makes all the formatting attractive.
Thus, it makes this html file look like this one. I'd like to preserve the formatting.