[R] LyX and Sweave

Friedrich.Leisch@tuwien.ac.at Friedrich.Leisch at tuwien.ac.at
Wed Jul 27 15:13:10 CEST 2005


>>>>> On Wed, 27 Jul 2005 14:47:21 +0200,
>>>>> Gorjanc Gregor (GG) wrote:

[...]

  >>> 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.

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

(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.

Best,
Fritz




More information about the R-help mailing list