equation blocks RMarkdown vignettes pkgdown

Hi folks,

I've been trying to read up on this in message boards but I'm just not getting it. I'm having issues with equations in an Rmarkdown document I'm trying to include as a vignette in a package I'm building.

Not always, but sometimes (longer equations or multiline equations) when I use $$ to denote an equation block in my Rmarkdown, the equations don't render properly. They work just fine if I knit and open the html for just that file, but if the Rmd is in a vignettes folder and I run build_site(), the resulting html on the webpage doesn't render the equation properly. Is there a simple solution?

I like the $$ formatting because I can see exactly what my equation looks like while I'm writing it. If I try to use something like {begin} {end} I can't see any missplaced parentheses or brackets until I knit/build. Is there something I can do or am I SOL? It's a public package so I can share the repository/ website if anyone wants to look there.

I really appreciate any help you can give. I'm not a programmer-I'm a wildlife biologist so please use simple sentences.....

1 Like

Can you share the source code of the vignette as well as the current and expected outputs?

Sure, the code is the TTE Advanced.Rmd file available here:

The desired view is what you get if you knit the Rmd on your personal computer, what I'm getting is available here....wonky equations...

https://tlyons253.github.io/MDChelp/articles/TTE-Advanced.html

These types of equations are likely not supported by mathml, which is the default used by pkgdown to render math equations. Try using katex instead by adding this in your _pkgdown.yml:

template:
  math-rendering: katex
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.