info201 / book

Source code for the course book
Other
21 stars 35 forks source link

Make PDF error #13

Open mkfreeman opened 6 years ago

mkfreeman commented 6 years ago

I get the following error when running make pdf: looks like the file needs to be deleted or explicitly overwritten.

make pdf
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::pdf_book', quiet=T)";
Error in bookdown::render_book("index.Rmd", "bookdown::pdf_book", quiet = T) : 
  The file tech-foundations-of-informatics.Rmd exists. Please delete it if it was automatically generated, or set a different book_filename option in _bookdown.yml.
Execution halted
make: *** [pdf] Error 1
joelwross commented 6 years ago

The bookdown system goes through a couple of steps when building, the first of which is compiling all the disparate files a single .Rmd (e.g., tech-foundations-of-informatics.Rmd). This file is then used to build the output (HTML or pdf, etc), and is then deleted. If something breaks at the build process (e.g., illegal RMarkdown code), then the file is NOT deleted automatically, and needs to be removed by hand before you can try building again. This is very frustrating and time consuming when trying to fight through RMarkdown chunk options.

One work-around might be to add a command the make file which will delete the combined Rmd no matter what