Gabor suggested I should write a short batch file or R script which would copy the various files needed to use Sweave in LyX so that one does not need to actually do it onself. That would be nice, but there are several things that I should take care of:
- I would need to find the LyX user/library directory. I do not know how to get his information in scriptable manner.
- If the preference file already exists, I would have to append new content. That is easy, but in case some definitions are already used I would first need to parse the old version of prefences. That would not be so easy.
- I would need to write a Unix shell script for Unix like systems and a batch file for MS Windows. I am not sure about Mac OS-X - I think Unix shell script should work there out of the box.
I think I will leave this step to someone else. I actually hope, that LyX developers might find a way to provide automatic customisation if R is installed on the computer. Some ideas were given here. Additionally, Gabors' {Sweave,Stangle}.bat could be used instead of {Sweave,Stangle}.sh that are shipped with R.