RefTeX with ESS and Sweave oddity...

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Sat Sep 18 16:50:28 CEST 2004


hi Patrick,
I just tried your example, but I get the desired behaviour.  I've got
the following in my .emacs:

----------------------------------------------------------------------
(defun Rnw-mode ()
  (require 'ess-noweb)
  (noweb-mode)
  (if (fboundp 'R-mode)
      (setq noweb-default-code-mode 'R-mode)))
(add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode))
(add-to-list 'auto-mode-alist '("\\.Snw\\'" . Rnw-mode))

(setq reftex-file-extensions
      '(("Snw" "Rnw" "nw" "tex" ".tex" ".ltx") ("bib" ".bib")))
(setq TeX-file-extensions
      '("Snw" "Rnw" "nw" "tex" "sty" "cls" "ltx" "texi" "texinfo"))
----------------------------------------------------------------------

I think I got these also from
http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html

but when I viewed that page today with Firefox, I notice extra spaces
in the lisp code: e.g. auto-mode-alist appears as "add-to-l i s t  "

I assume you removed the excess whitespace?  In the meantime, I'll
write to Friedrich to see if he is aware of this.

Please post what you have in your .emacs so we can compare.

Thanks, Stephen

 > I have a similar problem trying to insert references. Here's a
 > short Rnw file:
 > 
 > --8<------------------------schnipp------------------------->8---
 > \documentclass{article}
 > \begin{document}
 > some text\ldots
 > 
 > \begin{figure}[htbp]
 >   \centering
 > @ 
 > <<foo, fig=TRUE>>=
 > foo <- 1:10
 > bar <- sin(foo)
 > plot(foo,bar)
 > @ %def 
 >   \caption{testfunction}
 >   \label{fig:foobar}
 > \end{figure}
 > 
 > some more text.
 > \end{document}
 > --8<------------------------schnapp------------------------->8---
 > 
 > Hitting `C-c ) SPACE' after "some more text" opens the `RefTeX
 > Select' buffer correctly. But it's empty. I've also tried
 > reparsing and even closing and reopening emacs. Inserting a
 > reference in this manner in the resulting tex file works fine.
 > 
 > My ~/.emacs settings are copied directly from the instructions
 > of the Sweave docu.
 > 
 > 
 > Emacs: GNU Emacs 21.3.50.6 (i686-pc-linux-gnu, X toolkit, Xaw3d
 > scroll bars) of 2004-09-07 on trurl
 > ess-mode 5.2.2
 > AUCTeX 11.53
 > reftex-version 4.19




More information about the ESS-help mailing list