backport r40703 (fix #8019)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40706 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2012-02-03 17:30:21 +00:00
parent 10e3be13fc
commit 24cd11aa70
2 changed files with 15 additions and 5 deletions

View File

@ -23,8 +23,12 @@
# The advantage compared to the use of stylepath, is that the exported
# .tex file will be portable to another machine. (JMarc)
if (!length(system("kpsewhich Sweave.sty", intern=TRUE, ignore.stderr=TRUE))) {
file.copy(file.path(R.home("share"), "texmf", "tex", "latex", "Sweave.sty"),
dirname(.cmdargs[2]), overwrite=TRUE)
.texmf.path <- file.path(R.home("share"), "texmf")
if (!file.exists(.sweave.sty <- file.path(.texmf.path, "Sweave.sty"))) {
.sweave.sty <- file.path(.texmf.path, "tex", "latex", "Sweave.sty")
}
file.copy(.sweave.sty, dirname(.cmdargs[2]), overwrite=TRUE)
rm(list = c('.sweave.sty', '.texmf.path'))
}
@ -39,6 +43,11 @@ tmpout <- gsub(".", "-", sub("\\.tex$", "", basename(.cmdargs[2])), fixed = TRUE
.prefix.str <- paste(dirname(.cmdargs[2]), tmpout, sep="/")
rm(tmpout)
# avoid the default Rplots.pdf
options(device = function(...) {
pdf(file = tempfile())
})
# finally run sweave
# The Sweave version provided with R >= 0.13.1 has proper handling for

View File

@ -24,9 +24,6 @@ What's new
* DOCUMENT INPUT/OUTPUT
- Fix Sweave support for document encoding with R >= 2.13.1 (bug
7876).
- Add support for `knitr', an alternative for Sweave on R >= 2.14.1
(bug 7887).
@ -161,6 +158,10 @@ What's new
- Fix error when exporting DocBook tables (bug 7004).
- Fix Sweave support for document encoding with R >= 2.13.1 (bug
7876).
- Avoid creation of a spurious Rplots.pdf file when using Sweave (bug 8019).
* TEX2LYX