Exporting theorem environment from bookdown for other RMarkdown formats

Not an issue specific to bookdown, but I am using it to draft lecture notes for a math camp I am teaching and making use of the custom theorem environment. I was wondering if there is a (relatively) easy way to implement this environment in a slide format, such as xaringan slides? It would seem possible since bookdown just takes these code blocks and generates HTML formatted content and xaringan also uses HTML, but I cannot figure out how to properly export the theorem engine into a xarginan set of slides.

Clearly it is not as simple as loading bookdown in the document, as this attempt fails:

---
title: "Test slides"
output: xaringan::moon_reader
---

```{r, include = FALSE}
library(bookdown)
```

```{definition, echo = TRUE}
If $A$ is a set, we say that $x$ is an element of $A$ by writing, $x \in A$. If $x$ is not an element of $A$ then, we write $x \notin A$.
```

Any suggestions?

Disclosure: Haven't tried it myself.

It looks like you need more in the YAML header. See @yihui's page on using the xaringan package.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.