Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bookdown package for R, retain LaTeX file in render_book(..., pdf_book())

I compile my .Rmd files using

bookdown::render_book("index.Rmd", bookdown::pdf_book())

How do I ensure the intermediate LaTeX file is retained and not cleaned up?

I am aware of Rmarkdown Retain .tex file, but for some reason, editing my YAML files does not keep the LaTeX file.

like image 591
Stephan Kolassa Avatar asked Oct 28 '25 01:10

Stephan Kolassa


1 Answers

You need to use a parameter keep_tex = TRUE in the pdf_book() command:

bookdown::render_book("index.Rmd", bookdown::pdf_book(keep_tex=TRUE))

After this, there will be a file _main.tex in the _book directory.

like image 102
Stephan Kolassa Avatar answered Oct 31 '25 03:10

Stephan Kolassa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!