Skip to content
Prev 5427 / 12125 Next

[R-pkg-devel] RES: MathJax for Rd files

Thanks, Wolfgang and Helmut for the explanations.
When I was trying to use

#'\if{html}{\out{'<script id="MathJax-script" async
#''src="https://cdn.jsdelivr.net/npm/mathjax at 3.0.5/es5/tex-chtml-full.js
#'</script> }}
#'
#'And then typing
#' \ifelse{html}{\out{\[\sqrt{a^2}\]}}{\deqn{\sqrt{a^2}}}
My mgidi.Rd file was produced with devtools::document();
then, I just used ?mgidi, and the html page was rendered nicely.

If I could do the same with mathjaxr, It would be nice, because I wouldn't need to install the package to see if the equations are as I expect
Anyway, mathjaxr is a very useful package.
Congratulations on the efforts for developing it.

Best
Olivoto

-----Mensagem original-----
De: Viechtbauer, Wolfgang (SP) <wolfgang.viechtbauer at maastrichtuniversity.nl> 
Enviada em: quarta-feira, 13 de maio de 2020 13:14
Para: Helmut Sch?tz <helmut.schuetz at bebac.at>; tiagoolivoto at gmail.com; r-package-devel at r-project.org
Assunto: RE: [R-pkg-devel] MathJax for Rd files

Thanks for the info! Can confirm now that I tried this (I don't usually use RStudio). That's an RStudio issue then. My guess is that 'Preview' uses tools::Rd2HTML() and that indeed won't automatically understand macros coming from mathjaxr (or any add-on package for that matter). This would be an issue to raise with the RStudio folks then.

But once a package is installed, the equations are nicely rendered also in the RStudio help browser, so that part works.

Best,
Wolfgang