[texworks] Sweave with Texworks - Update

Paul A Norman paul.a.norman at gmail.com
Sun Aug 1 08:12:07 CEST 2010


Hi Chris,

Your basic set up seems right (I am not running Sweave but here are
some tips from http://stat.epfl.ch/webdav/site/stat/shared/Regression/EPFL-Sweave-powerdot.pdf)

Are you using an initial .Rnw or Snw extension for your first file(s)?
 E.g. MyFile.Rnw

Assuming (as you are using CMD) you are on MSWindows, is Sweave in
your path statement? (Right Click MyComputer choose Properties /
Advanced / Environment Variables / under System Variables scroll to
Path and Click edit (carefully) edit the path ststement includung the
full path to your Sweave binary. OK, OK  out.

Choose Sweave from the drop down beside the Green start arrow.

Run the Green arrow.

When Sweave runs it should produce a file with the same name stem but
.tex extension.

So MyFile.Rnw will produce a file MyFile.tex which you then need to
open in TeXWorks and run pdflatex (or what ever) over, (Change
dropdown to pdflatex and run green arrow), to get MyFile.pdf

You may want to try and see if you can edit
\config\configuration\syntax-patterns.txt

to make your Sweave in-document commands colour-ise in some useful
way, if you do you might want to consider adding that information to
the TeXWorks/issues as a resource perhaps (you might have alrteady
opened an issue 397 there)?

Another approach would be to make a Tw QtScript (like JavaScript) that
handles the processing of the Swaeve file and then opens the result in
the TexWorks editor for you.

Hope this helps ...

Paul

On 1 August 2010 05:48, Christopher Desjardins <cddesjardins at gmail.com> wrote:
> Hi,
> I think I got this to work properly. Here's what I did.
>
> Edit -> Preferences...
>
> Processing tools -> click the '+'
>
> Name: Sweave
> Program: R
> Arguments: CMD
>                   Sweave
>                   $fullname
>
>
> Is there anything else I should do?
> Chris
>



More information about the texworks mailing list