Skip to content

Commit

Permalink
MiKTeX nowadays respects TEXINPUTS
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87699 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
smeyer committed Feb 6, 2025
1 parent bceb5e2 commit 0dc7853
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions doc/manual/R-intro.texi
Original file line number Diff line number Diff line change
Expand Up @@ -7220,9 +7220,9 @@ R CMD latex.exe mydoc
@end example
@noindent
will run @LaTeX{} on @file{mydoc.tex}, with the path to @R{}'s
@file{share/texmf} macros appended to @env{TEXINPUTS}. (Unfortunately,
this does not help with the @I{MiKTeX} build of @LaTeX{}, but
@command{R CMD texify mydoc} will work in that case.)
@file{share/texmf} macros appended to @env{TEXINPUTS}.
(With the @I{MiKTeX} build of @LaTeX{}, using
@command{R CMD texify mydoc} is often more convenient.)

@node Invoking R under macOS
@appendixsec Invoking R under macOS
Expand Down
2 changes: 1 addition & 1 deletion src/library/base/man/Sys.which.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Sys.which(names)
}
\examples{
## the first two are likely to exist everywhere
## texi2dvi exists on most Unix-alikes and under MiKTeX
## texi2dvi exists on most Unix-alikes but not under MiKTeX
Sys.which(c("ftp", "ping", "texi2dvi", "this-does-not-exist"))
}
\keyword{ utilities }
12 changes: 5 additions & 7 deletions src/library/tools/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,15 @@ function(file, pdf = FALSE, clean = FALSE, quiet = TRUE,
extra <- ""

## look for MiKTeX (which this almost certainly is)
## and set the path to R's style files.
## -I works in MiKTeX >= 2.4, at least
## http://docs.miktex.org/manual/texify.html
## FIXME: is -I still needed? It documents EnvVars since at least 2016.
ver <- system(paste(shQuote(texi2dvi), "--version"), intern = TRUE)
if(length(grep("MiKTeX", ver[1L]))) {
## AFAICS need separate -I for each element of texinputs.
texinputs <- c(texinputs, Rtexinputs, Rbstinputs)
paths <- paste ("-I", shQuote(texinputs))
extra <- "--max-iterations=20"
extra <- paste(extra, paste(paths, collapse = " "))
## setting TEXINPUTS via -I is long obsolete, EnvVars are respected
## (<https://docs.miktex.org/manual/localadditions.html>)
## texinputs <- c(texinputs, Rtexinputs, Rbstinputs)
## paths <- paste ("-I", shQuote(texinputs))
## extra <- paste(extra, paste(paths, collapse = " "))
}
## 'file' could be a file path
base <- basename(file_path_sans_ext(file))
Expand Down

0 comments on commit 0dc7853

Please sign in to comment.