>>>>> On Mon, 25 Jul 2005 14:12:41 +0200, >>>>> Gorjanc Gregor (GG) wrote:> Hello R-users! > I have tried to use Sweave within LyX* and found two ways to accomplish > this. I have attached LyX source file for both ways as well as generated > PDFs. I have copied Gregor's files at http://www.ci.tuwien.ac.at/~leisch/Sweave/LyX for those who didn't get the attachments. LyX looks actually much better and stable then when I last had a look a couple of years ago. To add to the discussion: One might even get better integration between Sweave and LyX because LyX allows specification of file converters: Edit->Preferences->Converters Edit->Preferences->File Formats After registering .Stex as a file format for Sweave I can import .Stex files using conversion command reLyX -f $$i && mv $$i.lyx $$o and the move is necessary only because reLyX produces foo.Stex.lyx rather then foo.lyx. 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. Best, Fritz
> > Hello R-users!< > I have tried to use Sweave within LyX* and found two ways to accomplish> > this. I have attached LyX source file for both ways as well as generated > > PDFs.> I have copied Gregor's files at> http://www.ci.tuwien.ac.at/~leisch/Sweave/LyX> for those who didn't get the attachments. LyX looks actually much > better and stable then when I last had a look a couple of years ago.Well, I am satisfied with it, actaully I wrote my graduation thesis in it and it was much, much more stable than let's say MS Word. Of course one does not need to know much about LaTeX.>> To add to the discussion: One might even get better integration >> between Sweave and LyX because LyX allows specification of file >> converters:> Edit->Preferences->Converters > Edit->Preferences->File Formats> After registering .Stex as a file format for Sweave I can import .Stex > files using conversion command> reLyX -f $$i && mv $$i.lyx $$o> and the move is necessary only because reLyX produces foo.Stex.lyx > rather then foo.lyx.Nice!> 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.
[...]> >> 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+PDFNope. 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
[...]> > 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 ;)> Ahh, now I get it. Still it needs some polishing, because after > configuring LyX that way regular noweb will no longer work, but it > shouldn't take too much of an effort to duplicate the noweb configs in > LyX to recognise Sweave.Nice isn't it.> That certainly looks like the way to go, might give Sweave another > strong push because people do no longer have to learn all of LaTeX ...> If we make a clean solution then I think it shouldn't be too hard to > convince the LyX guys to include it in their distribution -> that > would make an out-of-the-box solution.Yes, LyX developers should copy "noweb configuration" to "Sweave configuration" and add small (like yours at Sweave repository) Sweave.sh and additionaly also import configuration you mentioned before. I strongly encourage you to send this to LyX developers. Gregor
I just wanted to point out that I was there first :) on the Lyx List (Nov 2004): http://www.mail-archive.com/lyx-users at lists.lyx.org/msg36262.html Perhaps somebody who is trying to put all of this together can benefit from both sets of explanations. pj Friedrich.Leisch at tuwien.ac.at wrote:>>>>>>On Mon, 25 Jul 2005 14:12:41 +0200, >>>>>>Gorjanc Gregor (GG) wrote: > > > > Hello R-users! > > I have tried to use Sweave within LyX* and found two ways to accomplish > > this. I have attached LyX source file for both ways as well as generated > > PDFs. > > I have copied Gregor's files at > > http://www.ci.tuwien.ac.at/~leisch/Sweave/LyX > > for those who didn't get the attachments. LyX looks actually much > better and stable then when I last had a look a couple of years ago. >-- Paul E. Johnson email: pauljohn at ku.edu Dept. of Political Science http://lark.cc.ku.edu/~pauljohn 1541 Lilac Lane, Rm 504 University of Kansas Office: (785) 864-9086 Lawrence, Kansas 66044-3177 FAX: (785) 864-5700