Deepak Tanwar
Deepak Tanwar

Reputation: 75

Include specific slides from another presentation for Xaringan

I use xaringan R package for making presentations.

I have following directory structure

└── presentations
    ├── 01_intro
    |    ├── intro.Rmd
    |    └── intro.html
    └── 02_test
    |    ├── test.Rmd
    |    └── test.html
    └── 03_new
         ├── new.Rmd
         └── new.html

For the new presentation (03_new), I would like to include slide number 3 from the intro slide (01_intro).

This could be done by:

  1. <iframe src="../01_intro/intro.html#3"></iframe> or,
  2. knitr::include_url("../01_intro/intro.html#3")

Question

Is there a way to do that using {r child='../01_intro/intro.Rmd{slide#}'}?

OR

Is there a way to do that using {r child='../01_intro/intro.Rmd{slide-name}'}?

Reasons I need a solution for this:

  1. Easy to reuse, and I have a track of slides.
  2. This would prevent me to work again on the same material.

This would be very beneficial when I have to make a new presentation from a number of existing presentations. I just input a specific section into a new one, then copy-paste or screenshot.

Upvotes: 0

Views: 178

Answers (1)

Daniel_j_iii
Daniel_j_iii

Reputation: 3252

have a look at this question, I hope it helps, link

I think you are right about how you can go about it, just make the presentation slide it's own .RMD file, hopefully that doesn't get too confusing

 ---  
 title: My Report  
 output: 
   pdf_document:
     toc: yes 
 ---

 ```{r child = 'chapter1.Rmd'}
 ```

 ```{r child = 'chapter2.Rmd'}
 ```

Upvotes: 0

Related Questions