Search code examples
rxaringanremarkjs

Fixed size slides in xaringan?


I'm trying to build a presentation in xaringan, which uses remarkjs. I'd like to make the slides all fixed-size, so they don't scale with the size of the browser. The reason is that my presentation needs to fit the format of the conference at which I'll be delivering it.

Is there a way I can do this? Thanks.


Solution

  • Yup you can do it by putting the following in say custom.css for a 900px x 600px fixed size:

    .remark-container {
        height: 600px!important;
        width: 900px!important;
      }
    

    and put in YAML of the Rmd css: css: ["default", "default-fonts", "custom.css"] (presuming that you still want the default theme - if not, replace as you see fit).

    I don't see the need to conform to a size set by the conference though (aside from the ratio of width to height which can be set in YAML) since you can just full screen it but perhaps there's some reason I'm missing.