I'm working in a project with R Markdown to automate some report of the company I work for.
Recently, I discovered that we can add the option toc: true
to show the table of contents based on headings.
It worked very well and I also set the option toc_float: true
to display the toc on the left side of display.
My question, does anyone know how to have more control over this table of contents, like change colors, the visual and other kinds of stuff?
Asked
Active
Viewed 214 times
0

caio.valente14
- 67
- 9
-
(1) It depends, what's your output format? `toc` applies to multiple formats, and styling is likely different for each. (2) It always helps when you can provide a concrete minimal example to play with. It doesn't have to be huge or complex, just enough to trigger a few key features you need to get your point across. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Jun 04 '20 at 17:42
-
The first answer to this stackoverflow question has a lot of info about changing the CSS of an HTML R Markdown! https://stackoverflow.com/questions/42546001/how-to-change-colors-and-attributes-of-table-of-contents-in-r-markdown-html-docu – Margaret Janiczek Jun 04 '20 at 18:21
-
@r2evans sorry, I forgot to tell about the output, which is html by the way. I can't provide a minimal exemple because the document has more than 3000 rows of code. I was just wondering if there is any library to style TOC. – caio.valente14 Jun 04 '20 at 18:30