How to export R Notebook to LaTex (.tex)?

In Jupyter Notebook or JupyterLab, I have option to save as LaTex (.tex) which is very useful in case I want to edit the file. In RStudio, with Knit, we can export R Notebook to beautiful Word or PDF documents.

enter image description here

I would like to ask how to export R Notebook to LaTex (.tex). Thank you so much for your help!

In the yaml metadata, add keep_tex: true and the intermediate latex file will be retained in the project folder:

---
title: "my title"
output:
  pdf_document:
    keep_tex: true
---

R Markdown: The Definitive Guide has more information on metadata options for PDF output.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.