Adding an image to title slide using slidify
Asked Answered
C

1

15

I am using the latest version of Rstudio (and knitr) and I have installed the development version of slidify from github. Slidify allows you to go straight from Rmarkdown to html5slides with 1 click.

My issue is that I would like to add an image to the title slide, but using the normal Rmarkdown syntax does not work. I think this is because the first slide is specified as a YAML.

title       : 
subtitle    : 
author      : 
job         : 
framework   : io2012        # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js  # {highlight.js, prettify, highlight}
hitheme     : tomorrow      # 
widgets     : []            # {mathjax, quiz, bootstrap}
mode        : selfcontained # {standalone, draft}

If I add anything to this first slide specification, I get an error in the function yaml.load() which parses the YAML. Is there a way to specify a background image using YAML?

Crossgrained answered 6/3, 2013 at 15:45 Comment(0)
R
13

The title-slide in io2012 framework is marked with the class title-slide. So you can customize the slide using css. For example, if you want to specify a background image, you need to add the following css.

  .title-slide {
     background-image: url(http://goo.gl/cF6W2);
   }

You can either add it directly to your Rmd file by enclosing it with <style></style> tags or to a custom css file in assets/css, which will automatically be included when you run slidify.

Hope this is useful.

EDIT. If you want to customize the appearance of the title slide further, you can tweak the lines in libraries/frameworks/io2012/layouts/deck.html.

Roborant answered 6/3, 2013 at 17:30 Comment(2)
Thanks Ramnath. What an awesome package! What's the best resource for slidify documentation at this point?Crossgrained
At this point, it would be slidify.org, but I plan to document more extensively. For questions, the best place would be SO or the issues page on github.Roborant

© 2022 - 2024 — McMap. All rights reserved.