rmathjaxr-packagepkgdown

Equation not rendered in helper files of function of html pages


I am building a package and an associated website (via Github Pages). Let's say I have a function funX. In R, when I do ?funXI have some equations (using \eqn{} or \deqn{}) in the description files, and they are rendered well in LaTeX within R interface. However, when I go to the website generated by pkgdown, it's the only equations of the entire site that do not show properly. For example \eqn{X=Y}would show: \(X=Y\) on the website.

This is puzzling because in all the other vignettes the equations are rendered with mathjax without any problem. So maybe it's a specificity of the .Rd files vs the .Rmd?

In my _pkgdown.yml file, I have:

template:
  mathjax: true

What could be the issue?


Solution

  • See this page: https://pkgdown.r-lib.org/articles/customise.html .

    In summary, if you are using

    template:
      bootstrap: 5
    

    then you also need

      math-rendering: mathjax
    

    in the same template: section.