Editor
matheditor.zip
(DOWNLOAD)http://moodle_root/admin/tool/installaddon/index.php
http://moodle_root/admin/settings.php?section=editorsettingstinymce
matheditor
keyword within the "Editor Toolbar"
field. Ensure buttons are separated by commas and groups separated by |
s.LaTeX Renderer
The following LaTeX server should be installed: http://www.forkosh.com/mathtex.html. Follow the instructions
there. By default the editor looks for this script at localhost/cgi-bin/mathtex.cgi
, to change this path,
see the customisation section below.
Customisation
To define your own LaTeX rendering server (used to render the equation preview image within the TinyMCE editor
itself) go to the Moodle settings page for TinyMCE and in the Custom Configuration
field, add the following
JSON code: {"matheditor_latexserver" : "<your server>"}
.
NodeJS and Node Package Manager, follow instructions stated here:
NOTE: The Ubuntu repositories do not have the latest version of node, using sudo apt-get
to retrieve these dependencies will not work!
Moodle 2.5+ (probably works in lower versions too, no testing has been done)
moodle_root/lib/editors/tinymce/plugins/matheditor
foldergit submodule init
git submodule update
cd
into the MathQuill directory
cd vendor/mathquill_custom
npm install
cd ../../
make
http://moodle_root/admin/index.php
http://moodle_root/admin/settings.php?section=editorsettingstinymce
matheditor
keyword within the "Editor Toolbar"
field. Ensure buttons are separated by commas and groups separated by |
s.make deploy
and a zip file called matheditor.zip
is created and ready for distributionThe MathQuill (http://mathquill.com/) library was forked as part of this plugin to add some extra functionality. The forked repository can be found at https://github.com/raywainman/mathquill.
A summary of the changes can be seen by visiting the latest commits on the forked project or the list below:
alt
tag. Upon
saving the contents of the editor, the image is converted to a simple span
element containing the LaTeX code
surrounded by double dollar signs $$ LaTeX Here $$
to be recognized by the Moodle MathJax filter
(see https://github.com/oohoo/moodle-filter_mathjax). Upon re-editing the contents, the TinyMCE pre-processor will
detect this span
and reconvert it to an image. This ensures that no LaTeX code is actually ever exposed to the user.
For more details on how this is done, see the editor_plugin.js
file.Another TinyMCE plugin which uses MathQuill: