Stephan Kolassa
Stephan Kolassa

Reputation: 8267

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.

Upvotes: 0

Views: 94

Answers (1)

Stephan Kolassa
Stephan Kolassa

Reputation: 8267

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.

Upvotes: 1

Related Questions