This release adds a number of new or improved features to MathJax, and fixes several issues in version 4.0.0. The new features are described in the sections below, and the changes and issues they resolve are linked in the lists in the last section.
- Compatibility Changes
- Updates to the User Interface
- Updates to Speech Generation
- Updates to TeX Input Processing
- Updates to CHTML and SVG Output
- New Configuration Options
Compatibility Updates
Some of the features in v4.0 used modern CSS that is not available in order browsers. Several updates in v4.1 address those issues by using older CSS techniques to accommodate more legacy browser versions.
In addition, v4.0 uses the modern Object.hasOwn() call rather than obj.hasOwnProperty(). The support for this only goes back a few years, and was a source of problems in older browsers. Version 4.1 uses a polyfill to overcome this deficiency in browsers that don't support Object.hasOwn(). A new MathJax.startup.polyfillHasOwn configuration option controls whether MathJax should use its polyfill when Object.hasOwn() isn't available natively. Use
MathJax = { startup: { polyfillHasOwn: false, } };
to disable the use of the polyfill.
The v4.0 build tools used to compile and package MathJax get confused by the use of Windows file paths. Version 4.1 has updated the tools to work in Windows, so you can compile and and bundle MathJax from the Windows command or power shell.
Updates to the User Interface
There are a number of user-interface improvements in this release. Notable among these is new support for a dark-mode color scheme. This should take effect automatically when the user changes the system settings to dark mode.
Another significant improvement is updated handling of dialog boxes, like the MathJax explorer help dialog. These now use the browser's dialog element, so they should float over top of the rest of the page (v4.0 failed to set the z-index properly for dialogs, and they could fall behind other page elements in that version). Furthermore, the dialogs now can be sized and repositioned, either by dragging with he mouse, or using arrow keys. Dialog boxes now have a (?) icon at the upper left that opens a new dialog that explains how to size and position the dialogs using the mouse or keyboard.
The explorer help icon (small ⓘ at the upper right-hand corner of an expression) is now positioned better so that it is not clipped when wide expressions scroll or truncate, and for displayed expressions without tags, the icon is now close to the expression rather than at the right-hand edge of the expression's container. Some page authors have requested the ability to remove the help icon altogether, so a new option MathJax.options.enableExplorerHelp has been added to control that setting it to false prevents the help icon from appearing.
In earlier versions of MathJax, you could not tab to links within expressions, and although they were focusable, they appeared within DOM nodes that were marked as hidden from screen readers, which was a problematic arrangement. In v4.1, you can tab to the links within an expression; however, due to technical limitations, these links do not appear in the list of links for the page.
In the expression explorer in v4.0, there were some situations where the highlighted terms did not include everything that was part of the spoken text. This has been fixed in v4.1, so highlighting should more accurately reflect the spoken expression. There were also a number of issues with explorer magnification of tagged expressions that are resolved in v4.1.
The speech for tagged expressions is improved in v4.1, in particular in how parentheses or other limiters around equation numbers are spoken. In order to support this, the tagformat TeX extension has been updated to allow the tagformat.tag and tagformat.ref configuration options to specify an array of three items, such as ['(', tag, ')'] rather than '(' + tag + ')' as in the past in order to separate the delimiter's from the tag itself. For backward compatibility, tagformat will separate out parentheses, braces and brakes automatically if the tag format is given as a single string.
Although the speech rule engine used by MathJax can produce Braille representations of the typeset expressions, support for tactile Braille output devices varies across screen readers, browsers, and operating systems. This has caused problems with Braille output devices in v4., which uses the aria-braillelabel attribute to specify an expression's Braille representation, since not all screen readers handle that attribute properly. Version 4.1 works around some of these limitations, and includes a new contextual menu item "Combine with Speech" in the Braille submenu that tells MathJax to include the Braille along with the speech in the aria-label attribute. This allows some screen readers to pass the Braille on to a Braille output device while still speaking the expression's text. In particular, NVDA users in Windows should select this option, while JAWS uses should not.
Prior to v4.0, MathJax by default used MathML that was visually hidden but available to screen readers that understand MathML and had it's onward speech-rule-engine generated text as an option that could be turned on. In v4.0, that was reversed, and the generated speech is on by default, with the hidden MathML as an option. Some readers prefer the hidden MathML, but to enable it you needed to turn it on and turn off speech and Braille, which took several menu selections to accomplish. In v4.1, selecting the hidden MathML turns off speech and Braille automatically, while selecting ether speech or Braille will turn off the hidden MathML, making it easier to switch between these two techniques. Note, however, that turning off speech and Braille will disable MathJax's expression explorer, and you must rely on the browser/screen-reader's ability to explore the hidden MathML expression instead.
Updates to Speech Generation
Labels are now spoken correctly at the top level and can be fully navigated at the end of a line or row. Also the speech for fenced labels now follow the rules selected by the speech preferences, the same as for other fenced expression. Likewise, prefix expression like column, row, line, case, etc., now follow the ClearSpeak preference settings.
SSML marking is now consistently being used throughout all speech rules across all rule sets and locales. Previously, only most of ClearSpeak and some of the English MathSpeak rules were marked up in SSML. Now it is rolled out across all locales, which leads to better synchronised highlighting in the MathJax self-voicing component. For example, for the formula