Re: [R] Sweave and Textwrangler

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Sat, 26 Mar 2011 15:57:22 -0400

On 11-03-26 10:58 AM, Christopher Desjardins wrote:
> Hi,
> I am trying to get TextWrangler to work with LaTeX and Sweave. Ideally
> I would call a script from TextWrangler that would run Sweave on a
> document, then LaTeX (using SyncTeX), and finally
> open the corresponding pdf in Skim. Of course I don't always need to
> run Sweave and would be looking for the option of LaTeX -> Open. I
> found this http://www.xs4all.nl/~msneep/latex/ but it doesn't work for
> me as it gives me an error. Something similar to do that would be
> ideal. Additionally the option to use BibTeX would be great too.
>
> Additionally, I tried this
> http://www.stat.umn.edu/~arendahl/computing/index.html
> and Sweave.sh script and trying to alter that (and the *.engine files) to
> work with TextWrangler but to no avail.
>
> Does anyone do this and have a tip they could give me? Sorry if this is
> off-topic (if so please reply to me off the list).

I don't use TextWrangler, but I got TeXShop working pretty nicely with Sweave. The "engine" file simply does this:

Rscript -e "patchDVI::SweavePDF( '$1' )"

The patchDVI package is on R-forge here:

https://r-forge.r-project.org/R/?group_id=233

This needs a very recent version of Sweave.sty if you have a recent pdflatex.

You say you don't want to run Sweave every time, and want to sometimes run only Latex. I don't see how this would be desirable, because your edits to the .tex file are lost the next time you run Sweave, but the above engine skips Sweave if it is given a .tex file instead of something it recognizes as Sweave input.

I gave a little tutorial on this recently; it's online here:

http://www.umanitoba.ca/statistics/seminars/2011/3/4/duncan-murdoch-using-sweave-R/

The last section of the sample document shows how to set up TeXShop. I suspect setting up TextWrangler would be somewhat similar.

Duncan Murdoch



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 26 Mar 2011 - 20:00:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 26 Mar 2011 - 20:10:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive