The Higher Education and Research forge

Home My Page Projects Code Snippets Project Openings Développement de WIMS
Summary Activity Forums Tracker Tasks Docs Surveys News SCM Files Listes Sympa

Forum: developers

Monitor Forum | Start New Thread Start New Thread
RE: mathjax in wims? [ Reply ]
By: joke evers on 2013-12-30 21:32
[forum:15119]
That's exactly what I propose : a default install of "mathjax"
Meaning: there is no -formal- configuration option to disable the use of mathjax.

And the library is thus 'embedded' into exec.c per default.

Modules depending on special features , like SVG in mathml ...see
http://golem.ph.utexas.edu/wiki/instiki/show/Sandbox
will work on a "default" wims install.

Note:
the main library mathjax.js is 58.9 kb.
then you can add ome extra library depending on your needs...we only need MML/HTML
(MML_HTMLorMML.js) functionality.
Mathjax can also be triggered to read latex/tex eg $\frac{1}{2}$ will be shown as a fraction

These are the extra libs

-rw-r--r-- 1 wims wims 228K Nov 22 00:15 AM_HTMLorMML-full.js
-rw-r--r-- 1 wims wims 121K Nov 22 00:15 AM_HTMLorMML.js
-rw-r--r-- 1 wims wims 293K Nov 22 00:15 Accessible-full.js
-rw-r--r-- 1 wims wims 186K Nov 22 00:15 Accessible.js
-rw-r--r-- 1 wims wims 217K Nov 22 00:15 MML_HTMLorMML-full.js
-rw-r--r-- 1 wims wims 110K Nov 22 00:15 MML_HTMLorMML.js
-rw-r--r-- 1 wims wims 1.9K Nov 22 00:15 MMLorHTML.js
-rw-r--r-- 1 wims wims 885B Nov 22 00:15 Safe.js
-rw-r--r-- 1 wims wims 293K Nov 22 00:15 TeX-AMS-MML_HTMLorMML-full.js
-rw-r--r-- 1 wims wims 186K Nov 22 00:15 TeX-AMS-MML_HTMLorMML.js
-rw-r--r-- 1 wims wims 236K Nov 22 00:15 TeX-AMS-MML_SVG-full.js
-rw-r--r-- 1 wims wims 183K Nov 22 00:15 TeX-AMS-MML_SVG.js
-rw-r--r-- 1 wims wims 247K Nov 22 00:15 TeX-AMS_HTML-full.js
-rw-r--r-- 1 wims wims 164K Nov 22 00:15 TeX-AMS_HTML.js
-rw-r--r-- 1 wims wims 325K Nov 22 00:15 TeX-MML-AM_HTMLorMML-full.js
-rw-r--r-- 1 wims wims 218K Nov 22 00:15 TeX-MML-AM_HTMLorMML.js
-rw-r--r-- 1 wims wims 40K Nov 22 00:15 default.js
drwxr-xr-x 2 wims wims 512B Nov 22 00:15 local

The rest is fonts !

By the way: If we decide (...) to include a tailored "wims-version" of mathjax into wims-*.tgz distribution, we maybe could minimize it,by just using the fonts
and include-scripts we need (eg. for example only STIX fonts and a few include js files...the total size could probably be reduced to 5 MB)
But I don't know if this is a real option (not tested )
/var/wims/public_html/mathjax/fonts/HTML-CSS :du -hc STIX-Web
1.7M STIX-Web/eot
1.5M STIX-Web/otf
918K STIX-Web/woff
4.1M STIX-Web
4.1M total






RE: mathjax in wims? [ Reply ]
By: Bernadette Perrin-Riou on 2013-12-30 18:38
[forum:15118]
I don't understand: you said Mathjax is approx 19MB gzipped and 93MB installed

What I just wanted to do is to insert in the .compile or somewhere something
as wget mathjax
tar xzf
and install it in public_html/mathjax
instead of putting in in the archive wims.tgz
People are connected in general when they install the servor.

The same thing should be done for jquery .
Of course this is possible only if there is no modification (or very small one).
We do not put pari or maxima in the wims.tgz and use it.

Bernadette


RE: mathjax in wims? [ Reply ]
By: joke evers on 2013-12-30 16:22
[forum:15117]
Hmm, I would like to install per default (...)
Using a usefull library as Mathjax (58kb) and MML_HTMLorMML-full.js or MML_HTMLorMML.js
(total sum : 160 - 270 kb) is not huge compared with an utter useless library as JQuery.js (>> 230kb + extras) ...but there are a lot of mb's in the supplied fonts...

