Author: lasgouttes
Date: Wed Jun 15 16:51:50 2011
New Revision: 39068
URL: http://www.lyx.org/trac/changeset/39068
Log:
Better fix for #7551. We can now handle several dots in the file name.
Modified:
lyx-devel/trunk/lib/scripts/lyxsweave.R
Modified: lyx-devel/trunk/lib/scripts/lyxsweave.R
==============================================================================
--- lyx-devel/trunk/lib/scripts/lyxsweave.R Wed Jun 15 16:40:34 2011
(r39067)
+++ lyx-devel/trunk/lib/scripts/lyxsweave.R Wed Jun 15 16:51:50 2011
(r39068)
@@ -30,8 +30,10 @@
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)