[ESS] Combining sweave and pdflatex into one helper function

Seb spluque at gmail.com
Wed Feb 9 00:56:59 CET 2011


On Tue, 8 Feb 2011 15:04:49 -0600,
Paul Johnson <pauljohn32 at gmail.com> wrote:

> Hello, I need to revive this thread from December.  I've got that same
> problem Dirk had. I'm running Ubuntu linux with Emacs 23.2 and ess
> 5.12.  After Sweaving a document, I get no further, ESS refuses,
> minibuffer says:

> ess-error: ESS process not ready. Finish your command before trying
> again.

> Did you find an answer to this problem?

I haven't looked at this particular problem, but I suggested an
alternative way of working to Dirk (off-list), which he liked (so we're
2 at least!), but that requires AUCTeX, so may not appeal to everyone.
I may have stolen the major pieces of this from the AUCTeX list:

(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) %s"
			   TeX-run-TeX nil (latex-mode) :help "Run Latex after Sweave") t)
	    (setq TeX-command-default "Sweave")))

and then you can just do 'C-c C-c Sweave' without having to have an R
session running; you can just check that things are fine with 'C-c C-l',
and then do 'C-c C-c LatexSweave'.  Follow this by 'C-c C-v' to open the
viewer the first time (keep it open for further processing).

Should we suggest this in the ESS manual or incorporate into the source
code?  I think it goes better in the manual, since maintaining it means
watching for AUCTeX's changes to these parts (these have bit me a few
times in the past).  Any arguments in favor/against any of these?


-- 
Seb



More information about the ESS-help mailing list