Skip to content

Commit cc9217f

Browse files
author
maechler
committed
fix thinko (has_figure) in 88132
git-svn-id: https://svn.r-project.org/R/trunk@88144 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 8fced61 commit cc9217f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/library/utils/R/help.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ print.help_files_with_topic <- function(x, ...) # ... may contain msg=FALSE
233233
else ""
234234
texfile <- paste0(topic, ".tex")
235235
if(nzchar(opt <- Sys.getenv("R_RD4PDF"))) opt else "times,inconsolata"
236-
has_figure <- any(grepl("\\Figure", lines))
237236
cat("\\documentclass[", getOption("papersize"), "paper]{article}\n",
238237
"\\usepackage[", opt, "]{Rd}\n",
239238
if(nzchar(encoding)) sprintf("\\usepackage[%s]{inputenc}\n", encoding),
@@ -243,7 +242,7 @@ print.help_files_with_topic <- function(x, ...) # ... may contain msg=FALSE
243242
file = texfile, sep = "")
244243
file.append(texfile, file)
245244
cat("\\end{document}\n", file = texfile, append = TRUE)
246-
texfile
245+
structure(texfile, has_figure = any(grepl("\\Figure", lines)))
247246
}
248247

249248
## "static": _only_ called once above for type == "pdf" : currently "offline" <==> {latex -> pdf}
@@ -253,7 +252,7 @@ print.help_files_with_topic <- function(x, ...) # ... may contain msg=FALSE
253252
texfile <- .help_topic_latex(file, topic)
254253
on.exit(unlink(texfile)) ## ? leave to helper
255254
helper <- get0("offline_help_helper", envir = .GlobalEnv) %||% offline_help_helper # <-> below
256-
if (has_figure)
255+
if (attr(texfile, "has_figure"))
257256
helper(texfile, type, texinputs=texinputs, msg=msg)
258257
else helper(texfile, type, msg=msg)
259258
invisible()

0 commit comments

Comments
 (0)