Skip to content

Instantly share code, notes, and snippets.

View braunm's full-sized avatar

Michael Braun braunm

  • Southern Methodist University
  • Dallas, TX
View GitHub Profile
@braunm
braunm / RLatex.md
Last active April 20, 2023 07:01
Integrating emacs, ESS, knitr, and polymode

New pattern for R code chunks in knitr

I use emacs/ESS to write LaTeX documents that embed R code. One of the nice features of emacs is the preview-latex package (part of AucTeX), which typesets LaTeX math directly in the emacs frame. However, preview-latex chokes when it encounters R code chunks, meaning I cannot preview LaTeX math in Rnw files.

My goal is to define a LaTeX environment, Rcode, with the following properties: