REQUIREMENTS - R => 2.4.0 - LyX => 1.4.4 (for LyX 1.4.3 use files from lyx-1.4.3 directory) - Unix shell for MS Windows users* INSTALL STEPS 1. Find the so-called LyX user directory or LyX library directory via the Help -> About LyX menu within LyX. 2. Save the 'preferences' file in the LyX user directory or LyX library directory; append content if the 'preferences' file already exists. 3. Save the 'literate-*.*' files to the 'layouts' sub-directory of the LyX user directory or LyX library directory. 4. Make sure that Sweave.sty is in one of the texmf trees and that path database is updated. 5. Start LyX and update configuration via the Tools -> Reconfigure menu within LyX. 6. Make sure that the directory with R binaries is specified in the path variable so that LyX can use R. MS Windows users should go to: Start -> Control Panel -> System -> Advanced -> Environment Variables, and then add the bin directory of R installation to the PATH system variable, say c:\Progra~1\R\R-X.Y.Z\bin 7. Restart LyX. 8. Start using Sweave with LyX. For further details about step 4. see the paper "Using Sweave with LyX: How to lower the LaTeX/Sweave learning curve" available at: http://www.r-project.org/doc/Rnews/Rnews_2008-1.pdf UNIX SHELL FOR MS WINDOWS* Unix shell is needed since R CMD Sweave and R CMD Stangle (used for weaving and tangling the document) use Unix shell scripts Sweave.sh and Stangle.sh. More info about Unix shell is available at: http://en.wikipedia.org/wiki/Unix_shell MS Windows users can install Unix shell in various ways (some possibilities which include Unix shell as well as plenty of other very usefull tools are provided below). In all cases Unix shell command must be installed to a place (directory) defined in PATH system variable! A. Rtools http://www.murdoch-sutherland.com/Rtools B. Cygwin http://www.cygwin.com C. MSYS http://www.mingw.org/msys.shtml Users of Windows batchfiles for R from http://batchfiles.googlecode.com can solve the need for Unix shell in two different ways: 1. Copy Rcmd.bat and/or R.bat to any place defined in PATH system variable and install the latest set of Rtools. 2. Copy Sweave.bat and Stangle.bat to any place defined in PATH system variable and use the following converter definitions in LyXs' preferences file: \converter "literate" "r" "Stangle $$i" "" \converter "literate" "latex" "Sweave $$i --tex" "" \converter "literate" "pdflatex" "Sweave $$i --tex" ""