[R-pkg-devel] help fixing CRAN package sos-now fails on GitHub

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Mon May 22 21:38:10 CEST 2023


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)}}

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

Duncan Murdoch



More information about the R-package-devel mailing list