首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Rmarkdown中调整YAML中的Reveal.initialize

在Rmarkdown中调整YAML中的Reveal.initialize
EN

Stack Overflow用户
提问于 2018-11-20 17:42:48
回答 1查看 316关注 0票数 3

我有一个用Rmarkdown制作的带有这个YAML头的revealjs演示文稿:

代码语言:javascript
复制
---
title: "My title"
author: "My name"
date: November 20, 2018
output: 
  revealjs::revealjs_presentation:
      css: styles.css
---

它工作得很完美,但现在我想在Reveal.initialize中调整width。现在,我直接在生成Rmarkdown的html中执行此操作,几乎在文件的末尾:

代码语言:javascript
复制
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
    width: 1000,
    // Push each slide change to the browser history
    history: true,
    // Vertical centering of slides
    center: false,
    // Transition style
    transition: 'default', // none/fade/slide/convex/concave/zoom
    // Transition style for full page slide backgrounds
    backgroundTransition: 'default', // none/fade/slide/convex/concave/zoom

我希望的是能够从Rmarkdown的YAML中做到这一点。我尝试过这种方式,但它不起作用:

代码语言:javascript
复制
---
title: "My title"
author: "My name"
date: November 20, 2018
output: 
  revealjs::revealjs_presentation:
      css: styles.css
  revealjs::revealjs_config:
      width: 1200
---

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2018-11-20 19:51:15

最后,我找到了正确的方法:

代码语言:javascript
复制
---
output: 
  revealjs::revealjs_presentation:
    css: styles.css
    reveal_options:
      width: 1200
---
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53390133

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档