Closed Edouard-Legoupil closed 1 year ago
I tried the approach you mentioned and it did create a table of content (see screenshot below) but the numbered sections doesn't work as it's not part of the block_toc()
function from the officer package.
On your other point, we could add it as parameters to the unhcrdown::docx_simple
call but you can also pass parameter for the depth of the TOC directly in the block_toc
function, e.g. block_toc(level = 2)
. There might be some possibilities with the following run_autonum()
function but will require some experimentations.
Now with the development of Quarto might be worth looking that way as it already includes these possibilities and will offer more flexibilities.
Again, for the time being for rmd documents, see more details on what can be parametrized in the officer package doc.
strange -- did re-install and tried again - below is what I get
Make sure to click yes on the update file popup when opening the file see here. Maybe that's the issue but works on my side. Also don't forget to put echo=FALSE
in the code chunk parameter to avoid the code box.
Hello - so we can close this - indeed the TOC is there - but I did not get the pop up so had to manually do the update -
In https://vidonne.github.io/unhcrdown/reference/docx_simple.html
I was trying to add the table of content - as explained here: https://ardata-fr.github.io/officeverse/officedown-for-word.html#toc
by adding
Ideally it would be great to also have a parameter to number sections like in