[ESS] Sweave with ESS and AUCTeX

Sparapani, Rodney rsparapa at mcw.edu
Fri Feb 2 18:44:52 CET 2018

Actually, for AUCTeX v11.91 (and presumably 11.88), this doesn’t quite do it.
You need to tweak that…
(eval-after-load "tex"
'(add-to-list 'TeX-command-list
'("SweavePDF" "R CMD Sweave %s.Rnw; pdflatex %s" TeX-run-command t t :help "SweavePDF") t))

But, this is tricky since the two versions of AUCTeX (v11 and v12) seem to have
slightly different behavior.  How do we do this in a backwards-/forwards-compatible
way?  And is that the trick to getting ESS to do this automatically?

Rodney Sparapani, PhD
Assistant Professor of Biostatistics
Medical College of Wisconsin, Milwaukee
From: Rodney Sparapani <rsparapa at mcw.edu>
Date: Friday, January 19, 2018 at 12:05 PM
To: Kasper Daniel Hansen <kasperdanielhansen at gmail.com>
Cc: Stephen Eglen <sje30 at cam.ac.uk>, ess-help <ess-help at r-project.org>, Vincent Goulet <vincent.goulet at me.com>
Subject: Re: [ESS] Sweave with ESS and AUCTeX

Well, at least, for v11.88.  You need this definition…
(eval-after-load "tex"
  '(add-to-list 'TeX-command-list
                        '("SweavePDF" "R CMD Sweave --pdf %s.Rnw" TeX-run-command t t :help "SweavePDF") t))
And then add this to make it the default with C-c C-c
%Local Variables:
%TeX-command-default: "SweavePDF"

More information about the ESS-help mailing list