首页 > 解决方案 > 在 ioslides 演示文稿中使用 bookdown 命令

问题描述

bookdown在 R markdown 演示文稿中使用输出格式为“beamer”的命令可以正常工作(另请参阅此 SO-post)。在 YAML 标头中,只需从

output:
  beamer_presentation: default
    

output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation

但是,如何bookdown在 R markdown 演示文稿中使用输出格式为“ioslides”的命令

MWE:

---
title: "ioslides_presentation with bookdown commands"
output:
  ioslides_presentation: default
  # Not working:
  # bookdown::pdf_book:
    # base_format: rmarkdown::ioslides_presentation
---

# Set of slides

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## Slide with bookdown cross references
- Figure: \@ref(fig:plot)
- Table: \@ref(tab:table)
- Slide without ref: \@ref(some-slide)
- Slide with ref: \@ref(slide-with-ref)

## Slide with Plot
```{r plot, fig.cap='Plot caption'}
plot(pressure)
```

## Slide with Table
```{r table}
knitr::kable(head(mtcars[, 1:3]),
             caption = "Table caption")
```

## Some Slide
Some text

## Another Slide {#slide-with-ref}
Some more text

标签: rlatexr-markdownbookdownioslides

解决方案


推荐阅读