[ESS] ess-developers/users using sweave/auctex

A.J. Rossini blindglobe at gmail.com
Thu Mar 31 09:42:07 CEST 2005


Here's an example Makefile which might be useful (my stock
noweb/Sweave template).  Be careful of line wrappings from this silly
mail program and tab-conversion (Emacs should help with both; I can't
readily attach it).  The compile button (or M-x compile) then becomes
your friend.  Note that you'll have to have something like Fritz's
"Sweave.sh" (simple batch script which loads the tools package and
Sweaves the file).

SOURCE=MyPaper
#SWEAVE=/home/rossini/bin/Sweave.sh
SWEAVE=Sweave.sh
#PDFVIEWER=acroread
PDFVIEWER=xpdf

.SUFFIXES: .i3 .m3 .nw .tex .dvi .html .c .h .Rnw .pdf
##.nw.html: ;       $(NOWEAVE) -filter l2h -index -html $*.nw > $*.html
##.nw.tex:  ;       $(NOWEAVE) -index -delay $*.nw | cpif $*.tex
##.nw.h:  ;       $(NOTANGLE) -R$*.h | cpif $*.h
##.nw.c:  ;       $(NOTANGLE) -R$*.c | cpif $*.c
.Rnw.tex: ;       $(SWEAVE) $*.Rnw
#.tex.pdf: ;       latex $*.tex ; dvips $*.dvi -o ; ps2pdf -sPAPERSIZE=a4 $*.ps
## w/o BibTeX
#.tex.pdf: ;       pdflatex '\scrollmode \input '"$*"; while grep -s
'Rerun to get cross-references right' $*.log; do pdflatex '\scrollmode
\input '"$*"; done
## w/ BibTeX
.tex.pdf: ;       pdflatex '\scrollmode \input '"$*"; bibtex $* ;
while grep -s 'Rerun to get cross-references right' $*.log; do
pdflatex '\scrollmode \input '"$*"; done
##.tex.dvi: ;          latex '\scrollmode \input '"$*"; while grep -s
'Rerun to get cross-references right' $*.log; do    latex '\scrollmode
\input '"$*"; done
##With BibTeX
#.Rnw.pdf: ;       $(SWEAVE) $*.Rnw ; pdflatex '\scrollmode \input
'"$*"; bibtex $* ;while grep -s 'Rerun to get cross-references right'
$*.log; do pdflatex '\scrollmode \input '"$*"; done
##Without BibTeX
#.Rnw.pdf: ;       $(SWEAVE) $*.Rnw ; pdflatex '\scrollmode \input
'"$*"; while grep -s 'Rerun to get cross-references right' $*.log; do
pdflatex '\scrollmode \input '"$*"; done

#$(SOURCE).dvi $(SOURCE).ps

$(SOURCE).pdf : $(SOURCE).tex

$(SOURCE).tex : $(SOURCE).Rnw

#$(SOURCE).dvi : $(SOURCE).tex

#$(SOURCE).ps  : $(SOURCE).dvi
#	dvips $(SOURCE) -o

default : $(SOURCE).pdf 
	$(PDFVIEWER) $(SOURCE).pdf




On Wed, 30 Mar 2005 18:44:41 +0200, Patrick Drechsler
<patrick at pdrechsler.de> wrote:
> 
> A. J. Rossini wrote on 30 Mar 2005 04:22:32 MET:
> 
> [...]
> 
> > I actually use a combination of Sweave and Makefiles,
> > evaluating code to test it out, and the makefiles automagically
> > generate the document.
> 
> > There is no good way to highjack the C-c C-c command feature of
> > AUC-TeX -- perhaps you could add an Sweave command using Fritz'
> > sample Sweave.sh (see the Sweave FAQ on his home page) but the
> > rest is usually easier with a Makefile.
> 
> I actually like using David Whiting's shortcuts which were posted
> here about half a year ago[1]. The only problem I have is that
> error messages are not displayed when something goes wrong.
> 
> Since I'm not to firm with Lisp I'll give Makefiles another try.
> 
> Thanks for your feedback,
> 
> Patrick
> 
> Footnotes:
> [1] <URL:https://stat.ethz.ch/pipermail/ess-help/2004-September/002108.html>
> 
> --
> Die Menschen werden geboren, die Menschen sterben, und die Zeit
> dazwischen verbringen sie mit dem Tragen der Digitaluhren.
> (Douglas Adams)
> 
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
> 


-- 
best,
-tony

"Commit early,commit often, and commit in a repository from which we can easily
roll-back your mistakes" (AJR, 4Jan05).

A.J. Rossini
blindglobe at gmail.com




More information about the ESS-help mailing list