Color change in beamer at R markdown

1.8k Views Asked by At

Esteemed,

I'm having trouble putting together a beamer presentation. I would like to put the title, the footer and the items in green tones.

I appreciate any help.

title: "long title"
date: "10/10/2020"
output: 
  beamer_presentation:
    theme: "CambridgeUS"
    keep_tex: true
header-includes:
  - \AtBeginDocument{\title[short title]{"long title"}}
  - \AtBeginDocument{\author[author1; author2; author3; author4]{author1\\author2\\author3\\author4}}
  - \addtobeamertemplate{headline}{\includegraphics[width=\paperwidth,height=2cm,page=2]{img.png}}
 
---
# Introduction   

* text1;  

* text2;  
 
* text3;

* text4.
1

There are 1 best solutions below

2
DaveArmstrong On

Something like the following should do it. You can use the \definecolor function in the xcolor package to define named colors that can be used in setbeamercolor and setbeamertemplate declarations. I didn't have the image you were trying to include, so I removed that line from the code below. I'm also not sure what footer you are talking about.

---
title: "long title"
date: "10/10/2020"
output: 
  beamer_presentation:
  theme: "CambridgeUS"
keep_tex: true
header-includes:
  - \AtBeginDocument{\title[short title]{"long title"}}
  - \AtBeginDocument{\author[author1; author2; author3; author4]{author1\\author2\\author3\\author4}}
  - \usepackage{xcolor}
  - \definecolor{olive}{rgb}{0.3, 0.4, .1}
  - \setbeamercolor{itemize/enumerate body}{fg=olive}
  - \setbeamercolor{title}{fg=green}
  - \setbeamercolor{frametitle}{fg=green}
  - \setbeamertemplate{itemize item}{\color{green}$\blacktriangleright$}
  - \setbeamertemplate{itemize subitem}{\color{green}$\blacktriangleright$}


---


# Introduction   

* text1;  

* text2;  

* text3;

* text4.

There are a couple of useful resources this wikibook identifies a number of different elements whose colors can be set with the setbeamercolor declaration. I also made use of this post in my answer.