[R] [Solved] Re: Sweave from Kile
Matthieu Stigler
matthieu.stigler at gmail.com
Tue Oct 14 06:15:41 CEST 2008
Thanks to the help of Gregor Gorjanc I could solve the problem:
1: With the command
sudo chmod a+x /usr/local/bin/Sweave.sh
I had only
ls -l /usr/local/bin/Sweave.sh
-rwxr-x--x 1 root root 29997 2008-10-11 15:42 /usr/local/bin/Sweave.sh
So I added sudo chmod o+r /usr/local/bin/Sweave.sh
And had then:
$ ls -l /usr/local/bin/Sweave.sh
-rwxr-xr-x 1 root root 29997 2008-10-11 15:42 /usr/local/bin/Sweave.sh
so first problem was solved.
2 The second problem was actually that the command from Kile was
misspecified: probably due to a copy/paste from the pdf doc, it was
actually a bigger − .This problem was then solved by adding the small -
Sweave.sh -ld 'example1Leisch.Rnw'
3 a new problem occurred, but I found the solution: I think the command
for Kile should not contain the \ before the name (at least removing it
worked for me)
Not Sweave.sh -ld '\example1Leisch.Rnw' But Sweave.sh -ld 'example1Leisch.Rnw'
Now I can compile direct from Kile! The only problem is that the command
-ld only create the pdf, does not open it. Maybe are there other options
from Script File of Gregor Gorjanc to compile with pdflatex (texi2dvi
did not work) and open but I just made it from Kile: Settings->Configure
Kile->Tools->Build->New Tool, configure it based on Archive for example,
put the new command sweave and then add any command to open (viewpdf in
my case).
So many thanks to Gregor Gorjanc for this nice script (and also for your
work for Lyx-Sweave!!!) and for your help now!
Matthieu
Gorjanc Gregor a écrit :
> 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 given
>>
>
> It 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
>
More information about the R-help
mailing list