12

I would like to change the aspect ratio of a xaringan presentation to 16:9. I guess it would be possible if I would create a custom css theme. However, this would be somewhat of an overkill for me.

So, is there any really simple way of doing that?

der_grund
  • 1,898
  • 20
  • 36

1 Answers1

21

That is super easy since it is already implemented. Just include the following in the YAML (in addition to all the other stuff in your YAML):

output:
  xaringan::moon_reader:
    nature:
      ratio: '16:9'

Here's my default start YAML. Maybe you can tweak that to your desires.

---
title: "My title"
author: "Claus<br>UCPH Biostatistics<br>.small[my@email.dk ]"
date: 'Some day 2019'
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: ['default', 'hygge']
    seal: true
    nature:
      ratio: '16:9'
      slideNumberFormat: '%current%' 
      highlightStyle: ir-black
      highlightLines: true
      countIncrementalSlides: false
---
ekstroem
  • 5,957
  • 3
  • 22
  • 48