[OS X TeX] TeXShop and Sweave

Maarten Sneep maarten.sneep at xs4all.nl
Mon Aug 28 18:14:31 EDT 2006


On 24-aug-2006, at 15:15, Michael Kubovy wrote:

> I'm using R to process .Rnw files (using the Sweave() function) to  
> produce .tex file which I compile with TeXShop. When I open a .Rnw  
> file in TeXShop, the corresponding .pdf is also opened. If I then  
> open the corresponding .tex file, it too tries to open the .pdf.  
> The problem I have is the following: If I forget to close the .tex  
> and all the .pdf files files before opening the modified .tex file  
> (after running the .Rnw file through R), TeXShop crashes.
>
> When I do this, I typically will go through dozens of runs:  
> edit .Rnw in TeXShop -> run through R -> open .tex in TeXShop ->  
> compile .tex in TeXShop. It is possible that multiple episodes of  
> my forgetfulness are required to produce such a crash. It seems to  
> me that it generally happens well into such a session. This may  
> mean that I'm getting careless or that something is gradually  
> getting screwed up until a last straw breaks the program.
>
> Advice?

I noticed noone had attempted to answer this. Sweave is a documented  
source tool, at least that's what I understand from a message to this  
list from 2004 (correct me if I'm wrong). The situation is similar to  
web/noweb/cweb where the source that is compiled and the source that  
you write are two different things.

I can see two solutions: use an editor that will check whetehr a file  
was modified on disk, and re-read as needed (BBedit, TextWrangler,  
TextMate (I think)). AppleScript will then allow you to compile and  
preview from this generated source.

Another solution is to use R's shell integration (system(), I think,  
there must be some function to call command line utilities), and  
integrate with TeX at that level. You can then use the "open" shell  
command to open the pdf and view the result. This way your generated  
sources never open in a text editor, and the bug is circumvented.

By all means visit the TeXShop sourceforge page and file a bug report  
(sync with disk is the appropriate term).

Maarten


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list