[R-SIG-Mac] Textmate/ SWeave: Error PDF file not written to disk

Saiwing Yeung saiwing at berkeley.edu
Thu Apr 16 11:30:16 CEST 2009

I played with it a little more and I think I have gotten it to work  
properly for me. I still don't entirely understand why this works (!)  
so follow at your own risk :) First a bit of clarification, I set my  
TextMate up with TM_LATEX_COMPILER set to latexmk.pl (in TextMate  
Preferences). Then these 2 changes are made.

need new version of latexmk.pl in . The original version is 3.07a, I  
got the one from
which is 4.05. It should be at
     ~/Library/Application Support/TextMate/Pristine Copy/Bundles/ 
which might be different if you installed it using other methods.

In "Sweave, Typeset & View", change a line in run_tex()
     else "$TEX" -f -r "${TM_BUNDLE_SUPPORT}/latexmkrc" "$1"
     else "$TEX" -f -pdf "$1"

* I am not sure why I need to call -pdf to get it to produce the pdf  
while wasn't needed in the original version.
* I don't have latexmkrc in my support directory and this option was  
making latexmk.pl unhappy.

* you still need Sweave.sty somewhere
* I commented out the standard error pipe in my last post. But with  
these changes I can (and should) revert the change.

Hope this helps. It would be great if someone can fix this properly  
instead of using some voodoo hack.


On Apr 13, 2009, at 1:55 AM, Felix Schönbrodt wrote:

>> I ran into the same problem today (at least the symptoms matched)  
>> and it took me some time to figure this out... Basically I solved  
>> this by copying the file Sweave.sty to the same directory as the  
>> the .rnw file. I suppose you can also try to add the path to  
>> Sweave.sty. But then, by having the file in the same directory,  
>> when you send your stuff to other people, it is more likely that  
>> you will include it and prevent your collaborators from having the  
>> same problem.
> Yes, that's one problem (I solved it by copying the Sweave.sty into  
> my texmf-local directory). Unfortunately, it does not solve my real  
> problem, because the Sweave does work (--> the .tex-file is produced).
>> A related issue is that the "missing Sweave.sty" error isn't shown  
>> in the TextMate output when you run "Sweave, Typeset, & View" even  
>> though it looks like it should.
>>   run_tex "$FILE" 2>&1| latexErrWarnHtml.py -v
>> I haven't really looked into this though. For now I just comment  
>> out the redirecting part
>>  run_tex "$FILE" # 2>&1| latexErrWarnHtml.py -v
>> so that I can see the LaTeX errors.
> I agree - the problem should lie in the following portion of code in  
> the Sweave.tmbundle:
> run_tex () {
> if [ "$TEX" != latexmk.pl ]
> 	then "$TEX" ${TM_LATEX_OPTIONS:=-interaction=nonstopmode -file-line- 
> error-style} "$1"
> 	else "$TEX" -f -r "${TM_BUNDLE_SUPPORT}/latexmkrc" "$1"
> fi
> }
> # Compile.
> run_tex "$FILE" 2>&1| latexErrWarnHtml.py -v
> Unfortunately my skills are to limited to track the error ... maybe  
> someone else has an idea?
> Best regards,
> Felix
>> Hope this helps,
>> Saiwing
>>> Dear list,
>>> I encountered a problem in the combination of Textmate and the  
>>> SWeave
>>> bundle: when I start "Sweave, typeset & View", the .Rnw-file is
>>> processed, but the log window shows "Error: PDF file not written to
>>> disk" and the tex-file is not processed.
>>> However, the sweaving was successful, as a valid .tex-file is in the
>>> same folder which can be typesetted without problem.
>>> So, in general it works, I just want to avoid the extra step of
>>> opening the .tex-file and would like to see my pdf directly from
>>> SWeave-Bundle.
>>> Did anyone encounter the same problem / any suggestions for  
>>> solutions?
>>> Best regards,
>>> Felix
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list