-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.unlisted and .unnumbered not excluding tagged headers from TOC #1436
Comments
Also to add - I note this same issue occured in 2020 but was resolved - so something seems to have triggered it to occur again. For reference the 2020 issue is #894 . |
First the issue you mentions is about a Pandoc version. The resolution has been done with a newer Pandoc. Do check your pandoc version ( Also it relates to bookdown output. Your issue here is about Just in case, here the reason it does not work with a
However, why open an issue here and not in https://github.com/davidgohel/officedown/ ? If you would have looked there you would see that this Pandoc limitation is also affecting officedown unfortunately |
@cderv I saw the mentions of the pandoc version issue, but I think mine is up to date (at least it is not the same version mentioned in the 2020 post):
I posted the issue here because I am using both bookdown and officedown and I saw the same issue had been posted here a few years ago. But you are right, perhaps it would be better to post in officedown issues as people using officedown are knitting only to Microsoft products. |
It is fine to post here if you have issue with bookdown too. Note what I said above though: |
@cderv yes, it seems that the problem is Microsoft Word itself does not have a facility to supress individual headers from the TOC. Instead I removed the hash tag from the TOC title, created a custom text format with I've added the solution to a Stack Overflow post I had on how to change the location of the TOC here I have not tested whether the tags work when knitting to .pdf or HTML - if they do, this issue can be closed. |
I have an r markdown document which is being knit to Microsoft Word. I need the table of contents to appear after the summary text, which I have achieved with adding
officer::block_toc()
in a chunk after the summary.However, the problem is that the table of contents displays its own title (and that of the summary section) which I don't want. I understand the correct way to exclude a section header from the table of contents is to add the unlisted and unnumbered tags after the header to remove, e.g.:
# Summary {.unlisted .unnumbered}
. It seems that neither tag is working, even after updating R, RStudio and all the required packages to the latest versions. The output shows the table of contents including itself and the Summary section before it as numbered items.Here is an example:
Here is what the TOC looks like when this is run - the first two items should have been excluded but they are still there:
Here is my session info:
Checklist
When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:
formatted your issue so it is easier for us to read?
included a minimal, self-contained, and reproducible example?
pasted the output from
xfun::session_info('bookdown')
in your issue?upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
installed and tested your bug with the development version of the bookdown package using
remotes::install_github("rstudio/bookdown")
?-->
The text was updated successfully, but these errors were encountered: