The MathJax team is pleased to announce version 3.2.1 of MathJax, released earlier today. This is mostly a bug-fix release, resolving various display and input bugs and other issues. See the individual bugs linked below for more details, and the 3.2.1 milestone for the pull requests involved in this release.
New Features in this Release
MathJax now integrates version 4 of Speech Rule Engine (SRE). (#800)
- Uses webpack as the primary bundler to offer a single bundle file for both node and browser.
- Major rewrite of rule handling and provision of locales.
- Smaller locale files and memory footprint in the index structure.
- Hierarchical locale setup that allows inheritance within rule sets.
- Uses ES6 promises to handle locale loading and engine setup.
- A number of new locales for Swedish, Norwegian (Bokmal and Nynorks), Danish (MathSpeak only), and Catalan (MathSpeak only)
- Locale files are now served with a
For more details and a full list of all changes and additions see the SRE release notes.
MathJax makes use of SRE v4 new features in the following ways:
- Source integration
- Integrates SRE directly via importing the relevant library files into its code and webpacks them into its components and bundles.
- Replaces the timeout-driven SRE loading promise with SRE’s new native promises.
sre.tsmodule now imports and exports exclusively API methods necessary for SRE’s use in MathJax
- A new
mathmaps.tsmodule provides a map for directly integrating and bundling locales (see more below).
- Components integration
components/src/srenow simply handles copying the locale files in the
components/src/srecontains a configuration file
sre_config.jsthat sets up the basic SRE configuration for MathJax, especially the correct path to the
mathmapsfolder (online or in the npm distribution).
- Components can webpack SRE’s locale files into bundles. See the
components/src/tex-chtml-full-speechcomponent as an example.
- MathJax Configuration
srepath in MathJax is now used exclusively for pointing to a directory containing the locale files.
Most of these changes are internal and should remain unnoticeable. However, there are a couple of points to note when using SRE via MathJax:
- Previously, MathJax would load SRE as a single library file, but now webpacks its source files, which, as a side-effect, closes several convenient loopholes you could have exploited in the past:
OLD: SRE’s functionality was available to a developer as if running SRE standalone. That is, in both node and browser, all of SRE’s API methods where available in the
SREnamespace, and additionally, the full functionality was reachable in the browser through the
NEW: Now only the explicitly exported API methods are available to import via the
OLD: You could easily change the version of SRE MathJax would use by:
- In the browser, pointing to an alternative copy of
srepath in the MathJax configuration, and
- In node, replacing the
speech-rule-enginepackage with a different version in the
NEW: This is no longer possible.
- In the browser, pointing to an alternative copy of
sreReadymethod is still exported but deprecated. In the future, you should use the corresponding method in the API bundle
- By default SRE comes without rules (or locales) preloaded, and pulls those in only when necessary. That is, it loads the relevant
.jsonfiles via XML-HTTP-request in the browser, or via file loading in the node module. However, it is now possible to pre-bundle (some) locales directly into a custom distribution using webpack, which is particularly useful if you want to run MathJax offline while still using the full power of is assistive technology extension. See the
tex-chtml-full-speechcomponent as an example.
- Properly handle border and padding CSS in CHTML and SVG output. (#799)
- Have lazy typesetter typeset all remaining math before printing. (#777)
- Have lazy typesetting specify a (configurable) distance around the viewport for triggering typesetting. (#777)
- Allow containers to be marked so that they are always typeset by the lazy typesetter. (#777)
Bugs Addressed in this Release
Output Bug Fixes
Update svg output to properly handle token elements with multiple child nodes. (mathjax/MathJax#2836)
Include CSS to reset border-collapse in CHTML output. (#2861)
Prevent CHTML adaptive CSS from adding character CSS multiple times. (#796)
Make sure all character data is included when adaptiveCSS is false. (#2724)
Place super- and subscripts properly around
Add a minimum height for accented characters. (#2766)
Take relative scaling into account for CHTML output of non-MathJax fonts. (#2818)
Fix placement of surd when root extends above the top of the root. (#2764)
Fix problem with
msubsupwhen subscript is blank. (#2765)
TeX Input Fixes
\textnormalto macros allowed by
\operatornameto work more like in LaTeX. (#2830)
Fix problem where errors during
mhchemargument collection are not properly handled. (#2835)
Update XSLT to produce better results in
Add ability for TeX input to force normal variant for CJK input. (#2744)
Make sure math-in-text forms an ORD atom within
Make sure explicit attributes added by
\mmlTokenare not removed. (#2806)
moas not an accent if used in
\oversetand friends. (#2800)
MathML Input Fixes
Fix problems with verification and repair of malformed mtables. (#779)
Add support for
Trim MathML string before parsing it. (#2805)
Only process MJX-TeXAtom classes on
mml3filter to an
forceReparseisn’t needed. (#2718)
Make U+2061 through U+2064 have TeX class NONE so they don’t affect spacing. (#806)
Handle documents better when created by parsing in XHTML. (#2788)
Add version numbers to component files and check them when loaded. (#738)
Fix problem where some menu settings weren’t sticky (#2786)
Refactor usage of all-packages to reduce redundant code in components. (#784)
Make variables local in legacy AsciiMath code. (#2748)
Make safe extension properly handle scriptlevel of 0. (#2745)
Update webpack files for
Update build tools to work with extensions better. (#737)
Availability of version 3.2.1
Although version 3.2.1 was released earlier today, it may take a day or two for the new version to propagate to the various CDN network computers, so you may not see v3.2.1 immediately if you are loading mathjax using a generic
mathjax@3 URL. You should be able to obtain it immediately if you use the full version
You may also have a cached version in your browser, so may need to either clear the browser cache, or relaunch your browser (or both) in order to get the latest version (the cached version should expire in about a week, depending on the CDN being used).
Note that it is possible for some files to be updated before others, so it may be the case that users of websites that load extensions (either explicitly or by autoloading TeX packages) may get mixed versions until the CDN versions stabilize, which should be within a day. If you are loading one of the combined components (e.g.,
tex-chml.js), this is less likely to be an issue, and if you are loading a component ending in
-full it is even less likely to occur.
Version 3.2.1 is available immediately from npm and GitHub for use in node applications.