latexr-markdownbeamer

Switching titlegraphics and date in RMarkdown's beamer presentation


Consider the following YAML header

title: "Project name"
author: "**Author1**, Author2"      
date: "Conference, 2024"
output: 
  beamer_presentation
header-includes:
  - \usepackage{booktabs}
  - \titlegraphic{\includegraphics[width = 2cm]{logo.png}}

Using the previous I obtain the following enter image description here . How can I invert the date and titlegraphic in the slide? What I would like to have is the logo below the authors and then "Conference, 2024" at the bottom of the slide.


Solution

  • If your beamer version is up-to-date (version v3.70 or newer), you could do:

    ---
    title: "Project name"
    author: "**Author1**, Author2"      
    date: "Conference, 2024"
    output: 
      beamer_presentation
    header-includes:
      - \usepackage{booktabs}
      - \titlegraphic{\includegraphics[width = 2cm]{example-image-duck}}
      - |
        \setbeamertemplate{title page}{%
          \vbox{}
          \vfill
          \begingroup
            \centering
            \usebeamertemplate{title}
            \vskip1em\par
            \usebeamertemplate{author}
            \usebeamertemplate{institute}
            \usebeamertemplate{titlegraphic}
            \vskip0.5em
            \usebeamertemplate{date}
          \endgroup
          \vfill
        }
    ---
    
    test
    

    enter image description here