I'm using GNU/Linux distro (Arch, if that's relevant), Emacs v23.2.1, ESS v5.9 and AucTeX v11.86.
I want to setup AucTeX to recognize .Rnw files, so I can run LaTeX on .Rnw files with C-c C-c
and get .dvi file automatically. I reckon it's quite manageable by editing .emacs file, but I still haven't got a firm grasp on Elisp.
Yet another problem is quite annoying - somehow, LaTeX is not recognizing \usepackage{Sweave}
in preambule, so I actually need to copy Sweave.sty
file (in my case located in /usr/share/R/texmf/Sweave.sty
) to directory where .Rnw file is located (and I'm becoming more frustrated by the fact that this is common bug on Windows platforms!)
My question boils down to two problems:
- how to make LaTeX recognize
\usepackage{Sweave}
(without copyingSweave.sty
to "home" folder each time) [Edit: managed to do this; see comment after Dirk's answer] - how to setup AucTeX to compile .Rnw files to .dvi