auctex
[Top][All Lists]
Advanced

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

[AUCTeX] Auctex and Sweave -- can't compile .*Rnw files directly


From: Leo
Subject: [AUCTeX] Auctex and Sweave -- can't compile .*Rnw files directly
Date: Thu, 7 May 2009 12:32:17 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi all,
Searching the web/this list I have found the following snippet from .emacs 
that should enable direct compilation of Sweave files in Auctex:

(add-hook 'Rnw-mode-hook
(lambda ()
(add-to-list 'TeX-command-list
'("Sweave" "R CMD Sweave %s"
TeX-run-command nil (latex-mode) :help "Run Sweave") t)
(add-to-list 'TeX-command-list
'("LatexSweave" "%l %(mode) \\input{%s}"
TeX-run-TeX nil (latex-mode) :help "Run Latex after Sweave") t)
(setq TeX-command-default "Sweave")))

Indeed, Sweave command now works for me and produces the formatted tex files 
and figures, however, LatexSweave fails like so: 
ERROR: I can't find file `input{test.Rnw}'.  

texput.log contains:
This is pdfTeX, Version 3.141592-1.40.4 (MiKTeX 2.7) (preloaded format=latex 
2008.4.1)  7 MAY 2009 08:10
entering extended mode
**input{test.Rnw}

! Emergency stop.
<*> input{test.Rnw}
                   
*** (job aborted, file error in nonstop mode)


Now, I work with files test.Rnw and test.tex.  If I change the 
line '("LatexSweave" "%l %(mode) \\input{%s}" to read
'("LatexSweave" "%l %(mode) test", the LatexSweave command produces the 
desired output.

Finally, I can copy the Sweave.sty file into the working directory, run Sweave 
command, and compile the test.tex file just like I would any other tex file.  

>From this it seems that the line '("LatexSweave" "%l %(mode) \\input{%s}" 
needs to be modified in order to pass the correct arguments to lates/pdftex.
Unfortunately, I am rather new to elisp and Auctex, so I can't figre out how 
to do so.  I would much appreciate any help to this end!
 





reply via email to

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