Re: [R] LyX and Sweave

From: Gorjanc Gregor <Gregor.Gorjanc_at_bfro.uni-lj.si>
Date: Wed 27 Jul 2005 - 23:28:54 EST


[...]

> >> Using an Sweave shell script like Gregor's in combination with
> >> "lyx -e latex" might do the trick to have direct conversion to PDF
> >> from the LyX GUI.

> > Note that this is not the only possible way. As I showed, the other one i.e.
> > noweb mode in LyX (look in file SweaveNoweb.lyx and its PDF at URL above)
> > can deal with Sweave in all ways i.e. export or view to any supported formats
> > by LyX.

> The point was actually not so much about .Stex versus .Snw but that
> you can integrate all into the LyX GUI: For my import above I get a
> menu entry

> File->Import->Sweave

> in the LyX GUI whhich probably is appealing to GUI-users. The same
> could be done by registering .Snw and modifying the noweb import
> filter accordingly.

> The same should be done for output, such that one can do

> File->Export->Sweave+PDF

Nope. That's what I also thought, but I was really amaized when discovered that there is no need for this. You only need to set up noweb stuff as mentioned at

<http://thread.gmane.org/gmane.editors.lyx.general/18847>

and use article(noweb) for document style. Then everything (export and view directly from LyX GUI) just works. As I said I was really surprised with it. Try with SweaveNoweb.lyx and you will see. This way, one can skip my silly Sweave.sh ;)

> (or whatever you want to call it) directly from within LyX, rather
> then saving & renaming as you suggest under "Compilation".

> But I'm too much of an Emacs person to really spend time on such
> things ... but I'll be happy to collect information and integrate it
> into the Sweave manual.

I also prefer Emacs this days, and I really did not spend a lot on this LyX feature, but since it is "so easy" I just couldn't retain to share.

Gregor



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 27 23:34:31 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:03 EST