svmiller / stevetemplates

My collection of R Markdown templates, as an R package.
http://svmiller.com/stevetemplates
125 stars 22 forks source link

stevetemplates::beamer producing table of contents at the end of document #10

Closed WihanZA closed 1 year ago

WihanZA commented 2 years ago

Hi! Thanks for your wonderful templates package. I'm a newcomer to the package and currently working from a R Markdown document initiated from the template. A table of contents is appearing at the end of my document. toc = FALSE in the YAML under stevetemplates::beamer: does not seem to work, nor am I sure how to move it at all. I can overcome the issue when I knit the .Rmd file and remove the toc at the end of the corresponding tex document , and compile a pdf from there. Thanks in advance, I'm really loving the templates so far. Regards

almartin82 commented 1 year ago

I can reproduce this using the skeleton document.

I believe that this is because the template has a hand-coded table of contents section that is not controlled by the toc logic.

almartin82 commented 1 year ago

@WihanZA I forked the project and opened a PR that removes the hardcoded TOC - you can install using devtools::install_github("almartin82/stevetemplates") if you'd like

svmiller commented 1 year ago

For what it's worth, this a deliberate design feature. I like this trailing table of contents because it better facilitates an ability to jump back to assorted sections of a presentation. It's also a better signal of "presentation is over" than just ending on the conclusion section. It ultimately works for my purposes.

That said, the development version of the package now has a no_toc_after: field in the YAML that can disable this trailing table of contents. Just specify it in the YAML to be TRUE.

WihanZA commented 1 year ago

Excellent! Thanks @almartin82. @svmiller the trailing toc is sensible for the reasons you provide. Thanks for the new feature.

almartin82 commented 1 year ago

Love it! Great outcome 👍