Introduce helper script for Sweave. The first benefit is that

Sweave.sty path is hardcoded if LaTeX cannot find it.

More to come.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35750 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2010-10-21 17:02:05 +00:00
parent 5fd9f870b2
commit be8cf7c98c
2 changed files with 11 additions and 1 deletions

View File

@ -612,7 +612,7 @@ def checkConverterEntries():
rc_entry = [r'''\converter literate latex "%%" ""
\converter literate pdflatex "%%" ""'''])
#
checkProg('a Sweave -> LaTeX converter', ['R CMD Sweave $$i'],
checkProg('a Sweave -> LaTeX converter', ['Rscript --vanilla $$s/scripts/lyxsweave.R $$i'],
rc_entry = [r'''\converter sweave latex "%%" ""
\converter sweave pdflatex "%%" ""'''])
#

10
lib/scripts/lyxsweave.R Normal file
View File

@ -0,0 +1,10 @@
# Wrapper around Sweave that sets up some things for LyX
# argument 1 is the file name
args <- commandArgs(trailingOnly=T)
# check whether Sweave.sty is seen by LaTeX
sweavesty <- system("kpsewhich Sweave.sty", intern=T, ignore.stderr=T)
sp <- (length(sweavesty) == 0)
Sweave(args[1], stylepath=sp)