From: Jean-Marc Lasgouttes Date: Thu, 21 Oct 2010 17:02:05 +0000 (+0000) Subject: Introduce helper script for Sweave. The first benefit is that X-Git-Tag: 2.0.0~2314 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=be8cf7c98c465264c765279ef97720ce04081f78;p=features.git 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 --- diff --git a/lib/configure.py b/lib/configure.py index a4fbb9d88b..1ea4c680f4 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -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 "%%" ""''']) # diff --git a/lib/scripts/lyxsweave.R b/lib/scripts/lyxsweave.R new file mode 100644 index 0000000000..8ab0ea9951 --- /dev/null +++ b/lib/scripts/lyxsweave.R @@ -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)