MathJax version 2.0 includes many new and improved features, including much better speeds in Internet Explorer, a new AsciiMath input processor, a new SVG output processor, support for additional LaTeX commands, and many bug fixes, to name just a few of the changes.
The HTML-CSS output processing was redesigned to avoid the page reflows that were the main source of the speed problem in Internet Explorer 8 and 9. For test pages having between 20 and 50 typeset expressions, we see an 80% reduction in output processing time for IE8, a 50% reduction for IE9, and between 15% and 25% reduction for most other browsers over the corresponding v1.1a times. Since the processing time in v1.1a grows non-linearly in IE, you should see even larger savings for pages with more equations when using v2.0. Forcing IE7 emulation mode is no longer necessary (and indeed is no longer recommended).
In the past, each expression was displayed as soon as it was typeset,
which caused a lot of visual flickering as MathJax processed the page.
In v2.0, the output is processed in blocks so that typeset expressions
are revealed in groups. This reduces the visual distraction, and also
speeds up the processing. The number of equations in a block can be
controlled through the EqnChunk
parameter in the HTML-CSS or SVG
block of your configuration. See the configuration options for
HTML-CSS and configuration options for SVG pages for details.
If the page URL includes a hash reference (a link to a particular
location within the page), MathJax v2.0 will jump to that location
after the page has finished typsetting. (Since the size of the page
may have changed due to the mathematical typsetting, that location may
no longer be visible on screen, so MathJax moves there when it is done
with the initial typesetting.) You can control this behavior with the
positionToHash
parameter in the main section of your
configuration. See the core configuration options page for details.
The TeX input jax now can be configured to add equation numbers
(though the default is not to number equations so that existing pages
will not change their appearance). This is controlled through the
equationNumbers
section of the TeX
block of your configuration
(see the equation numbering section for
details). You can request that the numbering follow the AMS-style
numbering of environments, or you can request that every displayed
equation be numbered. There are now \label
, \ref
, and
\eqref
commands to make it easier to link to particular equations
within the document.
MathJax now implements the MathML3 specification for automatic line
breaking of displayed equations in its HTML-CSS output. This is
disabled by default, but can be enabled via the linebreaks
section
of the HTML-CSS
or SVG
block of your configuration (see the
automatic line breaking section for
details). Note that automatic line breaking only applies to displayed
equations, not in-line equations, unless they are themselves longer
than a line. The algorithm uses the nesting depth, the type of
operator, the size of spaces, and other factors to decide on the
breakpoints, but it does not know the meaning of the mathematics, and
may not choose the optimal breakpoints. We will continue to work on
the algorithm as we gain information from its actual use in the field.
MathJax currently processes math in either TeX and LaTeX format, or MathML notation; version 2.0 augments that to include AsciiMath notation (see the ASCIIMathML home page for details on this format). This is a notation that is easier for students to use than TeX, and has been requested by the user community. See the AsciiMath support page for details.
In addition to the HTML-CSS and Native MathML output available in v1.1, MathJax v2.0 includes an SVG-based output jax. This should prove to be more reliable than the HTML-CSS output, as it avoids some CSS, web-font, and printing issues that the HTML-CSS output suffers from, and it currently has no browser-dependent code. The SVG mode even works in some ebook readers (like Apple iBooks and Calibre). See the output formats documentation for details.
Pre-defined configuration files that include the AsciiMath and SVG
processors are now available with MathJax v2.0. These include
AM_HTMLorMML
, TeX-AMS-MML_SVG
, and TeX-MML-AM_HTMLorMML
.
See the common configurations section for details.
Some issues surrounding the use of screen readers and their interaction with MathPlayer have been resolved in MathJax v2.0. In particular, there are additional menu items that allow the user finer control over some aspects of MathJax’s interface that were interfering with some screen readers’ ability to properly identify the mathematics. Several stability issues with MathPlayer have also been addressed. In Internet Explorer when MathPlayer is installed, there is now a new contextual menu item to allow you to specify what events are handled by MathJax and what should be handled by MathPlayer. This gives you finer control over MathPlayer’s interaction with some screen readers.
\ce
, \cf
, and \cee
macros)\cancel
, \bcancel
, \xcancel
, and \cancelto
macros)\color
work as a switch, as in LaTeX).
Adds \definecolor
, other color models, LaTeX named colors,
\colorbox
, \fcolorbox
, etc.\begingroup
and \endgroup
for isolating macro
declarations, and defines \let
, \renewenvironment
, \global
, and
\gdef
.<menclose>
elements.
Adds \enclose{type}[attributes]{math}
macro.<maction>
elements.
Adds \mathtip{math}{tip}
, \texttip{math}{tip}
, and
\toggle{math1}{math2}...\endtoggle
macros.\mmToken{type}[attributes]{text}
macro for producing <mo>
,
<mi>
, <mtext>
, and other token MathML elements directly.\bbox[color;attributes]{math}
macro to add background color,
padding, borders, etc.\middle
macro for stretchy delimiters between \left
and \right
.\label
, \ref
, and \eqref
macros for numbered equations.\not
so it produces proper MathML when possible.\dots
that selects \ldots
or \cdots
depending on the context.\cases
that automatically uses \text
on
the second entry in each row.\require
that only allows loading from
extensions directory.\newcomand
to provide a default parameter.\\
to take an optional argument that specifies additional
space between lines.\\
to be used anywhere (to force a line break), not just in
arrays.See the TeX support page for details on these extensions and macros.
<mtext>
elements to use the page font rather than MathJax
fonts (optionally). This is controlled by the mtextFontInerhit
configuration parameter for HTML-CSS and SVG output jax.DOMContentLoaded
event rather than the page onload
event (this allows the
mathematics to appear sooner).\cal
and other fonts.processClass
can now be
used to override the skipTags
to force a tag that is usually
skipped to have its contents be processed.MathJax.Hub.setRenderer()
function that can
be used to switch the current renderer. See the MathJax Hub
API documentation for details.The default renderer for Firefox has been changed from NativeMML to HTML-CSS (in those configurations that choose between the two). The only browser that defaults to NativeMML is now IE with MathPlayer installed. You can configure this to your liking using the MMLorHTML configuration options.
NativeMML output will now be selected in IE9 when MathPlayer is present (since IE9 was released the same day as MathJax v1.1a, and there had been problems with IE9 beta releases, we weren’t sure if MathPlayer would work with the official release, and so did not select NativeMML by default.)
The performance improvements in IE8 and IE9 now make it unnecessary
to use a <meta>
tag to force IE7 emulation mode. In fact IE9 in
IE9 standards mode now runs faster than IE9 in IE7 standards mode,
and IE8 in IE8 standards mode is comparable to IE8 in IE7 standards
mode. We now recommend that you use
<meta http-equiv="X-UA-Compatible" content="IE=edge">
to obtain the highest emulation mode available in IE, which will be the fastest one for MathJax 2.0.
The tex2jax preprocessor now balances braces when looking for the closing math delimiter. That allows expressions like
$y = x^2 \hbox{ when $x > 2$}$
to be properly parsed as a single math expression rather than two
separate ones with unbalanced braces. The old behavior can be
obtained by setting balanceBraces
to false in the tex2jax
block of your configuration. (See the tex2jax configuration
options for details.)
If you are hosting your own copy of MathJax on your server, and
that copy is being used from pages in a different domain, you will
have set up the access control paramters for the font directory to
allow Firefox to access the font files properly. Since MathJax 2.0
includes fonts in WOFF format, you will need to include woff
in
you access control declaration for the fonts. E.g., use
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
in the .htaccess` file for the ``Mathjax/fonts
directory if you
are using the Apache web server. See Notes about shared
installations for details.
The \cases
macro now properly places the second column in text
mode not math mode. In the past, one needed to use \text
in
the second column to achieve the proper results; pages that did
this will still work properly in v2.0. Pages that took advantage
of the math mode in the second column will need to be adjusted.
The \dots
macro now produces \ldots
or \cdots
depending
on the context (in the past, \dots
always produced \ldots
).
A one pixel padding has been added above and below HTML-CSS and SVG output so that math on successive lines of a paragraph won’t bump into each other.
There is a new MathPlayer submenu of the Math Settings menu in the MathJax contextual menu that allows the user to control what events are passed on to MathPlayer. This allows better control for those using assistive devices like screen readers. When menu events are being passed on to MathPlayer, the MathJax menu can be obtained by ALT-clicking on a typeset expression (so the user can still access MathJax’s other features).
In order to improve stability with IE when MathPlayer is installed,
MathJax now adds the namespace and object bindings that are needed
for MathPlayer at the time that Mathjax is first loaded, rather
than waiting for the NativeMML output jax to be loaded. Since
this is before the configuration information has been obtained,
this will happen regardless of whether the NativeMML output jax
is requested. This means that IE may ask the user to allow
MathPlayer to be used, and may show the MathPlayer splash dialog
even when MathPlayer is not in the end used by MathJax. Note that
this setup can only be performed if MathJax is loaded explicitly as
part of the initial web page; if it is injected into the page later
by adding a <script>
tag to the page dynamically, then
MathPlayer will be set up when the NativeMML jax is loaded as in
the past, and some stability issues may occur if events are passed
to MathPlayer.
The MathJax typesetting is now started on DOMContentLoaded
rather than at the page onload
event, when possible, so that
means MathJax may start typesetting the page earlier than in the
past. This should speed up typesetting one pages with lots of
images or side-bar content, for example.
MathJax now attempts to determine whether the page’s onload
event had already occurred, and if it has, it does not try to wait
for the DOMContentLoaded
or onload
event before doing its
initial typeset pass. This means that it is no longer necessary to
call MathJax.Hub.Startup.onload()
by hand if you insert MathJax
into the page dynamically (e.g., from a GreaseMonkey script).
If the page URL includes a hash reference (a link to a particular
location within the page), MathJax v2.0 will jump to that location
after the page has finished typsetting. Since the size of the page
may have changed due to the mathematical typsetting, that location
may no longer be visible on screen, so MathJax moves there when it
is done with the initial typesetting. You can control this
behavior with the positionToHash
parameter in the main section
of your configuration (see core configuration options).
In the event that MathJax is not able to load the configuration file
you have specified in the script tag that loads MathJax.js
via
config=filename
, it will no longer issue the warning message
about a missing configuration. The configuration process changed
in v1.1, and that message was to help page maintainers update their
configurations, but it turns out that for users with slow network
connections, MathJax could time out waiting for the configuration
file and would issue the warning message in that case, even though
the page included the proper configuration. That should no longer
occur in MathJax v2.0.
<mi>
rather than <mo>
for \sin
, \cos
, and other
such functions, for \mathop{\rm...}
and \operatorname
.⁡
after \mathop{}
and other macros that are
functions (e.g., \sin
).MathJax_Preview
style has been moved from HTML-CSS/jax.js
to
MathJax.js
, since it is common to all output.\boldsymbol
rather than
\bf
so that it will affect more characters.mu
’s be relative to the scriptlevel (as they
are supposed to be).\unicode{}
, or
otherwise outside of the fonts known to MathJax.\it
rather than the math italics, so
spacing is better.href
attributes better, especially when on <math>
elements.\sqrt\frac{}{}
without producing an error.<mo>
contents to the output jax so that the
original contents aren’t changed.mathvariant
with fontstyle
or fontweight
(as per the MathML specification).\cong
in MathJax web fonts .\widehat
and \widetilde
mu
’s are used in TeX input.TagSide
is set to right
.MathJax.Hub.getJaxFor()
and MathJax.Hub.isJax()
to
properly handle elements that are part of an output jax’s output
(in particular, you can find the element jax from any DOM element
in the output).<mspace>
with a background color would not
always overlay previous items.<mspace>
elements being too tall in
IE/quirks mode.<mtable>
with equalrows="true"
would
not produce equal height rows.<mpadded>
background color to be specified exactly (i.e.,
without the 1px padding) when one of its dimensions is given
explicitly (or there is no content).\unicode
bug with font names that include spaces.xmlns:xlink
becomes xlink
with no namespace, which confuses the XML parsers.MathJax.Message.Set()
and MathJax.Message.Clear()
so
that a delay of 0 is properly handled.\bmod
, \mod
, and \pmod
.\thickapprox
to use the correct glyph in HTML-CSS output
with MathJax web fonts.<mstyle>
elements.\:
space..
on \genfrac
(it was accidentally rejected).\cs{*}
no longer
counts as \cs*
).<annotation-xml>
to use the proper scaling in HTML-CSS
output.\mathchoice
when the contents have
negative width.<mo>
elements that have
different variants, styles, classes, or id’s.scriptlevel
when <munderover>
has base with
movablelimits="true"
in non-display mode.SimpleSUPER
.<mprescript>
tag.<mo>
in some
circumstances in HTML-CSS output.\ulcorner
, etc. use more approprate unicode positions, and remap
those positions to the locations in the MathJax web fonts.\ref
macro.Font Preference
menu honor the imageFont
setting.previewFilter
in all preprocessors.^
and _
be stretchy even though that isn’t in the W3C
dictionary.Find()
and IndexOf()
commands to menus to locate menu items.isMathJax
, so it can be used to identify
what elements are part of mathematical output.Begin Styles
message
before inserting their styles so when they are included in the
combined files, the author can still configure them.texError
when it is one (to
make it easier to recognize).Update()
method ask ElementJax to determine if it needs updating
(which in turn asks the associated input jax).Remove()
work for just clearing output (without detaching) if
desired.Hub.config
to
Hub itself (they are not user configurable through Hub.Config
, and so
even though they are configurations, they don’t belong there).OP
not ORD
to get spacing
right.MathJax.HTML.getScript()
to get the contents of a script (needed
since it works differently in different browsers).\text{}
,
\hbox{}
, \href{}
, etc.).xmlns
entries on the <html>
element).