Skip to content
Patrick Schratz edited this page Jan 19, 2017 · 12 revisions

Welcome to the xaringan wiki!

As most R users are not familiar with CSS, this vignette will show examples of basic slide modifications. They can be adapted and extended to your desires. However, you are still highly encouraged to familiarize yourself with remark.js (the engine behind xaringan) and read the Wiki!*

Prerequisites

To enable slide modifications, you need to specify a custom .css file in the YAML header of your .Rmd file.
Make sure to insert the relative path to the file if it is not placed in the same directory as your .Rmd file.
Your YAML header should look as follows:

---
title: "Presentation Ninja"
subtitle: "⚔<br/>with xaringan"
author: "Yihui Xie"
date: "2016/12/12"
output:
  xaringan::moon_reader:
    css: "my-theme.css"
    lib_dir: libs
    nature:
      highlightStyle: github
      highlightLines: true
---

In this example I assume that our file is named my-theme.css. If you want to specify multiple files and split up your CSS modifications, use square brackets: css: ["my-theme.css", "my-font.css"].

It is recommended to copy the default CSS example.css (Link) and adapt this copy to your needs.