@@ -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