Tentative fix for bug #7545. Please test.

The problem is with sweave when the temp file path contains spaces. This patch adds some postprocessing that removes the reference to the temp dir.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39070 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2011-06-15 15:51:02 +00:00
parent c820e4f8e2
commit ddd76c6b15

View File

@ -37,3 +37,12 @@ ls.pr <- paste(dirname(ls.args[2]), tmpout, sep="/")
# finally run sweave # finally run sweave
Sweave(file=ls.args[1], output=ls.args[2], syntax="SweaveSyntaxNoweb", stylepath=ls.sp, prefix.string=ls.pr) Sweave(file=ls.args[1], output=ls.args[2], syntax="SweaveSyntaxNoweb", stylepath=ls.sp, prefix.string=ls.pr)
# remove absolute path from \includegraphics
ls.doc = readLines(ls.args[2])
ls.cmd = paste('\\includegraphics{', dirname(ls.args[2]), "/", sep = "")
ls.idx = grep(ls.cmd, ls.doc, fixed = TRUE)
if (length(ls.idx)) {
ls.doc[ls.idx] = sub(ls.cmd, "\\includegraphics{", ls.doc[ls.idx], fixed = TRUE)
writeLines(ls.doc, ls.args[2])
}