Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xaringan: Easy way to change aspect ratio?

Tags:

r

xaringan

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?

like image 723
der_grund Avatar asked Jan 14 '19 10:01

der_grund


1 Answers

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[[email protected] ]"
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
---
like image 142
ekstroem Avatar answered Oct 20 '22 20:10

ekstroem