On 5/22/23 2:38 PM, Duncan Murdoch wrote:
On 22/05/2023 3:07 p.m., Ivan Krylov wrote:
I fed your vignette to R CMD Sweave, and here's the relevant fragment
from the resulting *.tex file:

This returned a {\tt "findFn"} object identifying 405 help pages.
When this was run while preparing this manuscript, the sixth row was
{\tt pspline_checker} in the \pkg{JOPS} package, which has a {\tt
Score} of 47. (On another day, the results could be different,
because CRAN changes over time.)  This was the sixth row in this
table, because it is in the \pkg{JOPS} package, which had a total of
54 help pages matching the search term, but this was the only one
whose name matched the {\tt pattern} passed to {\tt grepFn}.

This corresponds to the following part of the vignette:

This returned a {\tt "findFn"} object identifying \Sexpr{nrow(g)}
help pages.
When this was
run while preparing this manuscript, the sixth row was
{\tt \Sexpr{gFunc6}} in the
\pkg{\Sexpr{gPac6}} package, which has a {\tt Score} of
\Sexpr{gScore6}.

So, you need to escape the underscores in gFunc6. Probably not gPac6
because underscores are not allowed in package names.


Nice find.  Just in case Spencer has trouble with escaping the escapes, I think he should change

   "{\tt \Sexpr{gFunc6}}"

to

   "{\tt \Sexpr{sub("_", "\\\\_", gFunc6)}}


CLOSE:  That didn't work, but the following did:


{\tt \Sexpr{gsub("_", "\\\\\\\\_", gFunc6)}}


Even better would be to write a little function "sanitizeForLatex" that did this and any other necessary changes, and call that.


That would doubtless be better, but I don't know enough to do that, and the above worked.


Thanks very much to Duncan, Ivan, Vincent and Uwe, who contributed to this thread and the resolution of this problem.


          Spencer Graves


Duncan Murdoch

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to