Search code examples
r-markdownpresentation

Insert navigation bar in Beamer presentation with Rmarkdown


I am trying to make Beamer presentation in R Markdown, you can see how code begin below :

---
title: "Test presentation"  
author:   
  - Loana  
institute:   
  - Supervised by   
  - University  
date: Academic year 2017-2018  
output:   
  beamer_presentation:  
    incremental: false  
    theme: "Frankfurt"  
    colortheme: "beaver"  
    toc: true   
    slide_level: 5
    keep_tex: true
header-includes: 
- \AtBeginSubsection{} 
---

This code give output like pic below enter image description here

But my intention is to have navigation bar in right corner of slide, so can anybody help me how to do this ?


Solution

  • Is the following your desired output?

    enter image description here

    If so, create a file header.tex with the following contents (taken from https://tex.stackexchange.com/a/35637/181010)

    \setbeamertemplate{navigation symbols}{}
    \makeatletter
    \setbeamertemplate{footline}
    {%
      \pgfuseshading{beamer@barshade}%
      \ifbeamer@sb@subsection%
      \vskip-9.75ex%
      \else%
      \vskip-7ex%
      \fi%
      \begin{beamercolorbox}[ignorebg,ht=2.25ex,dp=3.75ex]{section in head/foot}
      \insertnavigation{\paperwidth}
      \end{beamercolorbox}%
      \ifbeamer@sb@subsection%
      \begin{beamercolorbox}[ignorebg,ht=2.125ex,dp=1.125ex,%
                             leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
      \usebeamerfont{subsection in head/foot}\insertsubsectionhead
      \end{beamercolorbox}%
      \fi%
    }%
    \setbeamertemplate{headline}{%
      \hskip1em\usebeamercolor[fg]{navigation symbols dimmed}%
    }
    \makeatother
    

    Then add the header to the yaml of your .Rmd as:

    ---
    title: "Test presentation"  
    author:   
      - Loana  
    institute:   
      - Supervised by   
      - University  
    date: Academic year 2017-2018  
    output:
      beamer_presentation:  
        incremental: false  
        theme: "Frankfurt"  
        colortheme: "beaver"  
        toc: true   
        slide_level: 5
        keep_tex: true
    header-includes: 
      - \AtBeginSubsection{} 
      - \input{header.tex}
    ---