在slidify中自定义幻灯片布局

Sal*_*lly 7 slidify

我有兴趣在index.Rmd文件中为不同的幻灯片使用不同的布局.复制此处和下面提供的模板后,我在我的assets/layouts文件夹中创建了一个.html文件.

<slide class="{{ class }}" id="{{ id }}">
  <hgroup>
    {{{ header }}}
  </hgroup>
  <article>
    <hr noshade size=4 color='red'>  
    {{{ content }}}  
    <div class='left' style='float:left;width:48%'>
     {{{ left }}}
    </div>    
    <div class='right' style='float:right;width:48%'>
     {{{ right }}}
    </div>
  </article>
</slide>
Run Code Online (Sandbox Code Playgroud)

到目前为止,仍然不清楚:

1)为什么我牌组中的幻灯片是空白的,并且没有显示以下任何内容:

---
#testing
hello

*** left

- point a
- point b
- point c

*** right

- point a
- point b
- point c
Run Code Online (Sandbox Code Playgroud)

2)如何从我的资产文件夹中为单个幻灯片而不是整个卡组"调用"自定义布局

Ram*_*ath 10

您可以将幻灯片的布局指定为元数据.例如,如果你救了你的问题,因为描述的布局twocol.htmlassets/layouts,那么你可以指定在幻灯片级元数据的布局.A &指定布局,而a .指定类,#指定id.您也可以自由定义自己的自定义元数据key:value.

--- &twocol

## Two Columns

*** left

- point a
- point b
- point c

*** right

- point a
- point b
- point c
Run Code Online (Sandbox Code Playgroud)