1

I'd like to make multiple bookdown projects that have particular chapters in common. For example I would like the content of a particular file content_in_common.Rmd to be merged in to two different books when they are built. How can I achieve this? I understand that bookdown requires the Rmd files to be in a common working directory, so having

rmd_files: ["index.Rmd", "path_where_common_content_is_stored/content_in_common.Rmd"]

in my _bookdown.yml doesn't work because it returns

Error: Input files not all in same directory, please supply explicit wd
Execution halted

Is there a solution to this (short of manually making duplicate versions of content_in_common.Rmd)?

SPP
  • 21
  • 3

1 Answers1

1

I found this link that suggests you can use {r child = 'chapter1.Rmd'}

such as

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

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

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

To use other .Rmd files inside your bookdown project hopefully

Daniel_j_iii
  • 3,041
  • 2
  • 11
  • 27