]> git.lyx.org Git - features.git/commitdiff
Backport r38895, r38896 and r39068
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 15 Jun 2011 15:04:42 +0000 (15:04 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 15 Jun 2011 15:04:42 +0000 (15:04 +0000)
This fixes bugs #7551 and #7552

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39069 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/lyxsweave.R

index 3ffc78809d556712528b2e5f489c21fee4feb0f9..15ec609cfbbc991c67a5d94d9b0c39c3818c8a47 100644 (file)
@@ -30,12 +30,10 @@ options(encoding=ls.args[3])
 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)