ESS/AucTeX/Sweave 集成 [英] ESS/AucTeX/Sweave integration
问题描述
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
That's two different questions.
For the first one, my Debian R packages make sure that there is a soft link from the $RHOME/share/texmf/
directory into the TeX file system tree, e.g. as /usr/share/texmf/tex/latex/R
.
For the second question: dunno. I tend to run Sweave via a small shell script I crafted years ago even though I do all the editing in Emacs.
Edit, a few months later: Use ESS, rather than AucTeX. Then M-n s
(i.e Alt-n followed by s) runs the Sweave step and M-n P
runs the LaTeX compilation, with a call to Bibtex if needed.
这篇关于ESS/AucTeX/Sweave 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!