]> git.lyx.org Git - features.git/commitdiff
Better fix for #7551. We can now handle several dots in the file name.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 15 Jun 2011 14:51:50 +0000 (14:51 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 15 Jun 2011 14:51:50 +0000 (14:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39068 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/lyxsweave.R

index bdc3d500d21b862d9863a59e5b51d95aaf914518..15ec609cfbbc991c67a5d94d9b0c39c3818c8a47 100644 (file)
@@ -30,8 +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 <- gsub('\\.([^/]*)$', '-\\1', sub("\\.tex$", "", ls.args[2]))
-
+# 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)