auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Noweb mode


From: Rasmus
Subject: Re: [AUCTeX] Noweb mode
Date: Mon, 26 Sep 2011 00:10:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)


> When I open such a file, Auctex turns on a Noweb-mode which seems to
> be in conflict with my favorite cdlatex mode.

I have never been able to make AUCTeX and cdlatex play along in
a satisfying manner.  I haven't spend any time on the issue either. 


> Is it possible to make AucTeX understand that my foo.Rnw files are
> pure LaTeX files (despite the Rnw extension) and prevent it from
> loading noweb mode?
Look at auto-mode-alist.  Maybe something simple like 

#+begin_src emacs-lisp
(add-to-list 'auto-mode-alist '("\\.Rnw$" . latex-mode)
#+end_src 

will work. It seems that ESS append auto-mode-alist.

> Another way is to solve the conflict between Noweb and cdlatex ;-)

I don't know what the problem is.

> Nota : my foo needs to keep the Rnw extension for compilation with Sweave.
 
There is a variable in newer versions of ESS that can be set to add
Sweave to C-c C-c of AUCTeX. I don't remember what it's called. 

Here is what I use (note pgfSweave ≠ Sweave).


#+begin_src emacs-lisp
(add-hook 'Rnw-mode-hook
          (lambda ()
            (add-to-list 'TeX-command-list
                         '("Sweave" "pgfsweave %s"
                           TeX-run-command nil the:help "Run Sweave") t)
            (add-to-list 'TeX-command-list
                         '("Sweave" "pgfsweave --pgfsweave-only %s"
                           TeX-run-command nil the:help "Run Sweave Only") t)
            (setq TeX-command-default "Sweave")))
#+end_src

> Keep in mind that I'am just a user who does not understand the bowels of 
> Emacs:-(

There is no excuse¹ :) '(emacs-lisp-intro '(included in Emacs) is very
friendly).

> i would be interested in a solution too.
> It would be perfect, if emacs could switch between TeX and
> Gnu-R Modes in noweb-Files.

What is Gnu-R modeS?  ESS?

Notice, ESS comes with a wonderful noweb-based solution out of the box.
Maybe something can be hacked together using MuMaMo² if one despites
noweb-mode.

–Rasmus

Footnotes: 
¹  http://www.youtube.com/watch?v=HM1Zb3xmvMc

²  http://www.emacswiki.org/emacs/MuMaMo

-- 
Sent from my Emacs




reply via email to

[Prev in Thread] Current Thread [Next in Thread]