On 13/03/2022 8:47 a.m., Ivan Krylov 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. > > 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. >An issue related to this was faced by the mathjaxr package: The file used for display is usually a minified version of the MathJax source, and Debian didn't consider it close enough to source code to want to distribute it as FOSS. So if the minified file is included with R, the original source should also be included. An alternative to this would be to provide a utility to download the minified file. Users with poor connectivity could do that once and access the local copy thereafter. Duncan Murdoch
On Sun, Mar 13, 2022 at 7:35 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote:> > On 13/03/2022 8:47 a.m., Ivan Krylov 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. > > > > 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. > > > > An issue related to this was faced by the mathjaxr package: The file > used for display is usually a minified version of the MathJax source, > and Debian didn't consider it close enough to source code to want to > distribute it as FOSS. So if the minified file is included with R, the > original source should also be included. > > An alternative to this would be to provide a utility to download the > minified file. Users with poor connectivity could do that once and > access the local copy thereafter.Would this really work? Wouldn't you also need the supplementary files such as fonts (relative to the main js file)? -Deepayan> Duncan Murdoch > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
On Sun, 13 Mar 2022 10:05:18 -0400 Duncan Murdoch <murdoch.duncan at gmail.com> wrote:> The file used for display is usually a minified version of the > MathJax source, and Debian didn't consider it close enough to source > code to want to distribute it as FOSS. So if the minified file is > included with R, the original source should also be included.Pardon my ignorance, but how much does it matter whether the file is minified when the documentation is served over a local network? Does JavaScript minification speed up parsing or involve other transformations without which it would be hard or impossible to run the code in the browser? -- Best regards, Ivan