16

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.

zx8754
  • 52,746
  • 12
  • 114
  • 209
Nicholas Hamilton
  • 10,044
  • 6
  • 57
  • 88

1 Answers1

17

You can specify it in your YML header with:

output:
  pdf_document:
    keep_tex: true
---

More options on the rmarkdown site.

Vincent Bonhomme
  • 7,235
  • 2
  • 27
  • 38