Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rmarkdown Retain .tex file

Tags:

r

r-markdown

tex

In R, when compiling a markdown document using rmarkdown::render(...), how can I retain the intermediate .tex file that is produced from knitting.

I have tried setting the clean=FALSE argument, but this retains the figures, not the final tex file or auxiliary files, which I need to inspect for debugging purposes.

like image 467
Nicholas Hamilton Avatar asked Jun 08 '16 12:06

Nicholas Hamilton


People also ask

How do I save an RMD file in R?

Rmd extension. You can save your file by clicking File > Save in the RStudio toolbar.

What is knitr in RMarkdown?

RMarkdown is an extension to markdown which includes the ability to embed code chunks and several other extensions useful for writing technical reports. The rmarkdown package extends the knitr package to, in one step, allow conversion between an RMarkdown file (.Rmd) into PDF, HTML, word document, amongst others.

Why is my RMarkdown not knitting?

No Knit HTML button This means that RStudio doesn't understand your document is supposed to be an RMarkdown document, often because your file extension is . txt . To fix this, go to the Files tab (lower right corner, same pane as Plots and Help) and select the checkbox next to your document's name.


1 Answers

You can specify it in your YML header with:

output:
  pdf_document:
    keep_tex: true
---

More options on the rmarkdown site.

like image 94
Vincent Bonhomme Avatar answered Oct 01 '22 04:10

Vincent Bonhomme