UW-Madison theme for xaringan

By Tuo Wang in Data Science Data Visualization

June 17, 2021

In May, I passed my Ph.D. prelim exam! When I was preparing the prelim slides, I really wanted to try something new. I’m tired of the beamer slides (no offense, just because they are everywhere). Then I found the xaringan R package. The xaringan package enable us to create slides in R Markdown with remark.js. The name comes from Sharingan from the anime Naruto! πŸ€£πŸ˜†πŸ€£

I think xaringan is game-changer for presentation, especially you need present any R codes. Like the beamer slides, xaringan has many themes. However, there is no theme for University of Wisconsin-Madison. Therefore, when I was creating my prelim slides using xaringan, I created a UW-Madison theme inspired by Joseph Casillas’s Rutgers theme. Recently, Yihui, the author of xaringan, approved my pull request about the UW-Madison theme. This is actually my first pull request! Here are some a couple of screenshots for the theme:

demo1

demo2

demo3

demo4

UW-Madison theme for xaringan

Here is a summary about the UW-Madison theme:

devtools::install_github('yihui/xaringan')
  • How to enable the UW-Madison theme:
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: ["uwm", "uwm-fonts"]
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
      ratio: "16:9"

Some great tutorials and extensions for xaringan

Some Tips

  • Do not forget to try the option yolo: true under xaringan::moon_reader in the YAML metadata of your R Markdown document. A picture of smiling Karl will be randomly insert in the slides.

  • Use DT for interactive tables.

  • xaringanExtra R package has many other additional and powerful features.

  • Insert emoji by using emo R package πŸ€” πŸ˜† πŸ‘

  • Insert icon by using icons R package

  • If you don’t like the default font size and color, you can change them by using html syntax <span style='font-size:55pt; color:#cc0033'> some text! </span>

  • If you want to change any elements of this theme, feel free to edit the source file as you like.

  • The best way to learn about Xaringan is reading other people’s source codes.

Posted on:
June 17, 2021
Length:
2 minute read, 358 words
Categories:
Data Science Data Visualization
See Also: