[ESS] Sweave, Emacs GNU

Martin Maechler maechler at stat.math.ethz.ch
Fri Jan 22 10:37:06 CET 2010

>>>>> "ET" == E T <2nuzzbot at gmail.com>
>>>>>     on Tue, 19 Jan 2010 14:02:48 +0000 writes:

    ET> Hi,
    ET> If anyone can please give advice on adding "Sweave" to  the command menu in
    ET> Emacs GNU, it would be greatly appreciated.

In ESS (GNU Emacs + ESS; even XEmacs + ESS), if you are editing
a *.Rnw or *.Snw i.e. an Sweave source file,

you get an Emacs menu called "Noweb"
     (that's what the "nw" in "Rnw" stands for !)
and if you open that, 
the very last line of this 'Noweb' menu says
 "Sweaving, Tangling, ...   >"   i.e., is a sub-menu

and that has entries
     "PS (dvips)"
     "Insert Sexpr"

each with the key shortcut that you can use
  {'M-n s',  the one for Sweave, is the one I use most often}

Is that not sufficient?

Martin Maechler, ETH Zurich

    ET> I was working on a mac and had "sweave" in the command drop-down menu  of
    ET> Aquamacs ... by using the code below. However I do not know how to apply
    ET> this
    ET> on a windows platform. Please help.

    ET> 1) Typing the following in the terminal:

    ET> sudo chmod +x ~/script/Sweave.sh

    ET> 2) Typing the following in the Aquamacs preference file:

    ET> '(reftex-plug-into-AUCTeX t)
    ET> '(text-mode-hook (quote (text-mode-hook-identify)))
    ET> (autoload 'reftex-mode    "reftex" "RefTeX Minor Mode" t)
    ET> (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" t)
    ET> (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
    ET> (add-hook 'latex-mode-hook 'turn-on-reftex)

    ET> (add-hook 'Rnw-mode-hook
    ET> (lambda ()
    ET> (add-to-list 'TeX-command-list
    ET> '("Sweave" "~/script/Sweave.sh -ld -nc %s"
    ET> TeX-run-command nil t :help "Run Sweave") t)
    ET> (setq TeX-command-default "Sweave")))

    ET> [[alternative HTML version deleted]]

    ET> ______________________________________________
    ET> ESS-help at stat.math.ethz.ch mailing list
    ET> https://stat.ethz.ch/mailman/listinfo/ess-help

More information about the ESS-help mailing list