Well, in any case I will install mathjax -included in wims-***.tgz or not ...
Just because after 5 months of mathml-default-server-setting , I'm tired of explaining to students,colleges ,system_admins that "wims==firefox"
(I'm having trouble enough with the frequent java updates)

Besides, the quality of mathjax is excellent (to say the least)

Furthermore the generic support for inputfields in mathml -as mentioned on "wimsedu"- opens a whole new area of very usefull math exercises !
At least I think so and I don't like to miss that opportunity.
(that's why I would like to install MathJax per default)

About the "google chrome mathjax extension": this extension only exists for Chrome. (as far as I know) and will thus solve only a part of the problem


joke

RE: mathjax in wims? [ Reply ]
By: Bernadette Perrin-Riou on 2013-12-30 14:46
[forum:15116]
What can we do is :

1 - suggest during compilation or/and in the README to install Mathajax in the good directory.

2 - test in compile if it is there. If it is, has a variable put on yes.
3 - in exec.c, if the variable is on yes, do what you suggest.

Just not to put everything in wims distribution.
We should do also things like that with jmolscript which is again a large javascript library. (but there there is nothing to modify in the src).

On the other hand, we could ask to any user to install mathajax on its web browser (google chrome for example). But you think, (and you should be right !) that people will not do it !

Bernadette

RE: mathjax in wims? [ Reply ]
By: joke evers on 2013-12-30 14:32
[forum:15115]
Font sizes can be individually adapted using the same buttons in adm/light...and are stored in a cookie "mjx.menu", see below

################################
QUERY_STRING=session=RBDB9ACFB9.4&+lang=nl&+module=adm%2Fmanage&+cmd=reply&+job=activ
HTTP_USER_AGENT=Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
HTTP_COOKIE=mjx.menu=zoom%3ADoubleClick
w_cmd=reply
w_empty=
w_lang=nl
#################################

I don't know about Mac Safari, but all browsers based on "Webkit Mathml" will suffer a severe blow from Google terminating Webkit based MathML support in Chrome ..."Webkit" is considered to be insecure and has many (!) typesetting issues (Opera has also switched to Webkit ) That's why Chrome has the mathjax extension (using the cdn server of mathjax)

Google,being the second/third great browser, will not have native mathml support in the near future...and it's users will be compelled to use the outdated "math_with_gifs"...grrr

I use amongst others 'Seamonkey' (fork of Mozilla) and it uses "Firefox" in it's browser id.

All browsers will support MathJax ! even MSIE without plugin, Opera ,Konqueror etc

But using Firefox's native Mathml support is ofcourse much much faster (but equal in quality to MathJax )

This difference in loading time is mainly caused by the asynchrone parsing of Mathjax.
After the page is loaded , mathjax will transform the 'matml' into html/css or svg
(in leiden I only use mathml , no latex-support, eg $ text $ is not interpreted as latex...)

Furthermore Mathjax must be installed in public_html ; since we should be able to work without direct internet connection (for loading mathjax.js and webfonts)


About install: in exec.c this must be added
<script type="text/javascript">
if (navigator.userAgent.indexOf("Firefox") == -1){
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "mathjax/MathJax.js?config=MML_HTMLorMML-full.js";
document.body.appendChild(script);
}
</script>
Ofcourse this script can be adapted, if you think your Safari or any other browser is better than MathJax

joke


RE: mathjax in wims? [ Reply ]
By: Bernadette Perrin-Riou on 2013-12-30 12:44
[forum:15112]
Just some remarks (I have not yet an opinion).

- There are some other browsers which supports Mathml as safari, opera and it can change.

- I load the document on determinants with mathajax : it takes sometimes to the math formulas
to be charged. But it is the same on Leiden and with my chrome (out of internet connexion on the local wims,
where I had added the plugin yesterday).
I found the mathematical formulas are not adapted to the other font sizes, but it is perhaps something to adapt.

- what it the thing to do in the distribution (except to put Mathjax in the tgz).
A possibility will be to propose during the compilation to download it (on some internet adress)
and install it, as we do with pari, maxima, etc (and there it is only in the read me).
Like that, we have not to add it to the distribution.

Bernadette

mathjax in wims? [ Reply ]
By: joke evers on 2013-12-30 10:48
[forum:15111]

Hi,
I would like to suggest we include mathjax as part of the wims-distribution.
In source (my favorite) or as download at build time.
Mathjax is approx 19MB gzipped and 93MB installed

Using the mathjax cdn server is no option.
(for example: we close internet access in case of an exam on the intranet)
A simple script added to the body tag (exec.c) to exclude Firefox from using Mathjax (and thus using native mathml support) is enough for all modern browsers on all platforms to have good looking math (and excellent zoom !)

To see mathjax working on a public wims server , see
http://wims.math.leidenuniv.nl

joke evers

and best wishes for 2014 !