MathSlate uses JavaScript, so should work cross-platform. Provides a viable open source (GPLv3) alternative to the DragMath Java applet, given issues with Java applet security and that browser NSAPI support is 'on the wane'.

There is a demonstration site and code is available on GitHub.

To install on Mahara:

1. Add MathJax to lib/web.php as detailed in earlier postings to this thread.

2. Copy plugins/mathslate (downloaded and unpacked from GitHub) to js/tinymce/plugins/mathslate.

3. Add mathslate to the TinyMCE toolbar configuration in lib/web.php. For example, search for **emoticons** (2 instances) and add **mathslate** as below:

Around line 161 (I have tweaked my web.php elsewhere, so your line numbers may be slightly different)

'"fontselect | fontsizeselect | **mathslat**e emoticons nonbreaking charmap ' . $spellchecker_toolbar . ' | table | removeformat pastetext | code"',

Around line 175

plugins: "tooltoggle,textcolor,link,image,table,**mathslate**,emoticons{$spellchecker},paste,code,fullscreen,directionality,searchreplace,nonbreaking,charmap",

MathSlate is currently version 1.0rc1. So, has a few rough edges. However, in my hands, works well on Mahara 1.10 and should work (though not tested) on earlier versions using TinyMCE 4.

]]>http://docs.mathjax.org/en/latest/tex.html#mhchem

To do this, immediately after:

$headers[] = '<script type="text/javascript">$j=jQuery;</script>';

in lib/web.php, add the following lines:

$headers[] = '<script>

MathJax.Hub.Config({

TeX: {

extensions: ["mhchem.js"]}

});

MathJax.Hub.Configured();

</script>';

Also, modify the MathJax link as follows (or equivalent for local install):

$javascript_array[] = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&delayStartupUntil=configured';

You can then use the mhchem extension to TeX syntax to add chemistry reactions, equilibia, ions, formulae, isotopes etc to your Mahara pages.

Currently, no DragMath-like GUI for this, though the mhchem syntax is relatively straight-forward to add directly via the editor.

http://www.ce4csb.org/equations/mhchem.pdf

]]>

thank you very much for your answer. I just read it today. Now i solved the problem. It was a strange combination of two error sources: external MathJax and case sensitiv link. That means that it is now working using a local copy of the MathJax-files and the spelling "mathjax" istead "MathJax" in the directory-link.

Hint for everyone: use the folowing link for testing the local mathjax

/js/mathjax/test/index.html

kind regards

Klaus

Sounds as if the Java DragMath editor plugin *is* working (but see note of caution later) but that the display of Maths by MathJax JavaScript is not.

Are you loading the MathJax libraries? The simplest way to set this up is to link to the MathJax CDN by adding the following to your Mahara's lib/web.php file

$javascript_array[] = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';

immediately before the line:

$javascript_array[] = $jsroot . 'keyboardNavigation.js';

If there is any issue access ing the MathaJax CDN (e.g. blocked by institutional firewall), then you can also download and deploy MathJax to your server, and link to that instead.

This has continued to work for me with recent Mahara versions (currently version 1.8.1), though with upgrades it is easy to forget to add the MathJax link to the new web.php.

Be aware that changes in security policies in recent Java versions may also cause issues with the use of DragMath. In the Moodle forums, there has been some interest in developing a new open source JavaScript alternative to DragMath for maths equations. May be something for the Mahara community to collaborate with.

https://moodle.org/mod/forum/discuss.php?d=251627#p1091002

Hope that helps

Geoff

]]>because i didn´t find new information about DragMath in Mahara i am using that old topic. DragMath apparently isn´t working anymore inside Mahara with modern browsers. See: http://docs.mathjax.org/en/latest/installation.html

(at the bottom: "Firefox and local fonts" and "IE9 and remote fonts")

DragMath ist still displayed in the editor and it is possible to use the Java-Frontend. But the latex-code isn´t displayed as "translated" picture like before. It just shows the source code and looks like this example:

\( \sqrt[3]{27} \)

\( \int_{n}^{1}x\,dx\)

That behaviour occurs in both of our Mahara-Installation, old one (1.3.7) and the new one (1.7.2). Using MathJax in combination with DragMath as described in the posts above.

Does somebody know workarounds? Exists a new version of "mahara-dragmath" (topic and git are last updated in 2011!)?

