编辑 R Markdown Slidy 演示文稿的标题幻灯片

5
有没有办法编辑R Markdown Slidy演示文稿的标题幻灯片?我已经能够添加页眉、页脚和自定义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模板替换标准的slidy标题幻灯片,就像我用页眉和页脚一样。

有没有办法做到这一点?

2个回答

2
您可以在pandoc slidy模板中修改关于标题页的部分,该模板可以通过 pandoc -D slidy 命令找到。请注意保留HTML标签。
$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$

将生成的文件保存为default.slidy并放在您的pandoc模板目录中:
$HOME/.pandoc/templates (unix)
C:\Documents And Settings\USERNAME\Application Data\pandoc\templates (windows XP)
C:\Users\USERNAME\AppData\Roaming\pandoc\templates (windows 7)

谢谢!如果您将模板保存为default.ioslides,它也适用于iosolides。 - yammerade

0

Rmarkdown在Slidy演示文稿中不会删除标题幻灯片,如果您没有给出标题。只需从yaml设置中删除标题行,并添加第一张幻灯片以根据您的需要提供详细信息即可。

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
---
#Slidy Template

**Author**

Affiliations

Date
---

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接