简体   繁体   English

如何使用 rmarkdown 渲染来渲染 ioslides 演示文稿?

[英]how to use rmarkdown render to render ioslides presentation?

So I have basic template with parameters for ioslides presentation.所以我有基本的模板,带有用于 ioslides 演示的参数。 Right now i render it with knit button in rstudio but I want to change it and use:现在我用 rstudio 中的编织按钮渲染它,但我想改变它并使用:

 rmarkdown::render(input = rmd_file,
                    output_file = file.path(dirname(rmd_file), output_file),
                    output_format = "html_document",
                    output_dir = paste0(getwd(), "/", output_folder),
                    params = params,
                    encoding = "utf-8",
                    envir = new.env(parent = globalenv()))

But output file look like simple render html, and don't have presentation format.但是 output 文件看起来像简单的渲染 html,并且没有演示格式。

---
title: "Untitled"
author: "MS"
date: "30 10 2019"
output: ioslides_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
#``` (this comment is here to add stackoverflow formating only)

## R Markdown

This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.

## Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

## Slide with R Output

```{r cars, echo = TRUE}
summary(cars)


## Slide with Plot

```{r pressure}
plot(pressure)

I was able to get it to render to ioslides in both RStudio and browser by changing the YAML to:通过将 YAML 更改为:

---
title: "Untitled"
author: "MS"
date: "30 10 2019"
output:
  ioslides_presentation: default
  html_document: null
---

Hope this is helpful to you.希望这对你有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM