views:

180

answers:

1

Hi All,

I am very new to LaTex and R, but I am learning on a daily basis. I really am getting into using Eclipse and want to join the party and start automating my work using Sweave; I am excited for the prospects.

That said, I followed Jeromy's post here and think (keyword, think) that everything is set up correctly. However, since I am very new to LaTex, how can I test it to know that I am up and running and can indeed create pdf's?

Simply, I want to test that my configurations are up and running before I start diving into templates and creating reports. What is the basic process, from within Eclipse, to create a pdf?

Any help will be very much appreciated!

Thanks,

Brock

+4  A: 

Right, assuming you're using StatEt within Eclipse, then make sure you've done the following;

  • Configured Statet under Window > Preferences ? StatEt, and setup things like your R environment.
  • Configure TexClipse under Window > Preferences > Texclipse, and tell it where your latex commands live (I'm on Windows, so this was c:\program files\miktex\miktex\
  • Make sure RJava is installed within your R environment
  • Setup the R build configuration, goto Run > Run Configurations, click the New icon and enter things like the R environment, the working directory and any parameter's you want.
  • Setup the Sweave command, goto Run > External Tools > Externals Tool Configurations, click the new icon under Sweave and I think I left everything default, to run sweave in the R console and run pdflatex

Then create an eclipse project, and within that project create a new Sweave document, StatEt should give you a skeleton template that will succesfully build, so then open the R console (either from the icon or via Run > Run As), then with your Sweave skeleton document tab selected, run Sweave (either via the icon, or via Run > External Tools > Whatever you called it)

You should then see the R bits occur in the R console, then the latex'y bits happening in the background and a little progress bar at the bottom of the window. Eventually it will finish and a new (blank) PDF will pop up.

Voila !

I'd also recomend this guide and this one

PaulHurleyuk
Thanks for the help; I am getting an error. I am using 2.10.1, I started R inside Eclipse, clicked the run button to select "Sweave Document (R/Latex) in R via 'Sweave'), and the console shows some code that says "You can now run LaTex on 'Test1.tex'. I then select it from External tools, and I get the following error: Status Processing Sweave Document 'Test1.Rnw'. The working directory (folder of tex file) have to be in the Eclipse workspace. Exit code = 113I searched in Windows for the tex file and moved it to my project workspace to no avail. Any ideas what I am doing wrong?
Btibert3
That vaguely rings a bell. Off the top of my head it might be that you need to copy the sweave.sty file (that sweave and latex need) into your eclipse project folder. Also, on my setup (wi XP, Eclipse/StatEt and MikTex) I just select the rnw sweave file and hit the eternal tool sweave command, sweave runs in the console and then latex runs automatically. Also also you might want to try the StatEt mailing list https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/statet-user
PaulHurleyuk