Math Notation - Recommended Install

Math Notation - Recommended Install

by Ian Wild -
Number of replies: 3
Picture of Plugin developers
Hi all,

Mauno and Marc: I was going to ask you both this question directly but I thought asking it on the forum would be useful to other Moodle users...

In a previous post Marc was wondering why I was using the tex filter to render my math notation and the simple answer is I've got latexrender installed on the server and I like the way it looks blush.

I appreciate AsciiMathML is probably the way to go in 1.9.x. So, am I right in thinking that the recommendation is...

1) Install AsciiMathML filter.
2) Install latexrender or, failing that (e.g. if you're on shared hosting), install jsMath

I appreciate this is probably a stupid question but, can AsciiMathML detect if the browser can support MathML and SVG? - i.e. can it tell if it's IE thoughtful ? If the browser can't support MathML and SVG then the filter will fall back? Is that right?

My problem is that in schools in the UK they are going to be using IE (in the foreseeable future, at least) and if Moodle math doesn't work first time (or with only *very* minimal configuring) then schools will think this is a Moodle problem rather than a browser problem. Either way it probably isn't going to be "fixed" in the school.

I understand that everything will be much simpler in Moodle 2 - thank goodness approve.

What does everyone think?

Cheers,

Ian.

Average of ratings: -
In reply to Ian Wild

Re: Math Notation - Recommended Install

by Mauno Korpelainen -

Hi Ian,

I know that my recommendations may confuse you but it really depends both on version of asciimathml script and environment / distribution of LaTeX / possible renderers - and there are far too many versions of AsciiMathML (and LatexMathML / AsciiSVG) available, some with image fallback some not... still:

1) If you choose filter approach: The asciimathml filter version script does not probably have image fallback at all and you can't decide when to render asciimath (content based and theme based rendering) because filter is always on (pre moodle 2.0) and old asciimathml filter may render asciimath even if your filter is disabled - adding script tags to theme meta.php or header.html allows you to use particular version of script in particular theme or adding the script tags to some plugin allows you to use that selected script in that selected plugin. This way you are not restricted to use one and only version on your site. If your script ASCIIMathML.js is for example in folder /lib/asciimath add just tags

<script type="text/javascript" src="<?php echo $CFG->httpswwwroot ?>/lib/asciimath/ASCIIMathML.js"></script>

to your theme meta.php or header.html and it works...

2) If you have an image fallback version of asciimathml and your latexrender is for example in http://latex.codecogs.com/gif.latex? (the full path before your latex notation ...you can set your asciimathml to use latexrender for image fallback by changing

var AMTcgiloc = http://latex.codecogs.com/gif.latex?

In my plugin demo version http://korpelainen.net/plugindemo/lib/editor/common/AM.js

I have changed function AMTparseMath(str,istex) to use

node.src = AMTcgiloc + texstring;

so that the script can use any tex render (Mathtex/Mimetex/Latexrender/mathTran etc) but the script you use should understand the tex tags or translated asciimathml/latexmathml tags and therefore all input/output values in AM.js or any version of asciimathml fallback scripts (AMsymbols, LMsymbols...) should have only such values that your environment understands.

For normal LaTeX you may in my opinion use any render you like that works best on your site - TeX filter is fine, external cgi mimetex/mathtex, jsMath or MathTran can do the same job etc. The main reason for changing some specific render is usually better quality of output and the ideal math system should produce MathML for Firefox and other MathML capable browsers (in the future) and quality TeX output as image fallback for those browsers that do not support MathML. I have a strange "feeling" that you will see a new math system in moodle 2.0 where you can do this with a modified version of AsciiMathML and a new version of asciimathml or TeX filter - next year...

Scripts can check if browser supports MathML or SVG and they do different things according to these tests - some versions simply tell that you should install MathPlayer or Adobe SVG viewer to be able to see mathML or AsciiSVG graphs but I would like to use in my scripts image fallback for IE allways - because neither MathPlayer nor Adobe SVG viewer can render all tags and scripts correct and Adobe SVG viewer is no longer supported by Adobe ... and installing extra plugins is not always possible to school PC:s. All other current modern browsers can render SVG graphs well but IE will probably never support MathML or SVG.

For schools in the UK that are going to be using IE(6) [ forever wink ] the best recommendation might be to use just TeX and (screen shots of) image graphs as gif files...

In reply to Mauno Korpelainen

Re: Math Notation - Recommended Install

by Ian Wild -
Picture of Plugin developers
Thanks Mauno. I know that things will be changing for the better in Moodle 2.0 math-wise, but I've a feeling that it will be a while before 1.9.x users will be adopting it (training issues, &c). I think with Moodle 1.9.x, as you say, it really all depends on your preference.

I was having discussions yesterday at a college in Cambridge (UK) with one of the Physics lecturers about math notation. They are running 1.9.x and, to be honest, it was difficult to be clear on which renderer they actually needed.

BTW: the reason why I need to be clear about math notation is that these larger organisations need to submit a change request to their server admins - and the teachers/lecturers they need something more specific than "Please install support for maths" big grin.

Just to double-check: am I right in thinking that all of these problems go away with Moodle 2.0 (looks longingly at Mauno big grin ! )

Ian.
In reply to Ian Wild

Re: Math Notation - Recommended Install

by Mauno Korpelainen -

No current maths notation system is perfect and moodle can't solve that but I believe we can offer next year in moodle 2.0 the following options:

+ content based TeX filter that allows you to use any distributions of LaTeX and for large organisations considering a new distribution of LaTeX I would recommend Tex Live http://www.tug.org/texlive/ full install with all available packages.

+ Dragmath (for wysiwyg - requires java...) in core

+ a new (editable) version of asciimathml as a downloadable script or as a part of optional advanced Math editor ( a parallel version of TinyMCE with some optional math plugins available: asciisvg, asciimathml, latexmathml, latex, calculator, unicode picker etc ). I suppose we will be able to select any traditional external image fallback script but also a (tex) filter fallback and an java applet based image fallback (HotEqn etc) for offline rendering (if javascript is disabled or you don't have access to any latex distribution. I'm not totally sure all of this will work but most of them will certainly work... 

The reason why I like to talk about moodle 2.0 is that moodle 1.9 is still using htmlArea as default editor and both new editor, activity and theme structure of moodle 2.0 is far more flexible than in moodle 1.9 - and it is easier to say "next year" than "tomorrow" or "today" big grin - and it is not reasonable to think that a person like me could solve all such issues that professors or professional developers have not been able to solve during the past years. I am basicly just a normal teacher and moodle is one of the best hobbies a man can have...