Search code examples
rlatexr-markdownbeamer

TOC summary in the header of each slide


There is the list of possible R-Markdown templates for beamer_presentation in R-Markdown.

And most of them include a kind of a "Navigation bar" at the top (or left/right) of each slide, like that:

Example of slider header

While I do understand how to create a TOC in R-Markdown (by providing a toc: true in the header, I cannot figure out how to add this navigation to each slide.

I also understand how to create a floating TOC for the R-Markdown for HTML format (via toc_float: true as it is described here) but still cannot figure out how to make it in a beamer format. Any hint will be appreciated.


Solution

  • The headline with the navigation bar is automatically inserted in every frame if you use a suitable beamer theme. The one you show in your questions is called Antibes

    ---
    title: test title
    output:
      beamer_presentation:
        theme: "Antibes"
    header-includes:
      - \usepackage{tikzlings}
    ---
    
    # Section name
    
    ## Subsection name
    
    ### Slide 1
    
    \begin{tikzpicture}
    \pig[scale=2]
    \end{tikzpicture}   
    

    enter image description here