Skip to content

MathJax v4.0.0-beta.6

Pre-release
Pre-release
Compare
Choose a tag to compare
@dpvc dpvc released this 30 Apr 19:15
· 81 commits to develop since this release

This release includes a significant rewrite of the expression explorer and an update to the speech-rule engine (SRE) that underlies MathJax's assistive support. Accompanying this is a reorganization of the MathJax contextual menu that moves the assistive options to a more prominent position for easier access and better control. This release also includes several new font-based TeX packages (and the fonts to accompany them) that provide alternative double-struck character styles. In addition, we have moved from npm to pnpm as the package manager for the MathJax source repository. Finally, there are also a number of bug fixes since the beta.4 release.

We anticipate one more beta release before the official 4.0.0 release.

Explorer Updates

The MathJax expression explorer has been updated to seamlessly fit in with an accessible browsing experience. In particular, there is no longer a need to switch on accessibility support in the contextual menu (which can still be used to explicitly disable that support, as described in the next section). Once a formula is focused, exploration can immediately start by using the arrow keys. (For a full list of keyboard commands see here.) This allows you to dive into the details of the formula, including highlighting sub-expressions, and, if selected, magnification. Moreover, the explorer can now also be started by left-clicking elements within in the formula itself. That is, you can click on any character within the expression to start the explorer at that point in the expression. Communication with screen readers (if any is used) is achieved via aria-label and aria-braille-label elements instead of the live region as utilized previously. Alternatively, automatic voicing and synchronized highlighting can be used directly without a screen reader by switching on those options in the contextual menu.

Menu Updates

The MathJax contextual menu has been reorganized to make the accessibility features more easy to use. The top-level menu now includes an "Accessibility" section with four submenus — "Speech", "Braille", "Explorer", and "Options" — rather than an accessibility submenu as in previous versions. The Speech menu allows you to enable/disable speech generation and its associated visual output, and to turn on or off auto voicing. It also provides control over the speech rule-set to use, the verbosity of the set in use, and the language to use for the speech. Similarly, the Braille menu allows you to enable/disable Braille generation and display, as well as to select the type of Braille to generate.

The explorer controls for magnification and highlighting have been moved to the Explorer menu, and other accessibility options have been moved from the Math Settings and old Accessibility submenus to the Options menu. A new "Semantic Enrichment" option controls whether the accessibility features are available or not (unchecking disables speech and Braille generation and the explorer).

New TeX packages

This release of MathJax includes three new TeX packages that provide alternative double-struck (i.e., blackboard bold) character sets: dsfont, bbm, and bboldx. New font extensions for the mathjax-modern font are now available for these packages, and the font extensions are loaded automatically when the TeX package is loaded. Currently, these fonts are available only in combination with the mathjax-modern font, but in the next release, they will be able to be applied to any of the available fonts.

The dsfont package defines a macro \mathds that provides access to its double-struck characters. There is a configuration option that controls whether the sans-serif version of these fonts is used, or the roman versions:

MathJax = {
  tex: {
    dsfont: {
      sans: true   // default is false
    }
  }
}

The bbm package defines macros \mathbbm, '\mathmmbss, and \mathbbmttto generate its double-struck characters, as well as a\mathversionmacro that can be used to select the version of the double-struck fonts to use (this is a global setting). Here,\mathversion{bold}selects the bold versions of the double-struck characters, while any argument other thanbold` will select the normal versions of the fonts.

The bboldx package redefines \mathbb to use the bboldx double-struck characters, and adds \mathbfbb to access their bold-face versions, plus \imathbb, \jmathbb, \imathbfbb, and \jmathbfbb for dotless i and j characters in these fonts. In addition, there are macros for upper- and lower-case Greek letters, e.g., \bbGamma, \bfbbsigma, etc., and text-based versions of these for use in \text{}, e.g., \txtbbGamma. The bold delimiters \bbLparen, \bbRparen, \bbLbrack, \bbRbrack, \bbLangle, \bbRangle, and the bfbb versions of these, are defined, but do not yet work with \left and \right. That will be addressed in the next release.

Move from npm to pnpm

With this release, MathJax is switching to pnpm as our package manager rather than npm. This speeds up installation and improves script handling. Although you can still use npm, some of the scripts in package.json call pnpm, so you will need to have pnpm installed to use those scripts. Fortunately, this only affects those who are compiling and packaging MathJax, so unless you are working with the MathJax source files, you should not be affected by this change. If you are only using MathJax in web pages via a CDN, for example, you will not need to worry about pnpm (or npm).

To install pnpm you can use

npm install -g pnpm

The following sections indicate the bug fixes in this release:

TeX Input Fixes

Output Fixes

  • Add xmlns attribute for global cache svg element. (mathjax/MathJax-demos-node#58) (#1045)

  • Fix issues with line breaks and spacing in SVG output. (mathjax/MathJax#3166) (#1043)

  • Make sure math items have their metrics set before lazy typesetting. (mathjax/MathJax#3167) (#1042)

  • Don't descend into items that aren't broken when looking for the line-break node. (mathjax/MathJax#3135) (#1024)

  • Fix font extension handling of extra variants, and handle those variants in enrichment. (#1033)

  • Update CHTML longdiv output to not require clip-path. (#1025)

  • Better measuring of text that is in a native font rather than MathJax fonts (#1014)

User Interface Updates

API Fixes

  • Proper handling of typesetPromise() in defaultPageReady(). (mathjax/MathJax#3130) (#1018)

  • Move from npm to pnpm (#1021, #1023, #1077)

  • Add missing Text.splitText() method to linkedom. (mathjax/MathJax#3134) (#1036)

  • Update LiteParser's serializeXML() method. (mathjax/MathJax-demos-node#58) (#1046)

  • Fix menu to not re-render if no typesetting has occurred. (mathjax/MathJax#3167) (#1044)

  • Fix keyvalOptions to process braces and backslashes better (#1031)

  • Update TeX input's keyvalOptions, and add GetBrackets() option to match brackets. (#1037)

  • Add ability to do typechecking and conversion on the values of key-value options (#1032)

  • Clear process bits for findMath and attach-speech, and remove safe bit that isn't needed. (#1034)

  • Refactor input/tex/ParseUtil.ts to remove namespace (#1022)

  • Add cssText() method to DOMadaptor and handle dynamic rules in HTML output. (#1027)

  • Make const enum DIRECTION into a regular object. (mathjax/MathJax#3114) (#1026)

  • Fix default option list to {} in constructors for output jax. (mathjax/MathJax#3128) (#1016)

  • Fix make-cjs-components script to work without mjs files being built first (#1013)