【问题标题】:Adjust Reveal.initialize from YAML in Rmarkdown在 Rmarkdown 中从 YAML 调整 Reveal.initialize
【发布时间】:2018-11-20 09:42:48
【问题描述】:

我在 Rmarkdown 中使用此 YAML 标头制作了一个revealjs 演示文稿:

---
title: "My title"
author: "My name"
date: November 20, 2018
output: 
  revealjs::revealjs_presentation:
      css: styles.css
---

效果很好,但现在我想在Reveal.initialize 中调整width。现在我直接在生成 Rmarkdown 的 html 中进行操作,几乎在文件末尾:

// 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 中做到这一点。这个方法我试过了,还是不行:

---
title: "My title"
author: "My name"
date: November 20, 2018
output: 
  revealjs::revealjs_presentation:
      css: styles.css
  revealjs::revealjs_config:
      width: 1200
---

有什么想法吗?

【问题讨论】:

    标签: r-markdown reveal.js


    【解决方案1】:

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

    ---
    output: 
      revealjs::revealjs_presentation:
        css: styles.css
        reveal_options:
          width: 1200
    ---
    

    【讨论】:

      猜你喜欢
      • 2021-12-05
      • 1970-01-01
      • 2014-10-12
      • 2015-01-09
      • 2017-08-28
      • 1970-01-01
      • 2018-07-02
      • 2021-08-20
      • 1970-01-01
      相关资源
      最近更新 更多