Skip to content
Prev 5424 / 12125 Next

[R-pkg-devel] MathJax for Rd files

Seems like you are using roxygen2. I have little experience with that, as all my Rd files are 'handcrafted' (plus 100% organic and biodegradable).

But what specifically do you mean by "when I try to preview the current document as HTML"? Is this some particular functionality of roxygen2 / devtools / RStudio? Or do you simply mean using tools::Rd2HTML()? Then you will have to use permissive=TRUE so that the macros from mathjaxr (which will not be recognized by default by parse_Rd()) are just passed through as text. Or you could try adjusting the 'macros' argument, maybe in combination with loadPkgRdMacros(), to specify that the mathjaxr macros should be loaded. See help(Rd2HTML, package="tools") and help(parse_Rd, package="tools") for details.

But if I want to see the HTML help file, I just install and load the package and call up the help file on some function. That works for sure.

As for the more complex equation - it includes a lot of curly braces. See the note I added recently to the 'devel' version about this:

https://github.com/wviechtb/mathjaxr#issues

Best,
Wolfgang