Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xaringan Title Slide

Tags:

css

r

xaringan

In xaringan, I want to add a background in the title slide. I've managed to do that following Yihui's instructions.

This works, except I loose the default fonts (Yanone Kaffeesatz).

YAML:

---
title: "My title"
subtitle: "My subtitle"
author: "Me Myself"
date: "01/01/2012"
output:
  xaringan::moon_reader:
    css: my-theme.css
    lib_dir: libs
    nature:
      ratio: '16:9'
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---


where my-theme.css is as follows:

.title-slide {
  background-image: url(Figures/MyBackground.jpg);
  background-size: cover;
}
like image 887
Thomas Speidel Avatar asked Aug 10 '18 19:08

Thomas Speidel


1 Answers

I don't recommend you to add default-fonts.css to your my-theme.css. If you want the default fonts, you can use

output:
  xaringan::moon_reader:
    css: [default, default-fonts, my-theme.css]

See more info in Section 7.5 of the R Markdown book.

like image 60
Yihui Xie Avatar answered Sep 20 '22 13:09

Yihui Xie