From: Jean-Marc Lasgouttes Date: Wed, 15 Jun 2011 14:51:50 +0000 (+0000) Subject: Better fix for #7551. We can now handle several dots in the file name. X-Git-Tag: 2.1.0beta1~3057 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c820e4f8e2eaf7f86b935f431167e47268d4eee1;p=lyx.git Better fix for #7551. We can now handle several dots in the file name. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39068 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/scripts/lyxsweave.R b/lib/scripts/lyxsweave.R index bdc3d500d2..15ec609cfb 100644 --- a/lib/scripts/lyxsweave.R +++ b/lib/scripts/lyxsweave.R @@ -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)