Hello Does anybody have experience with Sweave run from Kile? I'm trying to make it run but have problems and don't know if the instructions are false or I do something wrong (my knowledge in bash and shell is too low to understand it)... I discovered recently Sweave and wanted to run it from my latex editor, Kile. I found and followed these instructions:> If you want to be able to call Sweave outside of R, you will need to > install a shell > script (see footnote 4). To install the script, copy it to > /usr/local/bin, then open > the Konsole program and type sudo chmod +x /usr/local/bin/Sweave.sh to > make it executable. > Next, you may want to tell Kile where to find the Sweave.sh shell > script. Open > Kile and click Settings ? Configure Kile. Click the Tools tab on the > left-hand > side of the preferences window, and select Build. Click the New Tool > button at the > bottom of the preferences window. Name the new tool Sweave, click > next, and then > Finish. In the resulting screen, type Sweave.sh in the top box, and > ?ld \%source' in the > bottom box.I followed these instructions but have 2 problems: 1: finished with exit status 126> SweaveOnly output: > ***** cd '/media/Partition_Commune/Mes documents/Ordi/LaTex/Sweave' > ***** Sweave.sh ?ld '\example1Leisch.Rnw' > ***** > /bin/bash: /usr/local/bin/Sweave.sh: Permission non accord?ein english: permission not given Do you see where the problem is? 2: If I run kile with sudo (sudo Kile), the problem disappears but a new one comes> SweaveOnly output: > ***** cd '/media/Partition_Commune/Mes documents/Ordi/LaTex/Sweave' > ***** Sweave.sh ?ld '\example1Leisch.Rnw' > ***** > Run Sweave and postprocess with LaTeX directly from command line > ?ld is not a supported file type! > It should be one of: .lyx, .Rnw, .Snw., .nw or .texIs the instructions false? Or do I do something wrong? Thank you much for your help!!
I use Sweave on a Mac from my LaTeX editor and it requires a similar shell
script to typeset the document. Mine uses R it's self (instead of sh) and
looks like:
#!/usr/bin/Rscript
args <- commandArgs(T)
fname <- strsplit(args[1],'\\.')[[1]][1]
Sweave(paste(fname,'Rnw',sep='.'))
system(paste('pdflatex',paste(fname,'tex',sep='.')))
This script is run as so:
sweave /path/to/source.Rnw
It works pretty good, although I think I used:
chmod 755 sweave
To make sure it would execute. You can also check ls -l to make sure you
have ownership of the file, if not you might need to hit it with chown.
-Charlie
Matthieu Stigler-2 wrote:>
> Hello
>
> Does anybody have experience with Sweave run from Kile? I'm trying to
> make it run but have problems and don't know if the instructions are
> false or I do something wrong (my knowledge in bash and shell is too low
> to understand it)...
>
> I discovered recently Sweave and wanted to run it from my latex editor,
> Kile. I found and followed these instructions:
>> If you want to be able to call Sweave outside of R, you will need to
>> install a shell
>> script (see footnote 4). To install the script, copy it to
>> /usr/local/bin, then open
>> the Konsole program and type sudo chmod +x /usr/local/bin/Sweave.sh to
>> make it executable.
>> Next, you may want to tell Kile where to find the Sweave.sh shell
>> script. Open
>> Kile and click Settings ? Configure Kile. Click the Tools tab on the
>> left-hand
>> side of the preferences window, and select Build. Click the New Tool
>> button at the
>> bottom of the preferences window. Name the new tool Sweave, click
>> next, and then
>> Finish. In the resulting screen, type Sweave.sh in the top box, and
>> ?ld \%source' in the
>> bottom box.
> I followed these instructions but have 2 problems:
> 1: finished with exit status 126
>> SweaveOnly output:
>> ***** cd '/media/Partition_Commune/Mes
documents/Ordi/LaTex/Sweave'
>> ***** Sweave.sh ?ld '\example1Leisch.Rnw'
>> *****
>> /bin/bash: /usr/local/bin/Sweave.sh: Permission non accord?e
> in english: permission not given
> Do you see where the problem is?
>
> 2: If I run kile with sudo (sudo Kile), the problem disappears but a new
> one comes
>> SweaveOnly output:
>> ***** cd '/media/Partition_Commune/Mes
documents/Ordi/LaTex/Sweave'
>> ***** Sweave.sh ?ld '\example1Leisch.Rnw'
>> *****
>> Run Sweave and postprocess with LaTeX directly from command line
>> ?ld is not a supported file type!
>> It should be one of: .lyx, .Rnw, .Snw., .nw or .tex
> Is the instructions false? Or do I do something wrong?
>
> Thank you much for your help!!
>
> ______________________________________________
> 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.
>
>
-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
--
View this message in context:
http://www.nabble.com/Sweave-from-Kile-tp19955007p19955763.html
Sent from the R help mailing list archive at Nabble.com.
Hi Matthieu,> Does anybody have experience with Sweave run from Kile? I'm trying to > make it run but have problems and don't know if the instructions are > false or I do something wrong (my knowledge in bash and shell is too low > to understand it)...... It would help if you stated that you use "mine" Sweave.sh i.e. the one from http://cran.r-project.org/contrib/extra/scripts/Sweave.sh. I will assume you do. I will start with the second problem> 2: If I run kile with sudo (sudo Kile), the problem disappears but a new >one comes >> SweaveOnly output: >> ***** cd '/media/Partition_Commune/Mes documents/Ordi/LaTex/Sweave' >> ***** Sweave.sh ?ld '\example1Leisch.Rnw' >> ***** >> Run Sweave and postprocess with LaTeX directly from command line >> ?ld is not a supported file type! >> It should be one of: .lyx, .Rnw, .Snw., .nw or .tex > Is the instructions false? Or do I do something wrong?Is there a single - or double - i.e. --. If I issue the following $ Sweave.sh --ld test.Rnw Run Sweave and postprocess with LaTeX directly from command line --ld is not a supported file type! It should be one of: .lyx, .Rnw, .Snw., .nw or .tex I get the same error.> 1: finished with exit status 126 >> SweaveOnly output: >> ***** cd '/media/Partition_Commune/Mes documents/Ordi/LaTex/Sweave' >> ***** Sweave.sh ?ld '\example1Leisch.Rnw' >> ***** >> /bin/bash: /usr/local/bin/Sweave.sh: Permission non accord?e > in english: permission not givenIt seems that chmod did not behave as you expected. First check file permissions with ls -l /usr/local/bin/Sweave.sh On my computer I get -rwxr-xr-x 1 root root 30K 2008-04-30 11:17 /usr/local/bin/Sweave.sh* Note that x is there three times i.e. anyone can run this script, the user, the group and others. Try with sudo chmod a+x /usr/local/bin/Sweave.sh and check the file permissions. gg