As previously Jeff contributed a not on how to setup LyX and Sweave on Win XP or Vista. See here for the note.
P.S. (2010-04-01) See also LyX Wiki
![]() |
| From Bloggerjeve slike |
![]() |
| From Bloggerjeve slike |
![]() |
| From Bloggerjeve slike |
![]() |
| From Bloggerjeve slike |
![]() |
| From Bloggerjeve slike |
![]() |
| From Bloggerjeve slike |
![]() |
| From Bloggerjeve slike |
I have been wondering if it is possible to use Enter instead of Ctrl+Enter in the Sweave code chunk in LyX. It is not quite convenient to press Ctrl+Enter, what's more, we are not able to copy R code and paste it into LyX from other editors (vice versa). I see we are allowed to use a single carriage return in LaTeX code embedded in LyX. Why must Sweave code use Ctrl+Enter? Thanks!My reply:
LyX prohibits the use of enter key for anything else than starting a new paragraph - this is default behaviour which is great for writing, but notorious for using Sweave with LyX. When you press enter you get a new paragraph, which would start a new chunk of code or is it new paragraph with default style - I do not remember the details at the moment. I agree that this is far from handy, but I was not able to find a solution for this. However, as you mention, it is possible to use ERT LaTeX boxes, to overcome this.
Nothing was wrong with your instructions at http://www.bioconductor.org/CRAN/contrib/extra/lyx under install from what I can tell (other than where I put noweb.sty).
Here are the install steps I used (which basically follow the ones you provide on CRAN but I tried to list exactly what I did) to install Lyx 1.6.4 on my Linux Ubuntu Karmic Dual Core 32bit laptop with R v2.10.1 (2009-12-14). Note there are some minor differences with my install routine and what I found at- http://blog.nextbiomotif.com/2009/10/primer-to-sweave-with-lyx.html. Location of Sweave.sty is different.
1: I used Synaptic package manager to install Lyx and LaTex (tex-live). I updated R using sudo apt-get install and sudo apt-get install r-base before anything else.
2. Find the so-called LyX user directory or LyX library directory via the Help -> About LyX menu within LyX (mine was /usr/share/lyx/)
3. Save the 'preferences' file from CRAN (I saved unedited) into- /usr/share/lyx/
4. I saved all the literate-*.* files from CRAN to the layouts sub-directory of the Lyx user directory- /usr/share/lyx/layouts/
5. I put noweb.sty into- /usr/share/texmf/tex/latex/
6. I put Sweave.sty into- /usr/share/texmf/
7. I put any other .sty into- /usr/share/texmf/tex/latex/
8. I used texhash (or sudo texhash) to make sure all the .sty are located.
9. I made sure R was in the path (opened Terminal and typed in "R")
10. I used sudo lyx to open Lyx, then I went Tools->Reconfigure, got the reconfigure successful window, then I closed Lyx
11: Then I opened Lyx and everything was working on the Lyx end.