Skip to content

Commit b898130

Browse files
author
smeyer
committed
ensure R CMD Rd2pdf uses this R's Rd.sty
git-svn-id: https://svn.r-project.org/R/trunk@87675 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent e6d7a9a commit b898130

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

doc/NEWS.Rd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,9 @@
421421

422422
\item \code{tools::texi2pdf(..., texinputs=\var{paths})} now
423423
\emph{pre}pends the specified \var{paths} to \env{TEXINPUTS}.
424-
When building \R (\file{doc/NEWS.pdf} and base vignettes), this
425-
now ensures that its own \file{Rd.sty} takes precedence over
424+
When building \R itself (\file{doc/NEWS.pdf} and base vignettes)
425+
or package manuals using \command{R CMD Rd2pdf}, it is ensured
426+
that this \R's \file{Rd.sty} takes precedence over any other
426427
(incompatible) versions in default \dQuote{texmf trees}.
427428
}
428429
}

src/library/tools/R/Rd2pdf.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,12 @@ function(pkgdir, outfile, title, silent = FALSE,
917917
if (!quiet) cat("Creating", out_ext, "output from LaTeX ...\n")
918918
setwd(build_dir)
919919

920-
res <- try(texi2pdf('Rd2.tex', quiet = quiet, index = index))
920+
## R CMD _appends_ R's texmf tree to environmental TEXINPUTS, which could
921+
## list another R version, so ensure Rd2pdf finds _this_ R's Rd.sty
922+
texinputs <- file.path(R.home("share"), "texmf", "tex", "latex")
923+
res <- try(texi2pdf('Rd2.tex', quiet = quiet, index = index, texinputs = texinputs))
921924
if(inherits(res, "try-error")) {
922-
res <- try(texi2pdf('Rd2.tex', quiet = quiet, index = index))
925+
res <- try(texi2pdf('Rd2.tex', quiet = quiet, index = index, texinputs = texinputs))
923926
if(inherits(res, "try-error")) {
924927
message("Error in running tools::texi2pdf()")
925928
do_cleanup()

0 commit comments

Comments
 (0)