|
| 1 | +.. _whats-new-3.2: |
| 2 | + |
| 3 | +########################## |
| 4 | +What's New in MathJax v3.2 |
| 5 | +########################## |
| 6 | + |
| 7 | +Version 3.2 includes a number of new features, as well as bug fixes |
| 8 | +for several issues with version 3.1. The new features are described |
| 9 | +below. |
| 10 | + |
| 11 | +* :ref:`v3.2-lazy-typesetting` |
| 12 | +* :ref:`v3.2-css-updates` |
| 13 | +* :ref:`v3.2-tex-packages` |
| 14 | +* :ref:`v3.2-mml3` |
| 15 | +* :ref:`v3.2-hindi` |
| 16 | +* :ref:`v3.2-other` |
| 17 | + |
| 18 | +.. |
| 19 | +
|
| 20 | +* :ref:`v3.2-breaking` |
| 21 | + |
| 22 | + |
| 23 | +See also the `release notes |
| 24 | +<https://github.com/mathjax/MathJax-src/releases/tag/3.2.0#bugs>`__ |
| 25 | +for the list of bugs that have been fixed in version 3.2. |
| 26 | + |
| 27 | + |
| 28 | +------ |
| 29 | + |
| 30 | +.. _v3.2-lazy-typesetting: |
| 31 | + |
| 32 | +Lazy Typesetting |
| 33 | +================ |
| 34 | + |
| 35 | +Although MathJax version 3 is already an order of magnitude faster |
| 36 | +than version 2, with version 3.2 we offer a new extension that is |
| 37 | +designed to make pages with large numbers of equations perform even |
| 38 | +better. It implements a "lazy typesetting" approach that only |
| 39 | +typesets an expression when it comes into view, which means that |
| 40 | +expressions will not be typeset when they are not visible. Your |
| 41 | +readers will not have to wait for the entire document to typeset, |
| 42 | +which can speed up their initial view of the page. Furthermore, any |
| 43 | +expressions that are never seen will not be typeset. This also helps |
| 44 | +with the situation where you may link to a particular location in your |
| 45 | +page (via a URL with a hash); in version 2, typesetting the material |
| 46 | +above that point can cause the browser to change the scroll position, |
| 47 | +and so the user may not end up at the proper location in the page. |
| 48 | +With the lazy extension, the material above that point is not typeset |
| 49 | +until the user scrolls upwards, and so there is no position change. |
| 50 | + |
| 51 | +Lazy typesetting works best with SVG output, but changes (discussed |
| 52 | +below) with the way the CommonHTML output handles its stylesheet |
| 53 | +updates make the CHTML output nearly as fast. With TeX input, the |
| 54 | +lazy extension makes sure that previous expressions are processed by |
| 55 | +TeX (though not output to the page) so that any macro definitions or |
| 56 | +automatic equation numbers are in place when the visible expressions |
| 57 | +are processed. Currently, documents that contain ``\ref`` or ``\eqref`` |
| 58 | +links may not yet work properly, since target equations may not have |
| 59 | +been typeset, and so the link location may not be marked in the |
| 60 | +document. In particular, forward references are unlikely to work, and |
| 61 | +backward references will work only if the target expression has |
| 62 | +already been typeset. We hope to improve this situation in a future |
| 63 | +release. |
| 64 | + |
| 65 | +See the :ref:`lazy-typesetting` documentation for information on how |
| 66 | +to configure MathJax to use this new feature. |
| 67 | + |
| 68 | +----- |
| 69 | + |
| 70 | +.. _v3.2-css-updates: |
| 71 | + |
| 72 | +CSS Updates |
| 73 | +=========== |
| 74 | + |
| 75 | +MathJax's CHTML output handles the characters that appear in the math |
| 76 | +on the page by storing information about their bounding boxes and text |
| 77 | +content in a CSS stylesheet. When additional math is typeset, this |
| 78 | +stylesheet may need to be updated, and in previous versions, MathJax |
| 79 | +would replace the entire stylesheet with a new one. This can cause |
| 80 | +visual flashing, and can be expensive as the browser must re-evaluate |
| 81 | +all the rules and apply them again. In version 3.2, the CHTML output |
| 82 | +now adds rules to the stylesheet individually, so the older rules are |
| 83 | +not replaced, and only the new rules must be evaluated and applied. |
| 84 | +This makes updates must faster, and is of particular benefit to the |
| 85 | +lazy-typesetting extension described above, as the page can be updated |
| 86 | +many times as equations scroll into view. This change makes the CHTML |
| 87 | +output work almost as smoothly as SVG output with the lazy extension. |
| 88 | + |
| 89 | +----- |
| 90 | + |
| 91 | +.. _v3.2-tex-packages: |
| 92 | + |
| 93 | +New TeX Packages |
| 94 | +================ |
| 95 | + |
| 96 | +Version 3.2 includes nine new TeX extension packages: |
| 97 | + |
| 98 | +* :ref:`tex-cases` — provides environments for individually numbered cases. |
| 99 | +* :ref:`tex-centernot` — implements a centered `\not` command (and a non-standard `\centerOver` that places one symbol centered on top of another). |
| 100 | +* :ref:`tex-colortbl` — provides macros for coloring cells of an array or alignment. |
| 101 | +* :ref:`tex-empheq` — an environment for placing material to the left or right of an alignment that has individual equation numbers. |
| 102 | +* :ref:`tex-gensymb` — provides macros for some specific units. |
| 103 | +* :ref:`tex-mathtools` — offers a range of macros and environments for advanced mathematical typesetting. |
| 104 | +* :ref:`tex-setoptions` — provides the ability to change some TeX input jax options from within an expression (e.g., to change the tag side). |
| 105 | +* :ref:`tex-textcomp` — provides a range of macros for specifying various text characters. |
| 106 | +* :ref:`tex-upgreek` — provides macros for upright Greek characters. |
| 107 | + |
| 108 | +These are all included in the components that end in ``-full`` (and |
| 109 | +include the TeX input jax), and you can load individual ones as you |
| 110 | +would other tex packages. Note, however, that none of these are |
| 111 | +autoloaded, though you can configure the `autoload` extension to do |
| 112 | +so, if you wish. See the :ref:`tex-autoload` documentation for details. |
| 113 | + |
| 114 | +In addition to these new packages, some of the older packages have been updated: |
| 115 | + |
| 116 | +* The `ams` package now includes ``flalign``, ``xalign``, and ``xxalign`` |
| 117 | + environments. In addition, the ``multline`` extension has been made |
| 118 | + more compatible with actual LaTeX. In the past, ``multline`` was set |
| 119 | + to be 85% of the container width, but now it is set to 100%, but |
| 120 | + with a 1em indent on both sides; when there is a tag, the indent on |
| 121 | + the tag side is increased by the width of the tag, as is the case in |
| 122 | + LaTeX. The width was stored in the ``multlineWidth`` configuration |
| 123 | + option in the ``tex`` configuration block. That has now been moved to |
| 124 | + the ``ams`` block in the ``tex`` configuration, and there is a new |
| 125 | + ``multlineIndent`` value. These are set to ``100%`` and ``1em`` |
| 126 | + respectively. To obtain the old behavior, set them to ``85%`` and |
| 127 | + ``0``. Currently, if ``multlineWidth`` is found in the main ``tex`` |
| 128 | + option block, it will be moved to the ``ams`` block, but that |
| 129 | + backward-compatibility code will be removed in a future release. |
| 130 | + |
| 131 | +.. |
| 132 | +
|
| 133 | +* The `physics` package now implements all macros, even those that are |
| 134 | + not officially documented, but are nevertheless available in LaTeX. |
| 135 | + In addition, it now implements the ``italicdiff`` and ``arrowdel`` |
| 136 | + options. |
| 137 | + |
| 138 | +.. |
| 139 | +
|
| 140 | +* The following macros have been added to the indicated package: |
| 141 | + * ``\overunderset`` (ams) — a combination of ``\overset`` and ``\underset``. |
| 142 | + * ``\stackbin`` (ams) — similar to ``\stackrel`` but produces a symbol with the spacing of a binary operator. |
| 143 | + * ``\nonscript`` (base) — apply the following spacing only when in display and text styles. |
| 144 | + * ``\boxed`` (base) — puts a frame around an expression. |
| 145 | + * ``\framebox`` (base) — puts a frame around a text argument. |
| 146 | + * ``\ip``, ``\Bqty``, ``\qsince``, ``\Residue`` (physics) — originally missing from the physics package. |
| 147 | + |
| 148 | +----- |
| 149 | + |
| 150 | +.. _v3.2-mml3: |
| 151 | + |
| 152 | +MathML Extensions |
| 153 | +================= |
| 154 | + |
| 155 | +The MML3 extension from version 2 has been ported to version 3 and is |
| 156 | +available to be included when you load the MathML input jax. This |
| 157 | +extension implements the MathML3 elementary math tags (like ``<mstack>`` |
| 158 | +and ``<mlongdiv>``) using an XSLT transform to convert these tags into |
| 159 | +other presentation MathML tags that MathJax has implemented. This |
| 160 | +does a reasonable job for some constructs, and a poorer job for |
| 161 | +others, but it does make it possible to process elementary math within |
| 162 | +MathJax v3. This is an experimental extension as a stop-gap measure |
| 163 | +until these tags are fully implemented within core MathJax. |
| 164 | + |
| 165 | +See the :ref:`mathml-mml3` documentation for information on how to |
| 166 | +configure MathJax to use this new feature. |
| 167 | + |
| 168 | +----- |
| 169 | + |
| 170 | +.. _v3.2-hindi: |
| 171 | + |
| 172 | +Explorer Update |
| 173 | +=============== |
| 174 | + |
| 175 | +The Speech-Rule Engine (SRE) that underlies MathJax's assistive |
| 176 | +technology support has been updated to the most recent version |
| 177 | +(3.3.3). This includes support for the Hindi language, so that the |
| 178 | +expression explorer can generate speech in Hindi (as well as its other |
| 179 | +languages: English, French, German, Italian, Spanish, together with |
| 180 | +Braille support in Nemeth). |
| 181 | + |
| 182 | +See the `SRE release notes <https://github.com/zorkow/speech-rule-engine/releases>`__ for details. |
| 183 | + |
| 184 | +This release also ports the remaining missing features for the |
| 185 | +explorer to v3. This includes summarising expressions and navigation |
| 186 | +of tabular expressions, like matrices or equation systems. See the |
| 187 | +:ref:`keyboard command <special-keys>` documentation for details. |
| 188 | + |
| 189 | +----- |
| 190 | + |
| 191 | +.. _v3.2-other: |
| 192 | + |
| 193 | +Other New Features |
| 194 | +================== |
| 195 | + |
| 196 | +In addition to the major features listed above, there are some minor new features as well: |
| 197 | + |
| 198 | +* Packages can now be specified for the `textmacros` extension to the |
| 199 | + TeX input jax. This allows you to configure additional macros that |
| 200 | + can be processed within text mode. See the :ref:`tex-textmacros` |
| 201 | + documentation for details. |
| 202 | + |
| 203 | +.. |
| 204 | +
|
| 205 | +* Processing of raw Unicode characters in TeX input has been improved. |
| 206 | + In the past, nearly all non-ASCII characters would be placed within |
| 207 | + an ``<mo>`` element, which is not always the best tag to use. In |
| 208 | + version 3.2, processing of raw Unicode characters is more nuanced, |
| 209 | + so that letters are placed in ``<mi>`` elements and other symbols in |
| 210 | + ``<mo>``. For example, a literal Greek alpha (U+03B1) will produce |
| 211 | + ``<mi>α</mi>`` (which is what is generated by ``\alpha``) rather |
| 212 | + than ``<mo>α</mo>`` as in earlier versions. This should |
| 213 | + provide better results, though perhaps still not perfect in all |
| 214 | + cases. |
| 215 | + |
| 216 | +.. |
| 217 | +
|
| 218 | +* In the past, errors in the MathJax configuration options (such as an |
| 219 | + unknown option) would produce a fatal error and MathJax would not |
| 220 | + run. In version 3.2, such errors now produce non-fatal warnings |
| 221 | + instead, and MathJax will continue to process the remaining options |
| 222 | + (and then typeset the page). This means that changes to the options |
| 223 | + (like those described in the breaking changes section below) |
| 224 | + will not cause your pages to fail outright (though the old options |
| 225 | + will have no effect). You can configure MathJax to make such errors |
| 226 | + fatal again, if you wish, and you can provide a function that will |
| 227 | + be called when there is an option error so that you can more easily |
| 228 | + trap such errors and handle them yourself. See the :ref:`startup-options` |
| 229 | + for more details. |
| 230 | + |
| 231 | +.. |
| 232 | +
|
| 233 | +* The component loader uses a set of filters to convert a component |
| 234 | + specification (like ``[tex]/physics``) to the full URL for loading the |
| 235 | + extension. In the past, it was difficult to hook into that |
| 236 | + filtering mechanism, but in version 3.2, you can now configure |
| 237 | + additional filters for the loader. See the :ref:`loader-options` |
| 238 | + documentation for more details. |
| 239 | + |
| 240 | +----- |
| 241 | + |
| 242 | +.. _v3.2-breaking: |
| 243 | + |
| 244 | +Breaking Changes in this Release |
| 245 | +================================ |
| 246 | + |
| 247 | +Some of the changes made to the options to accommodate the updated |
| 248 | +speech-rule engine are potentially breaking changes, in that the |
| 249 | +previous options (``enrichSpeech``, ``a11y.locale``, ``a11y.speechRules``) |
| 250 | +are no longer valid options. Version 3.1.4 includes code to transfer |
| 251 | +the old options to their new locations, but that code has been removed |
| 252 | +in version 3.2. As errors in options are no longer fatal (unless you |
| 253 | +configure them to be), this change will no longer cause MathJax to |
| 254 | +fail, but will cause warning messages in the browser console, so look |
| 255 | +there for such error reports. |
| 256 | + |
| 257 | +Similarly, the code that automatically renames the older TeX package |
| 258 | +names to their current all-lower-case versions (e.g., ``configMacros`` |
| 259 | +to ``configmacros`` and ``colorV2`` to ``colorv2``) has been removed from |
| 260 | +version 3.2. If you are using old package names, you will need to |
| 261 | +update your configuration. This applies to ``\require{}`` macros that |
| 262 | +refer to the older names as well as their names in the ``loader`` |
| 263 | +section, the ``tex.packages`` array, and the ``tex.autoload`` block. |
| 264 | + |
| 265 | +Version 3.2 removes the ``matchFontHeight`` option for the SVG output |
| 266 | +jax, since it only applies to the CommonHTML output, but was |
| 267 | +previously allowed in the ``svg`` configuration block, while doing |
| 268 | +nothing. |
| 269 | + |
| 270 | +Version 3.2 removes of the ``toArray()`` method from the ``LinkedList`` |
| 271 | +class (and its subclasses), so any custom code that uses that should |
| 272 | +switch to using ``Array.from(...)`` around the list instead. |
| 273 | + |
| 274 | +Finally, the ``Box.ts`` and ``CssStyles.ts`` (and their associated ``.js`` |
| 275 | +files) have been moved from the ``output`` directories to the ``util`` |
| 276 | +directory. Compatibility files were placed in the original locations |
| 277 | +so that older code would continue to work, but these have been removed |
| 278 | +in v3.2, so you should modify any custom code that loads these files |
| 279 | +to obtain them from the ``util`` directory instead. |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | +|-----| |
0 commit comments