r-markdown – 编辑R Markdown Slidy Presentation的标题幻灯片

有没有办法编辑R Markdown Slidy Presentation的标题幻灯片?我能够添加页眉,页脚和自定义CSS:

title: "Slidy Template"
author: ""
date: "June 18, 2015"
runtime: shiny
output: 
  slidy_presentation:
    css: ./styles/Slidy_Styles.css
    includes:
      after_body: ./styles/doc_suffix.html
      before_body: ./styles/header.html

但我无法弄清楚如何在幻灯片中添加标题,作者和日期之外的任何内容,或者用自定义的html模板替换标准的标题幻灯片,就像我使用页眉和页脚一样.

有没有办法做到这一点?

最佳答案 您可以在pandoc
slidy template中修改有关标题页的部分,也可以在pandoc -D slidy中找到.

$if(title)$
<div class="slide titlepage">
  <h1 class="title">$title$</h1>
$if(subtitle)$
  <h1 class="subtitle">$subtitle$</h1>
$endif$
  <p class="author">
$for(author)$$author$$sep$<br/>$endfor$
  </p>
$if(date)$
  <p class="date">$date$</p>
$endif$
</div>
$endif$

将生成的文件保存为pandoc模板目录中的default.slidy:

$HOME/.pandoc/templates (unix)
C:\Documents And Settings\USERNAME\Application Data\pandoc\templates (windows XP)
C:\Users\USERNAME\AppData\Roaming\pandoc\templates (windows 7)
点赞