0
votes

I am about to begin writing my thesis, and am planning on using Bookdown with .Rmd files to achieve this.

However, the way bookdown searches for content isn't exactly what I want. As my thesis will be long, filled with many individual chapters and subchapters, I don't want to be restricted on having hundreds of .Rmd files in the root directory.

Instead, what I would like to do is have main chapters as .Rmd files, with a header designated by #, but then be able to "include" sub .md/.Rmd files from a folder. This way I can keep my thesis organised and easily be able to change the order of sections, but also not have to put a top level header at the top of every page.

What I'd like to do:

  • /
  • /content/introduction/chapter1.md
  • 00-introduction.Rmd
  • 01-somesection.Rmd

Then in 00-introduction.Rmd be able to call the subpages freely (in this case /content/introduction/chapter1.md, but of course there could be dozens of such chapters).

I noticed that this does exist for Pandoc for example: http://hackage.haskell.org/package/pandoc-include

Is this possible in Bookdown?

1

1 Answers

1
votes

Yes it is possible to have folders, sub-folders, etc. as described here and here, either defined within an index with rmd_files or sub-folders with rmd_subdir.

For example, for my thesis I am presently writing, I use the following structure in a seperate _bookdown.yml file in the root folder:

book_filename: "bookdown"
new_session: no # merge prior to render_book
rmd_files:
- index.Rmd # must include :)
#- text/00-abstract.Rmd
#- text/00-colophon.Rmd
#- text/00-acknowledge.Rmd
#- text/00-declaration.Rmd
#- text/00-preface.Rmd
- text/01-Intro.Rmd 
- text/02-IO.Rmd 
- text/03-Brainstem.Rmd 
- text/04-Cerebellum.Rmd 
- text/05-Behaviour.Rmd 
- text/References.Rmd