[ESS] Snw files are not weaved by C-c C-c from AucTeX-mode
Rodney Sparapani
rsparapa at mcw.edu
Wed Aug 2 21:18:20 CEST 2006
Johan Sandblom wrote:
>
> You could switch to ConTeXt (http://wiki.contextgarden.net,
> http://www.pragma-ade.com) and use the R module distributed with it,
> like so:
>
> \usemodule[r]
> \starttext
>
> \startR
> pdf("test.pdf")
> plot(1:10)
> dev.off()
> \stopR
>
> \externalfigure{test}
>
> \stoptext
>
> You could even use mmm-mode with it:
> (setq mmm-global-mode 'maybe)
> (setq mmm-submode-decoration-level 2)
> (mmm-add-group 'context-plus
> '((context-R
> :submode r-mode
> :face mmm-comment-submode-face
> :front ".*\\\\startR\\w*\\({\\w*}\\|\\[\\w*\\]\\|\\)\\W*"
> :back ".*\\\\stopR")
> (context-MP
> :submode metapost-mode
> :face mmm-code-submode-face
> :front ".*\\\\start\\w*MP\\w*\\({\\w*}\\|\\[\\w*\\]\\|\\)\\W*"
> :back ".*\\\\stop\\w*MP")
> ))
> (add-to-list 'mmm-mode-ext-classes-alist '(context-mode nil context-plus))
>
> But that would require learning another TeX dialect ...
Hi Johan:
That's very nice. And following along those lines... For those who
want to have ESS capabilities within latex-mode, do the following:
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 2)
(mmm-add-group 'latex-weave
'((Sinput
:submode r-mode
:face mmm-comment-submode-face
:front ".*\\\\begin{Sinput}"
:back ".*\\\\end{Sinput}")))
(add-to-list 'mmm-mode-ext-classes-alist '(latex-mode nil latex-weave))
Then, you will have ESS[S] in the R chunks (but for me, they are
highlighted in cyan). And, you have access to iESS[R] functions
through the menus, but you don't get the toolbar. And, it seems
like it would be easy to adapt this to iESS[SAS]. But, you don't
get Soutput unless I'm missing something Hmm... Need to get back
to sweave for that I'm guessing.
Rodney
More information about the ESS-help
mailing list