Plugins
OverviewHTML editors
CKEditor 5 CKEditor 4 TinyMCE 6 and 7 TinyMCE 4 Froala Tiptap AngularCMS and LMS
WordPress MoodleCanvas, Blackboard and LTI Blogger
Other
Google Docs and Slides TiddlyWikiDevelopers
Writing your own
Moodle
The fxEditor plugin for Moodle 4.1 and later adds an Equation button to Moodle's TinyMCE editor — so anywhere a teacher or student can type, in a quiz, a forum post, a page or an assignment, they can write an equation. This is the editor it adds, running here with Moodle's own modules stood in for:
Tested on Moodle 5.3 and 4.5 LTS. The plugin has been installed and used on
both: the Equation button, the dialog, and inserting equations. It needs Moodle 4.1 or later, but
has not yet been tried on 4.1 to 4.4 or on 5.0 to 5.2, so try it on a test site first if yours is
one of those. In Moodle the plugin is called CodeCogs Equation Editor; its component is
tiny_eqneditor.
Usage
- Click Equation on the editor's toolbar, or choose Insert → Equation…, to open the equation editor.
- Build the equation in the maths view. The LaTeX switch, bottom left, shows the LaTeX source above it.
- Choose how it is inserted from Insert as, bottom right, then press OK. The dialog remembers the choice next time.
- Double-click an inserted equation — an image, MathML, or LaTeX in the text — to edit it again. It goes back in the form it was inserted in.
Installation
The plugin includes its compiled JavaScript, so there is no build step, and it needs no other plugins and no Composer. It is on GitHub as willzyba/moodle-tiny_eqneditor.
From the plugin ZIP
Download the plugin's ZIP — from the Moodle plugins directory once it is listed there, or from the GitHub repository (Code → Download ZIP) — then, under Site administration → Plugins → Install plugins, upload it and follow the prompts.
From git
Clone the repository into your Moodle's TinyMCE plugins folder, as eqneditor:
cd <moodle>
git clone https://github.com/willzyba/moodle-tiny_eqneditor.git lib/editor/tiny/plugins/eqneditor
Or copy the tiny_eqneditor folder from the download in
Customise and download below to
<moodle>/lib/editor/tiny/plugins/eqneditor. On Moodle 5.1 and later, whose code
is under public/, the folder is
<moodle>/public/lib/editor/tiny/plugins/eqneditor. Then visit Site
administration → Notifications to complete the install.
Then
- Under Site administration → Plugins → Text editors → TinyMCE editor → CodeCogs Equation Editor, enter your licence key. This is the one step the plugin needs after installation.
- Optionally, paste your design —
design.jsonin the download from Customise and download — into Design on the same page.
The plugin puts the Equation button on the editor's toolbar, and Equation… in its Insert menu, itself: there is nothing to add to the toolbar by hand.
The licence key activates the equation editor for your Moodle site's domain. Get one from fxeditor.codecogs.com/purchase: a 30-day trial key, then a purchased key to keep using it. Without it, the editor still opens, and equations can be written in LaTeX and inserted as images, but the maths view shows the reason it cannot render in place of the equation, and MathML inserts are not available.
Settings
Site-wide, under Site administration → Plugins → Text editors → TinyMCE editor → CodeCogs Equation Editor:
| Equation editor URL | https://fxtex.codecogs.com | Where the equation editor is loaded from. Change it only if you run your own copy. |
| Licence key | Your fxEditor licence key (fx_pk_…), from fxeditor.codecogs.com/purchase. Required. It is sent to every browser that opens the editor, and works only on the domains it was issued for. | |
| Rendering service URL | https://fxtex.codecogs.com | The fxTeX Server that draws equations inserted as images: CodeCogs', or your own. |
| Insert as | Image | The dialog's starting Insert as choice — Image, LaTeX or MathML. Authors can change it for each equation, and the dialog then remembers their choice in that browser. |
| Design | The editor's look, as JSON: dialog width, height and scale, toolbar panels and size, colour, equation and markup sizes, undo/redo. Build one in Customise and download. Empty for the standard design. |
Customise and download
Make the equation editor your own: choose what it shows, drag panels from
More panels into up to three toolbar rows, and pick a colour and sizes. The preview is
the real Moodle page, rebuilt as you go. Then add your licence key and download it: an
example.html with a page of equations to edit, loading everything it needs from
fxplugins.codecogs.com.
Your toolbar
More panels 0
School levels
Your design
The option that gives Moodle this design — it is already in the download. Leave it out and the editor uses the standard design.
Get your licence key from fxeditor.codecogs.com/purchase. Without a key, the download still works: equations show why they cannot render until you add one.
Or get the plugin’s source code from GitHub.
Complete example
The whole of the page running above: a simple, complete HTML page that loads Moodle and the
plugin. Every file comes from fxplugins.codecogs.com, so it works as it is —
put in your own licence key. (Keys are shortened here.)
Choosing how equations are stored
Image — an SVG <img>. Displays
anywhere, but needs the rendering service to be reachable whenever the content is viewed.
LaTeX — \( \) when Inline is on,
$$ $$ otherwise. Compact and editable by hand. It needs a maths filter where the content
is shown: the fxTeX maths filter below, which is the only one that
also draws chemical structures and pictures, or Moodle's own MathJax filter. In the editor it shows as
the maths it is, and is saved as the LaTeX.
MathML — final markup, with nothing to fetch. Pages that
display it need the fxtex.css stylesheet, which the fxTeX maths
filter brings with it. Without the filter, add
<link rel="stylesheet" href="https://fxtex.codecogs.com/fxtex.css"> under Site
administration → Appearance → Additional HTML → Within HEAD. The plugin loads
it into the editing view itself, but cannot reach every page that later shows the content.
Displaying maths: the fxTeX maths filter
Moodle shows LaTeX through a filter, and its standard one is MathJax. A second plugin,
fxTeX maths (filter_fxtex), puts
fxTeX Pro in its place. It typesets each
equation as MathML in the reader's browser, many times faster than MathJax and with its spoken form
for screen readers. It also shows what MathJax cannot:
- chemical structures and reaction schemes —
\chemfig,\schemestart - pictures drawn with LaTeX's
pictureenvironment - the physics package —
\dv,\pdv,\qtyand the rest
It reads what Moodle content already uses — \(…\), \[…\]
and $$…$$, and $…$ if you turn it on — so content written
for MathJax needs no changes. It is on GitHub as
willzyba/moodle-filter_fxtex.
Switching from MathJax
- Install the filter to
filter/fxtexand visit Site administration → Notifications. - Under Site administration → Plugins → Filters → Manage filters, turn fxTeX maths on and MathJax off (and TeX notation, if it is on).
- The filter uses the licence key you gave the equation editor, or one of its own. With a key it uses fxTeX Pro; without one, the free fxTeX, which typesets everything except chemical structures, pictures and the physics package.
| Setting | Default | |
|---|---|---|
| Licence key | Your fxTeX Pro key (fx_pk_…), from fxeditor.codecogs.com/purchase. Empty: the equation editor's key, or the free fxTeX if there is none. A key that does not open fxTeX Pro on the site falls back to fxTeX too. | |
| Single dollar signs | Off | Also read $…$ as inline maths. Off because a single $ is common in ordinary text — a price in a forum post. |
| TeX filter compatibility | Off | Also read the old TeX notation filter's [tex]…[/tex]. |
| fxTeX URL | https://fxtex.codecogs.com | Where fxTeX and fxTeX Pro are loaded from. |
The Moodle app does not run the filter's JavaScript, so the app shows LaTeX as it is written.
More
For LTI-based tools rather than the text editor, see Canvas, Blackboard and LTI, which also works with Moodle.
