Table of content in beamer generated with R markdown/knitr

前端 未结 1 779
暗喜
暗喜 2020-12-21 09:42

In line with this question, I have problems generating table of contents with a beamer class document, which I have made in RStudio with R markdown and knitr.

My YAM

相关标签:
1条回答
  • 2020-12-21 10:09

    A table of contents lists sections, not individual pages. But you have no section in your document: since you used slide_level: 1, all level 1 titles are slides.

    If you add sections to your document, you will get a toc. That would be the proper use. Something like:

    ---
    output:
      beamer_presentation:
        slide_level: 2
        toc: true
    ---
    
    # Section 1
    
    ## Slide 1
    Slide content
    
    ## Slide 2
    Slide content
    

    If you really want to get a list of individuals slides as a table of content, there might be a way to do that with \renewcommand{\tableofcontents}{...} in your preamble, but tex.stackexchange.com is better suited for this question.

    0 讨论(0)
提交回复
热议问题