# [Rd] Using MathJax in R's help system

Gong-Yi Liao gong-yi.liao at uconn.edu
Wed Feb 2 17:33:49 CET 2011

Thank you for comments,

I think we can consider the following two cases:

A.  The user starts nanohttpd on his/her own PC and read the
help files in html
(i.e.    > options(help_type="html", browser="xdg_open")
> ?svd  )
For this case, I think that  the user can just  install a
MathJax distribution on his/her own PC (or workstation)
and let the local nanohttpd send the MathJax scripts,
fonts and image files to user's browser.  Since all the
MathJax files are transmitted locally (i.e. at the same
IP, on the same machine), I think 130 MB  is not a big
issue in this case.

B.  The user reads the R help html pages,  which are hosted by
a third party httpd server

For this case, I think a CDN (Content Delivery Network)
hosting server is needed. MathJax's 130 MB size can be a
critical issue in this case.  As far as I know, there's
a site ( mathjax.connectmv.com ) providing such service,
but I can't imagine if all the R users around the world
request resources from this site 24-7, the site must
be DoSed.

I install the helpr package from CRAN, and, maybe due to my
problem,  the manual of this package is quite confusing to me.
I run the command helpr and my browser shows me the following
content:

ERROR: no history available to save

1: do.call(function (...)
{
page_info <- helpr_home()
page_info$html <- "/index.html" render_brew("index", page_info, path = path) }, list()) 2: function (...) { page_info <- helpr_home() page_info$html <- "/index.html"
render_brew("index", page_info, path = path)
}()
3: helpr_home()
4: ten_functions()
5: get_function_history()
6: savehistory(file1)

And I can't find any CRAN packages with 'Solr' keyword, any

Thank you!

On Wed, 2011-02-02 at 09:04 -0600, Hadley Wickham wrote:
>
>  * one problem with mathjax is it's sheer size: 130 meg and >30,000
> files.  A hosted solution is in the works and will hopefully resolve
> that situations
>
>  * you might also want to look at the helpr package, which is a ground
> up rewrite of the R documentation html renderer to provide things like
> global comments on functions, examples that run in browser, syntax
> highlighting, search across all packages (coming in the next version),
> and much much more.
>

--
Gong-Yi Liao

Department of Statistics
University of Connecticut