Skip to content

Commit bceb5e2

Browse files
author
smeyer
committed
replace outdated LaTeX package in installed Rnw file and test rendering
git-svn-id: https://svn.r-project.org/R/trunk@87698 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 999378a commit bceb5e2

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/library/utils/inst/Sweave/Sweave-test-1.Rnw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
% -*- mode: noweb; noweb-default-code-mode: R-mode; -*-
2-
\documentclass[a4paper]{article}
2+
\documentclass{article}
33

44
\title{A Test File}
55
\author{Friedrich Leisch}
66

77
\SweaveOpts{echo=FALSE}
8-
\usepackage{a4wide}
8+
\usepackage[a4paper,margin=1in]{geometry}
99

1010
\begin{document}
1111

src/library/utils/tests/Sweave-tst.R

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@
1616

1717
## Testing Sweave
1818

19-
.proctime00 <- proc.time()
2019
library(utils)
2120
options(digits = 5) # to avoid trivial printed differences
2221
options(show.signif.stars = FALSE) # avoid fancy quotes in o/p
2322

2423
SweaveTeX <- function(file, ...) {
2524
if(!file.exists(file))
26-
stop("File", file, "does not exist in", getwd())
25+
stop("File ", sQuote(file), " does not exist in ", getwd())
2726
texF <- sub("\\.[RSrs]nw$", ".tex", file)
2827
Sweave(file, ...)
2928
if(!file.exists(texF))
30-
stop("File", texF, "does not exist in", getwd())
29+
stop("File ", sQuote(texF), " does not exist in ", getwd())
3130
readLines(texF)
3231
}
3332

@@ -80,5 +79,10 @@ Sweave("customgraphics.Rnw")
8079
Sweave(f <- "Sexpr-verb-ex.Rnw")
8180
tools::texi2pdf(sub("Rnw$","tex", f))# used to fail
8281

83-
84-
cat('Time elapsed: ', proc.time() - .proctime00,'\n')
82+
### ------------------------------------ 5 ----------------------------------
83+
## render the installed Rnw file from example(Sweave), using R CMD Sweave
84+
testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils")
85+
stopifnot(exprs = {
86+
tools::Rcmd(c("Sweave", "--help")) == 0L
87+
tools::Rcmd(c("Sweave", "--pdf", testfile)) == 0L
88+
})

0 commit comments

Comments
 (0)