From deep@y@n@@@rk@r @end|ng |rom gm@||@com  Sun Mar 13 16:22:26 2022
From: deep@y@n@@@rk@r @end|ng |rom gm@||@com (Deepayan Sarkar)
Date: Sun, 13 Mar 2022 20:52:26 +0530
Subject: [Rd] Bundling MathJax
In-Reply-To: <20220313154736.7301b31f@Tarkus>
References: <20220313154736.7301b31f@Tarkus>
Message-ID: <CADfFDC4Dn5E_JkebhdpzbtH0J8qaf9mgQu_BKpXDqLNd0VXA_A@mail.gmail.com>

On Sun, Mar 13, 2022 at 6:18 PM Ivan Krylov <krylov.r00t at gmail.com> wrote:
>
> Hello R-devel,
>
> I appreciate the efforts devoted towards improving equation typography
> in HTML manuals. Since MathML lost its status as the way to express
> mathematics on the web after its removal from Google Chrome in 2013,
> MathJax and KaTeX are probably the best options left: both TtH [1] and
> HeVeA [2] don't render math quite as well and likely don't do anything
> about accessibility of the resulting equations (which seems to be the
> reason to focus on the HTML documentation in the first place).
>
> Having seen r81881 [3], I would like to suggest bundling MathJax
> together with R instead of loading it from the Internet. Every now and
> then, I work from places with spotty Internet connection (e.g. mobile
> network on a train). If R defaults to downloading a file every time
> Rd2HTML is called, that would be very inconvenient to me, especially
> since the requests for external JavaScript could intermittently fail
> or take a long time to load, resulting in partially failed renders.

Usually browser caching should avoid multiple downloads, shouldn't it?

> For now, R documentation can be viewed without access to external
> resources (admittedly, not counting the use of external \figure{} and
> other Rd macros by packages, which is rare). I think that's a major
> strength of R and I would like to help preserve it.

Bundling is something we considered (and is still a possibility), but
ended up not doing mainly because it's more than just a single file.
E.g., these are the files bundled by mathjaxr:

https://github.com/wviechtb/mathjaxr/tree/master/src/mathjax/es5

Would it be reasonable to use the installation provided by mathjaxr
instead, if it is available?

Best,
-Deepayan

> --
> Best regards,
> Ivan
>
> [1] http://hutchinson.belmont.ma.us/tth/in_action.html
>
> [2] http://hevea.inria.fr/examples/test/suite.html
>
> [3]
> https://github.com/r-devel/r-svn/commit/55e013251cbaf8942d34820f1854c9cfc38e097b
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Bundling MathJax
Deepayan Sarkar