Author: lasgouttes
Date: Wed Jun 15 17:04:42 2011
New Revision: 39069
URL: http://www.lyx.org/trac/changeset/39069

Log:
Backport r38895, r38896 and r39068

This fixes bugs #7551 and #7552

Modified:
   lyx-devel/branches/BRANCH_2_0_X/lib/scripts/lyxsweave.R

Modified: lyx-devel/branches/BRANCH_2_0_X/lib/scripts/lyxsweave.R
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/lib/scripts/lyxsweave.R     Wed Jun 15 
16:51:50 2011        (r39068)
+++ lyx-devel/branches/BRANCH_2_0_X/lib/scripts/lyxsweave.R     Wed Jun 15 
17:04:42 2011        (r39069)
@@ -30,12 +30,10 @@
 setwd(ls.args[4])
 
 # this is passed as a prefix.string to tell where temporary files should go
-ls.pr <- sub("\\.tex$", "", ls.args[2])
-
-# Replace the default pdf device by the null device (tip from Yihui Xie)
-# See: 
http://yihui.name/en/2010/12/a-special-graphics-device-in-r-the-null-device/ 
-.Call("R_GD_nullDevice", PACKAGE = "grDevices")
-
+# the output file without extension and without '.'
+tmpout <- gsub(".", "-", sub("\\.tex$", "", basename(ls.args[2])), fixed = 
TRUE)
+# replace 
+ls.pr <- paste(dirname(ls.args[2]), tmpout, sep="/")
 
 # finally run sweave
 Sweave(file=ls.args[1], output=ls.args[2], syntax="SweaveSyntaxNoweb", 
stylepath=ls.sp, prefix.string=ls.pr)

Reply via email to