4
votes

I tried to use the new rmd_subdir option in the _bookdown.yml by setting a list of subdirectories. I copied all files except the index.Rmd of a freshly created bookdown project in a folder called content. The following setting in the _bookdown.yml does work

rmd_subdir: = yes

However when I change the _bookdown.yml to the following only the index.Rmd is compiled.

_bookdown.yml

book_filename: "_tmp_rmd_subdir"
delete_merged_file: true
language:
  ui:
    chapter_name: "Chapter "
rmd_subdir: ["content"]

R version 3.4.3 (2017-11-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached): [1] Rcpp_0.12.15 bookdown_0.7 digest_0.6.14 rprojroot_1.3-2 backports_1.1.2 [6] magrittr_1.5 evaluate_0.10.1 stringi_1.1.6 rstudioapi_0.7 rmarkdown_1.9
[11] tools_3.4.3 stringr_1.3.0 tinytex_0.4 xfun_0.1 yaml_2.1.19
[16] rsconnect_0.8.5 compiler_3.4.3 htmltools_0.3.6 knitr_1.20

1
As of July 2020 this is still broken. Steps to duplicate: 1) Create a fresh bookdown project in Rstudio. 2) Build a gitbook with no modifications = Success. 3) Create directory in project named "corpus" 4) add ' rmd_subdir: ["corpus"] ' to _bookdown.yml. 5) build a gitbook = failure with "output file: bookdown_test.knit.md. Error: Input files not all in same directory, please supply explicit wd. Execution halted "mnr

1 Answers

1
votes

This should be fixed in the development version of bookdown. Please try

devtools::install_github('rstudio/bookdown')