10

I am trying to add logo to each slide in rmarkdown in ioslides presentation, using RStudio.

My code is below:

---
title: " "
author: " "
date: " "
output:
  ioslides_presentation:
    widescreen: false
    logo: logo_wp.png
runtime: shiny
---

# Caption1

## Caption 2

and the logo can be downloaded from here!

here

There is no logo on slide nr 3. runtime: shiny is needed because there is a shiny app in that presentation.

According to this sentence from rstudio webpage this should work but it does not..

A 128x128 version of the logo graphic will be added to the title slide and an icon version of the logo will be included in the bottom-left footer of each slide

I am using windows 7 and I have set encoding to UTF-8.

2
  • It works for me. There's no logo on the 2nd page because its a title page. Do you have the logo saved in the same directory as the .Rmd file? Jan 22, 2015 at 15:01
  • It worked on unix but it does not work on windows. Yes I did have logo in good direcotry, it would not appear in a title page if not :<
    – Marcin
    Jan 23, 2015 at 20:25

1 Answer 1

9

Have you tried publishing your slides? I've found on Windows 8.1 that the icon does not appear in the RStudio preview, but it's there when I publish them to shinyapps.io.

If you want to force the icon to show up in the RStudio preview you can use:

---
title: " "
author: " "
date: " "
output:
  ioslides_presentation:
    widescreen: false
    logo: logo_wp.png
runtime: shiny
---

```{r, echo=FALSE}
logo<-"path_to_logo_wp.png"
```

# Caption1

## Caption 2
<IMG style="position:absolute;bottom:2.5%;left:5%;width:35px;"SRC="`r logo`">

Note: you'll have to include this last line of code on each content slide you want the logo to appear. If you choose to publish the slides, this "forced" icon will be placed on top of the "native" icon called out in the YAML header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.