If your journal publishes mathematics, statistics, physics or engineering articles, you know this sight: in the title, the abstract and the references, a line of LaTeX full of backslashes and braces sits where a formula should be. MathJax for OJS is a free plugin that renders those formulas properly in the reader’s browser. It does not touch the text the author entered; it only fixes what the reader sees.
Where are formulas rendered?
On the pages below. The screenshots are all from the same demo article.
Article title and abstract
Inline formulas are rendered within the sentence, display formulas centred on their own line. Fractions, sums, roots and matrices included.
- Inline:
\( ... \) - Display:
$$ ... $$or\[ ... \] - There is a separate option for titles written with single dollars (below)
References
Formulas in the reference list are rendered too. One writing rule applies here: OJS removes single backslashes when it reads the references field, so in references every backslash is typed twice.
- In references:
\\(\\gamma\\)shows the formula - Titles, abstracts and full text are not affected by this rule
- You can add this sentence to your author guidelines
The “How to Cite” box
If the article title in the citation box contains a formula, it is rendered as well. When the reader switches citation format (from APA to IEEE, say), the text loaded afterwards is rendered automatically.
Issue contents, archive and search
Titles with formulas look right not only on the article page but also in the issue’s table of contents, the archive and search results.
HTML full text
OJS displays the HTML full text as a separate document inside the page; scripts added to the page header cannot reach it. The plugin adds MathJax to the full-text document itself.
- OJS’s HTML Article Galley plugin must be enabled
- PDF files are out of scope: maths in a PDF is already typeset in the PDF itself
Works with your theme too
The screenshots above were taken with OJS’s default theme. The plugin needs nothing theme-specific; alongside is the same article in the Atlas theme.
The settings form: four sections
In the plugin list it appears as MathJax for OJS. The “Settings” button opens a single form; its four sections follow below in order. Settings are per journal; on a multi-journal installation each journal makes its own choices.
1. Enabled areas
MathJax is loaded only on the pages you select. Unselected pages are left completely untouched: no script, no overhead.
- Article landing page (abstract) on
title, abstract, references and citation box - HTML galley (full text) pages on
- Issue table of contents and archive on
- Search results on
- Journal homepage and announcements off
- Editorial backend off
experimental: renders formulas in editor lists such as submission titles. Nothing is rendered inside rich-text editing boxes, so when an editor saves, the formula’s original LaTeX is what gets stored. If it ever interferes with editorial work, simply turn it off here. - When you enable the editorial backend, one more option appears in the form: treat single dollar signs as inline math in the backend on
independent of the single-dollar setting for the public pages
2. MathJax source
You choose where MathJax is loaded from.
- Bundled copy default
files are served from your own server; no request goes to any other address - CDN (jsDelivr, pinned version 3.2.2) optional
files come from an external network - If the bundled copy is selected but its files are missing from the server (an incomplete upload, say), the settings form warns you and MathJax is loaded from the CDN in the meantime; reinstalling the package fixes it
3. Formula delimiters
In mathematics journals, titles are usually written with single dollars: $\mathbb{Z}_n$-symmetric … for example. With this option off, single-dollar notation stays as plain text.
- Also treat single dollar signs ($ … $) as inline math off
turn it on if your journal consistently writes inline math with single dollars - Once it is on, write real money amounts as
\$25; the amount stays as plain text (see the screenshot)
4. Input formats
TeX and LaTeX are always on. You can enable two more formats if you need them; doing so loads a slightly larger MathJax build.
- TeX / LaTeX always on
- MathML off
- AsciiMath off
formulas are delimited with backticks
How to write formulas
Authors type the formula straight into the title, the abstract or the HTML full text. The plugin only displays it; the stored text stays exactly as entered.
| What | How to write it | Note |
|---|---|---|
| Inline formula | \(E=mc^2\) | always works |
| Display formula | $$\int_0^1 x\,dx$$ or \[ ... \] | always works |
| Inline with single dollars | $E=mc^2$ | when the single-dollar option is on |
| Money amount | \$25 | write amounts this way when single dollars are on |
| Formula in references | \\(\\gamma\\) | backslashes typed twice in the references field |
Privacy and security
Visitor data stays on your site
By default, MathJax’s script and fonts are served from the plugin’s own directory, that is, from your server. The plugin makes no request to any other address. This is the setting to prefer for privacy and GDPR, or for intranet installations.
If you choose the CDN, the reader’s browser downloads the files from cdn.jsdelivr.net; as with any third-party hosted script, that service sees the reader’s IP address, browser information and the page address. The plugin sends no data to us, OJS Services, either.
Safe mode
Titles, abstracts and references are entered by authors. That is why MathJax runs in safe mode: links written inside a formula can only be http and https; class, id and style commands are restricted. Ordinary formulas are not affected.
The plugin does not change stored data. When an editor edits and saves a title or an abstract, what is stored is the LaTeX the author wrote.
Limits you should know
- Single backslashes disappear in references. This is OJS’s own behaviour; if you type
\(\gamma\)in a reference, the page shows(gamma). The fix is to type every backslash twice in the references field. The stored text is not changed; titles, abstracts and full text are not affected. - Truncated abstracts. Themes that shorten the abstract on issue and search cards can cut a formula in half; the visible fragment is then plain LaTeX.
- PDF is out of scope. Maths in a PDF file is already typeset in the PDF itself.
- Plain-text fields. The browser tab title and the metadata tags read by indexes carry the title as the author entered it, LaTeX included. The plugin does not touch them.
- HTML full text requires OJS’s HTML Article Galley plugin to be enabled.
- Rendering in the editorial backend is experimental. If it interferes with editorial work, turn it off in the settings; no data is affected.
Compatibility and installation
| Package | OJS, tested in full | OJS, checked by the automated regression run only | PHP (full tests) |
|---|---|---|---|
| OJS 3.3 package | 3.3.0.22 | 3.3.0.16, 3.3.0.20, 3.3.0.21 | 7.4, 8.1 |
| OJS 3.4–3.5 package | 3.4.0.10, 3.5.0.5 | 3.4.0.3, 3.5.0.1, 3.5.0.3 | 3.4: 8.1, 8.2 · 3.5: 8.2 |
“Tested in full”: formula rendering was tried page by page (title, abstract, references, citation box, issue and search lists, HTML full text). “Automated regression run”: it verifies that the plugin loads exactly once, with the configured source and delimiters, on article, issue, search and home pages; it does not try formula rendering page by page. Other versions of these release lines have not been tested.
Installation
- If another plugin that loads MathJax is installed, disable or remove it first; two plugins would load MathJax twice.
- In OJS, go to Website Settings → Plugins → Upload A New Plugin and upload the package that matches your OJS version.
- Enable MathJax for OJS in the Generic Plugins list.
- Open “Settings” and choose the enabled areas, the source and the delimiters.
If formulas do not appear, clear the OJS caches.
Upgrading from OJS 3.3 to 3.4 or 3.5
The two packages are not interchangeable. After upgrading OJS, delete the old plugin directory (plugins/generic/mathJaxRender) and install the OJS 3.4–3.5 package. OJS 3.5 does not render formulas with the old package; OJS 3.4 loads the old package but it should still be replaced. Then clear the OJS caches. Your settings are kept.
Download
Licence: GPL v3. The bundled copy of MathJax is under the Apache License 2.0.
For journals that publish formulas
MathJax for OJS is free; download the package and install it from the OJS plugins page. For questions and bug reports, open an issue in the repository.
We develop themes and plugins for academic journals and OJS, and provide support services. Whatever you need, get in touch with us.






















Comments are closed