Skip to content
Prev 60573 / 63421 Next

Bundling MathJax

On Sun, 13 Mar 2022 15:25:37 +0100
Jeroen Ooms <jeroenooms at gmail.com> wrote:

            
I do like the build-time rendering approach (I had started writing a
plotmath-style equation renderer for documentation in my R packages
with HTML and TeX support, but quickly abandoned it), but I see two
problems with adopting KaTeX in tools::Rd2HTML:

1. As far as I understand, these changes are supposed to improve
accessibility of the documentation. (PDF is beautifully typeset, but
can't be understood by screen readers as well as web pages.) MathJax
seems to have better accessibility than KaTeX. While there is a hidden
MathML block for screen readers in KaTeX output, some of them don't
pick it up: https://github.com/KaTeX/KaTeX/issues/820

2. If R-core were to adopt KaTeX, that would add a hard dependency from
Rd2HTML to the V8 JavaScript engine. I think that's unlikely to happen.

</seriously> Maybe in 20 years, when browser is the operating system
and everyone runs R compiled to JavaScript with emscripten...