]> git.lyx.org Git - features.git/commitdiff
Almost finish fixing bug http://www.lyx.org/trac/ticket/6623
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 21 Mar 2011 14:48:22 +0000 (14:48 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 21 Mar 2011 14:48:22 +0000 (14:48 +0000)
Now we specify the output file for sweave explicitely for robustness reasons.
We also specify prefix.string (in order to have the temp files generated in lyx tmp directory.

The only annoying file now is Rplots.pdf, but I am not sure why it is generated...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37984 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py
lib/scripts/lyxsweave.R

index a64737be3b6c948b6cb4f038aa639abdae80f12e..ec9b4ccc459a756420b3d917602671b5a23697fa 100644 (file)
@@ -627,7 +627,7 @@ def checkConverterEntries():
         rc_entry = [r'''\converter literate   latex      "%%"  ""
 \converter literate   pdflatex      "%%"       ""'''])
     #
-    checkProg('a Sweave -> LaTeX converter', ['Rscript --no-save --no-restore $$s/scripts/lyxsweave.R $$p$$i $$e $$r'],
+    checkProg('a Sweave -> LaTeX converter', ['Rscript --verbose --no-save --no-restore $$s/scripts/lyxsweave.R $$p$$i $$p$$o $$e $$r'],
         rc_entry = [r'''\converter sweave   latex      "%%"    ""
 \converter sweave   pdflatex      "%%" ""'''])
     #
index 1723cd716606593d85cf35442b99cfaffd7e274e..9a8c6f3e6acc27dee3c019c0945d6462c982d6b8 100644 (file)
@@ -1,7 +1,8 @@
 # Wrapper around Sweave that sets up some things for LyX
-# argument 1 is the file name
-# argument 2 is the iconv name for the encoding of the file
-# argument 3 is the document directory
+# argument 1 is the absolute name of the input file
+# argument 2 is the absolute name of the output file
+# argument 3 is the iconv name for the encoding of the file
+# argument 4 is the original document directory
 
 ls.args <- commandArgs(trailingOnly=T)
 
@@ -11,11 +12,15 @@ ls.sp <- (length(ls.sweavesty) == 0)
 
 # set default encoding to the one of the file; it will be reset to previous
 # default by the sweave module
-ls.enc=getOption("encoding")
-options(encoding=ls.args[2])
+ls.enc <- getOption("encoding")
+options(encoding=ls.args[3])
 
 # pass document dir to sweave module
-ls.dir <- ls.args[3]
+ls.dir <- ls.args[4]
 
-#run sweave
-Sweave(ls.args[1], stylepath=ls.sp)
+# this is used to tell where temporary files should go
+ls.pr <- sub("\\.tex$", "", ls.args[2])
+
+
+# finally run sweave
+Sweave(file=ls.args[1], output=ls.args[2], syntax="SweaveSyntaxNoweb", stylepath=ls.sp, prefix.string=ls.pr)