Suppress R Markdown Heading from TOC

Viewed 504

I have a bookdown project where I would like to exclude a heading from the table of contents. From this GitHub issue and the R Markdown Cookbook, it appears this should be possible by adding the unlisted and unnumbered classes, e.g.,

# Section heading {.unlisted .unnumbered}

However, when I apply these classes, only the unnumbered seems to have an effect. That is, the section heading still appears in the TOC, but without a number (i.e., the same effect as # Section heading {-}).

A minimal example is in this repo, and the rendered book here. Am I missing something to make this work?

Session info:

rmarkdown::pandoc_version()
#> [1] '2.9.2.1'

xfun::session_info()
#> R version 4.0.0 (2020-04-24)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Mojave 10.14.6
#> 
#> Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
#> 
#> Package version:
#>   base64enc_0.1.3 compiler_4.0.0  digest_0.6.25   evaluate_0.14  
#>   glue_1.4.1      graphics_4.0.0  grDevices_4.0.0 highr_0.8      
#>   htmltools_0.4.0 jsonlite_1.6.1  knitr_1.28      magrittr_1.5   
#>   markdown_1.1    methods_4.0.0   mime_0.9        Rcpp_1.0.4.6   
#>   rlang_0.4.6     rmarkdown_2.1.9 stats_4.0.0     stringi_1.4.6  
#>   stringr_1.4.0   tinytex_0.23    tools_4.0.0     utils_4.0.0    
#>   xfun_0.14       yaml_2.2.1

Created on 2020-05-29 by the reprex package (v0.3.0)

0 Answers
Related