Are there plans to integrate Dragmath into core like in Moodle 2.x?

Thanks and kind regardsKlaus

]]>I have just added a DragMath equation editor bundle for Mahara to Gitorious

https://gitorious.org/mahara-dragmath/mahara-dragmath/trees/master

This adds the open source DragMath equation editor (the equation editor built-in to Moodle 2) to the Mahara TinyMCE toolbar. DragMath is a Java applet, so will need a local Java installation and won't work on all (e.g. some mobile) platforms.

The bundled Dragmath is configered to output TeX/LaTeX in one of two formats

Inline - the default - equations are delimited by \( and \)

Display - equations are delimited by %% and %% (like MoodleTeX)

To display equations correctly, you also need the open source MathJax JavaScript library to be installed, as outlined earlier in this thread.

See the bundled README for installation instructions. Apart from adding two new folders (and contents) /lib/dragmath and /js/tinymce/plugins/dragmath, only minor edits of /lib/web.php are required. For initial testing it is conveneient to link to the MathJax CDN, though you may wish to install a local copy of MathJax (in, say, /js/MathJax) for better performance.

http://www.mathjax.org/download/

The aim of all this is to provide a 'minimal' equation editor for Mahara. For inspiration about what else may be possible, check out Mauno Korpelainen's work with Moodle:

http://moodle.org/mod/forum/discuss.php?d=182627

The usual warnings apply. So, do test before deploying on a production Mahara

Enjoy

Geoff

]]>Unfortunately, WIRIS is not really an option for us.

MathJax, however works rather well for rendering mathematical notation (particularly with Iñaki's one line integration!).

So, it would be really neat to combine this with DragMath to provide a simple GUI for maths equations (as per the first post of this forum!).

Has anyone made any progress with this? I'll be prepared to have a go at 'reverse engineering' things from the Moodle-Dragmath integration, though suspect it won't be a quick job.

Cheers

Geoff

]]>Instead of using dragmath, I added in wiris (which looks good to me now that I've learned about it).

To integrate wiris, I followed their moodle directions: http://www.wiris.com/en/plugins/docs/moodle/moodle-2.0

In conjuction with advice from an older topic on this forum: http://mahara.org/interaction/forum/topic.php?id=1944

Thanks for all the help on getting math on my mahara.

-Malcolm

]]>thanks a million, it did indeed do the trick.

B. Regards,

Malcolm

]]>edit lib/web.php, and around line 221 (for Mahara 1.3, 229 for Mahara 1.4), you will see a line that reads:

`$javascript_array[] = $jsroot . 'keyboardNavigation.js';`

just add the following line above that one:

`$javascript_array[] = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';`

That should do the trick :-)

Saludos.

Iñaki.

Oops. I meant to write "isn't". I don't know which file would be the best to put the extra code in. A developer would need to answer this question instead of me making a wild guess.

Cheers

Kristina

]]>I can follow the directions (probably) to put MathJax into Mahara from the blog you sent me to, but MathJax has a newer way of doing it now. They recommend the use of the following script in the head of any page to display math LateX or MathML. Unfortunately, I haven't found the place to insert the script. I tried the themeconfig.php for my theme, but get a parse error, or if I put it outside the php tags, I get an error about 'something really bad having happened' when the header is called.

Do you know where it should go to render math text on any page in mahara?

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>]]>

dajan posted his opinion at https://bugs.launchpad.net/mahara/+bug/730373

Cheers

Kristina

]]>No, MathJax isn't bundled. You'd have to install it separately.

Cheers

Kristina

]]>I'll give it a try soon.

Thanks,

Malcolm

]]>MathJax should already work on Mahara according to http://mahara.org/interaction/forum/topic.php?id=2882

Then it would only be dragmath that you'd have to investigate. I don't remember anybody writing anything about it here.

Cheers

Kristina

]]>I'd like to do the same for mahara, so that my students (and I) will be able to use dragmath or something like it when entering content into portfolio views so that they don't have to be LaTex or MathML experts from the start. And then I'd like to incorporate MathJax as the site renderer.

With moodle, dragmath has an automatic installation package. Does anyone know how to get the job done with mahara? I plan to give it a go in a few days, but if anyone already knows or has some insight please let me know.

I'm quite a novice, and mainly just fumble my way through php files and such until I manage to get things working or ruin the lot. So please be kind with the detail.

Thanks!

]]>