texlive[46240] Master/texmf-dist: unicode-math (7jan18)

commits+karl at tug.org commits+karl at tug.org
Mon Jan 8 00:46:58 CET 2018


Revision: 46240
          http://tug.org/svn/texlive?view=revision&revision=46240
Author:   karl
Date:     2018-01-08 00:46:58 +0100 (Mon, 08 Jan 2018)
Log Message:
-----------
unicode-math (7jan18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md
    trunk/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md
    trunk/Master/texmf-dist/doc/latex/unicode-math/README.md
    trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.pdf
    trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf
    trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins
    trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty
    trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex
    trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
    trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-legacyfontdimen.tex
    trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-main.tex
    trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-mathfontdimen.tex
    trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-nfsssummary.tex
    trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-stixextract.tex
    trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-style.tex
    trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.ltx
    trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math.ltx
    trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-example.ltx
    trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.ltx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx
    trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx

Removed Paths:
-------------
    trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex
    trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex
    trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex
    trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex
    trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex
    trunk/Master/texmf-dist/source/latex/unicode-math/um-doc.tex
    trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx
    trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx
    trunk/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx
    trunk/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx

Modified: trunk/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/CHANGES.md	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,6 +1,52 @@
 CHANGE HISTORY
 --------------
 
+- v0.8j (2018/01/07)
+
+  * NEW
+
+    * Numbers and latin letters in the fullwidth Unicode range are now supported
+      as aliases to their ASCII counterparts (#337).
+    * New commands `\(New|Renew)NegationCommand \foo` for defining custom negations
+      accessed via `\not\foo`.
+
+  * SYMBOLS
+
+    * `\typecolon` is now `\mathrel` instead of `\mathbin` (#360).
+    * New symbol `\mathhyphen` which acts like a ‘letter’ (#313).
+    * `\nabla` and `\partial` have corrected documentation (#257).
+    * The following legacy commands are listed as ‘unsupported’ and will result
+      in sensible error messages rather than the old behaviour of meaningless
+      output: `\arrowvert`, `\Arrowvert`, `\bracevert`. (#411).
+
+  * BUGS
+
+    * LuaTeX bug with shifted `\underbrace` when it contains accented symbols worked around (#391).
+    * When using the `range` feature, users commonly found they needed to call
+      `\setmathfont` a final time with the original font to ensure correct
+      formatting and correct selection of symbol alphabets. I hope the issues
+      that required this have now been corrected (#331, #387).
+    * If `\setmathfont` is called a second time in a document, it tries harder
+      to more properly reset the maths font setup for the new font (#224).
+    * Properly hard-coded the `\delcode` of the period to ensure `\left`/`\right`
+      behave correctly in all circumstances (#344, #351, #420).
+    * Correct `\mathrm` (etc.) situation when no fonts loaded explicitly by the user (#330).
+    * Various bug fixes to `\not` (#126, #343, #363)
+    * `\std at minus` & `\std at equal` now properly corrected (#332).
+    * Fix problem with infinite loop with `\cdots` when `amsmath` loaded after `unicode-math` (#227).
+    * If `\setmath(rm|sf|tt)` is called *before* loading `unicode-math`, the setting
+      is now remembered (#407).
+
+  * INTERNALS
+
+    * A number of improvements to efficiency when loading subsequent math fonts
+      using the `range` feature.
+    * No longer loads the `ucharcat` package.
+    * Test suite re-implemented for better portability and use with Travis CI.
+      See <https://travis-ci.org/wspr/unicode-math> for the up-to-date status
+      of whether the test suite is passing.
+
+
 - v0.8i (2017/11/18)
 
   * Many internal changes to support future work.

Modified: trunk/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/MANIFEST.md	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,77 +1,294 @@
 # Manifest for unicode-math
 
-This file is automatically generated with `texlua build.lua manifest`.
-Only ‘source’ files in the repository and derived files are included in this list;
-it does not include ‘generated’ files such as PDF.
+This file is a listing of all files considered to be part of this package.
+It is automatically generated with `texlua build.lua manifest`.
 
-## Source files
 
-* unimath-example.ltx
-* um-code-pkgopt.dtx
-* um-code-opening.dtx
-* unicode-math-code.ltx
-* um-code-usv.dtx
-* unicode-math.ltx
-* unimath-symbols.ltx
-* um-code-epilogue.dtx
-* unicode-math-table.tex
-* um-doc-style.tex
-* um-code-api.dtx
-* um-code-msg.dtx
-* um-doc.tex
-* um-doc-nfsssummary.tex
-* um-code-sscript.dtx
-* um-code-base.dtx
-* um-code-fontopt.dtx
-* um-code-fontparam.dtx
-* um-doc-mathfontdimen.tex
-* um-code-ui.dtx
-* um-code-mathmap.dtx
-* um-code-mathtext.dtx
-* um-doc-legacyfontdimen.tex
-* unicode-math.dtx
-* unicode-math.ins
-* um-code-primes.dtx
-* um-code-compat.dtx
-* um-code-alphabets.dtx
-* um-code-main.dtx
-* um-code-variables.dtx
-* um-doc-stixextract.tex
-* um-code-setchar.dtx
+## Repository manifest
 
-## Text and Documentation files
+The following groups list the files included in the development repository of the package.
+Files listed with a ‘†’ marker are included in the TDS but not CTAN files, and files listed
+with ‘‡’ are included in both.
 
-* README.md
-* CHANGES.md
+### Source files
 
-## Derived files
+These are source files for a number of purposes, including the `unpack` process which
+generates the installation files of the package. Additional files included here will also
+be installed for processing such as testing.
 
-* unicode-math-luatex.sty
-* unicode-math-xetex.sty
-* unicode-math.sty
+ | File                     | Flag | Description                                                                   |
+ | ---                      | ---  | ---                                                                           |
+ | unicode-math.dtx         | ‡    | Metadata for the package code, including files and versioning                 |
+ | um-code-base.dtx         | ‡    | Definition of unicode-math.sty, which splits and loads according to engine.   |
+ | um-code-opening.dtx      | ‡    | Assorted initialisation tasks, including some low-level function definitions. |
+ | um-code-variables.dtx    | ‡    | Declaration of all code-level variables used in the package.                  |
+ | um-code-api.dtx          | ‡    | The (underdeveloped) API to interface with the package internals.             |
+ | um-code-ui.dtx           | ‡    | The xparse user interface top-level definitions.                              |
+ | um-code-pkgopt.dtx       | ‡    | Package options.                                                              |
+ | um-code-msg.dtx          | ‡    | Definitions of error, warning, and log messages.                              |
+ | um-code-usv.dtx          | ‡    | Mapping of mathematical unicode slots for alphabets.                          |
+ | um-code-setchar.dtx      | ‡    | General assignment of maths symbols.                                          |
+ | um-code-mathtext.dtx     | ‡    | The "math text" commands such as `\mathbf` and co.                            |
+ | um-code-main.dtx         | ‡    | Definition of `\setmainfont`.                                                 |
+ | um-code-fontopt.dtx      | ‡    | Keyval for `\setmathfont`                                                     |
+ | um-code-fontparam.dtx    | ‡    | Cross-platform interface for font parameters                                  |
+ | um-code-mathmap.dtx      | ‡    | Setup of symbol alphabets.                                                    |
+ | um-code-sym-commands.dtx |      | Definition of "math symbol alphabet" commands such as `\symbf` and co.        |
+ | um-code-alphabets.dtx    | ‡    | Definitions for setting up the "math symbol alphabets".                       |
+ | um-code-epilogue.dtx     | ‡    | Assorted definitions to close up.                                             |
+ | um-code-primes.dtx       | ‡    | The definitions needed for the input of primes.                               |
+ | um-code-sscript.dtx      | ‡    | Setup for active chars needed to process subscript/superscript input chars.   |
+ | um-code-compat.dtx       | ‡    | Compatibility with 3rd party packages.                                        |
+ | um-code-amsmath.dtx      |      | Compatibility with amsmath.                                                   |
+ | unicode-math.ins         | ‡    | Docstrip installer.                                                           |
+ | unicode-math-table.tex   | ‡    | Source file of the math symbols.                                              |
 
-## Typeset documents
+### Typeset documentation source files
 
-* unicode-math.pdf
-* unimath-example.pdf
-* unicode-math-code.pdf
-* unimath-symbols.pdf
+These files are typeset using LaTeX to produce the PDF documentation for the package.
 
-## Checking-specific support files
+ | File                  | Flag | Description                                                      |
+ | ---                   | ---  | ---                                                              |
+ | unicode-math-code.ltx | ‡    | Typeset code.                                                    |
+ | unicode-math.ltx      | ‡    | User documentation.                                              |
+ | unimath-example.ltx   | ‡    | A minimal example file to demonstrate the package.               |
+ | unimath-symbols.ltx   | ‡    | Listing of Unicode mathematics symbols using a variety of fonts. |
 
-* umtest-preamble.tex
+### Documentation files
 
-## Test files
+These files form part of the documentation but are not typeset. Generally they will be
+additional input files for the typeset documentation files listed above.
 
-* mathit-symit.luatex.tlg
-* mathit-symit.xetex.tlg
-* fontname-log.luatex.tlg
-* mathit-symit-var.lvt
-* fontname-log.lvt
-* fontname-log.xetex.tlg
-* aaa-loading.luatex.tlg
-* mathit-symit.lvt
-* aaa-loading.lvt
-* mathit-symit-var.luatex.tlg
-* mathit-symit-var.xetex.tlg
-* aaa-loading.xetex.tlg
+ 1. um-doc-style.tex ‡
+ 2. um-doc-main.tex ‡
+ 3. um-doc-stixextract.tex ‡
+ 4. um-doc-nfsssummary.tex ‡
+ 5. um-doc-legacyfontdimen.tex ‡
+ 6. um-doc-mathfontdimen.tex ‡
+
+### Text files
+
+Plain text files included as documentation or metadata.
+
+ 1. CHANGES.md ‡
+ 2. MANIFEST.md ‡
+ 3. README.md ‡
+ 4. LICENSE 
+
+### Derived files
+
+The files created by ‘unpacking’ the package sources. This typically includes
+`.sty` and `.cls` files created from DocStrip `.dtx` files.
+
+ 1. unicode-math-luatex.sty †
+ 2. unicode-math-xetex.sty †
+ 3. unicode-math.sty †
+
+### Typeset documents
+
+The output files (PDF, essentially) from typesetting the various source, demo,
+etc., package files.
+
+ 1. unicode-math-code.pdf ‡
+ 2. unicode-math.pdf ‡
+ 3. unimath-example.pdf ‡
+ 4. unimath-symbols.pdf ‡
+
+### Checking-specific support files
+
+Support files for checking the test suite.
+
+ 1. umtest-preamble.tex 
+
+### Test files
+
+These files form the test suite for the package. `.lvt` or `.lte` files are the individual
+unit tests, and `.tlg` are the stored output for ensuring changes to the package produce
+the same output. These output files are sometimes shared and sometime specific for
+different engines (pdfTeX, XeTeX, LuaTeX, etc.).
+
+ 1. Bbbit.lvt 
+ 2. aaa-loading.lvt 
+ 3. active-frac.lvt 
+ 4. active-sscripts-amsmath.lvt 
+ 5. active-sscripts.lvt 
+ 6. amsmath-sqrt-exec.lvt 
+ 7. amsmath-sqrt-output.lvt 
+ 8. ascii-catcodes.lvt 
+ 9. fontname-log.lvt 
+10. hyphen.lvt 
+11. input-fullwidth.lvt 
+12. lmdefault-mathrm-it-bf.lvt 
+13. mathit-symit-var.lvt 
+14. mathit-symit.lvt 
+15. mathsizes.lvt 
+16. nabla.lvt 
+17. not.lvt 
+18. operatorname.lvt 
+19. partial.lvt 
+20. range-char-cmd.lvt 
+21. range-class.lvt 
+22. range-up-num.lvt 
+23. setmathsf.lvt 
+24. sqrt-exec.lvt 
+25. sqrt-output.lvt 
+26. Bbbit.luatex.tlg 
+27. Bbbit.xetex.tlg 
+28. aaa-loading.luatex.tlg 
+29. aaa-loading.xetex.tlg 
+30. active-frac.luatex.tlg 
+31. active-frac.xetex.tlg 
+32. active-sscripts-amsmath.luatex.tlg 
+33. active-sscripts-amsmath.xetex.tlg 
+34. active-sscripts.luatex.tlg 
+35. active-sscripts.xetex.tlg 
+36. amsmath-sqrt-exec.luatex.tlg 
+37. amsmath-sqrt-exec.xetex.tlg 
+38. amsmath-sqrt-output.luatex.tlg 
+39. amsmath-sqrt-output.xetex.tlg 
+40. ascii-catcodes.luatex.tlg 
+41. ascii-catcodes.xetex.tlg 
+42. fontname-log.luatex.tlg 
+43. fontname-log.xetex.tlg 
+44. hyphen.luatex.tlg 
+45. hyphen.xetex.tlg 
+46. input-fullwidth.luatex.tlg 
+47. input-fullwidth.xetex.tlg 
+48. lmdefault-mathrm-it-bf.luatex.tlg 
+49. lmdefault-mathrm-it-bf.xetex.tlg 
+50. mathit-symit-var.luatex.tlg 
+51. mathit-symit-var.xetex.tlg 
+52. mathit-symit.luatex.tlg 
+53. mathit-symit.xetex.tlg 
+54. mathsizes.luatex.tlg 
+55. mathsizes.xetex.tlg 
+56. nabla.luatex.tlg 
+57. nabla.xetex.tlg 
+58. not.luatex.tlg 
+59. not.xetex.tlg 
+60. operatorname.luatex.tlg 
+61. operatorname.xetex.tlg 
+62. partial.luatex.tlg 
+63. partial.xetex.tlg 
+64. range-char-cmd.luatex.tlg 
+65. range-char-cmd.xetex.tlg 
+66. range-class.luatex.tlg 
+67. range-class.xetex.tlg 
+68. range-up-num.luatex.tlg 
+69. range-up-num.xetex.tlg 
+70. setmathsf.luatex.tlg 
+71. setmathsf.xetex.tlg 
+72. sqrt-exec.luatex.tlg 
+73. sqrt-exec.xetex.tlg 
+74. sqrt-output.luatex.tlg 
+75. sqrt-output.xetex.tlg 
+
+
+## TDS manifest
+
+The following groups list the files included in the TeX Directory Structure used to install
+the package into a TeX distribution.
+
+### Source files (TDS)
+
+All files included in the `unicode-math/source` directory.
+
+ 1. um-code-alphabets.dtx 
+ 2. um-code-api.dtx 
+ 3. um-code-base.dtx 
+ 4. um-code-compat.dtx 
+ 5. um-code-epilogue.dtx 
+ 6. um-code-fontopt.dtx 
+ 7. um-code-fontparam.dtx 
+ 8. um-code-main.dtx 
+ 9. um-code-mathmap.dtx 
+10. um-code-mathtext.dtx 
+11. um-code-msg.dtx 
+12. um-code-opening.dtx 
+13. um-code-pkgopt.dtx 
+14. um-code-primes.dtx 
+15. um-code-setchar.dtx 
+16. um-code-sscript.dtx 
+17. um-code-ui.dtx 
+18. um-code-usv.dtx 
+19. um-code-variables.dtx 
+20. unicode-math.dtx 
+21. unicode-math.ins 
+
+### TeX files (TDS)
+
+All files included in the `unicode-math/tex` directory.
+
+ 1. unicode-math-luatex.sty 
+ 2. unicode-math-table.tex 
+ 3. unicode-math-xetex.sty 
+ 4. unicode-math.sty 
+
+### Doc files (TDS)
+
+All files included in the `unicode-math/doc` directory.
+
+ 1. CHANGES.md 
+ 2. MANIFEST.md 
+ 3. README.md 
+ 4. um-doc-legacyfontdimen.tex 
+ 5. um-doc-main.tex 
+ 6. um-doc-mathfontdimen.tex 
+ 7. um-doc-nfsssummary.tex 
+ 8. um-doc-stixextract.tex 
+ 9. um-doc-style.tex 
+10. unicode-math-code.ltx 
+11. unicode-math-code.pdf 
+12. unicode-math.ltx 
+13. unicode-math.pdf 
+14. unimath-example.ltx 
+15. unimath-example.pdf 
+16. unimath-symbols.ltx 
+17. unimath-symbols.pdf 
+
+
+## CTAN manifest
+
+The following group lists the files included in the CTAN package.
+
+### CTAN files
+
+ 1. CHANGES.md 
+ 2. MANIFEST.md 
+ 3. README.md 
+ 4. um-code-alphabets.dtx 
+ 5. um-code-api.dtx 
+ 6. um-code-base.dtx 
+ 7. um-code-compat.dtx 
+ 8. um-code-epilogue.dtx 
+ 9. um-code-fontopt.dtx 
+10. um-code-fontparam.dtx 
+11. um-code-main.dtx 
+12. um-code-mathmap.dtx 
+13. um-code-mathtext.dtx 
+14. um-code-msg.dtx 
+15. um-code-opening.dtx 
+16. um-code-pkgopt.dtx 
+17. um-code-primes.dtx 
+18. um-code-setchar.dtx 
+19. um-code-sscript.dtx 
+20. um-code-ui.dtx 
+21. um-code-usv.dtx 
+22. um-code-variables.dtx 
+23. um-doc-legacyfontdimen.tex 
+24. um-doc-main.tex 
+25. um-doc-mathfontdimen.tex 
+26. um-doc-nfsssummary.tex 
+27. um-doc-stixextract.tex 
+28. um-doc-style.tex 
+29. unicode-math-code.ltx 
+30. unicode-math-code.pdf 
+31. unicode-math-table.tex 
+32. unicode-math.dtx 
+33. unicode-math.ins 
+34. unicode-math.ltx 
+35. unicode-math.pdf 
+36. unimath-example.ltx 
+37. unimath-example.pdf 
+38. unimath-symbols.ltx 
+39. unimath-symbols.pdf 

Modified: trunk/Master/texmf-dist/doc/latex/unicode-math/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/README.md	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/README.md	2018-01-07 23:46:58 UTC (rev 46240)
@@ -52,7 +52,7 @@
 Please see the PDF documentation for full details. A simple beginning is:
 
     \usepackage{unicode-math}
-    \setmathfont{xits-math.otf}
+    \setmathfont{texgyrepagella-math.otf}
 
 Most LaTeX math should still work after this. (Let me know if it doesn't.)
 Furthermore, it will be in a different font.
@@ -61,12 +61,19 @@
 REQUIREMENTS
 ------------
 
-As well as running XeTeX or LuaTeX, this package requires recent versions of the `fontspec`, `expl3`, `xpackages`, `filehook`, `ucharcat`, and `lualatex-math` packages.
+As well as running XeTeX or LuaTeX, this package requires recent versions of the `fontspec`, `expl3`, `xpackages`, `filehook`, and `lualatex-math` packages.
 
 
-MAINTENANCE
------------
+THANKS
+------
 
+I write LaTeX code as a hobby and a passion, not as part of my day job.
+If you would like to say thanks, please consider a donation at: <https://www.patreon.com/wspr>
+
+
+DEVELOPMENT and MAINTENANCE
+---------------------------
+
 The current release version is available from CTAN:
 > <http://tug.ctan.org/pkg/unicode-math>
 
@@ -78,14 +85,10 @@
 
 See `CHANGES.md` for the complete listing of change history.
 
+Further information on the details surrounding the development of the package
+can be found in the `CONTRIBUTING.md` file in the Github repository.
 
-THANKS
-------
 
-I write LaTeX code as a hobby and a passion, not as part of my day job.
-If you would like to say thanks, please consider a donation at: <https://www.patreon.com/wspr>
-
-
 LICENCE
 -------
 
@@ -95,36 +98,4 @@
 
 [LPPL]: http://www.latex-project.org/lppl/
 
-This work is author-maintained and consists of the code files:
-
-- unicode-math.dtx,
-- unicode-math.ins,
-- um-code-*.dtx,
-- unicode-math-table.tex;
-
-the documentation files:
-
-- unicode-math.ltx,
-- unicode-math-code.ltx,
-- um-doc*.tex,
-- unimath-example.ltx,
-- unimath-symbols.ltx;
-
-the derived files:
-
-- unicode-math.lua,
-- unicode-math-xetex.sty,
-- unicode-math-luatex.sty,
-- unicode-math.sty;
-
-the compiled documentation files:
-
-- unicode-math.pdf,
-- unicode-math-code.pdf,
-- unimath-example.pdf,
-- unimath-symbols.pdf;
-
-and the test suite:
-
-- testfiles/support/umtest-preamble.tex,
-- testfiles/*.(lvt|tlg).
+This work is author-maintained and consists of the files listed in `MANIFEST.md`.

Added: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-legacyfontdimen.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-legacyfontdimen.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-legacyfontdimen.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,76 @@
+%%^^A%% um-doc-legacyfontdimen.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+\section{Legacy \TeX\ font dimensions}
+
+\centerline{%
+\begin{tabular}[t]{@{}lp{4cm}@{}}
+\toprule
+\multicolumn{2}{@{}c@{}}{Text fonts} \\
+\midrule
+$\phi_1$ & slant per pt                \\
+$\phi_2$ & interword space             \\
+$\phi_3$ & interword stretch           \\
+$\phi_4$ & interword shrink            \\
+$\phi_5$ & x-height                    \\
+$\phi_6$ & quad width                  \\
+$\phi_7$ & extra space                 \\
+$\phi_8$ & cap height (\XeTeX\ only)   \\
+\bottomrule
+\end{tabular}
+\quad
+\begin{tabular}[t]{@{}lp{4cm}@{}}
+\toprule
+\multicolumn{2}{@{}c@{}}{Maths font, \cs{fam}2} \\
+\midrule
+$\sigma_5$    & x height                    \\
+$\sigma_6$    & quad                        \\
+$\sigma_8$    & num1                        \\
+$\sigma_9$    & num2                        \\
+$\sigma_{10}$ & num3                        \\
+$\sigma_{11}$ & denom1                      \\
+$\sigma_{12}$ & denom2                      \\
+$\sigma_{13}$ & sup1                        \\
+$\sigma_{14}$ & sup2                        \\
+$\sigma_{15}$ & sup3                        \\
+$\sigma_{16}$ & sub1                        \\
+$\sigma_{17}$ & sub2                        \\
+$\sigma_{18}$ & sup drop                    \\
+$\sigma_{19}$ & sub drop                    \\
+$\sigma_{20}$ & delim1                      \\
+$\sigma_{21}$ & delim2                      \\
+$\sigma_{22}$ & axis height                 \\
+\bottomrule
+\end{tabular}
+\quad
+\begin{tabular}[t]{@{}lp{4cm}@{}}
+\toprule
+\multicolumn{2}{@{}c@{}}{Maths font, \cs{fam}3} \\
+\midrule
+$\xi_8$    & default rule thickness      \\
+$\xi_9$    & big op spacing1             \\
+$\xi_{10}$ & big op spacing2             \\
+$\xi_{11}$ & big op spacing3             \\
+$\xi_{12}$ & big op spacing4             \\
+$\xi_{13}$ & big op spacing5             \\
+\bottomrule
+\end{tabular}
+}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-legacyfontdimen.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-main.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-main.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-main.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,1207 @@
+%%^^A%% um-doc-main.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+\begin{abstract}
+\noindent
+This document describes the \pkg{unicode-math} package, which is
+intended as an implementation of Unicode
+maths for \LaTeX\ using the \XeTeX\ and Lua\TeX\ typesetting engines.
+With this package, changing maths fonts is as easy as changing
+text fonts --- and there are more and more maths fonts appearing now.
+Maths input can also be simplified with Unicode since literal glyphs may be
+entered instead of control sequences in your document source.
+
+The package provides support for both \XeTeX\ and Lua\TeX. The different
+engines provide differing levels of support for Unicode maths.
+Please let us know of any troubles.
+
+Alongside this documentation file, you should be able to find a minimal
+example demonstrating the use of the package,
+`\texttt{unimath-example.ltx}'. It also comes with a separate document,
+`\texttt{unimath-symbols.pdf}',
+containing a complete listing of mathematical symbols defined by
+\pkg{unicode-math}, including comparisons between different fonts.
+
+Finally, while the STIX fonts may be used with this package, accessing
+their alphabets in their `private user area' is not yet supported.
+(Of these additional alphabets there is a separate caligraphic design
+distinct to the script design already included.)
+Better support for the STIX fonts is planned for an upcoming revision of the
+package after any problems have been ironed out with the initial version.
+
+\end{abstract}
+
+\newpage
+\tableofcontents
+
+\clearpage
+\section{Introduction}
+
+This document describes the \pkg{unicode-math} package, which is an
+\emph{experimental} implementation of a macro to Unicode glyph encoding for
+mathematical characters.
+
+Users who desire to specify maths alphabets only (Greek and Latin letters,
+and Arabic numerals)
+may wish to use Andrew Moschou's \pkg{mathspec} package instead.
+(\XeTeX-only at time of writing.)
+
+\section{Acknowledgements}
+
+Many thanks to:
+Microsoft for developing the mathematics extension to OpenType as part of
+Microsoft Office~2007;
+Jonathan Kew for implementing Unicode math support in \XeTeX;
+Taco Hoekwater for implementing Unicode math support in \LuaTeX;
+Barbara Beeton for her prodigious effort compiling the definitive list of Unicode math
+glyphs and their \LaTeX\ names (inventing them where necessary), and also
+for her thoughtful replies to my sometimes incessant questions;
+Philipp Stephani for extending the package to support \LuaTeX.
+Ross Moore and Chris Rowley have provided moral and technical support
+from the very early days with great insight into the issues we face trying
+to extend and use \TeX\ in the future.
+Apostolos Syropoulos, Joel Salomon, Khaled Hosny, and Mariusz Wodzicki
+have been fantastic beta testers.
+
+\section{Getting started}
+
+Load \pkg{unicode-math} as a regular \LaTeX\ package. It should be loaded
+after any other maths or font-related package in case it needs to overwrite
+their definitions. Here's an example using the filename syntax to load the \TeX\ Gyre Pagella Math font: (this works for both \XeLaTeX\ and \LuaLaTeX)
+\begin{Verbatim}
+\usepackage{amsmath} % if desired
+\usepackage{unicode-math}
+\setmathfont{texgyrepagella-math.otf}
+\end{Verbatim}
+
+Once the package is loaded, traditional TFM-based maths fonts are no longer supported;
+you can only switch to a different OpenType maths font using the \cs{setmathfont} command.
+If you do not load an OpenType maths font before |\begin{document}|, Latin Modern Math (see above) will be loaded automatically.
+
+\subsection{New commands}
+\LaTeX, since the first version of \LaTeXe, changed the math group
+selection from, say, |{\bf x}| to |\mathbf{x}|. It introduced commands
+such as |\mathbf|, |\mathit|, |\mathsf|, |\mathtt| and |\mathcal|,
+besides |\mathnormal|.  This was not only done to maintain the analogy
+with |\textbf|, |\textit| and so on, but with the precise purpose of
+loading the needed math groups (or math families) on demand and not
+allocating them if not required by the document.
+
+The introduction of \pkg{unicode-math} posed new problems. For
+instance, there is a big difference between say |fit| as an operator
+name in boldface type and the product of three boldface variables.
+With legacy \TeX{} engines, |\mathbf{fit}| would use a ligature and
+the same would happen with the input |\mathbf{f}\mathbf{i}\mathbf{t}|.
+For the latter case, the user should probably use |\mathbf{f\/}|.
+
+However, there is another important point from a \emph{conceptual}
+point of view. A boldface variable name should be printed using the
+\emph{math font}, whereas a boldface operator name should be printed
+using the \emph{text font}. OpenType math fonts make this distinction
+feasible, because they contain several math alphabets. Of course a
+boldface text~`x' will not differ much (or at all) from a boldface
+math~`x', but this is not the point: they \emph{should} be considered
+different, because the former is |U+0078| in Unicode, the latter is
+|U+1D431|.
+
+It was clear that \emph{two} different commands are needed: one for using text boldface in math,
+one for using math boldface. Only the document's author can know
+whether one or the other is needed. The decision was to split off
+the two meanings with a command like |\mathbf| for the boldface text font
+in math and a command like |\symbf| (for the bold math font).
+
+The five new symbol font commands that behave in this way are: \cs{symup},
+\cs{symit}, \cs{symbf}, \cs{symsf}, and \cs{symit}.
+These commands switch to single-letter mathematical symbols
+(generally within the same OpenType font).
+
+The legacy \cs{math..} commands switch to text fonts that are set up to behave
+correctly in mathematics, and should be used for multi-letter identifiers.  These
+could be denoted `text math alphabets'; further details are discussed
+in \secref{mathselect}.  Additional similar `text math alphabet'
+commands can be defined using the \cs{setmathfontface} command
+discussed in \secref{mathselect}.  To control the behaviour of the
+default text math alphabet commands to behave in a
+backwards-compatible mode, see the package options described in
+\secref{textmathlegacy}.
+
+
+\begin{table}[t!]
+  \topcaption{New \pkg{unicode-math} commands which overlap with legacy
+  math commands. For new documents the \texttt{sym} versions are recommended.}
+  \tablabel{symvsmath}
+  \centering
+  \begin{tabular}[t]{ll}
+    \toprule
+    Command & Synonym \\
+    \midrule
+    \cs{symnormal}  & \cs{mathnormal} \\
+    \cs{symliteral} &                 \\
+    &  \\
+    &  \\
+    &  \\
+    \cs{symbb}      & \cs{mathbb}     \\
+    \cs{symbbit}    & \cs{mathbbit}   \\
+    \cs{symcal}     & \cs{mathcal}    \\
+    \cs{symscr}     & \cs{mathscr}    \\
+    \cs{symfrak}    & \cs{mathfrak}   \\
+    \cs{symsfup}    & \cs{mathsfup}   \\
+    \cs{symsfit}    & \cs{mathsfit}   \\
+    \bottomrule
+  \end{tabular}\qquad
+  \begin{tabular}[t]{ll}
+    \toprule
+    Command & Synonym \\
+    \midrule
+    &  \\
+    &  \\
+    \cs{symbfsf}    & \cs{mathbfsf}   \\
+    \cs{symbfup}    & \cs{mathbfup}   \\
+    \cs{symbfit}    & \cs{mathbfit}   \\
+    &  \\
+    &  \\
+    \cs{symbfcal}   & \cs{mathbfcal}  \\
+    \cs{symbfscr}   & \cs{mathbfscr}  \\
+    \cs{symbffrak}  & \cs{mathbffrak} \\
+    \cs{symbfsfup}  & \cs{mathbfsfup} \\
+    \cs{symbfsfit}  & \cs{mathbfsfit} \\
+    \bottomrule
+  \end{tabular}
+\end{table}
+
+In addition, \pkg{unicode-math} also provides a number of commands (such as
+|\symcal|) to select specific `symbol alphabets' within the unicode
+maths font, with usage, e.g., |$\symcal{G}$|${}\to\symcal{G}$.  The
+full listing is shown in \Tabref{symvsmath}.  For backwards
+compatibility, many of these are also defined with `familiar' synonyms
+such as |\mathcal|.  However, where possible the `sym' prefix
+commands should be preferred, as certain synonyms may become
+deprecated in time. The |\symliteral| command is described in
+\secref{math-style}.
+
+
+\subsection{Package options}
+Package options may be set when the package as loaded or at any later
+stage with the \cs{unimathsetup} command. Therefore, the following two
+examples are equivalent:
+\begin{Verbatim}
+\usepackage[math-style=TeX]{unicode-math}
+% OR
+\usepackage{unicode-math}
+\unimathsetup{math-style=TeX}
+\end{Verbatim}
+Note, however, that some package options affects how maths is initialised
+and changing an option such as |math-style| will not take effect until a
+new maths font is set up.
+
+Package options may \emph{also} be used when declaring new maths fonts,
+passed via options to the \cs{setmathfont} command.
+Therefore, the following two examples are equivalent:
+\begin{Verbatim}
+\unimathsetup{math-style=TeX}
+\setmathfont{texgyrepagella-math.otf}
+% OR
+\setmathfont{texgyrepagella-math.otf}[math-style=TeX]
+\end{Verbatim}
+
+A summary list of package options is shown in \tabref{pkgopt}.
+See following sections for more information.
+
+\begin{table}\centering
+  \topcaption{Package options.}
+  \tablabel{pkgopt}
+  \begin{tabular}{lll}
+    \toprule
+    Option & Description & See\dots \\
+    \midrule
+    |math-style| & Style of letters & \secref*{math-style} \\
+    |bold-style| & Style of bold letters & \secref*{bold-style} \\
+    |sans-style| & Style of sans serif letters & \secref*{sans-style} \\
+    |nabla|      & Style of the nabla symbol & \secref*{nabla} \\
+    |partial|    & Style of the partial symbol & \secref*{partial} \\
+    |colon| & Behaviour of \cs{colon} & \secref*{colon} \\
+    |slash-delimiter| & Glyph to use for `stretchy' slash & \secref*{slash-delimiter} \\
+    \bottomrule
+  \end{tabular}
+\end{table}
+
+
+\section{Unicode maths font setup}
+
+In the ideal case, a single Unicode font will contain all maths glyphs we
+need. The file |unicode-math-table.tex| (based on Barbara Beeton's \STIX\ table)
+provides the mapping between Unicode
+maths glyphs and macro names (all 3298 — or however many — of them!). A
+single command
+\codeline{\cmd\setmathfont\marg{font name}\oarg{font features}}
+implements this for every every symbol and alphabetic variant.
+That means |x| to $x$, |\xi| to $\xi$, |\leq| to $\leq$, etc., |\symscr{H}|
+to $\symscr{H}$ and so on, all for Unicode glyphs within a single font.
+
+This package deals well with Unicode characters for maths
+input. This includes using literal Greek letters in formulae,
+resolving to upright or italic depending on preference.
+
+Font features specific to \pkg{unicode-math} are shown in \tabref{mathfontfeatures}.
+Package options (see \tabref{pkgopt}) may also be used.
+Other \pkg{fontspec} features are also valid.
+
+\begin{table}\centering
+  \topcaption{Maths font options.}
+  \tablabel{mathfontfeatures}
+  \begin{tabular}{lll}
+    \toprule
+    Option & Description & See\dots \\
+    \midrule
+    |range| & Style of letters & \secref{range} \\
+    |script-font| & Font to use for sub- and super-scripts & \secref{sscript} \\
+    |script-features| & Font features for sub- and super-scripts & \secref{sscript} \\
+    |sscript-font| & Font to use for nested sub- and super-scripts & \secref{sscript} \\
+    |sscript-features| & Font features for nested sub- and super-scripts & \secref{sscript} \\
+    \bottomrule
+  \end{tabular}
+\end{table}
+
+\subsection{Using multiple fonts}
+\seclabel{range}
+
+There will probably be few cases where a single Unicode maths font suffices
+(simply due to glyph coverage). The \STIX\ font comes to mind as a
+possible exception. It will therefore be necessary to delegate specific
+Unicode ranges of glyphs to separate fonts:
+  \codeline{\cmd\setmathfont\marg{font name}|[range=|\meta{unicode range}|,|\meta{font features}|]|}
+where \meta{unicode range} is a comma-separated list of Unicode slot numbers and ranges such as |{"27D0-"27EB,"27FF,"295B-"297F}|.
+Note that \TeX's syntax for accessing the slot number of a character, such as |`\+|, will also work here.
+Only numerical slots can be used in ranged declarations.
+
+You may also use the macro for accessing the glyph, such as |range=|\cs{int}, or whole collection of symbols with the same math type, such as |range=\mathopen|, or complete math styles such as |range=\symbb| (or just |range=bb|).
+
+\subsubsection{Control over alphabet ranges}
+
+As discussed earlier, Unicode mathematics consists of a number of `alphabet styles' within a single font. In \pkg{unicode-math}, these ranges are indicated with the following (hopefully self-explanatory) labels:
+\begin{quote}\ttfamily
+\ExplSyntaxOn
+\clist_const:Nn \g__um_named_ranges_clist {
+up    ,
+it    ,
+bb    ,
+bbit  ,
+scr   ,
+cal   ,
+bfcal ,
+frak  ,
+tt    ,
+sfup  ,
+sfit  ,
+bfup  ,
+bfit  ,
+bfscr ,
+bffrak,
+bfsfup,
+bfsfit,
+}
+\clist_use:Nn \g__um_named_ranges_clist {\,,\,~}
+\ExplSyntaxOff
+\end{quote}
+Fonts can be selected (for predefined ranges only) using the following syntax, in which case all other maths font setup remains untouched:
+\begin{itemize}
+\item |[range=bb]| to use the font for `|bb|' letters only.
+\item |[range=bfsfit/{greek,Greek}]| for Greek lowercase and uppercase only (also with |latin|, |Latin|, |num| as possible options for Latin lower-/upper-case and numbers, resp.).
+\item |[range=up->sfup]| to map to different output styles.
+\end{itemize}
+
+A common request is to load numerals only from a specific font. This can be
+achieved with an option such as |range=up/{num}|.
+
+Note that `meta-styles' such as `|bf|' and `|sf|' are not included in the list above since they are context dependent. Use |[range=bfup]| and |[range=bfit]| to effect changes to the particular ranges selected by `|bf|' (and similarly for `|sf|').
+
+If a particular math style is not defined in the font, we fall back onto the lower-base plane (i.e., `upright') glyphs.
+Therefore, to use an \ascii-encoded fractur font, for example, write
+\begin{Verbatim}
+  \setmathfont{SomeFracturFont}[range=frak]
+\end{Verbatim}
+and because the math plane fractur glyphs will be missing, \pkg{unicode-math} will know to use the \ascii\ ones instead.
+If necessary this behaviour can be forced with |[range=frak->up]|, since the `|up|' range corresponds to \ascii\ letters.
+
+%If you wanted to swap the maths symbols with sans serif forms, it would be possible to write |[range={up->sfup,it->sfit}]|.
+%Note, however, that at present Unicode does not encode glyphs for sans serif Greek (\tabref{mathalphabets}).
+
+Users of the impressive Minion Math fonts (commercial) may use remapping to access the bold glyphs using:
+\begin{Verbatim}
+  \setmathfont{MinionMath-Regular.otf}
+  \setmathfont{MinionMath-Bold.otf}[range={bfup->up,bfit->it}]
+\end{Verbatim}
+To set up the complete range of optical sizes for these fonts, a font declaration such as the following may be used: (adjust may be desired according to the font size of the document)
+\begin{Verbatim}
+\setmathfont{Minion Math}[
+ SizeFeatures = {
+  {Size =      -6.01,  Font = MinionMath-Tiny},
+  {Size =  6.01-8.41,  Font = MinionMath-Capt},
+  {Size =  8.41-13.01, Font = MinionMath-Regular},
+  {Size = 13.01-19.91, Font = MinionMath-Subh},
+  {Size = 19.91-,      Font = MinionMath-Disp}
+ }]
+
+\setmathfont{Minion Math}[range = {bfup->up,bfit->it},
+ SizeFeatures = {
+  {Size =      -6.01,  Font = MinionMath-BoldTiny},
+  {Size =  6.01-8.41,  Font = MinionMath-BoldCapt},
+  {Size =  8.41-13.01, Font = MinionMath-Bold},
+  {Size = 13.01-19.91, Font = MinionMath-BoldSubh},
+  {Size = 19.91-,      Font = MinionMath-BoldDisp}
+ }]
+\end{Verbatim}
+
+
+\subsection{Script and scriptscript fonts/features}
+\seclabel{sscript}
+
+Cambria Math uses OpenType font features to activate smaller optical sizes
+for scriptsize and scriptscriptsize symbols (the $B$ and $C$, respectively,
+in $A_{B_C}$).
+Other typefaces (such as Minion Math) may use entirely separate font files.
+
+The features |script-font| and |sscript-font| allow alternate fonts to be
+selected for the script and scriptscript sizes, and |script-features| and
+|sscript-features| to apply different OpenType features to them.
+
+By default |script-features| is defined as |Style=MathScript| and |sscript-features| is |Style=MathScriptScript|.
+These correspond to the two levels of OpenType's |ssty| feature tag.
+If the |(s)script-features| options are specified manually, you must
+additionally specify the |Style| options as above.
+
+
+\subsection{Maths `versions'}
+
+\LaTeX\ uses a concept known as `maths versions' to switch math fonts
+mid-document.
+This is useful because it is more efficient than loading a complete maths
+font from scratch every time---especially with thousands of glyphs in the case of Unicode maths!
+The canonical example for maths versions is to select a `bold' maths font
+which might be suitable for section headings, say.
+(Not everyone agrees with this typesetting choice, though; be careful.)
+
+To select a new maths font in a particular version, use the syntax
+  \codeline{\cmd\setmathfont\marg{font name}|[version=|\meta{version name}|,|\meta{font features}|]|}
+and to switch between maths versions mid-document use the standard \LaTeX\ command
+\cmd\mathversion\marg{version name}.
+
+Note there are currently open issues regarding the interaction between the |version|
+and the |range| features, so please proceed with caution.
+
+\subsection{Legacy maths `alphabet' commands}
+\seclabel{mathselect}
+
+\LaTeX\ traditionally uses \cs{DeclareMathAlphabet} and \cs{SetMathAlphabet} to define document commands such as \cs{mathit}, \cs{mathbf}, and so on.
+While these commands can still be used, \pkg{unicode-math} defines a wrapper command to assist with the creation of new such maths alphabet commands.
+This command is known as \cs{setmathface} in symmetry with \pkg{fontspec}'s \cs{newfontface} command; it takes syntax:
+\begin{quote}
+  \cmd\setmathfontface\meta{command}\marg{font name}|[|\meta{font features}|]|
+
+  \makebox[0pt][l]{\cmd\setmathfontface\meta{command}\marg{font name}|[||version=|\meta{version name}|,|\meta{font features}|]|}
+\end{quote}
+For example, if you want to define a new legacy maths alphabet font \cs{mathittt}:
+\begin{verbatim}
+  \setmathfontface\mathittt{texgyrecursor-italic.otf}
+  ...
+  $\mathittt{foo} = \mathittt{a} + \mathittt{b}$
+\end{verbatim}
+
+
+\subsubsection{Default `text math' fonts}
+
+The five `text math' fonts, discussed above, are: \cs{mathrm}, \cs{mathbf}, \cs{mathit}, \cs{mathsf}, and \cs{mathtt}.
+These commands are also defined with their original definition under synonyms \cs{mathtextrm}, \cs{mathtextbf}, and so on.
+(These definitions hold regardless of package option, in case you need to be sure.)
+
+When selecting document fonts using \pkg{fontspec} commands such as \cs{setmainfont}, \pkg{unicode-math} inserts some additional code into \pkg{fontspec} that keeps the current default fonts `in sync' with their corresponding \cs{mathrm} commands, etc.
+
+For example, in standard \LaTeX, \cs{mathsf} doesn't change even if the main document font is changed using |\renewcommand\sfdefault{...}|. With \pkg{unicode-math} loaded, after writing |\setsansfont{Helvetica}|, \cs{mathsf} will now be set in Helvetica.
+
+If the \cs{mathsf} font is set explicitly at any time in the preamble, this `auto-following' does not occur. The legacy math font switches can be defined either with commands defined by \pkg{fontspec} (|\setmathrm|, |\setmathsf|, etc.) or using the more general |\setmathfontface\mathsf| interface defined by \pkg{unicode-math}.
+
+
+\subsubsection{Replacing `text math' fonts by symbols}
+\seclabel{textmathlegacy}
+
+For certain types of documents that use legacy input syntax, it may be preferable to have |\mathbf| behave as if it were |\symbf| en masse (et cetera respectively).
+A series of package options (\tabref{legacyfontswitch}) are provided to facilitate switching the definition of \cs{mathXYZ} for the five legacy text math font definitions.
+
+For example, if in a particular document |\mathbf| is used only for choosing symbols of vectors and matrices, a dedicated symbol font (|\symbf|) will produce better spacing and will better match the main math font.
+In that case loading |unicode-math| with the |mathbf=sym| will achieve the desired result.
+
+\begin{table}
+  \centering
+  \topcaption{Maths text font configuration options. Note that \cs{mathup} and \cs{mathrm} are aliases of each other and cannot be configured separately.}
+  \tablabel{legacyfontswitch}
+  \begin{tabular}{lll}
+    \toprule
+    Defaults (from `text' font) & From `maths symbols' \\
+    \midrule
+    |mathrm=text| &   |mathrm=sym |  \\
+    |mathup=text|\rlap{$^\ast$} &   |mathup=sym|{}\rlap{$^\ast$}  \\
+    |mathit=text| &   |mathit=sym |  \\
+    |mathsf=text| &   |mathsf=sym |  \\
+    |mathbf=text| &   |mathbf=sym |  \\
+    |mathtt=text| &   |mathtt=sym |  \\
+    \bottomrule
+  \end{tabular}
+\end{table}
+
+
+\subsubsection{Operator font}
+
+\LaTeX\ defines an internal command \cs{operator at font} for typesetting elements such as |\sin| and |\cos|.
+This font is selected from the legacy |operators| NFSS `MathAlphabet', which is no longer relevant in the context of \pkg{unicode-math}.
+By default, the \cs{operator at font} command is defined to switch to the \cs{mathrm} font.
+You may now change these using the command:
+\begin{Verbatim}
+\setoperatorfont\mathit
+\end{Verbatim}
+Or, to select a \pkg{unicode-math} range:
+\begin{Verbatim}
+\setoperatorfont\symscr
+\end{Verbatim}
+\setoperatorfont\symscr
+For example, after the latter above, |$\sin x$| will produce `$\sin x$'.
+
+\mathversion{normal}
+\setoperatorfont\mathrm
+
+
+\section{Maths input}
+
+\XeTeX's Unicode support allows maths input through two methods. Like
+classical \TeX, macros such as \cmd\alpha, \cmd\sum, \cmd\pm, \cmd\leq, and
+so on, provide verbose access to the entire repertoire of characters defined
+by Unicode. The literal characters themselves may be used instead, for more
+readable input files.
+
+\subsection{Math `style'}
+\seclabel{math-style}
+
+Classically, \TeX\ uses italic lowercase Greek letters and \emph{upright}
+uppercase Greek letters for variables in mathematics. This is contrary to
+the \textsc{iso} standards of using italic forms for both upper- and lowercase.
+Furthermore, in various historical contexts, often associated with French typesetting, it was common to use upright uppercase \emph{Latin} letters as well as upright
+upper- and lowercase Greek, but italic lowercase latin. Finally, it is not unknown to use upright letters
+for all characters, as seen in the Euler fonts.
+
+The \pkg{unicode-math} package accommodates these possibilities with the
+option \opt{math-style} that takes one of four (case sensitive) arguments:
+\opt{TeX}, \opt{ISO}, \opt{french}, or \opt{upright}.\footnote{Interface inspired by Walter Schmidt's \pkg{lucimatx} package.}
+The \opt{math-style} options' effects are shown in brief in \tabref{math-style}.
+
+The philosophy behind the interface to the mathematical symbols
+lies in \LaTeX's attempt of separating content and formatting. Because input
+source text may come from a variety of places, the upright and
+`mathematical' italic Latin and Greek alphabets are \emph{unified} from the
+point of view of having a specified meaning in the source text. That is, to
+get a mathematical ‘$x$’, either the \ascii\ (`keyboard') letter |x| may
+be typed, or the actual Unicode character may be used. Similarly for Greek
+letters. The upright or italic forms are then chosen based on the
+|math-style| package option.
+
+If glyphs are desired that do not map as per the package option (for
+example, an upright `g' is desired but typing |$g$| yields `$g$'),
+\emph{markup} is required to specify this; to follow from the example:
+|\symup{g}|.
+Maths style commands such as \cmd\symup\ are detailed later.
+
+For compatibility and consistency, however, upright and italic Greek letters
+can be `forced` using \verb|up| or \verb|it| prefixes before their names.
+For example, \cs{Gamma} will give an upright or italic Gamma depending on the
+\opt{math-style}, but \cs{upGamma} and \cs{itGamma} will always give upright
+or italic Gammas, respectively.
+
+\paragraph{`Literal' interface}
+Some may not like this convention of normalising their input.
+For them, an upright |x| is an upright `x' and that's that.
+(This will be the case when obtaining source text from copy/pasting PDF or
+Microsoft Word documents, for example.)
+For these users, the |literal| option to |math-style| will effect this behaviour.
+The \cs{symliteral}\marg{syms} command can also be used, regardless of package setting, to force the style to match the literal input characters.
+This is a `mirror' to \cs{symnormal}\marg{syms} (also alias \cs{mathnormal}) which `resets' the character mapping in its argument to that originally set up through package options.
+
+
+\begin{table}
+  \centering
+  \topcaption{Effects of the \opt{math-style} package option.}
+  \tablabel{math-style}
+  \begin{tabular}{@{}>{\ttfamily}lcc@{}}
+    \toprule
+      & \multicolumn{2}{c}{Example} \\
+       \cmidrule(l){2-3}
+      \rmfamily Package option & Latin & Greek \\
+    \midrule
+      math-style=ISO & $(a,z,B,X)$ & $\symit{(\alpha,\beta,\Gamma,\Xi)}$ \\
+      math-style=TeX & $(a,z,B,X)$ & $(\symit\alpha,\symit\beta,\symup\Gamma,\symup\Xi)$ \\
+      math-style=french & $(a,z,\symup B,\symup X)$ & $(\symup\alpha,\symup\beta,\symup\Gamma,\symup\Xi)$ \\
+      math-style=upright & $(\symup a,\symup z,\symup B,\symup X)$ & $(\symup\alpha,\symup\beta,\symup\Gamma,\symup\Xi)$ \\
+    \bottomrule
+  \end{tabular}
+\end{table}
+
+\paragraph{`Full-width' letters}
+Unicode contains `full-width' versions of ASCII from \unichar{FF01}.
+The numerals and latin letters in this range are defined by \pkg{unicode-math}
+to map to their standard ASCII counterparts, which are then controlled by the relevant \opt{math-style} setting.
+Other full-width symbols are not currently included but can be if there is sufficient need or desire.
+
+\subsection{Bold style}
+\seclabel{bold-style}
+
+Similar as in the previous section, ISO standards differ somewhat to \TeX's
+conventions (and classical typesetting) for `boldness' in mathematics. In
+the past, it has been customary to use bold \emph{upright} letters to denote
+things like vectors and matrices. For example, \( \symbfup{M} =
+(\mitM_x,\mitM_y,\mitM_z) \). Presumably, this was due to the relatively
+scarcity of bold italic fonts in the pre-digital typesetting era.
+It has been suggested by some that \emph{italic} bold symbols should be used nowadays instead, but this practise is certainly not widespread.
+
+Bold Greek letters have simply been bold variant glyphs of their regular
+weight, as in \( \mbfitxi = (\mitxi_\mitr,\mitxi_\mitphi,\mitxi_\mittheta)
+\).
+Confusingly, the syntax in \LaTeX\ traditionally has been different for obtaining `normal' bold symbols in Latin and Greek: \cmd\mathbf\ in the former (`$\symbfup{M}$'), and \cmd\bm\ (or
+\cmd\boldsymbol, deprecated) in the latter (`$\mbfitxi$').
+
+In \pkg{unicode-math}, the \cmd\symbf\ command works directly with both
+Greek and Latin maths characters and depending on package option
+either switches to upright for Latin letters (|bold-style=TeX|) as well or
+keeps them italic (|bold-style=ISO|).
+To match the package options for non-bold characters, with option
+|bold-style=upright| all bold characters are upright, and
+|bold-style=literal| does not change the upright/italic shape of the letter.
+The \opt{bold-style} options' effects are shown in brief in \tabref{bold-style}.
+
+Upright and italic bold mathematical letters input as direct Unicode
+characters are normalised with the same rules. For example, with
+|bold-style=TeX|, a literal bold italic latin character will be typeset
+upright.
+
+Note that \opt{bold-style} is independent of \opt{math-style}, although if
+the former is not specified then matching defaults are chosen based on the
+latter.
+
+\begin{table}
+  \centering
+  \topcaption{Effects of the \opt{bold-style} package option.}
+  \tablabel{bold-style}
+  \begin{tabular}{@{}>{\ttfamily}lcc@{}}
+    \toprule
+      & \multicolumn{2}{c}{Example} \\
+       \cmidrule(l){2-3}
+      \rmfamily Package option & Latin & Greek \\
+    \midrule
+      bold-style=ISO & $(\symbfit a, \symbfit z, \symbfit B, \symbfit X)$ & $(\symbfit\alpha, \symbfit\beta, \symbfit\Gamma, \symbfit\Xi)$ \\
+      bold-style=TeX & $(\symbfup a,\symbfup z,\symbfup B,\symbfup X)$ & $(\symbfit\alpha, \symbfit\beta,\symbfup \Gamma,\symbfup \Xi)$ \\
+      bold-style=upright & $(\symbfup a,\symbfup z,\symbfup B,\symbfup X)$ & $(\symbfup \alpha,\symbfup \beta,\symbfup \Gamma,\symbfup \Xi)$ \\
+    \bottomrule
+  \end{tabular}
+\end{table}
+
+
+\subsection{Sans serif style}
+\seclabel{sans-style}
+
+Unicode contains upright and italic, medium and bold mathematical style characters.
+These may be explicitly selected with the \cs{symsfup}, \cs{symsfit}, \cs{symbfsfup}, and \cs{symbfsfit}
+commands discussed in \secref{all-math-alphabets}.
+
+How should the generic \cs{symsf} behave? Unlike bold, sans serif is used much more sparingly
+in mathematics. I've seen recommendations to typeset tensors in sans serif italic
+or sans serif italic bold (e.g., examples in the \pkg{isomath} and \pkg{mattens} packages).
+But \LaTeX's \cs{mathsf} is \textsl{upright} sans serif.
+
+Therefore, the package options |[sans-style=upright]| and |[sans-style=italic]| control the behaviour of \cs{symsf}.
+The |upright| style sets up the command to use upright sans serif, including Greek;
+the |italic| style switches to using italic in both Latin and Greek.
+In other words, this option simply changes the meaning of \cs{symsf} to either \cs{symsfup} or \cs{symsfit}, respectively.
+Please let me know if more granular control is necessary here.
+
+There is also a |[sans-style=literal]| setting, set automatically with |[math-style=literal]|, which retains the uprightness of the input characters used when selecting the sans serif output.
+
+\subsubsection{What about bold sans serif?}
+
+While you might want your bold upright and your sans serif italic, I don't believe you'd also want your bold sans serif upright (etc.).
+Therefore, bold sans serif follows from the setting for sans serif; it is completely independent of the setting for bold.
+
+In other words, \cs{symbfsf} is either \cs{symbfsfup} or \cs{symbfsfit} based on |[sans-style=upright]| or |[sans-style=italic]|, respectively. And \texttt{[sans-style = literal]} causes \cs{symbfsf} to retain the same italic or upright shape as the input, and turns it bold sans serif.
+
+N.B.: there is no medium-weight sans serif Greek range in Unicode.
+Therefore, |\symsf{\alpha}| does not make sense (it produces `$\symsf{\alpha}$'), while |\symbfsf{\alpha}| gives `$\symbfsfup{\alpha}$' or `$\symbfsfit{\alpha}$' according to the |sans-style|.
+
+\subsection{All (the rest) of the mathematical styles}
+\seclabel{all-math-alphabets}
+
+Unicode contains separate codepoints for most if not all variations of style
+shape one may wish to use in mathematical notation. The complete list is shown
+in \tabref{mathalphabets}. Some of these have been covered in the previous sections.
+
+The math font switching commands do not nest; therefore if you want
+sans serif bold, you must write |\symbfsf{...}| rather than |\symbf{\symsf{...}}|.
+This may change in the future.
+
+\begin{table}
+\caption{Mathematical styles defined in Unicode. Black dots indicate an style exists in the font specified; blue dots indicate shapes that should always be taken from the upright font even in the italic style. See main text for description of \cs{mathbbit}.}
+\tablabel{mathalphabets}
+\centering
+\def\Y{\textbullet}
+\def\M{\textcolor[rgb]{0.5,0.5,1}{\textbullet}}
+\begin{tabular}{@{} lll l ccc @{}}
+\toprule
+\multicolumn{3}{c}{Font} & & \multicolumn{3}{c}{Alphabet} \\
+\cmidrule(r){1-3}
+\cmidrule(l){5-7}
+Style & Shape & Series & Switch & Latin & Greek & Numerals \\
+\midrule
+Serif      & Upright & Normal & \cs{symup}     & \Y & \Y & \Y  \\
+           &         & Bold   & \cs{symbfup}   & \Y & \Y & \Y  \\
+           & Italic  & Normal & \cs{symit}     & \Y & \Y & \M  \\
+           &         & Bold   & \cs{symbfit}   & \Y & \Y & \M  \\
+Sans serif & Upright & Normal & \cs{symsfup}   & \Y &    & \Y  \\
+           & Italic  & Normal & \cs{symsfit}   & \Y &    & \M  \\
+           & Upright & Bold   & \cs{symbfsfup} & \Y & \Y & \Y  \\
+           & Italic  & Bold   & \cs{symbfsfit} & \Y & \Y & \M  \\
+Typewriter & Upright & Normal & \cs{symtt}     & \Y &    & \Y  \\
+Double-struck & Upright & Normal & \cs{symbb}     & \Y &    & \Y  \\
+              & Italic  & Normal & \cs{symbbit}   & \Y &    &  \\
+Script     & Upright & Normal & \cs{symscr}    & \Y &    &     \\
+           &         & Bold   & \cs{symbfscr}  & \Y &    &     \\
+Fraktur    & Upright & Normal & \cs{symfrak}   & \Y &    &     \\
+           &         & Bold   & \cs{symbffrac} & \Y &    &     \\
+\bottomrule
+\end{tabular}
+\end{table}
+
+\subsubsection{Scope of the functionality of the \cs{sym..} commands}
+
+The \cs{sym..} commands are designed to affect only the follow sets of input letters: numerals ($0$--$9$), Latin ($a$--$z$, $A$--$Z$), Greek ($\alpha$--$\omega$, $\Alpha$--$\Omega$,), and the \cs{partial} and \cs{nabla} symbols ($\partial$, $\nabla$).
+These are the only symbols for which Unicode defines separate codepoints with varying mathematical style.
+
+There is currently no scope for including other symbols in the \cs{sym..} commands, such as writing |\symbf{\int}| for a bold integral symbol.
+Therefore the commands provided by \pkg{unicode-math} should not be compared to those provided by the \pkg{bm} package.
+
+\subsubsection{Double-struck}
+
+The double-struck style (also known as `blackboard bold') consists of
+upright Latin letters $\{\symbb{a}$--$\symbb{z}$,$\symbb{A}$$\symbb{Z}\}$,
+numerals $\symbb{0}$--$\symbb{9}$, summation symbol $\symbb\sum$, and four
+Greek letters only: $\{\symbb{\gamma\pi\Gamma\Pi}\}$.
+
+While |\symbb{\sum}| does produce a double-struck summation symbol,
+its limits aren't properly aligned. Therefore,
+either the literal character or the control sequence \cs{Bbbsum} are
+recommended instead.
+
+There are also five Latin \emph{italic} double-struck letters: $\symbbit{Ddeij}$.
+These can be accessed (if not with their literal characters or control sequences)
+with the \cs{mathbbit} style switch, but note that only those five letters
+will give the expected output.
+
+\subsubsection{Caligraphic vs.\ Script variants}
+
+The Unicode maths encoding contains a style for `Script' letters,
+and while by default \cs{mathcal} and \cs{mathscr}
+are synonyms, there are some situations when a
+separate `Caligraphic' style is needed as well.
+
+If a font contains alternate glyphs for a separat caligraphic style,
+they can be selected explicitly as shown below.
+This feature is currently only supported by the XITS~Math font, where
+the caligraphic letters are accessed with the same glyph slots as the
+script letters but with the first stylistic set feature (|ss01|) applied.
+\begin{verbatim}
+  \setmathfont{xits-math.otf}[range={cal,bfcal},StylisticSet=1]
+\end{verbatim}
+An example is shown below.
+\begin{quote}
+\setmathfont{xits-math.otf}[range=scr]
+\setmathfont{xits-math.otf}[range=cal,StylisticSet=1]
+The Script style (\cs{mathscr}) in XITS Math is: $\symscr{ABCXYZ}$\par
+The Caligraphic style (\cs{mathcal}) in XITS Math is: $\symcal{ABCXYZ}$
+\end{quote}
+
+
+\subsection{Miscellanea}
+
+\subsubsection{Nabla}
+\seclabel{nabla}
+
+ The symbol $\nabla$ comes in the six forms shown in \tabref{nabla}.
+ We want an individual option to specify whether we want upright or italic
+ nabla by default (when either upright or italic nabla is used in the
+ source). \TeX\ classically uses an upright nabla, and \textsc{iso}
+ standards agree with this convention.
+ The package options |nabla=upright| (default) and
+ |nabla=italic| switch between the two choices, and |nabla=literal| respects
+ the shape of the input character.
+|nabla=literal| is activated automatically after |math-style=literal|.
+
+These settings are then inherited through \cmd\symbf; \cmd\symit\ and \cmd\symup\ can be used to force the shape of the nabla one way or the other.
+
+
+\begin{table}
+  \begin{minipage}[b]{0.49\textwidth}
+  \centering
+  \topcaption{The various forms of nabla.}
+  \tablabel{nabla}
+  \let \tmpshow\empty
+  \begin{tabular}{@{}llc@{}}
+    \toprule
+    \multicolumn{2}{@{}l}{Description} & Glyph \\
+    \cmidrule(r){1-2}\cmidrule(l){3-3}
+    Upright & Serif      & $\symup\nabla$     \\
+            & Bold serif & $\symbfup\nabla$   \\
+            & Bold sans  & $\symbfsfup\nabla$ \\
+    \cmidrule(lr){1-2}\cmidrule(lr){3-3}
+    Italic & Serif       & $\symit\nabla$     \\
+           & Bold serif  & $\symbfit\nabla$   \\
+           & Bold sans   & $\symbfsfit\nabla$ \\
+    \bottomrule
+  \end{tabular}
+  \end{minipage}\hfill
+  \begin{minipage}[b]{0.49\textwidth}
+  \centering
+  \topcaption{The partial differential.}
+  \tablabel{partial}
+  \begin{tabular}{@{}llc@{}}
+    \toprule
+    \multicolumn{2}{@{}l}{Description} & Glyph \\
+    \cmidrule(r){1-2}\cmidrule(l){3-3}
+    Regular   & Upright & $\symup\partial$     \\
+              & Italic  & $\symit\partial$     \\
+    Bold      & Upright & $\symbfup\partial$   \\
+              & Italic  & $\symbfit\partial$   \\
+    Sans bold & Upright & $\symbfsfup\partial$ \\
+              & Italic  & $\symbfsfit\partial$ \\
+    \bottomrule
+  \end{tabular}
+  \end{minipage}
+\end{table}
+
+
+\subsubsection{Partial}
+\seclabel{partial}
+
+The same logic as for nabla applies to the symbols \unichar{2202} partial differential and \unichar{1D715} math italic partial differential.
+However, in practice these symbols are often designed identically in an italic style.
+
+If the font you are using supports it, use the |partial=upright| or |partial=italic| (default) package options to specify
+which one you would like, or |partial=literal| to have the same character
+used in the output as was used for the input.
+|partial=literal| is activated following |math-style=literal|.
+
+See \tabref{partial} for the variations on the partial differential symbol.
+
+
+\subsubsection{Primes}
+
+Primes ($x'$) may be input in several ways. You may use any combination
+the \ascii\ straight quote (\texttt{\char`\'}) or the Unicode prime \unichar{2032}
+($'$); when multiple primes occur next to each other, they chain
+together to form double, triple, or quadruple primes if the font contains
+pre-drawn glyphs. The individual prime glyphs are accessed, as usual,
+with the \cs{prime} command, and the double-, triple-, and quadruple-prime
+glyphs are available with \cs{dprime}, \cs{trprime}, and \cs{qprime},
+respectively.
+
+If the font does not contain the pre-drawn glyphs or more than four primes
+are used, the single prime glyph is used multiple times with a negative
+kern to get the spacing right. There is no user interface to adjust this
+negative kern yet (because I haven't decided what it should look like);
+if you need to, write something like this:
+\begin{Verbatim}
+\ExplSyntaxOn
+\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }
+\ExplySyntaxOff
+\end{Verbatim}
+Backwards or reverse primes behave in exactly the same way; use the \ascii\
+back tick (\texttt{\char`\`}) or the Unicode reverse prime \unichar{2035}
+({\umfont\char"2035}).
+The command to access the backprime is \cs{backprime}, and
+multiple backwards primes can accessed with \cs{backdprime},
+\cs{backtrprime}, and \cs{backqprime}.
+
+In all cases above, no error checking is performed if you attempt to
+access a multi-prime glyph in a font that doesn't contain one. For this
+reason, it may be safer to write |x''''| instead of |x\qprime|
+in general.
+
+If you ever need to enter the straight quote |'| or the backtick |`| in
+maths mode, these glyphs can be accessed with \cs{mathstraightquote} and
+\cs{mathbacktick}.
+
+\subsubsection{Unicode subscripts and superscripts}
+
+You may, if you wish, use Unicode subscripts and superscripts in your
+source document. For basic expressions, the use of these characters
+can make the input more readable.
+Adjacent sub- or super-scripts will be concatenated into a single
+expression.
+
+The range of subscripts and superscripts supported by this package
+are shown in \figref{superscripts,subscripts}. Please request more if
+you think it is appropriate.
+
+\begin{figure}\centering
+\fbox{\fontspec{CharisSILR.ttf}\Large
+A
+^^^^2070 ^^^^00b9 ^^^^00b2 ^^^^00b3 ^^^^2074 ^^^^2075 ^^^^2076 ^^^^2077
+^^^^2078 ^^^^2079 ^^^^207a ^^^^207b ^^^^207c ^^^^207d ^^^^207e ^^^^2071
+^^^^207f ^^^^207f ^^^^02b0 ^^^^02b2 ^^^^02b3 ^^^^02b7 ^^^^02b8
+Z}
+\caption{
+  The Unicode superscripts supported as input characters.
+  These are the literal glyphs from Charis SIL,
+  not the output seen when used for maths input.
+  The `A' and `Z' are to provide context for the size and
+  location of the superscript glyphs.
+}
+\figlabel{superscripts}
+\end{figure}
+
+\begin{figure}\centering
+\fbox{\fontspec{CharisSILR.ttf}\Large
+A
+^^^^2080 ^^^^2081 ^^^^2082 ^^^^2083 ^^^^2084 ^^^^2085 ^^^^2086 ^^^^2087
+^^^^2088 ^^^^2089 ^^^^208a ^^^^208b ^^^^208c ^^^^208d ^^^^208e ^^^^2090
+^^^^2091 ^^^^1d62 ^^^^2092 ^^^^1d63 ^^^^1d64 ^^^^1d65 ^^^^2093 ^^^^1d66
+^^^^1d67 ^^^^1d68 ^^^^1d69 ^^^^1d6a
+Z}
+\caption{
+  The Unicode subscripts supported as input characters.
+  See note from \figref{superscripts}.
+}
+\figlabel{subscripts}
+\end{figure}
+
+\subsubsection{Colon}
+\seclabel{colon}
+
+The colon is one of the few confusing characters of Unicode maths.
+In \TeX, \texttt{:} is defined as a colon with relation spacing: `$a:b$'.
+While \cs{colon} is defined as a colon with punctuation spacing: `$a\colon b$'.
+
+In Unicode, \unichar{003A} {colon} is defined as a punctuation symbol,
+while \unichar{2236} {ratio} is the colon-like symbol used in mathematics to denote
+ratios and other things.
+
+This breaks the usual straightforward mapping from control sequence to Unicode input character
+to (the same) Unicode glyph.
+
+To preserve input compatibility, we remap the \ascii\ input character `\texttt{:}' to \unichar{2236}.
+Typing a literal \unichar{2236} char will result in the same output.
+If \pkg{amsmath} is loaded, then the definition of \cs{colon} is inherited from there
+(it looks like a punctuation colon with additional space around it).
+Otherwise, \cs{colon} is made to output a colon with \cs{mathpunct} spacing.
+
+The package option |colon=literal| forces \ascii\ input `|:|' to be printed as \cs{mathcolon} instead.
+
+
+\subsubsection{Slashes and backslashes}
+\seclabel{slash-delimiter}
+
+There are several slash-like symbols defined in Unicode. The complete list is shown in \tabref{slashes}.
+
+\begin{table}\centering
+\caption{Slashes and backslashes.}
+\tablabel{slashes}
+\begin{tabular}{@{}cl@{}cl@{}}
+\toprule
+Slot & Name & Glyph & Command  \\
+\midrule
+\unichar{002F} & \textsc{solidus}                 & \umfont \char"002F & \cs{slash} \\
+\unichar{2044} & \textsc{fraction slash}          & \umfont \char"2044 & \cs{fracslash} \\
+\unichar{2215} & \textsc{division slash}          & \umfont \char"2215 & \cs{divslash} \\
+\unichar{29F8} & \textsc{big solidus}             & \umfont \char"29F8 & \cs{xsol} \\
+\midrule
+\unichar{005C} & \textsc{reverse solidus}         & \umfont \char"005C & \cs{backslash} \\
+\unichar{2216} & \textsc{set minus}               & \umfont \char"2216 & \cs{smallsetminus} \\
+\unichar{29F5} & \textsc{reverse solidus operator}& \umfont \char"29F5 & \cs{setminus} \\
+\unichar{29F9} & \textsc{big reverse solidus}     & \umfont \char"29F9 & \cs{xbsol} \\
+\bottomrule
+\end{tabular}
+\end{table}
+
+In regular \LaTeX\ we can write \cs{left}\cs{slash}\dots\cs{right}\cs{backslash}
+and so on and obtain extensible delimiter-like symbols. Not all of the Unicode slashes
+are suitable for this (and do not have the font support to do it).
+
+\paragraph{Slash}
+
+Of \unichar{2044} {fraction slash}, TR25 says that it is:
+\begin{quote}
+\dots used to build up simple fractions in running text\dots
+however parsers of mathematical texts should be prepared to handle fraction slash
+when it is received from other sources.
+\end{quote}
+
+\unichar{2215} {division slash} should be used when division is represented
+without a built-up fraction; $\pi\approx22/7$, for example.
+
+\unichar{29F8} {big solidus} is a `big operator' (like $\sum$).
+
+\paragraph{Backslash}
+
+The \unichar{005C} {reverse solidus} character \cs{backslash} is used for denoting
+double cosets: $A\backslash B$. (So I'm led to believe.)
+It may be used as a `stretchy' delimiter if supported by the font.
+
+MathML uses \unichar{2216} {set minus} like this: $A\smallsetminus B$.\footnote{\S4.4.5.11 \url{http://www.w3.org/TR/MathML3/}}
+The \LaTeX\ command name \cs{smallsetminus} is used for backwards compatibility.
+
+Presumably, \unichar{29F5} {reverse solidus operator} is intended to
+be used in a similar way, but it could also (perhaps?) be used to
+represent `inverse division': $\pi\approx7\mathbin{\backslash}22$.^^A
+\footnote{This is valid syntax in the Octave and Matlab programming languages,
+in which it means matrix inverse pre-multiplication. I.e., $A\mathbin{\backslash} B\equiv A^{-1}B$.}
+The \LaTeX\ name for this character is \cs{setminus}.
+
+Finally, \unichar{29F9} {big reverse solidus} is a `big operator' (like $\sum$).
+
+\paragraph{How to use all of these things}
+
+Unfortunately, font support for the above characters/glyphs is rather inconsistent.
+In Cambria Math, the only slash that grows (say when writing
+\[
+\left.\left[\begin{array}{cc} a & b \\ c & d\end{array}\right]\middle\slash
+      \left[\begin{array}{cc} 1 & 1 \\ 1 & 0\end{array}\right] \right.\quad )
+\]
+is the \textsc{fraction slash}, which we just established above is
+sort of only supposed to be used in text.
+
+Of the above characters, the following are allowed to be used after
+\cs{left}, \cs{middle}, and \cs{right}:
+\begin{itemize}
+\item \cs{fracslash};
+\item \cs{slash}; and,
+\item \cs{backslash} (the only reverse slash).
+\end{itemize}
+
+However, we assume that there is only \emph{one} stretchy slash
+in the font; this is assumed by default to be \unichar{002F} {solidus}.
+Writing \cs{left/} or \cs{left}\cs{slash} or \cs{left}\cs{fracslash}
+will all result in the same stretchy delimiter being used.
+
+The delimiter used can be changed with the |slash-delimiter| package option.
+Allowed values are |ascii|, |frac|, and |div|, corresponding to the respective
+Unicode slots.
+
+For example: as mentioned above, Cambria Math's stretchy slash is
+\unichar{2044} {fraction slash}. When using Cambria Math, then
+\pkg{unicode-math} should be loaded with the |slash-delimiter=frac| option.
+(This should be a font option rather than a package option, but
+it will change soon.)
+
+\subsubsection{Behaviour of hyphens in mathematics}
+\seclabel{hyphen}
+
+Unicode defines the following related characters:
+\begin{itemize}
+\item \unichar{0002D}{hyphen-minus}
+\item \unichar{02212}{minus sign}
+\item \unichar{02010}{hyphen} (\cs{mathhyphen})
+\end{itemize}
+The first two of these characters in the input will all behave as the binary operator
+`minus sign'.
+The third is defined by \pkg{unicode-math} as a `math letter' for constructions
+like \verb|$R‐\text{Mod}$| ($R‐\text{Mod}$).
+If more control is needed surrounding these symbols, additional options can be added to the package;
+please get in touch if this is the case for you.
+
+
+\subsubsection{Growing and non-growing accents}
+\seclabel{growing-accents}
+
+There are a few accents for which \TeX\ has both non-growing and growing
+versions.  Among these are \cs{hat} and \cs{tilde}; the corresponding growing
+versions are called \cs{widehat} and \cs{widetilde}, respectively.
+
+Older versions of \XeTeX\ and \LuaTeX\ did not support this distinction,
+however, and \emph{all} accents there were growing automatically. (I.e.,
+\cs{hat} and \cs{widehat} are equivalent.) As of \LuaTeX\ v0.65 and \XeTeX\
+v0.9998, these wide/non-wide commands will again behave in their expected
+manner.
+
+
+\subsubsection{Negations and the \cs{not} command}
+\seclabel{negations}
+
+The \cs{not} command in classic \LaTeXe\ was a mathematical slash modifying glyph that allowed for `negating` maths symbols where pre-built glyphs were not available. While Unicode encodes a slot for this modifying slash, it is only well-supported in \LuaTeX\ and not in \XeTeX.
+
+To provide more flexibility, the \pkg{unicode-math} package defines \cs{not} to search for a predefined `negated' definitions for its argument and use that if available. This method can be used for fine-tuning in cases where spacing needs to be adjusted.
+
+A `negated definition` is any symbol command prefixed by either \verb|n| or \verb|not|. For example, \pkg{unicode-math} by default defines both \cs{leftarrow} ($\leftarrow$) and \cs{nleftarrow} ($\nleftarrow$).
+
+To define custom negated definitions for either symbols (e.g., \verb|\not=|) or commands (e.g., \verb|\not\equal|), use the \cs{NewNotCommand}\marg{symbol or cmd}\marg{definition} command. Its usage is as follows:
+\begin{verbatim}
+\NewNegationCommand {=} {\neq}
+\NewNegationCommand {\equal} {\neq}
+\end{verbatim}
+If the command has already been defined, an error will result and \verb|\RenewNegationCommand| can be used to overwrite the original definition.
+
+
+\subsubsection{Pre-drawn fraction characters}
+
+Pre-drawn fractions \unichar{00BC}--\unichar{00BE}, \unichar{2150}--\unichar{215E}
+are not suitable for use in mathematics output. However, they can be useful
+as input characters to abbreviate common fractions.
+\begin{center}
+\fontspec{DejaVuSerif.ttf} ^^A available in TeX Live 2012 if not earlier
+¼ ½ ¾  ↉ ⅐ ⅑ ⅒ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞
+\end{center}
+For example, instead of writing `|\tfrac12 x|', you may consider it more readable to have
+`|½x|' in the source instead.
+
+If the \cs{tfrac} command exists (i.e., if \pkg{amsmath} is loaded or
+you have specially defined \cs{tfrac} for this purpose), it will be used
+to typeset the fractions. If not, regular \cs{frac} will be used. The command
+to use (\cs{tfrac} or \cs{frac}) can be forced either way with the package
+option |active-frac=small| or |active-frac=normalsize|, respectively.
+
+\subsubsection{Circles}
+
+Unicode defines a large number of different types of circles for a variety
+of mathematical purposes. There are thirteen alone just considering the
+all white and all black ones, shown in \tabref{circles}.
+
+\LaTeX\ defines considerably fewer: \cs{circ} and \cs{bigcirc} for white;
+\cs{bullet} for black. This package maps those commands to \cs{vysmwhtcircle},
+\cs{mdlgwhtcircle}, and \cs{smblkcircle}, respectively.
+
+\begin{table}\centering
+\def\showchar#1#2#3{ \textsc{u}+{\small\ttfamily #1} & \texttt{\string#3} & \umfont \char"#1 \\}
+\begin{tabular}{@{}llc@{}}
+\toprule
+Slot & Command & Glyph \\
+\midrule
+\showchar{00B7}{centerdot}{\cdotp}
+\showchar{22C5}{small middle dot}{\cdot}
+\showchar{2219}{bullet operator}{\vysmblkcircle}
+\showchar{2022}{round bullet, filled}{\smblkcircle}
+\showchar{2981}{z notation spot}{\mdsmblkcircle}
+\showchar{26AB}{medium black circle}{\mdblkcircle}
+\showchar{25CF}{circle, filled}{\mdlgblkcircle}
+\showchar{2B24}{black large circle}{\lgblkcircle}
+\bottomrule
+\end{tabular}
+\def\showchar#1#2#3{ \umfont \char"#1 & \texttt{\string#3} & \textsc{u}+{\small\ttfamily #1} \\}
+\begin{tabular}{@{}cll@{}}
+\toprule
+Glyph & Command & Slot \\
+\midrule
+\\
+\\
+\showchar{2218}{composite function (small circle)}{\vysmwhtcircle}
+\showchar{25E6}{white bullet}{\smwhtcircle}
+\showchar{26AC}{medium small white circle}{\mdsmwhtcircle}
+\showchar{26AA}{medium white circle}{\mdwhtcircle}
+\showchar{25CB}{large circle}{\mdlgwhtcircle}
+\showchar{25EF}{large circle}{\lgwhtcircle}
+\bottomrule
+\end{tabular}
+\caption{Filled and hollow Unicode circles.}
+\tablabel{circles}
+\end{table}
+
+\subsubsection{Triangles}
+
+While there aren't as many different sizes of triangle as there are circle,
+there's some important distinctions to make between a few similar characters. See \tabref{uptriangles} for the full summary.
+
+These triangles all have different intended meanings. Note for backwards
+compatibility with \TeX, \unichar{25B3} has \emph{two} different mappings
+in \pkg{unicode-math}. \cs{bigtriangleup} is intended as a binary operator
+whereas \cs{triangle} is intended to be used as a letter-like symbol.
+
+But you're better off if you're using the latter form to indicate an
+increment to use the glyph intended for this purpose, \unichar{2206}: $\increment x$.
+
+Finally, given that $\triangle$ and $\increment$ are provided for you
+already, it is better off to only use upright Greek Delta $\Delta$ if you're
+actually using it as a symbolic entity such as a variable on its own.
+
+\begin{table}\centering
+\begin{tabular}{@{}llcl@{}}
+\toprule
+Slot & Command & Glyph & Class \\
+\midrule
+\unichar{25B5} & \cs{vartriangle}      & \umfont \char"25B5 & binary \\
+\unichar{25B3} & \cs{bigtriangleup}    & \umfont \char"25B3 & binary \\
+\unichar{25B3} & \cs{triangle}         & \umfont \char"25B3 & ordinary \\
+\unichar{2206} & \cs{increment}        & \umfont \char"2206 & ordinary \\
+\unichar{0394} & \cs{mathup}\cs{Delta} & \umfont \char"0394 & ordinary \\
+\bottomrule
+\end{tabular}
+\caption{Different upwards pointing triangles.}
+\tablabel{uptriangles}
+\end{table}
+
+\iffalse
+\subsubsection{Normalising some input characters}
+
+I believe
+all variant forms should be used as legal input that is normalised to
+a consistent output glyph, because we want to be fault-tolerant in the input.
+Here are the duplicates:
+\begin{quote}\obeylines
+\unichar {251} {latin small letter alpha}
+\unichar {25B} {latin small letter epsilon}
+\unichar {263} {latin small letter gamma}
+\unichar {269} {latin small letter iota}
+\unichar {278} {latin small letter phi}
+\unichar {28A} {latin small letter upsilon}
+\unichar {190} {latin capital letter epsilon}
+\unichar {194} {latin capital letter gamma}
+\unichar {196} {latin capital letter iota}
+\unichar {1B1} {latin capital letter upsilon}
+\end{quote}
+
+(Not yet implemented.)
+\fi
+
+\section{Advanced}
+
+\subsection{Warning messages}
+
+This package can produce a number of informational messages to try and inform the user when something might be going wrong due to package conflicts or something else.
+As an experimental feature, these can be turn off on an individual basis with the package option |warnings-off| which takes a comma-separated list of warnings to suppress.
+A warning will give you its name when printed on the console output; e.g.,
+\begin{Verbatim}
+  * unicode-math warning: "mathtools-colon"
+  *
+  * ... <warning message> ...
+\end{Verbatim}
+This warning could be suppressed by loading the package as follows:
+\begin{Verbatim}
+  \usepackage[warnings-off={mathtools-colon}]{unicode-math}
+\end{Verbatim}
+
+\subsection{Programmer's interface}
+
+(Tentative and under construction.)
+If you are writing some code that needs to know the current
+maths style (\cs{mathbf}, \cs{mathit}, etc.), you can query the
+variable \cs{l_@@_mathstyle_tl}. It will contain the maths style
+without the leading `math' string; for example,
+|\symbf { \show \l_@@_mathstyle_tl }|
+will produce `bf'.
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-main.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-mathfontdimen.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-mathfontdimen.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-mathfontdimen.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,151 @@
+%%^^A%% um-doc-mathfontdimen.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+\section{\Hologo{XeTeX} math font dimensions}
+
+These are the extended \cmd\fontdimen s available for suitable fonts
+in \XeTeX. Note that Lua\TeX\ takes an alternative route, and this package
+will eventually provide a wrapper interface to the two (I hope).
+
+\newcounter{mfdimen}
+\setcounter{mfdimen}{9}
+\newcommand\mathfontdimen[2]{^^A
+  \stepcounter{mfdimen}^^A
+  \themfdimen & {\scshape\small #1} & #2\vspace{0.5ex} \tabularnewline}
+
+\begin{longtable}{
+  @{}c>{\raggedright\parfillskip=0pt}p{4cm}>{\raggedright}p{7cm}@{}}
+\toprule \cmd\fontdimen & Dimension name & Description\tabularnewline\midrule \endhead
+\bottomrule\endfoot
+\mathfontdimen{Script\-Percent\-Scale\-Down}
+{Percentage of scaling down for script level 1. Suggested value: 80\%.}
+\mathfontdimen{Script\-Script\-Percent\-Scale\-Down}
+{Percentage of scaling down for script level 2 (Script\-Script). Suggested value: 60\%.}
+\mathfontdimen{Delimited\-Sub\-Formula\-Min\-Height}
+{Minimum height required for a delimited expression to be treated as a subformula. Suggested value: normal line height\,×\,1.5.}
+\mathfontdimen{Display\-Operator\-Min\-Height}
+{Minimum height of n-ary operators (such as integral and summation) for formulas in display mode.}
+\mathfontdimen{Math\-Leading}
+{White space to be left between math formulas to ensure proper line spacing. For example, for applications that treat line gap as a part of line ascender, formulas with ink  going above (os2.sTypoAscender + os2.sTypoLineGap – MathLeading) or with ink going below os2.sTypoDescender will result in increasing line height.}
+\mathfontdimen{Axis\-Height}
+{Axis height of the font. }
+\mathfontdimen{Accent\-Base\-Height}
+{Maximum (ink) height of accent base that does not require raising the accents. Suggested: x-height of the font (os2.sxHeight) plus any possible overshots. }
+\mathfontdimen{Flattened\-Accent\-Base\-Height}
+{Maximum (ink) height of accent base that does not require flattening the accents. Suggested: cap height of the font (os2.sCapHeight).}
+\mathfontdimen{Subscript\-Shift\-Down}
+{The standard shift down applied to subscript elements. Positive for moving in the downward direction. Suggested: os2.ySubscriptYOffset.}
+\mathfontdimen{Subscript\-Top\-Max}
+{Maximum allowed height of the (ink) top of subscripts that does not require moving subscripts further down. Suggested: /5 x-height.}
+\mathfontdimen{Subscript\-Baseline\-Drop\-Min}
+{Minimum allowed drop of the baseline of subscripts relative to the (ink) bottom of the base. Checked for bases that are treated as a box or extended shape. Positive for subscript baseline dropped below the base bottom.}
+\mathfontdimen{Superscript\-Shift\-Up}
+{Standard shift up applied to superscript elements. Suggested: os2.ySuperscriptYOffset.}
+\mathfontdimen{Superscript\-Shift\-Up\-Cramped}
+{Standard shift of superscripts relative to the base, in cramped style.}
+\mathfontdimen{Superscript\-Bottom\-Min}
+{Minimum allowed height of the (ink) bottom of superscripts that does not require moving subscripts further up. Suggested: ¼ x-height.}
+\mathfontdimen{Superscript\-Baseline\-Drop\-Max}
+{Maximum allowed drop of the baseline of superscripts relative to the (ink) top of the base. Checked for bases that are treated as a box or extended shape. Positive for superscript baseline below the base top.}
+\mathfontdimen{Sub\-Superscript\-Gap\-Min}
+{Minimum gap between the superscript and subscript ink. Suggested: 4×default rule thickness.}
+\mathfontdimen{Superscript\-Bottom\-Max\-With\-Subscript}
+{The maximum level to which the (ink) bottom of superscript can be pushed to increase the gap between superscript and subscript, before subscript starts being moved down.
+Suggested: /5 x-height.}
+\mathfontdimen{Space\-After\-Script}
+{Extra white space to be added after each subscript and superscript. Suggested: 0.5pt for a 12 pt font.}
+\mathfontdimen{Upper\-Limit\-Gap\-Min}
+{Minimum gap between the (ink) bottom of the upper limit, and the (ink) top of the base operator. }
+\mathfontdimen{Upper\-Limit\-Baseline\-Rise\-Min}
+{Minimum distance between baseline of upper limit and (ink) top of the base operator.}
+\mathfontdimen{Lower\-Limit\-Gap\-Min}
+{Minimum gap between (ink) top of the lower limit, and (ink) bottom of the base operator.}
+\mathfontdimen{Lower\-Limit\-Baseline\-Drop\-Min}
+{Minimum distance between baseline of the lower limit and (ink) bottom of the base operator.}
+\mathfontdimen{Stack\-Top\-Shift\-Up}
+{Standard shift up applied to the top element of a stack.}
+\mathfontdimen{Stack\-Top\-Display\-Style\-Shift\-Up}
+{Standard shift up applied to the top element of a stack in display style.}
+\mathfontdimen{Stack\-Bottom\-Shift\-Down}
+{Standard shift down applied to the bottom element of a stack. Positive for moving in the downward direction.}
+\mathfontdimen{Stack\-Bottom\-Display\-Style\-Shift\-Down}
+{Standard shift down applied to the bottom element of a stack in display style. Positive for moving in the downward direction.}
+\mathfontdimen{Stack\-Gap\-Min}
+{Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element. Suggested: 3×default rule thickness.}
+\mathfontdimen{Stack\-Display\-Style\-Gap\-Min}
+{Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element in display style. Suggested: 7×default rule thickness.}
+\mathfontdimen{Stretch\-Stack\-Top\-Shift\-Up}
+{Standard shift up applied to the top element of the stretch stack.}
+\mathfontdimen{Stretch\-Stack\-Bottom\-Shift\-Down}
+{Standard shift down applied to the bottom element of the stretch stack. Positive for moving in the downward direction.}
+\mathfontdimen{Stretch\-Stack\-Gap\-Above\-Min}
+{Minimum gap between the ink of the stretched element, and the (ink) bottom of the element above. Suggested: Upper\-Limit\-Gap\-Min}
+\mathfontdimen{Stretch\-Stack\-Gap\-Below\-Min}
+{Minimum gap between the ink of the stretched element, and the (ink) top of the element below. Suggested: Lower\-Limit\-Gap\-Min.}
+\mathfontdimen{Fraction\-Numerator\-Shift\-Up}
+{Standard shift up applied to the numerator. }
+\mathfontdimen{Fraction\-Numerator\-Display\-Style\-Shift\-Up}
+{Standard shift up applied to the numerator in display style. Suggested: Stack\-Top\-Display\-Style\-Shift\-Up.}
+\mathfontdimen{Fraction\-Denominator\-Shift\-Down}
+{Standard shift down applied to the denominator. Positive for moving in the downward direction.}
+\mathfontdimen{Fraction\-Denominator\-Display\-Style\-Shift\-Down}
+{Standard shift down applied to the denominator in display style. Positive for moving in the downward direction. Suggested: Stack\-Bottom\-Display\-Style\-Shift\-Down.}
+\mathfontdimen{Fraction\-Numerator\-Gap\-Min}
+{Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar. Suggested: default rule thickness}
+\mathfontdimen{Fraction\-Num\-Display\-Style\-Gap\-Min}
+{Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar in display style. Suggested: 3×default rule thickness.}
+\mathfontdimen{Fraction\-Rule\-Thickness}
+{Thickness of the fraction bar. Suggested: default rule thickness.}
+\mathfontdimen{Fraction\-Denominator\-Gap\-Min}
+{Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar. Suggested: default rule thickness}
+\mathfontdimen{Fraction\-Denom\-Display\-Style\-Gap\-Min}
+{Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar in display style. Suggested: 3×default rule thickness.}
+\mathfontdimen{Skewed\-Fraction\-Horizontal\-Gap}
+{Horizontal distance between the top and bottom elements of a skewed fraction.}
+\mathfontdimen{Skewed\-Fraction\-Vertical\-Gap}
+{Vertical distance between the ink of the top and bottom elements of a skewed fraction.}
+\mathfontdimen{Overbar\-Vertical\-Gap}
+{Distance between the overbar and the (ink) top of he base. Suggested: 3×default rule thickness.}
+\mathfontdimen{Overbar\-Rule\-Thickness}
+{Thickness of overbar. Suggested: default rule thickness.}
+\mathfontdimen{Overbar\-Extra\-Ascender}
+{Extra white space reserved above the overbar. Suggested: default rule thickness.}
+\mathfontdimen{Underbar\-Vertical\-Gap}
+{Distance between underbar and (ink) bottom of the base. Suggested: 3×default rule thickness.}
+\mathfontdimen{Underbar\-Rule\-Thickness}
+{Thickness of underbar. Suggested: default rule thickness.}
+\mathfontdimen{Underbar\-Extra\-Descender}
+{Extra white space reserved below the underbar. Always positive. Suggested: default rule thickness.}
+\mathfontdimen{Radical\-Vertical\-Gap}
+{Space between the (ink) top of the expression and the bar over it. Suggested: 1¼ default rule thickness.}
+\mathfontdimen{Radical\-Display\-Style\-Vertical\-Gap}
+{Space between the (ink) top of the expression and the bar over it. Suggested: default rule thickness + ¼ x-height. }
+\mathfontdimen{Radical\-Rule\-Thickness}
+{Thickness of the radical rule. This is the thickness of the rule in designed or constructed radical signs. Suggested: default rule thickness.}
+\mathfontdimen{Radical\-Extra\-Ascender}
+{Extra white space reserved above the radical. Suggested: Radical\-Rule\-Thickness.}
+\mathfontdimen{Radical\-Kern\-Before\-Degree}
+{Extra horizontal kern before the degree of a radical, if such is present. Suggested: 5/18 of em.}
+\mathfontdimen{Radical\-Kern\-After\-Degree}
+{Negative kern after the degree of a radical, if such is present. Suggested: −10/18 of em.}
+\mathfontdimen{Radical\-Degree\-Bottom\-Raise\-Percent}
+{Height of the bottom of the radical degree, if such is present, in proportion to the ascender of the radical sign. Suggested: 60\%.}
+\end{longtable}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-mathfontdimen.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-nfsssummary.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-nfsssummary.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-nfsssummary.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,84 @@
+%%^^A%% um-doc-nfsssummary.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+\section{Documenting maths support in the NFSS}
+
+In the following, \meta{NFSS decl.} stands for something like |{T1}{lmr}{m}{n}|.
+
+\begin{description}
+\item[Maths symbol fonts] Fonts for symbols: $\propto$, $\leq$, $\rightarrow$
+
+\cmd\DeclareSymbolFont\marg{name}\meta{NFSS decl.}\\
+Declares a named maths font such as |operators| from which symbols are defined with \cmd\DeclareMathSymbol.
+
+\item[Maths alphabet fonts] Fonts for {\font\1=cmmi10 at 10pt\1 ABC}\,–\,{\font\1=cmmi10 at 10pt\1 xyz}, {\font\1=eufm10 at 10pt\1 ABC}\,–\,{\font\1=cmsy10 at 10pt\1 XYZ}, etc.
+
+\cmd\DeclareMathAlphabet\marg{cmd}\meta{NFSS decl.}
+
+For commands such as \cmd\mathbf, accessed
+through maths mode that are unaffected by the current text font, and which are used for
+alphabetic symbols in the \ascii\ range.
+
+\cmd\DeclareSymbolFontAlphabet\marg{cmd}\marg{name}
+
+Alternative (and optimisation) for \cmd\DeclareMathAlphabet\ if a single font is being used
+for both alphabetic characters (as above) and symbols.
+
+\item[Maths `versions'] Different maths weights can be defined with the following, switched
+in text with the \cmd\mathversion\marg{maths version} command.
+
+\cmd\SetSymbolFont\marg{name}\marg{maths version}\meta{NFSS decl.}\\
+\cmd\SetMathAlphabet\marg{cmd}\marg{maths version}\meta{NFSS decl.}
+
+\item[Maths symbols] Symbol definitions in maths for both characters (=) and macros (\cmd\eqdef):
+\cmd\DeclareMathSymbol\marg{symbol}\marg{type}\marg{named font}\marg{slot}
+This is the macro that actually defines which font each symbol comes from and how they behave.
+\end{description}
+Delimiters and radicals use wrappers around \TeX's \cmd\delimiter/\cmd\radical\ primitives,
+which are re-designed in \XeTeX. The syntax used in \LaTeX's NFSS is therefore not so relevant here.
+\begin{description}
+\item[Delimiters] A special class of maths symbol which enlarge themselves in certain contexts.
+
+\cmd\DeclareMathDelimiter\marg{symbol}\marg{type}\marg{sym.\ font}\marg{slot}\marg{sym.\ font}\marg{slot}
+
+\item[Radicals] Similar to delimiters (\cmd\DeclareMathRadical\ takes the same syntax) but
+behave `weirdly'.
+\end{description}
+In those cases, glyph slots in \emph{two} symbol fonts are required; one for the small (`regular') case,
+the other for situations when the glyph is larger. This is not the case in \XeTeX.
+
+Accents are not included yet.
+
+\paragraph{Summary}
+
+For symbols, something like:
+\begin{Verbatim}
+\def\DeclareMathSymbol#1#2#3#4{
+  \global\mathchardef#1"\mathchar at type#2
+    \expandafter\hexnumber@\csname sym#2\endcsname
+    {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}}
+\end{Verbatim}
+For characters, something like:
+\begin{Verbatim}
+\def\DeclareMathSymbol#1#2#3#4{
+  \global\mathcode`#1"\mathchar at type#2
+    \expandafter\hexnumber@\csname sym#2\endcsname
+    {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}}
+\end{Verbatim}
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-nfsssummary.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-stixextract.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-stixextract.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-stixextract.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,38 @@
+%%^^A%% um-doc-stixextract.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+\section{\STIX\ table data extraction}\label{part:awk}
+
+The source for the \TeX\ names for the very large number of mathematical
+glyphs are provided via Barbara Beeton's table file for the \STIX\ project
+(|ams.org/STIX|). A version is located at
+|http://www.ams.org/STIX/bnb/stix-tbl.asc|
+but check |http://www.ams.org/STIX/| for more up-to-date info.
+
+This table is converted into a form suitable for reading by \TeX.
+A single file is produced containing all (more than 3298) symbols.
+Future optimisations might include generating various (possibly overlapping) subsets
+so not all definitions must be read just to redefine a small range of symbols.
+Performance for now seems to be acceptable without such measures.
+
+This file is currently developed outside this DTX file. It will be
+incorporated when the final version is ready. (I know this is not how
+things are supposed to work!)
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-stixextract.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-style.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-style.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-style.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,129 @@
+%%^^A%% um-doc-style.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+\makeatletter
+\input{unicode-math.dtx}
+\GetFileInfo{unicode-math.dtx}
+\let\umfiledate\filedate
+\let\umfileversion\fileversion
+
+\CheckSum{0}
+\EnableCrossrefs
+\CodelineIndex
+\setcounter{IndexColumns}{2}
+
+\usepackage[svgnames]{xcolor}
+\usepackage[inline]{enumitem}
+\usepackage{amsmath,array,booktabs,calc,enumitem,fancyvrb,graphicx,ifthen,longtable,refstyle,subfig,topcapt,url,varioref,underscore}
+\setcounter{LTchunksize}{100}
+\usepackage[slash-delimiter=frac,nabla=literal]{unicode-math}
+\usepackage{metalogo,hologo}
+
+\fvset{fontsize=\small,xleftmargin=2em}
+\usepackage[it]{titlesec}
+
+\setmainfont{texgyrepagella}%
+ [
+  Extension = .otf ,
+  UprightFont = *-regular ,
+  ItalicFont = *-italic ,
+  BoldFont = *-bold ,
+  BoldItalicFont = *-bolditalic ,
+ ]
+\setsansfont{Iwona}%
+ [
+  Scale=MatchLowercase,
+  Extension = .otf,
+  UprightFont = *-Regular,
+  ItalicFont  = *-Italic,
+  BoldFont    = *-Bold,
+  BoldItalicFont = *-BoldItalic,
+ ]
+\setmonofont{Inconsolatazi4-Regular.otf}%
+ [
+  Scale=MatchLowercase,
+  BoldFont=Inconsolatazi4-Bold.otf
+ ]
+
+\setmathfont{texgyrepagella-math.otf}
+\setmathfont[version=xits]{xits-math.otf}
+\newfontface\umfont{xits-math.otf}
+
+\usepackage{hypdoc}
+\hypersetup{linktocpage}
+
+% work around some issue turning | into "j" inside mathsf in the definition of \Module:
+% (also prettify)
+\def\Module#1{{\footnotesize\color{red}$\langle$\texttt{#1}$\rangle$}}
+
+\linespread{1.1}
+\frenchspacing
+
+\definecolor{niceblue}{rgb}{0.2,0.4,0.8}
+
+\def\theCodelineNo{\textcolor{niceblue}{\sffamily\tiny\arabic{CodelineNo}}}
+
+\newcommand*\name[1]{{#1}}
+\newcommand*\pkg[1]{\textsf{#1}}
+\newcommand*\feat[1]{\texttt{#1}}
+\newcommand*\opt[1]{\texttt{#1}}
+
+\newcommand*\note[1]{\unskip\footnote{#1}}
+
+\let\latin\textit
+\def\eg{\latin{e.g.}}
+\def\Eg{\latin{E.g.}}
+\def\ie{\latin{i.e.}}
+\def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}}
+
+\def\STIX{\textsc{stix}}
+\def\MacOSX{Mac~OS~X}
+\def\ascii{\textsc{ascii}}
+\def\OMEGA{Omega}
+
+\newcounter{argument}
+
+\makeatletter
+\g at addto@macro\endmacro{\setcounter{argument}{0}}
+\makeatother
+
+\newcommand*\darg[1]{%
+  \stepcounter{argument}%
+  {\ttfamily\char`\#\theargument~:~}#1\par\noindent\ignorespaces
+}
+\newcommand*\doarg[1]{%
+  \stepcounter{argument}%
+  {\ttfamily\makebox[0pt][r]{[}\char`\#\theargument]:~}#1\par\noindent\ignorespaces
+}
+
+\newcommand\codeline[1]{\par{\centering#1\par\noindent}\ignorespaces}
+
+\newcommand\unichar[1]{\textsc{u}+\texttt{\small#1}}
+
+\setlength\parindent{2em}
+
+\def \MakePrivateLetters {%
+  \catcode`\@=11\relax
+  \catcode`\_=11\relax
+  \catcode`\:=11\relax
+}
+
+\makeatother
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/um-doc-style.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.ltx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,40 @@
+%%^^A%% unicode-math-code.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Typeset code.
+
+\documentclass[a4paper]{ltxdoc}
+\input{um-doc-style.tex}
+\begin{document}
+
+\title{Experimental Unicode mathematical typesetting: The \pkg{unicode-math} package}
+\author{\itshape Will Robertson\\\itshape Philipp Stephani, Joseph Wright, Khaled Hosny\\\url{http://github.com/wspr/unicode-math}}
+\date{\umfiledate \qquad \umfileversion}
+
+\maketitle
+\tableofcontents
+
+\def\DTX#1{\clearpage\part{#1}\DocInput{#1}}
+\DTXFILES
+
+\clearpage
+\PrintIndex
+
+\end{document}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math-code.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math.ltx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,43 @@
+%%^^A%% unicode-math.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% User documentation.
+
+\documentclass[a4paper]{ltxdoc}
+\input{um-doc-style.tex}
+\begin{document}
+
+\title{Experimental Unicode mathematical typesetting: The \pkg{unicode-math} package}
+\author{\itshape Will Robertson\\\itshape Philipp Stephani, Joseph Wright, Khaled Hosny\\\url{http://github.com/wspr/unicode-math}}
+\date{\umfiledate \qquad \umfileversion}
+
+\maketitle
+
+\input{um-doc-main.tex}
+
+\clearpage
+\appendix
+
+\input{um-doc-stixextract.tex}
+\input{um-doc-nfsssummary.tex}
+\input{um-doc-legacyfontdimen.tex}
+\input{um-doc-mathfontdimen.tex}
+
+\end{document}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-example.ltx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-example.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-example.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,69 @@
+%%^^A%% unimath-example.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% A minimal example file to demonstrate the package.
+
+%%%%%%%%%%%%%%%%%%%%%%%
+% UNICODE-MATH EXAMPLE FILE
+%%%%%%%%%%%%%%%%%%%%%%%
+
+\documentclass{article}
+
+% Load fontspec and define a document font:
+\usepackage{fontspec}
+\setmainfont{texgyrepagella-regular.otf}
+
+% Load unicode-math and define a math font:
+\usepackage{unicode-math}
+\setmathfont{texgyrepagella-math.otf}
+
+\begin{document}
+\title{An example of \textsf{unicode-math}}
+\author{Will Robertson}
+\maketitle
+
+This is an example of the \textsf{unicode-math} package.
+It allows you to write maths with Unicode input and to use fonts that contain Unicode mathematical glyphs. Follow along in the source code to see how it works.
+
+After loading the package and selecting a font, you shouldn't need to change much to continue to write maths as always.
+\[
+   F(s)=\symscr L \{f(t)\}=\int_0^\infty \symup e^{-st}f(t)\,\symup d t
+\]
+
+The style of Latin and Greek letters is set up by default to match the output of standard \LaTeX: Latin letters and Greek lowercase letters are italic, and Greek uppercase letters are upright. These can be configured with the \texttt{math-style} package option.
+
+One very important feature to recognise is that bold maths now works consistently for both Latin and Greek letters. By default, \verb|\symbf| will turn a Latin letter bold and upright, and a Greek letter will remain italic and also become bold. For example:
+\[
+  \symbf{a} = a\,\symbf{I} \qquad \symbf{\beta} = \beta\,\symbf{I}
+\]
+This behaviour can be configured with the \texttt{bold-style} package option.
+
+In the examples above, I've used \LaTeX\ commands to input characters like \verb|\beta|, \verb|\infty|, and so on. These may now be typed directly into the source of the document:
+\[
+   𝐉 = ∇×𝐇 \qquad 𝐁 = μ₀(𝐌 + 𝐇)
+\]
+\[
+  ∫₀³ xⁿφ₁₂(x)\,ⅆx
+\]
+It does not matter if you use upright or italic characters; they will be normalised according to the setting of the \texttt{math-style} and \texttt{bold-style} options.
+
+And that's a brief introduction to the package. Please see the documentation for further details. This is a new package; feedback, suggestions, and bug reports are all most welcome.
+
+\end{document}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-example.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.ltx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,487 @@
+%%^^A%% unimath-symbols.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Listing of Unicode mathematics symbols using a variety of fonts.
+
+%!TEX TS-program = LuaLaTeX
+
+%%%%%%%%%%%%%%%%%%%%%%%
+% SYMBOLS DEFINED BY UNICODE-MATH
+%%%%%%%%%%%%%%%%%%%%%%%
+
+\documentclass[final]{article}
+\makeatletter
+
+\usepackage{ragged2e,setspace,booktabs,catchfile,shortvrb,geometry,metalogo,textcomp,longtable,tabu,hyperref}
+
+\geometry{margin=3cm}
+\hypersetup{colorlinks,linkcolor=black}
+
+\def\cmd#1{\texttt{\textbackslash\expandafter\@gobble\string#1}}
+
+\usepackage{fontspec}
+\setmainfont{texgyrepagella}%
+ [
+  Extension = .otf ,
+  UprightFont = *-regular,
+  ItalicFont = *-italic,
+  BoldFont = *-bold,
+  BoldItalicFont = *-bolditalic,
+  Ligatures=TeX,
+  Numbers={Lowercase,Monospaced},
+ ]
+\usepackage[math-style=literal,bold-style=literal]{unicode-math}
+
+\ExplSyntaxOn
+\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {c}
+
+\def\defmathfont#1#2#3{
+  \newcounter{#1}
+  \setcounter{#1}{-1}
+  \setmathfont[version=#1,SizeFeatures={
+      {Size=-10, Colour=999999},
+      {Size=10-, Colour=#3}}]{#2}
+  \fontspec_set_fontface:cNnn {#1} \x {ItalicFont={},BoldFont={}} {#2}
+}
+\ExplSyntaxOff
+
+\defmathfont{lm}{latinmodern-math.otf}{CC6666}
+\defmathfont{xits}{xits-math.otf}{CCCC66}
+\defmathfont{stix}{STIXMath-Regular.otf}{AA66CC}
+\defmathfont{cambria}{Cambria Math}{66CCCC}
+\defmathfont{asana}{Asana-Math.otf}{6666CC}
+\defmathfont{pagella}{texgyrepagella-math.otf}{AA6666}
+\defmathfont{dejavu}{texgyredejavu-math.otf}{AACC66}
+\defmathfont{euler}{euler.otf}{CC66CC}
+
+\def\INPUT{\input{unicode-math-table.tex}}
+\def\TABLE{%
+\par\noindent
+\begin{longtabu}[l]{@{}lcccccccclX[l]@{}}
+  \toprule
+  \textsc{usv} & M & X & S & C & A & P & D & E & Macro & Description \\
+  \midrule \endhead
+  \INPUT\\
+  \bottomrule
+\end{longtabu}
+}
+\makeatletter
+\def\USV#1{\footnotesize\scshape\MakeLowercase{u+\@gobble#1}}
+\makeatother
+\def\CMD#1{\footnotesize\cmd#1}
+\def\DESC#1{%
+  \begin{spacing}{0.5}
+    \RaggedRight\scriptsize #1%
+  \end{spacing}
+}
+
+\newcommand\SHOW[1]{%
+  \def\UnicodeMathSymbol##1##2##3##4{%
+    \def\1{#1}\def\2{##3}%
+    \ifx\1\2\PRINTLINE{##1}{##2}{##4}\fi
+  }%
+  \TABLE
+}
+\ExplSyntaxOn
+\def\PRINTLINE#1#2#3{
+    \def\tempa{
+      \USV{#1} &
+      \SYMB{#2}{lm}{#1} &
+      \SYMB{#2}{xits}{#1} &
+      \SYMB{#2}{stix}{#1} &
+      \SYMB{#2}{cambria}{#1} &
+      \SYMB{#2}{asana}{#1} &
+      \SYMB{#2}{pagella}{#1} &
+      \SYMB{#2}{dejavu}{#1} &
+      \SYMB{#2}{euler}{#1} &
+      \CMD{#2}
+      \tl_if_in:NnT \PLAIN {#2}
+        {
+          \makebox[0pt][l]
+            { \color[gray]{0.7} \textsuperscript{\sffamily (p)} }
+        }
+      \tl_if_in:NnT \LTXSYM {#2}
+        {
+          \makebox[0pt][l]
+            { \color[gray]{0.7} \textsuperscript{\sffamily (l)} }
+        }
+      \tl_if_in:NnT \AMSSYMB {#2}
+        {
+          \makebox[0pt][l]
+            { \color[gray]{0.7} \textsuperscript{\sffamily (a)} }
+        }
+      &
+      \DESC{#3} \\
+    }%
+    \expandafter\tempa
+}
+\ExplSyntaxOff
+\def\SYMB#1#2#3{%
+  \expandafter\iffontchar\csname#2\endcsname #3\relax
+    \refstepcounter{#2}%
+    \mathversion{#2}%
+    $\displaystyle#1$%
+  \fi
+}
+
+\def\PLAIN{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu\xi\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega\varepsilon\vartheta\varpi\varrho\varsigma\varphi\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega
+%
+\aleph\hbar\imath\jmath\ell\wp\Re\Im\partial\infty\prime\emptyset\nabla\surd\top\bot\angle\triangle\forall\exists\neg\flat\natural\sharp\clubsuit\diamondsuit\heartsuit\spadesuit
+%
+\coprod\bigvee\bigwedge\biguplus\bigcap\bigcup\int\prod\sum\bigotimes\bigoplus\bigodot\oint\bigsqcup\smallint
+%
+\triangleleft\triangleright\bigtriangleup\bigtriangledown\wedge\land\vee\lor\cap\cup\ddagger\dagger\sqcap\sqcup\uplus\amalg\diamond\bullet\wr\div\odot\oslash\otimes\ominus\oplus\mp\pm\circ\bigcirc\setminus\cdot\ast\times\star\propto\sqsubseteq\sqsupseteq\parallel\mid\dashv\vdash\nearrow\searrow\nwarrow\swarrow\Leftrightarrow\Leftarrow\Rightarrow\neq\ne\lnot\leq\le\geq\ge\succ\prec\approx\succeq\preceq\supset\subset\supseteq\subseteq\in\ni\owns\gg\ll\not\leftrightarrow\leftarrow\gets\rightarrow\to\mapstochar\mapsto\sim\simeq\perp\equiv\asymp\smile\frown\leftharpoonup\leftharpoondown\rightharpoonup\rightharpoondown
+%
+\joinrel\relbar\Relbar\lhook\hookrightarrow\rhook\hookleftarrow\bowtie\models\Longrightarrow\longrightarrow\longleftarrow\Longleftarrow\longmapsto\longleftrightarrow\Longleftrightarrow\iff
+%
+\ldotp\cdotp\colon\ldots\cdots\vdots\ddots
+%
+\acute\grave\ddot\tilde\bar\breve\check\hat\vec\dot\widetilde\widehat
+%
+\overrightarrow\overleftarrow\overbrace\underbrace\lmoustache\rmoustache\lgroup\rgroup\arrowvert\Arrowvert\bracevert\Vert\vert\uparrow\downarrow\updownarrow\Uparrow\Downarrow\Updownarrow\backslash\rangle\langle\rbrace\lbrace\rceil\lceil\rfloor\lfloor\sqrt}
+
+
+\def\LTXSYM{
+\cong
+\notin
+\rightleftharpoons
+\doteq
+\mathring
+}
+
+\def\AMSSYMB{\boxdot\boxplus\boxtimes\square\blacksquare\centerdot\lozenge\blacklozenge\circlearrowright\circlearrowleft\leftrightharpoons\boxminus\Vdash\Vvdash\vDash\twoheadrightarrow\twoheadleftarrow\leftleftarrows\rightrightarrows\upuparrows\downdownarrows\upharpoonright\restriction\downharpoonright\upharpoonleft\downharpoonleft\rightarrowtail\leftarrowtail\leftrightarrows\rightleftarrows\Lsh\Rsh\rightsquigarrow\leftrightsquigarrow\looparrowleft\looparrowright\circeq\succsim\gtrsim\gtrapprox\multimap\therefore\because\doteqdot\Doteq\triangleq\precsim\lesssim\lessapprox\eqslantless\eqslantgtr\curlyeqprec\curlyeqsucc\preccurlyeq\leqq\leqslant\lessgtr\backprime\risingdotseq\fallingdotseq\succcurlyeq\geqq\geqslant\gtrless\vartriangleright\vartriangleleft\trianglerighteq\trianglelefteq\bigstar\between\blacktriangledown\blacktriangleright\blacktriangleleft\vartriangle\blacktriangle\triangledown\eqcirc\lesseqgtr\gtreqless\lesseqqgtr\gtreqqless\Rrightarrow\Lleftarrow\veebar\barwedge\doublebarwedge\measuredangle\sphericalangle\varpropto\smallsmile\smallfrown\Subset\Supset\Cup\doublecup\Cap\doublecap\curlywedge\curlyvee\leftthreetimes\rightthreetimes\subseteqq\supseteqq\bumpeq\Bumpeq\lll\llless\ggg\gggtr\circledS\pitchfork\dotplus\backsim\backsimeq\complement\intercal\circledcirc\circledast\circleddash\lvertneqq\gvertneqq\nleq\ngeq\nless\ngtr\nprec\nsucc\lneqq\gneqq\nleqslant\ngeqslant\lneq\gneq\npreceq\nsucceq\precnsim\succnsim\lnsim\gnsim\nleqq\ngeqq\precneqq\succneqq\precnapprox\succnapprox\lnapprox\gnapprox\nsim\ncong\diagup\diagdown\varsubsetneq\varsupsetneq\nsubseteqq\nsupseteqq\subsetneqq\supsetneqq\varsubsetneqq\varsupsetneqq\subsetneq\supsetneq\nsubseteq\nsupseteq\nparallel\nmid\nshortmid\nshortparallel\nvdash\nVdash\nvDash\nVDash\ntrianglerighteq\ntrianglelefteq\ntriangleleft\ntriangleright\nleftarrow\nrightarrow\nLeftarrow\nRightarrow\nLeftrightarrow\nleftrightarrow\divideontimes\varnothing\nexists\Finv\Game\eth\eqsim\beth\gimel\daleth\lessdot\gtrdot\ltimes\rtimes\shortmid\shortparallel\smallsetminu!
 s\thicksim\thickapprox\approxeq\succapprox\precapprox\curvearrowleft\curvearrowright\digamma\varkappa\Bbbk\hslash\backepsilon}
+
+\input{unicode-math.dtx}
+\makeatletter
+\def\GetFileInfo#1{%
+  \def\filename{#1}%
+  \def\@tempb##1 ##2 ##3\relax##4\relax{%
+    \def\filedate{##1}%
+    \def\fileversion{##2}%
+    \def\fileinfo{##3}}%
+  \edef\@tempa{\csname ver@#1\endcsname}%
+  \expandafter\@tempb\@tempa\relax? ? \relax\relax}
+\makeatother
+\GetFileInfo{unicode-math.dtx}
+\let\umfiledate\filedate
+\let\umfileversion\fileversion
+
+\begin{document}
+\MakeShortVerb\|
+\title{Every symbol (most symbols) defined by \textsf{unicode-math}}
+\author{Will Robertson}
+\date{\umfiledate \qquad \umfileversion}
+\maketitle
+
+This document uses the file \texttt{unicode-math-table.tex}
+to print every symbol defined by the \textsf{unicode-math}
+package.
+Use this document to find the command name or the Unicode glyph slot for a symbol that you wish to use.
+The following fonts are shown: (with approximate symbol counts)
+\begin{itemize}
+\item[M] \mathversion{lm} $\mathup{Latin\ Modern\ Math}$ (\ref{count:lm})
+\item[X] \mathversion{xits} $\mathup{XITS\ Math}$ (\ref{count:xits})
+\item[S] \mathversion{stix} $\mathup{STIX\ Math}$ (\ref{count:stix})
+\item[C] \mathversion{cambria} $\mathup{Cambria\ Math}$ (\ref{count:cambria})
+\item[A] \mathversion{asana} $\mathup{Asana\ Math}$ (\ref{count:asana})
+\item[P] \mathversion{pagella} $\mathup{TeX\ Gyre\ Pagella\ Math}$ (\ref{count:pagella})
+\item[D] \mathversion{dejavu} $\mathup{DejaVu\ Math\ TeX\ Gyre}$ (\ref{count:dejavu})
+\item[E] \mathversion{euler} $\mathup{Neo\ Euler}$ (\ref{count:euler})
+\end{itemize}
+Note that there are addition maths fonts in the `\TeX\ Gyre' collection which aren't included here.
+
+Symbols defined in Plain \TeX\ are indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (p)}} after their macro name.
+\LaTeX\ follows Plain \TeX, but defines a handful more, indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (l)}}
+Symbols defined in \textsf{amssymb} are indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (a)}}.
+
+\tableofcontents
+
+\clearpage
+\section{Opening symbols, \cmd\mathopen}
+\begingroup
+\def\sqrt{\sqrtsign{}}
+\def\longdivision{\longdivisionsign{}}
+\SHOW\mathopen
+\endgroup
+
+\clearpage
+\section{Closing symbols, \cmd\mathclose}
+\SHOW\mathclose
+
+\clearpage
+\section{Fence symbols, \cmd\mathfence}
+\SHOW\mathfence
+
+\section{Punctuation symbols, \cmd\mathpunct}
+\SHOW\mathpunct
+
+\section{`Over' symbols, \cmd\mathover}
+\begingroup
+\def\SYMB#1#2#3{%
+  \expandafter\iffontchar\csname#2\endcsname #3\relax
+    \refstepcounter{#2}%
+    \mathversion{#2}%
+    $\displaystyle #1{\mitx+\mity}$%
+  \fi
+}
+\SHOW\mathover
+\endgroup
+
+
+\section{`Under' symbols, \cmd\mathunder}
+\begingroup
+\def\SYMB#1#2#3{%
+  \expandafter\iffontchar\csname#2\endcsname #3\relax
+    \refstepcounter{#2}%
+    \mathversion{#2}%
+    $\displaystyle #1{\mitx+\mity}$%
+  \fi
+}
+\SHOW\mathunder
+\endgroup
+
+\clearpage
+\section{Accents, \cmd\mathaccent}
+
+Note that accents will only be properly placed if used with an OpenType font with the necessary information.
+
+\begingroup
+\def\SYMB#1#2#3{%
+  \expandafter\iffontchar\csname#2\endcsname #3\relax
+    \refstepcounter{#2}%
+    \mathversion{#2}%
+    $\displaystyle#1 \mitx$%
+  \fi
+}
+\SHOW\mathaccent
+\endgroup
+
+\section{Bottom accents, \cmd\mathbotaccent}
+\begingroup
+\def\SYMB#1#2#3{%
+  \expandafter\iffontchar\csname#2\endcsname #3\relax
+    \refstepcounter{#2}%
+    \mathversion{#2}%
+    $\displaystyle#1 \mitx$%
+  \fi
+}
+\SHOW\mathbotaccent
+\endgroup
+
+\clearpage
+\section{Big operators, \cmd\mathop}
+
+Of the operators shown below, a subset need to be flagged by \textsf{unicode-math} for \cmd\nolimits\ adjustments.
+The limits behaviour as specified by \textsf{unicode-math} are shown with grey subscripts and superscripts.
+\begingroup
+\def\SYMB#1#2#3{%
+  \expandafter\iffontchar\csname#2\endcsname #3\relax
+    \stepcounter{#2}%
+    \mathversion{#2}%
+    $\displaystyle#1_0^1$%
+  \fi
+}
+\SHOW\mathop
+\endgroup
+
+\section{Binary relations, \cmd\mathbin}
+\SHOW\mathbin
+
+\clearpage
+\section{Ordinary symbols, \cmd\mathord}
+\SHOW\mathord
+
+\clearpage
+\section{Relation symbols, \cmd\mathrel}
+\SHOW\mathrel
+
+\clearpage
+\section{Alphabetical symbols, \cmd\mathalpha}
+
+% first read in all \mathalpha symbols into a variable:
+\ExplSyntaxOn
+\cs_set:Npn \UnicodeMathSymbol #1#2#3#4 {
+  \str_if_eq:nnT {\mathalpha} {#3} {
+    \exp_not:n { \UnicodeMathSymbol {#1}{#2}{#3}{#4} }
+  }
+}
+\CatchFileEdef
+  \ALPHA{unicode-math-table.tex}
+  {\char_set_catcode_space:N \ }
+
+% now each time we print an alphabet we remove the slot;
+% this ensures we won't miss anything
+
+\def\INPUT{\ALPHA}
+\cs_new:Npn \SLOTS #1#2 {
+  \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 {
+    \bool_lazy_and:nnT
+      { \int_compare_p:n {##1 >= #1} }
+      { \int_compare_p:n {##1 <= #2} }
+      {
+        \PRINTLINE{##1}{##2}{##4}
+      }
+  }
+  \TABLE
+  \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 {
+    \bool_lazy_or:nnT
+      { \int_compare_p:n {##1 > #2} }
+      { \int_compare_p:n {##1 < #1} }
+      {
+        \exp_not:n { \UnicodeMathSymbol {##1}{##2}{##3}{##4} }
+      }
+  }
+  \edef\ALPHA{\ALPHA}
+}
+
+\ExplSyntaxOff
+
+\subsection{Normal weight}
+
+\subsubsection{Upright Greek, uppercase}
+\SLOTS{"00391}{"003A9}
+
+\subsubsection{Upright Greek, lowercase}
+\SLOTS{"003B1}{"003F5}
+
+\subsubsection{Italic, Latin, uppercase}
+\SLOTS{"1D434}{"1D44D}
+
+\subsubsection{Italic, Latin, lowercase}
+\SLOTS{"1D44E}{"1D467}
+
+\subsubsection{Italic Greek, uppercase}
+\SLOTS{"1D6E2}{"1D6FA}
+
+\subsubsection{Italic Greek, lowercase}
+\SLOTS{"1D6FC}{"1D71B}
+
+\subsubsection{Script, Latin, uppercase}
+\SLOTS{"1D49C}{"1D4B5}
+
+\subsubsection{Script, Latin, lowercase}
+\SLOTS{"1D4B6}{"1D4CF}
+
+\subsubsection{Fraktur, Latin, uppercase}
+\SLOTS{"1D504}{"1D51C}
+
+\subsubsection{Fraktur, Latin, lowercase}
+\SLOTS{"1D51E}{"1D537}
+
+\subsubsection{Blackboard, Latin, uppercase}
+\SLOTS{"1D538}{"1D550}
+
+\subsubsection{Blackboard, Latin, lowercase}
+\SLOTS{"1D552}{"1D56B}
+
+\subsubsection{Sans serif, Latin, uppercase}
+\SLOTS{"1D5A0}{"1D5B9}
+
+\subsubsection{Sans serif, Latin, lowercase}
+\SLOTS{"1D5BA}{"1D5D3}
+
+\subsubsection{Italic sans serif, Latin, uppercase}
+\SLOTS{"1D608}{"1D621}
+
+\subsubsection{Italic sans serif, Latin, lowercase}
+\SLOTS{"1D622}{"1D63B}
+
+\subsubsection{Typewriter, Latin, uppercase}
+\SLOTS{"1D670}{"1D689}
+
+\subsubsection{Typewriter, Latin, lowercase}
+\SLOTS{"1D68A}{"1D6A3}
+
+\subsection{Bold}
+
+\subsubsection{Bold, Latin, uppercase}
+\SLOTS{"1D400}{"1D419}
+
+\subsubsection{Bold, Latin, lowercase}
+\SLOTS{"1D41A}{"1D433}
+
+\subsubsection{Bold Greek, uppercase}
+\SLOTS{"1D6A8}{"1D6C0}
+
+\subsubsection{Bold Greek, lowercase}
+\SLOTS{"1D6C2}{"1D6E1}
+
+\subsubsection{Bold italic, Latin, uppercase}
+\SLOTS{"1D468}{"1D481}
+
+\subsubsection{Bold italic, Latin, lowercase}
+\SLOTS{"1D482}{"1D49B}
+
+\subsubsection{Bold italic Greek, uppercase}
+\SLOTS{"1D71C}{"1D734}
+
+\subsubsection{Bold italic Greek, lowercase}
+\SLOTS{"1D736}{"1D755}
+
+\subsubsection{Bold script, Latin, uppercase}
+\SLOTS{"1D4D0}{"1D4E9}
+
+\subsubsection{Bold script, Latin, lowercase}
+\SLOTS{"1D4EA}{"1D503}
+
+\subsubsection{Bold fraktur, Latin, uppercase}
+\SLOTS{"1D56C}{"1D585}
+
+\subsubsection{Bold fraktur, Latin, lowercase}
+\SLOTS{"1D586}{"1D59F}
+
+\subsubsection{Bold sans serif, Latin, uppercase}
+\SLOTS{"1D5D4}{"1D5ED}
+
+\subsubsection{Bold sans serif, Latin, lowercase}
+\SLOTS{"1D5EE}{"1D607}
+
+\subsubsection{Bold italic sans serif, Latin, uppercase}
+\SLOTS{"1D63C}{"1D655}
+
+\subsubsection{Bold italic sans serif, Latin, lowercase}
+\SLOTS{"1D656}{"1D66F}
+
+\subsubsection{Bold sans serif Greek, uppercase}
+\SLOTS{"1D756}{"1D76E}
+
+\subsubsection{Bold sans serif Greek, lowercase}
+\SLOTS{"1D770}{"1D78F}
+
+\subsubsection{Bold italic sans serif Greek, uppercase}
+\SLOTS{"1D790}{"1D7A8}
+
+\subsubsection{Bold italic sans serif Greek, lowercase}
+\SLOTS{"1D7AA}{"1D7C9}
+
+\subsection{Miscellaneous}
+\def\UnicodeMathSymbol#1#2#3#4{\PRINTLINE{#1}{#2}{#4}}
+\TABLE
+
+\refstepcounter{lm}\label{count:lm}
+\refstepcounter{xits}\label{count:xits}
+\refstepcounter{stix}\label{count:stix}
+\refstepcounter{cambria}\label{count:cambria}
+\refstepcounter{asana}\label{count:asana}
+\refstepcounter{pagella}\label{count:pagella}
+\refstepcounter{euler}\label{count:euler}
+\refstepcounter{dejavu}\label{count:dejavu}
+
+\end{document}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-alphabets.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definitions for setting up the "math symbol alphabets".
 
 % \section{Setting up alphabets}
 % \label{sec:setupalphabets}
@@ -12,91 +13,91 @@
 %
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {up} {num}
- {
-  \@@_set_normal_numbers:nn {up} {#1}
-  \@@_set_mathalphabet_numbers:nnn {up} {up} {#1}
- }
+  {
+    \@@_set_normal_numbers:nn {up} {#1}
+    \@@_set_mathalphabet_numbers:nnn {up} {up} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {up} {Latin}
- {
-  \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {up} {#1} }
-   {
-    \bool_if:NT \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} }
-   }
-  \@@_set_mathalphabet_Latin:nnn {up} {up,it} {#1}
-  \@@_set_mathalphabet_Latin:nnn {literal} {up} {up}
-  \@@_set_mathalphabet_Latin:nnn {literal} {it} {it}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {up} {#1} }
+      {
+        \bool_if:NT \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} }
+      }
+    \@@_set_mathalphabet_Latin:nnn {up} {up,it} {#1}
+    \@@_set_mathalphabet_Latin:nnn {literal} {up} {up}
+    \@@_set_mathalphabet_Latin:nnn {literal} {it} {it}
+  }
 
 \@@_new_alphabet_config:nnn {up} {latin}
- {
-  \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_latin:nn {up} {#1} }
-   {
-    \bool_if:NT \g_@@_uplatin_bool
-     {
-      \@@_set_normal_latin:nn        {up,it} {#1}
-      \@@_set_normal_char:nnn        {h} {up,it} {#1}
-      \@@_set_normal_char:nnn {dotlessi} {up,it} {#1}
-      \@@_set_normal_char:nnn {dotlessj} {up,it} {#1}
-     }
-   }
-  \@@_set_mathalphabet_latin:nnn {up} {up,it}{#1}
-  \@@_set_mathalphabet_latin:nnn {literal} {up} {up}
-  \@@_set_mathalphabet_latin:nnn {literal} {it} {it}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_latin:nn {up} {#1} }
+      {
+        \bool_if:NT \g_@@_uplatin_bool
+          {
+            \@@_set_normal_latin:nn        {up,it} {#1}
+            \@@_set_normal_char:nnn        {h} {up,it} {#1}
+            \@@_set_normal_char:nnn {dotlessi} {up,it} {#1}
+            \@@_set_normal_char:nnn {dotlessj} {up,it} {#1}
+          }
+      }
+    \@@_set_mathalphabet_latin:nnn {up} {up,it}{#1}
+    \@@_set_mathalphabet_latin:nnn {literal} {up} {up}
+    \@@_set_mathalphabet_latin:nnn {literal} {it} {it}
+  }
 
 \@@_new_alphabet_config:nnn {up} {Greek}
- {
-  \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Greek:nn {up}{#1} }
-   {
-    \bool_if:NT \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it}{#1} }
-   }
-  \@@_set_mathalphabet_Greek:nnn {up} {up,it}{#1}
-  \@@_set_mathalphabet_Greek:nnn {literal} {up} {up}
-  \@@_set_mathalphabet_Greek:nnn {literal} {it} {it}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Greek:nn {up}{#1} }
+      {
+        \bool_if:NT \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it}{#1} }
+      }
+    \@@_set_mathalphabet_Greek:nnn {up} {up,it}{#1}
+    \@@_set_mathalphabet_Greek:nnn {literal} {up} {up}
+    \@@_set_mathalphabet_Greek:nnn {literal} {it} {it}
+  }
 
 \@@_new_alphabet_config:nnn {up} {greek}
- {
-  \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_greek:nn {up} {#1} }
-   {
-    \bool_if:NT \g_@@_upgreek_bool
-     {
-      \@@_set_normal_greek:nn {up,it} {#1}
-     }
-   }
-  \@@_set_mathalphabet_greek:nnn {up} {up,it} {#1}
-  \@@_set_mathalphabet_greek:nnn {literal} {up} {up}
-  \@@_set_mathalphabet_greek:nnn {literal} {it} {it}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_greek:nn {up} {#1} }
+      {
+        \bool_if:NT \g_@@_upgreek_bool
+          {
+            \@@_set_normal_greek:nn {up,it} {#1}
+          }
+      }
+    \@@_set_mathalphabet_greek:nnn {up} {up,it} {#1}
+    \@@_set_mathalphabet_greek:nnn {literal} {up} {up}
+    \@@_set_mathalphabet_greek:nnn {literal} {it} {it}
+  }
 
 \@@_new_alphabet_config:nnn {up} {misc}
- {
-  \bool_if:NTF \g_@@_literal_Nabla_bool
-   {
-    \@@_set_normal_char:nnn {Nabla}{up}{up}
-   }
-   {
-    \bool_if:NT \g_@@_upNabla_bool
-     {
-      \@@_set_normal_char:nnn {Nabla}{up,it}{up}
-     }
-   }
-  \bool_if:NTF \g_@@_literal_partial_bool
-   {
-    \@@_set_normal_char:nnn {partial}{up}{up}
-   }
-   {
-    \bool_if:NT \g_@@_uppartial_bool
-     {
-      \@@_set_normal_char:nnn {partial}{up,it}{up}
-     }
-   }
-  \@@_set_mathalphabet_pos:nnnn {up}  {partial} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {up}    {Nabla} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1}
- }
+  {
+    \bool_if:NTF \g_@@_literal_Nabla_bool
+      {
+        \@@_set_normal_char:nnn {Nabla}{up}{up}
+      }
+      {
+        \bool_if:NT \g_@@_upNabla_bool
+          {
+            \@@_set_normal_char:nnn {Nabla}{up,it}{up}
+          }
+      }
+    \bool_if:NTF \g_@@_literal_partial_bool
+      {
+        \@@_set_normal_char:nnn {partial}{up}{up}
+      }
+      {
+        \bool_if:NT \g_@@_uppartial_bool
+          {
+            \@@_set_normal_char:nnn {partial}{up,it}{up}
+          }
+      }
+    \@@_set_mathalphabet_pos:nnnn {up}  {partial} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {up}    {Nabla} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Italic: it}
@@ -103,84 +104,84 @@
 %
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {it} {Latin}
- {
-  \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {it} {#1} }
-   {
-    \bool_if:NF \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} }
-   }
-  \@@_set_mathalphabet_Latin:nnn {it}{up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool { \@@_set_normal_Latin:nn {it} {#1} }
+      {
+        \bool_if:NF \g_@@_upLatin_bool { \@@_set_normal_Latin:nn {up,it} {#1} }
+      }
+    \@@_set_mathalphabet_Latin:nnn {it} {up,it} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {it} {latin}
- {
-  \bool_if:NTF \g_@@_literal_bool
-   {
-    \@@_set_normal_latin:nn {it} {#1}
-    \@@_set_normal_char:nnn {h}{it}{#1}
-   }
-   {
-    \bool_if:NF \g_@@_uplatin_bool
-     {
-      \@@_set_normal_latin:nn {up,it} {#1}
-      \@@_set_normal_char:nnn {h}{up,it}{#1}
-      \@@_set_normal_char:nnn {dotlessi}{up,it}{#1}
-      \@@_set_normal_char:nnn {dotlessj}{up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_latin:nnn {it}            {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool
+      {
+        \@@_set_normal_latin:nn    {it}{#1}
+        \@@_set_normal_char:nnn {h}{it}{#1}
+      }
+      {
+        \bool_if:NF \g_@@_uplatin_bool
+          {
+            \@@_set_normal_latin:nn            {up,it} {#1}
+            \@@_set_normal_char:nnn {h}        {up,it} {#1}
+            \@@_set_normal_char:nnn {dotlessi} {up,it} {#1}
+            \@@_set_normal_char:nnn {dotlessj} {up,it} {#1}
+          }
+      }
+    \@@_set_mathalphabet_latin:nnn {it}            {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {it} {dotlessi} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {it} {dotlessj} {up,it} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {it} {Greek}
- {
-  \bool_if:NTF \g_@@_literal_bool
-   {
-    \@@_set_normal_Greek:nn {it}{#1}
-   }
-   {
-    \bool_if:NF \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it}{#1} }
-   }
-  \@@_set_mathalphabet_Greek:nnn {it} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool
+      {
+        \@@_set_normal_Greek:nn {it} {#1}
+      }
+      {
+        \bool_if:NF \g_@@_upGreek_bool { \@@_set_normal_Greek:nn {up,it} {#1} }
+      }
+    \@@_set_mathalphabet_Greek:nnn {it} {up,it} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {it} {greek}
- {
-  \bool_if:NTF \g_@@_literal_bool
-   {
-    \@@_set_normal_greek:nn {it} {#1}
-   }
-   {
-    \bool_if:NF \g_@@_upgreek_bool { \@@_set_normal_greek:nn {it,up} {#1} }
-   }
-  \@@_set_mathalphabet_greek:nnn {it} {up,it} {#1}
- }
+  {
+    \bool_if:NTF \g_@@_literal_bool
+      {
+        \@@_set_normal_greek:nn {it} {#1}
+      }
+      {
+        \bool_if:NF \g_@@_upgreek_bool { \@@_set_normal_greek:nn {it,up} {#1} }
+      }
+    \@@_set_mathalphabet_greek:nnn {it} {up,it} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {it} {misc}
- {
-  \bool_if:NTF \g_@@_literal_Nabla_bool
-   {
-    \@@_set_normal_char:nnn {Nabla}{it}{it}
-   }
-   {
-    \bool_if:NF \g_@@_upNabla_bool
-     {
-      \@@_set_normal_char:nnn {Nabla}{up,it}{it}
-     }
-   }
-  \bool_if:NTF \g_@@_literal_partial_bool
-   {
-    \@@_set_normal_char:nnn {partial}{it}{it}
-   }
-   {
-    \bool_if:NF \g_@@_uppartial_bool
-     {
-      \@@_set_normal_char:nnn {partial}{up,it}{it}
-     }
-   }
-  \@@_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {it} {Nabla}   {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_literal_Nabla_bool
+      {
+        \@@_set_normal_char:nnn {Nabla} {it} {it}
+      }
+      {
+        \bool_if:NF \g_@@_upNabla_bool
+          {
+            \@@_set_normal_char:nnn {Nabla} {up,it} {it}
+          }
+      }
+    \bool_if:NTF \g_@@_literal_partial_bool
+      {
+        \@@_set_normal_char:nnn {partial} {it} {it}
+      }
+      {
+        \bool_if:NF \g_@@_uppartial_bool
+          {
+            \@@_set_normal_char:nnn {partial} {up,it} {it}
+          }
+      }
+    \@@_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1}
+    \@@_set_mathalphabet_pos:nnnn {it} {Nabla}   {up,it}{#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Blackboard or double-struck: bb and bbit}
@@ -187,44 +188,44 @@
 %
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {bb} {latin}
- {
-  \@@_set_mathalphabet_latin:nnn {bb} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_latin:nnn {bb} {up,it} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {bb} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {bb} {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {bb}    {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {bb} {num}
- {
-  \@@_set_mathalphabet_numbers:nnn {bb} {up}{#1}
- }
+  {
+    \@@_set_mathalphabet_numbers:nnn {bb} {up} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {bb} {misc}
- {
-  \@@_set_mathalphabet_pos:nnnn {bb}        {Pi} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb}        {pi} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb}     {Gamma} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb}     {gamma} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1}
- }
+  {
+    \@@_set_mathalphabet_pos:nnnn {bb}        {Pi} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb}        {pi} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb}     {Gamma} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb}     {gamma} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bb} {summation} {up}    {#1}
+  }
 
 \@@_new_alphabet_config:nnn {bbit} {misc}
- {
-  \@@_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1}
-  \@@_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1}
- }
+  {
+    \@@_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Script and caligraphic: scr and cal}
@@ -231,41 +232,41 @@
 %
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {scr} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {scr}    {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {B}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {E}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {F}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {H}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {I}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {L}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {M}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {R}{up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {scr}     {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {B} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {E} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {F} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {H} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {I} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {L} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {M} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {R} {up,it} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {scr} {latin}
- {
-  \@@_set_mathalphabet_latin:nnn {scr}    {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {e}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {g}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {scr} {o}{up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_latin:nnn {scr}     {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {e} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {g} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {scr} {o} {up,it} {#1}
+  }
 %    \end{macrocode}
 % These are by default synonyms for the above, but with the STIX
 % fonts we want to use the alternate alphabet.
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {cal} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {cal}  {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {B}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {E}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {F}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {H}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {I}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {L}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {M}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {cal} {R}{up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {cal}     {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {B} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {E} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {F} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {H} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {I} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {L} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {M} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {cal} {R} {up,it} {#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Fractur or fraktur or blackletter: frak}
@@ -272,59 +273,60 @@
 %
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {frak} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {frak}    {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {frak} {C}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {frak} {H}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {frak} {I}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {frak} {R}{up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {frak} {Z}{up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {frak}     {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {frak} {C} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {frak} {H} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {frak} {I} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {frak} {R} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn  {frak} {Z} {up,it} {#1}
+  }
 \@@_new_alphabet_config:nnn {frak} {latin}
- {
-  \@@_set_mathalphabet_latin:nnn {frak} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_latin:nnn {frak} {up,it} {#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Sans serif upright: sfup}
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {sfup} {num}
- {
-  \@@_set_mathalphabet_numbers:nnn {sf}   {up}{#1}
-  \@@_set_mathalphabet_numbers:nnn {sfup} {up}{#1}
- }
+  {
+    \@@_set_mathalphabet_numbers:nnn {sf}   {up} {#1}
+    \@@_set_mathalphabet_numbers:nnn {sfup} {up} {#1}
+  }
 \@@_new_alphabet_config:nnn {sfup} {Latin}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_Latin:nn {sfup} {#1}
-    \@@_set_mathalphabet_Latin:nnn {sf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_upsans_bool
-     {
-      \@@_set_normal_Latin:nn {sfup,sfit} {#1}
-      \@@_set_mathalphabet_Latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_Latin:nnn {sfup} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_Latin:nn {sfup} {#1}
+        \@@_set_mathalphabet_Latin:nnn {sf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_upsans_bool
+          {
+            \@@_set_normal_Latin:nn {sfup,sfit} {#1}
+            \@@_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \@@_set_mathalphabet_Latin:nnn {sfup} {up,it} {#1}
+  }
+
 \@@_new_alphabet_config:nnn {sfup} {latin}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_latin:nn {sfup} {#1}
-    \@@_set_mathalphabet_latin:nnn {sf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_upsans_bool
-     {
-      \@@_set_normal_latin:nn {sfup,sfit} {#1}
-      \@@_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_latin:nnn {sfup} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_latin:nn {sfup} {#1}
+        \@@_set_mathalphabet_latin:nnn {sf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_upsans_bool
+          {
+            \@@_set_normal_latin:nn {sfup,sfit} {#1}
+            \@@_set_mathalphabet_latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \@@_set_mathalphabet_latin:nnn {sfup} {up,it} {#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Sans serif italic: sfit}
@@ -331,53 +333,54 @@
 %
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {sfit} {Latin}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_Latin:nn {sfit} {#1}
-    \@@_set_mathalphabet_Latin:nnn {sf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g_@@_upsans_bool
-     {
-      \@@_set_normal_Latin:nn {sfup,sfit} {#1}
-      \@@_set_mathalphabet_Latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_Latin:nnn {sfit} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_Latin:nn {sfit} {#1}
+        \@@_set_mathalphabet_Latin:nnn {sf} {it} {#1}
+      }
+      {
+        \bool_if:NF \g_@@_upsans_bool
+          {
+            \@@_set_normal_Latin:nn {sfup,sfit} {#1}
+            \@@_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \@@_set_mathalphabet_Latin:nnn {sfit} {up,it} {#1}
+  }
+
 \@@_new_alphabet_config:nnn {sfit} {latin}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_latin:nn {sfit} {#1}
-    \@@_set_mathalphabet_latin:nnn {sf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g_@@_upsans_bool
-     {
-      \@@_set_normal_latin:nn {sfup,sfit} {#1}
-      \@@_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_latin:nnn {sfit} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_latin:nn {sfit} {#1}
+        \@@_set_mathalphabet_latin:nnn {sf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g_@@_upsans_bool
+          {
+            \@@_set_normal_latin:nn {sfup,sfit} {#1}
+            \@@_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
+          }
+      }
+    \@@_set_mathalphabet_latin:nnn {sfit} {up,it}{#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Typewriter or monospaced: tt}
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {tt} {num}
- {
-  \@@_set_mathalphabet_numbers:nnn {tt} {up}{#1}
- }
+  {
+    \@@_set_mathalphabet_numbers:nnn {tt} {up}{#1}
+  }
 \@@_new_alphabet_config:nnn {tt} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {tt} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {tt} {up,it}{#1}
+  }
 \@@_new_alphabet_config:nnn {tt} {latin}
- {
-  \@@_set_mathalphabet_latin:nnn {tt} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_latin:nnn {tt} {up,it}{#1}
+  }
 %    \end{macrocode}
 %
 %
@@ -384,118 +387,122 @@
 % \subsection{Bold Italic: bfit}
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {bfit} {Latin}
- {
-  \bool_if:NF \g_@@_bfupLatin_bool
-   {
-    \@@_set_normal_Latin:nn {bfup,bfit} {#1}
-   }
-  \@@_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_Latin:nn {bfit} {#1}
-    \@@_set_mathalphabet_Latin:nnn {bf} {it}{#1}
-   }
-   {
+  {
     \bool_if:NF \g_@@_bfupLatin_bool
-     {
-      \@@_set_normal_Latin:nn {bfup,bfit} {#1}
-      \@@_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
+      {
+        \@@_set_normal_Latin:nn {bfup,bfit} {#1}
+      }
+    \@@_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_Latin:nn {bfit} {#1}
+        \@@_set_mathalphabet_Latin:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g_@@_bfupLatin_bool
+          {
+            \@@_set_normal_Latin:nn {bfup,bfit} {#1}
+            \@@_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
 
 \@@_new_alphabet_config:nnn {bfit} {latin}
- {
-  \bool_if:NF \g_@@_bfuplatin_bool
-   {
-    \@@_set_normal_latin:nn {bfup,bfit} {#1}
-   }
-  \@@_set_mathalphabet_latin:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_latin:nn {bfit} {#1}
-    \@@_set_mathalphabet_latin:nnn {bf} {it}{#1}
-   }
-   {
+  {
     \bool_if:NF \g_@@_bfuplatin_bool
-     {
-      \@@_set_normal_latin:nn {bfup,bfit} {#1}
-      \@@_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
+      {
+        \@@_set_normal_latin:nn {bfup,bfit} {#1}
+      }
+    \@@_set_mathalphabet_latin:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_latin:nn {bfit} {#1}
+        \@@_set_mathalphabet_latin:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g_@@_bfuplatin_bool
+          {
+            \@@_set_normal_latin:nn {bfup,bfit} {#1}
+            \@@_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
 
 \@@_new_alphabet_config:nnn {bfit} {Greek}
- {
-  \@@_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_Greek:nn {bfit}{#1}
-    \@@_set_mathalphabet_Greek:nnn {bf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g_@@_bfupGreek_bool
-     {
-      \@@_set_normal_Greek:nn {bfup,bfit}{#1}
-      \@@_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
-     }
-   }
- }
+  {
+    \@@_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_Greek:nn {bfit}{#1}
+        \@@_set_mathalphabet_Greek:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g_@@_bfupGreek_bool
+          {
+            \@@_set_normal_Greek:nn {bfup,bfit}{#1}
+            \@@_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
 
 \@@_new_alphabet_config:nnn {bfit} {greek}
- {
-  \@@_set_mathalphabet_greek:nnn {bfit} {up,it} {#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_greek:nn {bfit} {#1}
-    \@@_set_mathalphabet_greek:nnn {bf} {it} {#1}
-   }
-   {
-    \bool_if:NF \g_@@_bfupgreek_bool
-     {
-      \@@_set_normal_greek:nn {bfit,bfup} {#1}
-      \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
-     }
-   }
- }
+  {
+    \@@_set_mathalphabet_greek:nnn {bfit} {up,it} {#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_greek:nn {bfit} {#1}
+        \@@_set_mathalphabet_greek:nnn {bf} {it} {#1}
+      }
+      {
+        \bool_if:NF \g_@@_bfupgreek_bool
+          {
+            \@@_set_normal_greek:nn {bfit,bfup} {#1}
+            \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
 
 \@@_new_alphabet_config:nnn {bfit} {misc}
- {
-  \bool_if:NTF \g_@@_literal_Nabla_bool
-   { \@@_set_normal_char:nnn {Nabla}{bfit}{#1} }
-   {
-    \bool_if:NF \g_@@_upNabla_bool
-     { \@@_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} }
-   }
-  \bool_if:NTF \g_@@_literal_partial_bool
-   { \@@_set_normal_char:nnn {partial}{bfit}{#1} }
-   {
-    \bool_if:NF \g_@@_uppartial_bool
-     { \@@_set_normal_char:nnn {partial}{bfup,bfit}{#1} }
-   }
-  \@@_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {bfit} {Nabla}   {up,it}{#1}
-  \bool_if:NTF \g_@@_literal_partial_bool
-   {
-    \@@_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1}
-   }
-   {
-    \bool_if:NF \g_@@_uppartial_bool
-     {
-      \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g_@@_literal_Nabla_bool
-   {
-    \@@_set_mathalphabet_pos:nnnn {bf} {Nabla}   {it}{#1}
-   }
-   {
-    \bool_if:NF \g_@@_upNabla_bool
-     {
-      \@@_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
+  {
+    \bool_if:NTF \g_@@_literal_Nabla_bool
+      { \@@_set_normal_char:nnn {Nabla} {bfit} {#1} }
+      {
+        \bool_if:NF \g_@@_upNabla_bool
+          { \@@_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} }
+      }
+
+    \bool_if:NTF \g_@@_literal_partial_bool
+      { \@@_set_normal_char:nnn {partial} {bfit} {#1} }
+      {
+        \bool_if:NF \g_@@_uppartial_bool
+          { \@@_set_normal_char:nnn {partial} {bfup,bfit} {#1} }
+      }
+
+    \@@_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bfit} {Nabla}   {up,it} {#1}
+
+    \bool_if:NTF \g_@@_literal_partial_bool
+      {
+        \@@_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1}
+      }
+      {
+        \bool_if:NF \g_@@_uppartial_bool
+          {
+            \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
+          }
+      }
+
+    \bool_if:NTF \g_@@_literal_Nabla_bool
+      {
+        \@@_set_mathalphabet_pos:nnnn {bf} {Nabla}   {it}{#1}
+      }
+      {
+        \bool_if:NF \g_@@_upNabla_bool
+          {
+            \@@_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
+          }
+      }
+  }
 %    \end{macrocode}
 %
 %
@@ -502,240 +509,242 @@
 % \subsection{Bold Upright: bfup}
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {bfup} {num}
- {
-  \@@_set_mathalphabet_numbers:nnn {bf}   {up}{#1}
-  \@@_set_mathalphabet_numbers:nnn {bfup} {up}{#1}
- }
+  {
+    \@@_set_mathalphabet_numbers:nnn {bf}   {up} {#1}
+    \@@_set_mathalphabet_numbers:nnn {bfup} {up} {#1}
+  }
 
 \@@_new_alphabet_config:nnn {bfup} {Latin}
- {
-  \bool_if:NT \g_@@_bfupLatin_bool
-   {
-    \@@_set_normal_Latin:nn {bfup,bfit} {#1}
-   }
-  \@@_set_mathalphabet_Latin:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_Latin:nn {bfup} {#1}
-    \@@_set_mathalphabet_Latin:nnn {bf} {up}{#1}
-   }
-   {
+  {
     \bool_if:NT \g_@@_bfupLatin_bool
-     {
-      \@@_set_normal_Latin:nn {bfup,bfit} {#1}
-      \@@_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
-     }
-   }
+      {
+        \@@_set_normal_Latin:nn {bfup,bfit} {#1}
+      }
+    \@@_set_mathalphabet_Latin:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_Latin:nn {bfup} {#1}
+        \@@_set_mathalphabet_Latin:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_bfupLatin_bool
+          {
+            \@@_set_normal_Latin:nn {bfup,bfit} {#1}
+            \@@_set_mathalphabet_Latin:nnn {bf} {up,it} {#1}
+          }
+      }
  }
 
 \@@_new_alphabet_config:nnn {bfup} {latin}
- {
-  \bool_if:NT \g_@@_bfuplatin_bool
-   {
-    \@@_set_normal_latin:nn {bfup,bfit} {#1}
-   }
-  \@@_set_mathalphabet_latin:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_latin:nn {bfup} {#1}
-    \@@_set_mathalphabet_latin:nnn {bf} {up}{#1}
-   }
-   {
+  {
     \bool_if:NT \g_@@_bfuplatin_bool
-     {
-      \@@_set_normal_latin:nn {bfup,bfit} {#1}
-      \@@_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
+      {
+        \@@_set_normal_latin:nn {bfup,bfit} {#1}
+      }
+    \@@_set_mathalphabet_latin:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_latin:nn {bfup} {#1}
+        \@@_set_mathalphabet_latin:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_bfuplatin_bool
+          {
+            \@@_set_normal_latin:nn {bfup,bfit} {#1}
+            \@@_set_mathalphabet_latin:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
 \@@_new_alphabet_config:nnn {bfup} {Greek}
- {
-  \@@_set_mathalphabet_Greek:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_Greek:nn {bfup}{#1}
-    \@@_set_mathalphabet_Greek:nnn {bf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_bfupGreek_bool
-     {
-      \@@_set_normal_Greek:nn {bfup,bfit}{#1}
-      \@@_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
-     }
-   }
- }
+  {
+    \@@_set_mathalphabet_Greek:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_Greek:nn {bfup} {#1}
+        \@@_set_mathalphabet_Greek:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_bfupGreek_bool
+          {
+            \@@_set_normal_Greek:nn {bfup,bfit} {#1}
+            \@@_set_mathalphabet_Greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
 
 \@@_new_alphabet_config:nnn {bfup} {greek}
- {
-  \@@_set_mathalphabet_greek:nnn {bfup} {up,it} {#1}
-  \bool_if:NTF \g_@@_bfliteral_bool
-   {
-    \@@_set_normal_greek:nn {bfup} {#1}
-    \@@_set_mathalphabet_greek:nnn {bf} {up} {#1}
-   }
-   {
-    \bool_if:NT \g_@@_bfupgreek_bool
-     {
-      \@@_set_normal_greek:nn {bfup,bfit} {#1}
-      \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
-     }
-   }
- }
+  {
+    \@@_set_mathalphabet_greek:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g_@@_bfliteral_bool
+      {
+        \@@_set_normal_greek:nn {bfup} {#1}
+        \@@_set_mathalphabet_greek:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_bfupgreek_bool
+          {
+            \@@_set_normal_greek:nn {bfup,bfit} {#1}
+            \@@_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
 
 \@@_new_alphabet_config:nnn {bfup} {misc}
- {
-  \bool_if:NTF \g_@@_literal_Nabla_bool
-   {
-    \@@_set_normal_char:nnn {Nabla}{bfup}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_upNabla_bool
-     {
-      \@@_set_normal_char:nnn {Nabla}{bfup,bfit}{#1}
-     }
-   }
-  \bool_if:NTF \g_@@_literal_partial_bool
-   {
-    \@@_set_normal_char:nnn {partial}{bfup}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_uppartial_bool
-     {
-      \@@_set_normal_char:nnn {partial}{bfup,bfit}{#1}
-     }
-   }
-  \@@_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {bfup} {Nabla}   {up,it}{#1}
-  \@@_set_mathalphabet_pos:nnnn {bfup} {digamma} {up}{#1}
-  \@@_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up}{#1}
-  \@@_set_mathalphabet_pos:nnnn {bf}   {digamma} {up}{#1}
-  \@@_set_mathalphabet_pos:nnnn {bf}   {Digamma} {up}{#1}
-  \bool_if:NTF \g_@@_literal_partial_bool
-   {
-    \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_uppartial_bool
-     {
-      \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g_@@_literal_Nabla_bool
-   {
-    \@@_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_upNabla_bool
-     {
-      \@@_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
+  {
+    \bool_if:NTF \g_@@_literal_Nabla_bool
+      {
+        \@@_set_normal_char:nnn {Nabla} {bfup} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_upNabla_bool
+          {
+            \@@_set_normal_char:nnn {Nabla} {bfup,bfit} {#1}
+          }
+      }
+    \bool_if:NTF \g_@@_literal_partial_bool
+      {
+        \@@_set_normal_char:nnn {partial} {bfup} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_uppartial_bool
+          {
+            \@@_set_normal_char:nnn {partial} {bfup,bfit} {#1}
+          }
+      }
+    \@@_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bfup} {Nabla}   {up,it} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bfup} {digamma} {up} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bf}   {digamma} {up} {#1}
+    \@@_set_mathalphabet_pos:nnnn {bf}   {Digamma} {up} {#1}
+    \bool_if:NTF \g_@@_literal_partial_bool
+      {
+        \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_uppartial_bool
+          {
+            \@@_set_mathalphabet_pos:nnnn {bf} {partial} {up,it} {#1}
+          }
+      }
+    \bool_if:NTF \g_@@_literal_Nabla_bool
+      {
+        \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1}
+      }
+      {
+        \bool_if:NT \g_@@_upNabla_bool
+          {
+            \@@_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it} {#1}
+          }
+      }
+  }
 %    \end{macrocode}
 %
 % \subsection{Bold fractur or fraktur or blackletter: bffrak}
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {bffrak} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1}
+  }
 
 \@@_new_alphabet_config:nnn {bffrak} {latin}
- {
-  \@@_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Bold script or calligraphic: bfscr}
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {bfscr} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1}
+  }
 \@@_new_alphabet_config:nnn {bfscr} {latin}
- {
-  \@@_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1}
+  }
 \@@_new_alphabet_config:nnn {bfcal} {Latin}
- {
-  \@@_set_mathalphabet_Latin:nnn {bfcal}  {up,it}{#1}
- }
+  {
+    \@@_set_mathalphabet_Latin:nnn {bfcal}  {up,it}{#1}
+  }
 %    \end{macrocode}
 %
 % \subsection{Bold upright sans serif: bfsfup}
 %    \begin{macrocode}
 \@@_new_alphabet_config:nnn {bfsfup} {num}
- {
-  \@@_set_mathalphabet_numbers:nnn {bfsf}   {up}{#1}
-  \@@_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1}
- }
+  {
+    \@@_set_mathalphabet_numbers:nnn {bfsf}   {up}{#1}
+    \@@_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1}
+  }
 \@@_new_alphabet_config:nnn {bfsfup} {Latin}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_Latin:nn {bfsfup} {#1}
-    \@@_set_mathalphabet_Latin:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_upsans_bool
-     {
-      \@@_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
-      \@@_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_Latin:nn {bfsfup} {#1}
+        \@@_set_mathalphabet_Latin:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g_@@_upsans_bool
+          {
+            \@@_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
+            \@@_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \@@_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1}
+  }
 
 \@@_new_alphabet_config:nnn {bfsfup} {latin}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_latin:nn {bfsfup} {#1}
-    \@@_set_mathalphabet_latin:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_upsans_bool
-     {
-      \@@_set_normal_latin:nn {bfsfup,bfsfit} {#1}
-      \@@_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_latin:nn {bfsfup} {#1}
+        \@@_set_mathalphabet_latin:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g_@@_upsans_bool
+          {
+            \@@_set_normal_latin:nn {bfsfup,bfsfit} {#1}
+            \@@_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \@@_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1}
+  }
 
 \@@_new_alphabet_config:nnn {bfsfup} {Greek}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_Greek:nn {bfsfup}{#1}
-    \@@_set_mathalphabet_Greek:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g_@@_upsans_bool
-     {
-      \@@_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
-      \@@_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \@@_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_Greek:nn {bfsfup}{#1}
+        \@@_set_mathalphabet_Greek:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g_@@_upsans_bool
+          {
+            \@@_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
+            \@@_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \@@_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1}
+  }
 
 \@@_new_alphabet_config:nnn {bfsfup} {greek}
- {
-  \bool_if:NTF \g_@@_sfliteral_bool
-   {
-    \@@_set_normal_greek:nn {bfsfup} {#1}
-    \@@_set_mathalphabet_greek:nnn {bfsf} {up} {#1}
-   }
-   {
-    \bool_if:NT \g_@@_upsans_bool
-     {
-      \@@_set_normal_greek:nn {bfsfup,bfsfit} {#1}
-      \@@_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
-     }
-   }
-  \@@_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1}
- }
+  {
+    \bool_if:NTF \g_@@_sfliteral_bool
+      {
+        \@@_set_normal_greek:nn {bfsfup} {#1}
+        \@@_set_mathalphabet_greek:nnn {bfsf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g_@@_upsans_bool
+          {
+            \@@_set_normal_greek:nn {bfsfup,bfsfit} {#1}
+            \@@_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
+          }
+      }
+    \@@_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1}
+  }
+
 \@@_new_alphabet_config:nnn {bfsfup} {misc}
  {
   \bool_if:NTF \g_@@_literal_Nabla_bool
@@ -916,7 +925,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Added: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,225 @@
+%%^^A%% um-code-amsmath.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Compatibility with amsmath.
+
+% \section{Compatibility with \pkg{amsmath}}
+%
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+%
+% Since the mathcode of |`\-| is greater than eight bits, this piece of |\AtBeginDocument| code from \pkg{amsmath} dies if we try and set the maths font in the preamble:
+%    \begin{macrocode}
+\AtEndOfPackageFile * {amsmath}
+  {
+    \tl_remove_once:Nn \@begindocumenthook
+      {
+        \mathchardef\std at minus\mathcode`\-\relax
+        \mathchardef\std at equal\mathcode`\=\relax
+      }
+    \AtBeginDocument
+      {
+        \Umathcharnumdef\std at minus\Umathcodenum`-
+        \Umathcharnumdef\std at equal\Umathcodenum`=
+      }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+    \cs_set:Npn \@cdots {\mathinner{\unicodecdots}}
+    \cs_set_eq:NN \dotsb@ \cdots
+%    \end{macrocode}
+% This isn't as clever as the \pkg{amsmath} definition but I think it works:
+%    \begin{macrocode}
+%<*XE>
+    \def \resetMathstrut@
+      {%
+        \setbox\z@\hbox{$($}%)
+        \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
+      }
+%    \end{macrocode}
+% The |subarray| environment uses inappropriate font dimensions.
+%    \begin{macrocode}
+    \@@_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 }
+      {
+        \vcenter
+        \bgroup
+        \Let@
+        \restore at math@cr
+        \default at tag
+        \baselineskip \fontdimen 10~ \scriptfont \tw@
+        \advance \baselineskip \fontdimen 12~ \scriptfont \tw@
+        \lineskip \thr@@@@ \fontdimen 8~ \scriptfont \thr@@@@
+        \lineskiplimit \lineskip
+        \ialign
+        \bgroup
+        \ifx c #1 \hfil \fi
+        $ \m at th \scriptstyle ## $
+        \hfil
+        \crcr
+      }
+      {
+        \vcenter
+        \c_group_begin_token
+        \Let@
+        \restore at math@cr
+        \default at tag
+        \skip_set:Nn \baselineskip
+          {
+%    \end{macrocode}
+% Here we use stack top shift + stack bottom shift, which sounds reasonable.
+%    \begin{macrocode}
+            \@@_stack_num_up:N \scriptstyle
+            + \@@_stack_denom_down:N \scriptstyle
+          }
+%    \end{macrocode}
+% Here we use the minimum stack gap.
+%    \begin{macrocode}
+        \lineskip \@@_stack_vgap:N \scriptstyle
+        \lineskiplimit \lineskip
+        \ialign
+        \c_group_begin_token
+        \token_if_eq_meaning:NNT c #1 { \hfil }
+        \c_math_toggle_token
+        \m at th
+        \scriptstyle
+        \c_parameter_token \c_parameter_token
+        \c_math_toggle_token
+        \hfil
+        \crcr
+      }
+%</XE>
+%    \end{macrocode}
+% The roots need a complete rework.
+%    \begin{macrocode}
+%<*LU>
+  \@@_check_and_fix:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 }
+    {
+      \setbox \rootbox \hbox
+        {
+          $ \m at th \scriptscriptstyle { #1 } $
+        }
+      \mathchoice
+        { \r@@@@t \displaystyle      { #2 } }
+        { \r@@@@t \textstyle         { #2 } }~
+        { \r@@@@t \scriptstyle       { #2 } }
+        { \r@@@@t \scriptscriptstyle { #2 } }
+      \egroup
+    }
+    {
+      \bool_if:nTF
+        {
+          \int_compare_p:nNn { \uproot@ } = { \c_zero }
+          && \int_compare_p:nNn { \leftroot@ } = { \c_zero }
+        }
+        {
+          \Uroot \l_@@_radical_sqrt_tl { #1 } { #2 }
+        }
+        {
+          \hbox_set:Nn \rootbox
+            {
+              \c_math_toggle_token \m at th
+              \scriptscriptstyle { #1 }
+              \c_math_toggle_token
+            }
+          \mathchoice
+            { \r@@@@t \displaystyle      { #2 } }
+            { \r@@@@t \textstyle         { #2 } }
+            { \r@@@@t \scriptstyle       { #2 } }
+            { \r@@@@t \scriptscriptstyle { #2 } }
+        }
+       \c_group_end_token
+    }
+%</LU>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+  \@@_check_and_fix:NNnnn \r@@@@t \cs_set_nopar:Npn { #1 #2 }
+    {
+      \setboxz at h { $ \m at th #1 \sqrtsign { #2 } $ }
+      \dimen@ \ht\z@
+      \advance \dimen@ -\dp\z@
+      \setbox\@ne \hbox { $ \m at th #1 \mskip \uproot@ mu $ }
+      \advance \dimen@ by 1.667 \wd\@ne
+      \mkern -\leftroot@ mu
+      \mkern 5mu
+      \raise .6\dimen@ \copy\rootbox
+      \mkern -10mu
+      \mkern \leftroot@ mu
+      \boxz@
+    }
+%<*LU>
+    {
+      \hbox_set:Nn \l_tmpa_box
+        {
+          \c_math_toggle_token \m at th
+            #1 \mskip \uproot@ mu
+          \c_math_toggle_token
+        }
+      \Uroot \l_@@_radical_sqrt_tl
+        {
+          \box_move_up:nn { \box_wd:N \l_tmpa_box }
+            {
+              \hbox:n
+                {
+                  \c_math_toggle_token \m at th
+                    \mkern -\leftroot@ mu
+                    \box_use:N \rootbox
+                    \mkern \leftroot@ mu
+                  \c_math_toggle_token
+                }
+            }
+        }
+        { #2 }
+    }
+%</LU>
+%<*XE>
+    {
+      \hbox_set:Nn \l_tmpa_box
+        {
+          \c_math_toggle_token \m at th
+            #1 \sqrtsign { #2 }
+          \c_math_toggle_token
+        }
+      \hbox_set:Nn \l_tmpb_box
+        {
+          \c_math_toggle_token \m at th
+            #1 \mskip \uproot@ mu
+          \c_math_toggle_token
+        }
+      \mkern -\leftroot@ mu
+      \@@_mathstyle_scale:Nnn #1 { \kern } { \fontdimen 63 \g_@@_sqrt_font_cmd_tl }
+      \box_move_up:nn
+        {
+          \box_wd:N \l_tmpb_box + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
+            * \number \fontdimen 65 \g_@@_sqrt_font_cmd_tl / 100
+        }
+        { \box_use:N \rootbox }
+      \@@_mathstyle_scale:Nnn #1 { \kern } { \fontdimen 64 \g_@@_sqrt_font_cmd_tl }
+      \mkern \leftroot@ mu
+      \box_use_clear:N \l_tmpa_box
+    }
+%</XE>
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</package>
+%    \end{macrocode}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-amsmath.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-api.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The (underdeveloped) API to interface with the package internals.
 
 % \section{Programmers' interface}
 %
@@ -33,7 +34,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-base.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine.
 
 % \section{The \texttt{unicode-math.sty} loading file}
 %
@@ -37,10 +38,11 @@
 %    \begin{macrocode}
 \RequirePackage{expl3,xparse,l3keys2e}
 \RequirePackage{fontspec}
-\RequirePackage{ucharcat}
-\RequirePackage{fix-cm} % avoid some warnings (still necessary? check...)
 \RequirePackage{filehook}
+\RequirePackage{fix-cm}
+%<debug>\RequirePackage{l3benchmark}
 %    \end{macrocode}
+%
 % \paragraph{Bifurcate}
 %    \begin{macrocode}
 \ExplSyntaxOn
@@ -64,7 +66,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-compat.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Compatibility with 3rd party packages.
 
 % \section{Compatibility}
 %
@@ -6,52 +7,6 @@
 %<*package>
 %    \end{macrocode}
 %
-% \begin{macro}{\@@_check_and_fix:NNnnnn}
-% \darg{command}
-% \darg{factory command}
-% \darg{parameter text}
-% \darg{expected replacement text}
-% \darg{new replacement text for \LuaTeX}
-% \darg{new replacement text for \XeTeX}
-% Tries to patch \meta{command}.
-% If \meta{command} is undefined, do nothing.
-% Otherwise it must be a macro with the given \meta{parameter text} and \meta{expected replacement text}, created by the given \meta{factory command} or equivalent.
-% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text for \LuaTeX} or the \meta{new replacement text for \XeTeX}, depending on the engine.
-% Otherwise issue a warning and don’t overwrite.
-%    \begin{macrocode}
-\cs_new_protected_nopar:Nn \@@_check_and_fix:NNnnnn
- {
-  \cs_if_exist:NT #1
-   {
-    \token_if_macro:NTF #1
-     {
-      \group_begin:
-      #2 \@@_tmpa:w #3 { #4 }
-      \cs_if_eq:NNTF #1 \@@_tmpa:w
-       {
-        \msg_info:nnx { unicode-math } { patch-macro }
-          { \token_to_str:N #1 }
-        \group_end:
-        #2 #1 #3
-%<XE>          { #6 }
-%<LU>          { #5 }
-       }
-       {
-        \msg_warning:nnxxx { unicode-math } { wrong-meaning }
-          { \token_to_str:N #1 } { \token_to_meaning:N #1 }
-          { \token_to_meaning:N \@@_tmpa:w }
-        \group_end:
-       }
-     }
-     {
-      \msg_warning:nnx { unicode-math } { macro-expected }
-        { \token_to_str:N #1 }
-     }
-   }
- }
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{macro}{\@@_check_and_fix:NNnnn}
 % \darg{command}
 % \darg{factory command}
@@ -61,39 +16,43 @@
 % Tries to patch \meta{command}.
 % If \meta{command} is undefined, do nothing.
 % Otherwise it must be a macro with the given \meta{parameter text} and \meta{expected replacement text}, created by the given \meta{factory command} or equivalent.
-% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text}.
+% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text for \LuaTeX} or the \meta{new replacement text for \XeTeX}, depending on the engine.
 % Otherwise issue a warning and don’t overwrite.
 %    \begin{macrocode}
 \cs_new_protected_nopar:Nn \@@_check_and_fix:NNnnn
- {
-  \@@_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 }
- }
+  {
+    \cs_if_exist:NT #1
+      {
+        \token_if_macro:NTF #1
+          {
+            \group_begin:
+            #2 \@@_tmpa:w #3 { #4 }
+            \cs_if_eq:NNTF #1 \@@_tmpa:w
+              {
+                \msg_info:nnx { unicode-math } { patch-macro } { \token_to_str:N #1 }
+                \group_end:
+                #2 #1 #3 { #5 }
+              }
+              {
+                \msg_warning:nnxxx { unicode-math } { wrong-meaning }
+                  { \token_to_str:N #1 } { \token_to_meaning:N #1 }
+                  { \token_to_meaning:N \@@_tmpa:w }
+                \group_end:
+              }
+          }
+          {
+            \msg_warning:nnx { unicode-math } { macro-expected }
+              { \token_to_str:N #1 }
+          }
+       }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_check_and_fix_luatex:NNnnn}
-% \begin{macro}{\@@_check_and_fix_luatex:cNnnn}
-% \darg{command}
-% \darg{factory command}
-% \darg{parameter text}
-% \darg{expected replacement text}
-% \darg{new replacement text}
-% Tries to patch \meta{command}.
-% If \XeTeX\ is the current engine or \meta{command} is undefined, do nothing.
-% Otherwise it must be a macro with the given \meta{parameter text} and \meta{expected replacement text}, created by the given \meta{factory command} or equivalent.
-% In this case it will be overwritten using the \meta{parameter text} and the \meta{new replacement text}.
-% Otherwise issue a warning and don’t overwrite.
-%    \begin{macrocode}
-\cs_new_protected_nopar:Nn \@@_check_and_fix_luatex:NNnnn
- {
-%<LU>    \@@_check_and_fix:NNnnn #1 #2 { #3 } { #4 } { #5 }
- }
-\cs_generate_variant:Nn \@@_check_and_fix_luatex:NNnnn { c }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
+% \section{Patching/augmenting 3rd-party packages}
 %
-% \paragraph{\pkg{url}}
+% \subsection{\pkg{url}}
+%
 % Simply need to get \pkg{url} in a state such that
 % when it switches to math mode and enters \ascii\ characters, the maths
 % setup (i.e., \pkg{unicode-math}) doesn't remap the symbols into Plane 1.
@@ -104,310 +63,70 @@
 % font still work correctly.
 %    \begin{macrocode}
 \AtEndOfPackageFile * {url}
- {
-  \tl_put_left:Nn \Url at FormatString { \@@_switchto_up: }
-  \tl_put_right:Nn \UrlSpecials
-   {
-    \do\`{\mathchar`\`}
-    \do\'{\mathchar`\'}
-    \do\${\mathchar`\$}
-    \do\&{\mathchar`\&}
-   }
- }
+  {
+    \tl_put_left:Nn \Url at FormatString { \@@_switchto_up: }
+    \tl_put_right:Nn \UrlSpecials
+      {
+        \do \` { \mathchar`\` }
+        \do \' { \mathchar`\' }
+        \do \$ { \mathchar`\$ }
+        \do \& { \mathchar`\& }
+      }
+  }
 %    \end{macrocode}
 %
-% \paragraph{\pkg{amsmath}}
-% Since the mathcode of |`\-| is greater than eight bits, this piece of |\AtBeginDocument| code from \pkg{amsmath} dies if we try and set the maths font in the preamble:
-%    \begin{macrocode}
-\AtEndOfPackageFile * {amsmath}
- {
-%<*XE>
-    \tl_remove_once:Nn \@begindocumenthook
-     {
-      \mathchardef\std at minus\mathcode`\-\relax
-      \mathchardef\std at equal\mathcode`\=\relax
-     }
-    \def\std at minus{\Umathcharnum\Umathcodenum`\-\relax}
-    \def\std at equal{\Umathcharnum\Umathcodenum`\=\relax}
-%</XE>
-%    \end{macrocode}
 %
-%    \begin{macrocode}
-  \cs_set:Npn \@cdots {\mathinner{\cdots}}
-  \cs_set_eq:NN \dotsb@ \cdots
-%    \end{macrocode}
-% This isn't as clever as the \pkg{amsmath} definition but I think it works:
-%    \begin{macrocode}
-%<*XE>
-    \def \resetMathstrut@
-     {%
-      \setbox\z@\hbox{$($}%)
-      \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
-     }
-%    \end{macrocode}
-% The |subarray| environment uses inappropriate font dimensions.
-%    \begin{macrocode}
-    \@@_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 }
-     {
-      \vcenter
-      \bgroup
-      \Let@
-      \restore at math@cr
-      \default at tag
-      \baselineskip \fontdimen 10~ \scriptfont \tw@
-      \advance \baselineskip \fontdimen 12~ \scriptfont \tw@
-      \lineskip \thr@@@@ \fontdimen 8~ \scriptfont \thr@@@@
-      \lineskiplimit \lineskip
-      \ialign
-      \bgroup
-      \ifx c #1 \hfil \fi
-      $ \m at th \scriptstyle ## $
-      \hfil
-      \crcr
-     }
-     {
-      \vcenter
-      \c_group_begin_token
-      \Let@
-      \restore at math@cr
-      \default at tag
-      \skip_set:Nn \baselineskip
-       {
-%    \end{macrocode}
-% Here we use stack top shift + stack bottom shift, which sounds reasonable.
-%    \begin{macrocode}
-        \@@_stack_num_up:N \scriptstyle
-        + \@@_stack_denom_down:N \scriptstyle
-       }
-%    \end{macrocode}
-% Here we use the minimum stack gap.
-%    \begin{macrocode}
-      \lineskip \@@_stack_vgap:N \scriptstyle
-      \lineskiplimit \lineskip
-      \ialign
-      \c_group_begin_token
-      \token_if_eq_meaning:NNT c #1 { \hfil }
-      \c_math_toggle_token
-      \m at th
-      \scriptstyle
-      \c_parameter_token \c_parameter_token
-      \c_math_toggle_token
-      \hfil
-      \crcr
-     }
-%</XE>
-%    \end{macrocode}
-% The roots need a complete rework.
-%    \begin{macrocode}
-  \@@_check_and_fix_luatex:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 }
-   {
-    \setbox \rootbox \hbox
-     {
-      $ \m at th \scriptscriptstyle { #1 } $
-     }
-    \mathchoice
-      { \r@@@@t \displaystyle      { #2 } }
-      { \r@@@@t \textstyle         { #2 } }~
-      { \r@@@@t \scriptstyle       { #2 } }
-      { \r@@@@t \scriptscriptstyle { #2 } }
-    \egroup
-   }
-   {
-    \bool_if:nTF
-     {
-      \int_compare_p:nNn { \uproot@ } = { \c_zero }
-      && \int_compare_p:nNn { \leftroot@ } = { \c_zero }
-     }
-     {
-        \Uroot \l_@@_radical_sqrt_tl { #1 } { #2 }
-     }
-     {
-      \hbox_set:Nn \rootbox
-       {
-        \c_math_toggle_token
-        \m at th
-        \scriptscriptstyle { #1 }
-        \c_math_toggle_token
-       }
-      \mathchoice
-        { \r@@@@t \displaystyle      { #2 } }
-        { \r@@@@t \textstyle         { #2 } }
-        { \r@@@@t \scriptstyle       { #2 } }
-        { \r@@@@t \scriptscriptstyle { #2 } }
-     }
-    \c_group_end_token
-   }
-  \@@_check_and_fix:NNnnnn \r@@@@t \cs_set_nopar:Npn { #1 #2 }
-   {
-    \setboxz at h { $ \m at th #1 \sqrtsign { #2 } $ }
-    \dimen@ \ht\z@
-    \advance \dimen@ -\dp\z@
-    \setbox\@ne \hbox { $ \m at th #1 \mskip \uproot@ mu $ }
-    \advance \dimen@ by 1.667 \wd\@ne
-    \mkern -\leftroot@ mu
-    \mkern 5mu
-    \raise .6\dimen@ \copy\rootbox
-    \mkern -10mu
-    \mkern \leftroot@ mu
-    \boxz@
-   }
-   {
-    \hbox_set:Nn \l_tmpa_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \mskip \uproot@ mu
-      \c_math_toggle_token
-     }
-      \Uroot \l_@@_radical_sqrt_tl
-     {
-      \box_move_up:nn { \box_wd:N \l_tmpa_box }
-       {
-        \hbox:n
-         {
-          \c_math_toggle_token
-          \m at th
-          \mkern -\leftroot@ mu
-          \box_use:N \rootbox
-          \mkern \leftroot@ mu
-          \c_math_toggle_token
-         }
-       }
-     }
-     { #2 }
-   }
-   {
-    \hbox_set:Nn \l_tmpa_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \sqrtsign { #2 }
-      \c_math_toggle_token
-     }
-    \hbox_set:Nn \l_tmpb_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \mskip \uproot@ mu
-      \c_math_toggle_token
-     }
-    \mkern -\leftroot@ mu
-    \@@_mathstyle_scale:Nnn #1 { \kern }
-     {
-      \fontdimen 63 \l_@@_font
-     }
-    \box_move_up:nn
-     {
-      \box_wd:N \l_tmpb_box
-      + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
-      * \number \fontdimen 65 \l_@@_font / 100
-     }
-     {
-      \box_use:N \rootbox
-     }
-    \@@_mathstyle_scale:Nnn #1 { \kern }
-     {
-      \fontdimen 64 \l_@@_font
-     }
-    \mkern \leftroot@ mu
-    \box_use_clear:N \l_tmpa_box
-   }
- }
-%    \end{macrocode}
+% \subsection{\pkg{mathtools}}
 %
-% \paragraph{\pkg{amsopn}}
-% This code is to improve the output of analphabetic symbols in text of operator names (\cs{sin}, \cs{cos}, etc.). Just comment out the offending lines for now:
-%    \begin{macrocode}
-%<*XE>
-\AtEndOfPackageFile * {amsopn}
- {
-  \cs_set:Npn \newmcodes@
-   {
-    \mathcode`\'39\scan_stop:
-    \mathcode`\*42\scan_stop:
-    \mathcode`\."613A\scan_stop:
-%%  \ifnum\mathcode`\-=45 \else
-%%    \mathchardef\std at minus\mathcode`\-\relax
-%%  \fi
-    \mathcode`\-45\scan_stop:
-    \mathcode`\/47\scan_stop:
-    \mathcode`\:"603A\scan_stop:
-   }
- }
-%</XE>
-%    \end{macrocode}
-%
-% \paragraph{\pkg{mathtools}}
 % \pkg{mathtools}’s |\cramped| command and others that make use of its internal version use an incorrect font dimension.
 %
-%    \begin{macrocode}
-%<*XE>
-\AtEndOfPackageFile * { mathtools }
- {
-    \@@_check_and_fix:NNnnn
-        \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 }
-     {
-      \sbox \z@
-       {
-        $
-        \m at th
-        #1
-        \nulldelimiterspace = \z@
-        \radical \z@ { #2 }
-        $
-       }
-      \ifx #1 \displaystyle
-        \dimen@ = \fontdimen 8 \textfont 3
-        \advance \dimen@ .25 \fontdimen 5 \textfont 2
-      \else
-        \dimen@ = 1.25 \fontdimen 8
-        \ifx #1 \textstyle
-          \textfont
-        \else
-          \ifx #1 \scriptstyle
-            \scriptfont
-          \else
-            \scriptscriptfont
-          \fi
-        \fi
-        3
-      \fi
-      \advance \dimen@ -\ht\z@
-      \ht\z@ = -\dimen@
-      \box\z@
-     }
-%    \end{macrocode}
 % The \XeTeX\ version is pretty similar to the legacy version, only using the correct font dimensions.
 % Note we used `\verb|\XeTeXradical|' with the family 255 to be almost sure
 % that the radical rule width is not set. Former use of `\verb|\newfam|' had an
 % upsetting effect on legacy math alphabets.
 %    \begin{macrocode}
+%<*XE>
+\AtEndOfPackageFile * { mathtools }
+  {
+    \@@_check_and_fix:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 }
      {
-      \hbox_set:Nn \l_tmpa_box
-       {
-        \color at setgroup
-        \c_math_toggle_token
-        \m at th
-        #1
-        \dim_zero:N \nulldelimiterspace
-        \XeTeXradical \c_two_hundred_fifty_five \c_zero { #2 }
-        \c_math_toggle_token
-        \color at endgroup
-       }
-      \box_set_ht:Nn \l_tmpa_box
-       {
-        \box_ht:N \l_tmpa_box
-%    \end{macrocode}
-% Here we use the radical vertical gap.
-%    \begin{macrocode}
-        - \@@_radical_vgap:N #1
-       }
-      \box_use_clear:N \l_tmpa_box
+       \sbox \z@ { $ \m at th #1 \nulldelimiterspace = \z@ \radical \z@ { #2 } $ }
+       \ifx #1 \displaystyle
+         \dimen@ = \fontdimen 8 \textfont 3
+         \advance \dimen@ .25 \fontdimen 5 \textfont 2
+       \else
+         \dimen@ = 1.25 \fontdimen 8
+         \ifx #1 \textstyle
+           \textfont
+         \else
+           \ifx #1 \scriptstyle
+             \scriptfont
+           \else
+             \scriptscriptfont
+           \fi
+         \fi
+         3
+       \fi
+       \advance \dimen@ -\ht\z@
+       \ht\z@ = -\dimen@
+       \box\z@
      }
- }
+     {
+       \hbox_set:Nn \l_tmpa_box
+         {
+           \color at setgroup \c_math_toggle_token \m at th
+             #1
+             \dim_zero:N \nulldelimiterspace
+             \XeTeXradical \c_two_hundred_fifty_five \c_zero { #2 }
+           \c_math_toggle_token \color at endgroup
+         }
+       \box_set_ht:Nn \l_tmpa_box
+         {
+           \box_ht:N \l_tmpa_box - \@@_radical_vgap:N #1
+         }
+       \box_use_clear:N \l_tmpa_box
+     }
+  }
 %</XE>
 %    \end{macrocode}
 %
@@ -416,40 +135,42 @@
 %   \pkg{mathtools}’s |\overbracket| and |\underbracket| take optional
 %   arguments and are defined in terms of rules, so we keep them, and rename
 %   ours to |\Uoverbracket| and |\Uunderbracket|.
+%
+%   Original definition used the height of |\braceld| which is not available
+%   with Unicode fonts, so we are hard coding the $5/18$ex suggested by
+%   \pkg{mathtools}’s documentation.
 %    \begin{macrocode}
 \AtEndOfPackageFile * { mathtools }
- {
+  {
     \cs_set_eq:NN \MToverbracket  \overbracket
     \cs_set_eq:NN \MTunderbracket \underbracket
 
     \AtBeginDocument
-     {
-      \msg_warning:nn { unicode-math } { mathtools-overbracket }
+      {
+        \msg_warning:nn { unicode-math } { mathtools-overbracket }
 
-	\def\downbracketfill#1#2
-	 {%
-%    \end{macrocode}
-%   Original definition used the height of |\braceld| which is not available
-%   with Unicode fonts, so we are hard coding the $5/18$ex suggested by
-%   \pkg{mathtools}’s documentation.
-%    \begin{macrocode}
-            \edef\l_MT_bracketheight_fdim{.27ex}%
-            \downbracketend{#1}{#2}
+    	  \cs_set:Npn \downbracketfill #1 #2
+	        {
+            \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
+            \downbracketend {#1} {#2}
             \leaders \vrule \@height #1 \@depth \z@ \hfill
-            \downbracketend{#1}{#2}%
-     }
-	\def\upbracketfill#1#2
-	 {%
-            \edef\l_MT_bracketheight_fdim{.27ex}%
-            \upbracketend{#1}{#2}
+            \downbracketend {#1} {#2}
+          }
+
+	      \cs_set:Npn \upbracketfill #1 #2
+	        {
+            \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
+            \upbracketend {#1} {#2}
             \leaders \vrule \@height \z@ \@depth #1 \hfill
-            \upbracketend{#1}{#2}%
+            \upbracketend {#1} {#2}
+          }
+
+	      \cs_set_eq:NN \Uoverbracket  \overbracket
+	      \cs_set_eq:NN \Uunderbracket \underbracket
+        \cs_set_eq:NN \overbracket   \MToverbracket
+        \cs_set_eq:NN \underbracket  \MTunderbracket
      }
-	\let\Uoverbracket =\overbracket
-	\let\Uunderbracket=\underbracket
-        \let\overbracket  =\MToverbracket
-        \let\underbracket =\MTunderbracket
-     }% end of AtBeginDocument
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -464,12 +185,14 @@
 %   \cmd{\providecommand} \cmd{\AtBeginDocument}, we can just define the
 %   offending commands here.
 %    \begin{macrocode}
-  \msg_warning:nn { unicode-math } { mathtools-colon }
-  \NewDocumentCommand \dblcolon { } { \Colon }
-  \NewDocumentCommand \coloneqq { } { \coloneq }
-  \NewDocumentCommand \Coloneqq { } { \Coloneq }
-  \NewDocumentCommand \eqqcolon { } { \eqcolon }
- }
+\AtEndOfPackageFile * { mathtools }
+  {
+    \msg_warning:nn { unicode-math } { mathtools-colon }
+    \NewDocumentCommand \dblcolon { } { \Colon }
+    \NewDocumentCommand \coloneqq { } { \coloneq }
+    \NewDocumentCommand \Coloneqq { } { \Coloneq }
+    \NewDocumentCommand \eqqcolon { } { \eqcolon }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -476,7 +199,7 @@
 % \end{macro}
 % \end{macro}
 %
-% \paragraph{\pkg{colonequals}}
+% \subsection{\pkg{colonequals}}
 %
 % \begin{macro}{\ratio}
 % \begin{macro}{\coloncolon}
@@ -489,15 +212,15 @@
 %   overwrite their definitions.
 %    \begin{macrocode}
 \AtEndOfPackageFile * { colonequals }
- {
-  \msg_warning:nn { unicode-math } { colonequals }
-  \RenewDocumentCommand \ratio { } { \mathratio }
-  \RenewDocumentCommand \coloncolon { } { \Colon }
-  \RenewDocumentCommand \minuscolon { } { \dashcolon }
-  \RenewDocumentCommand \colonequals { } { \coloneq }
-  \RenewDocumentCommand \equalscolon { } { \eqcolon }
-  \RenewDocumentCommand \coloncolonequals { } { \Coloneq }
- }
+  {
+    \msg_warning:nn { unicode-math } { colonequals }
+    \RenewDocumentCommand \ratio { } { \mathratio }
+    \RenewDocumentCommand \coloncolon { } { \Colon }
+    \RenewDocumentCommand \minuscolon { } { \dashcolon }
+    \RenewDocumentCommand \colonequals { } { \coloneq }
+    \RenewDocumentCommand \equalscolon { } { \eqcolon }
+    \RenewDocumentCommand \coloncolonequals { } { \Coloneq }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -521,7 +244,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-epilogue.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Assorted definitions to close up.
 
 % \section{Epilogue}
 %
@@ -16,23 +17,25 @@
 % to upright or italic happens with the mathcode definitions, whereas these macros
 % just stand for the literal Unicode characters.
 %    \begin{macrocode}
-\AtBeginDocument{\@@_resolve_greek:}
+\AtBeginDocument { \@@_resolve_greek: }
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_new:Npn \@@_resolve_greek:
- {
-  \clist_map_inline:nn
-   {
-    Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,
-    alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
-    Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,
-    mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,
-    varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi
-   }
-   {
-    \tl_set:cx {##1} { \exp_not:c { mit ##1 } }
-    \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } }
-    \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } }
-   }
- }
+  {
+    \clist_map_inline:nn
+      {
+        Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,
+        alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
+        Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,
+        mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,
+        varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi
+      }
+      {
+        \tl_set:cx {##1} { \exp_not:c { mit ##1 } }
+        \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } }
+        \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -42,128 +45,102 @@
 %
 % Make sure \cs{Uroot} is defined in the case where the \LaTeX{}
 % kernel doesn't make it available with its native name.
+%
+% \begin{macro}{\@@_redefine_radical:}
 %    \begin{macrocode}
-%<*LU>
-\cs_if_exist:NF \Uroot
-  { \cs_new_eq:NN \Uroot \luatexUroot }
-%</LU>
+\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \@@_redefine_radical: } }
 %    \end{macrocode}
 %
-%    \begin{macrocode}
-\AtBeginDocument{\@@_redefine_radical:}
-\cs_new:Nn \@@_redefine_radical:
-%<*XE>
- {
-  \@ifpackageloaded { amsmath } { }
-   {
-%    \end{macrocode}
 % \begin{macro}{\r@@t}
 % \darg{A mathstyle (for \cmd\mathpalette)}
 % \darg{Leading superscript for the sqrt sign}
 % A re-implementation of \LaTeX's hard-coded n-root sign using the appropriate \cmd\fontdimen s.
 %    \begin{macrocode}
+%<*XE>
+\cs_new:Nn \@@_redefine_radical:
+  {
     \cs_set_nopar:Npn \r@@@@t ##1 ##2
-     {
-      \hbox_set:Nn \l_tmpa_box
-       {
-        \c_math_toggle_token
-        \m at th
-        ##1
-        \sqrtsign { ##2 }
-        \c_math_toggle_token
-       }
-      \@@_mathstyle_scale:Nnn ##1 { \kern }
-       { \fontdimen 63 \l_@@_font }
-      \box_move_up:nn
-       {
-        (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
-        * \number \fontdimen 65 \l_@@_font / 100
-       }
-       { \box_use:N \rootbox }
-      \@@_mathstyle_scale:Nnn ##1 { \kern }
-       { \fontdimen 64 \l_@@_font }
-      \box_use_clear:N \l_tmpa_box
-     }
+      {
+        \hbox_set:Nn \l_tmpa_box
+          {
+            \c_math_toggle_token \m at th
+            ##1 \sqrtsign { ##2 }
+            \c_math_toggle_token
+          }
+        \@@_mathstyle_scale:NnnN ##1 { \kern } { \fontdimen 63 \g_@@_sqrt_font_cmd_tl } \g_@@_sqrt_font_cmd_tl
+        \box_move_up:nn
+          {
+            (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) * \number \fontdimen 65 \g_@@_sqrt_font_cmd_tl / 100
+          }
+          { \box_use:N \rootbox }
+        \@@_mathstyle_scale:NnnN ##1 { \kern } { \fontdimen 64 \g_@@_sqrt_font_cmd_tl } \g_@@_sqrt_font_cmd_tl
+        \box_use_clear:N \l_tmpa_box
+      }
+  }
+%</XE>
 %    \end{macrocode}
 % \end{macro}
-%    \begin{macrocode}
-   }
- }
-%</XE>
-%<*LU>
- {
-  \@ifpackageloaded { amsmath } { }
-   {
-%    \end{macrocode}
+%
 % \begin{macro}{\root}
 % Redefine this macro for \LuaTeX, which provides us a nice primitive to use.
 %    \begin{macrocode}
+%<*LU>
+\cs_new:Nn \@@_redefine_radical:
+  {
     \cs_set:Npn \root ##1 \of ##2
-     {
-       \Uroot \l_@@_radical_sqrt_tl { ##1 } { ##2 }
-     }
+      {
+        \Uroot \l_@@_radical_sqrt_tl { ##1 } { ##2 }
+      }
+  }
+%</LU>
 %    \end{macrocode}
 % \end{macro}
-%    \begin{macrocode}
-   }
- }
-%</LU>
-%    \end{macrocode}
+% \end{macro}
 %
+%
 % \subsubsection{Active fractions}
-% Active fractions can be setup independently of any maths font definition;
+%
+% Active fractions can be set up independently of any maths font definition;
 % all it requires is a mapping from the Unicode input chars to the relevant
 % \LaTeX\ fraction declaration.
 %
 %    \begin{macrocode}
-\cs_new:Npn \@@_define_active_frac:Nw #1 #2/#3
- {
-  \char_set_catcode_active:N #1
-  \@@_char_gmake_mathactive:N #1
-  \tl_rescan:nn
-   {
-    \catcode`\_=11\relax
-    \catcode`\:=11\relax
-   }
-   {
-    \cs_gset:Npx #1
-     {
-      \bool_if:NTF \l_@@_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac}
-          {#2} {#3}
-     }
-   }
- }
+\cs_new:Nn \@@_which_frac:nn
+  {
+    \bool_if:NTF \l_@@_smallfrac_bool {\tfrac} {\frac} {#1} {#2}
+  }
 %    \end{macrocode}
-% These are redefined for each math font selection in case the |active-frac|
-% feature changes.
+%
 %    \begin{macrocode}
 \cs_new:Npn \@@_setup_active_frac:
- {
-  \group_begin:
-  \@@_define_active_frac:Nw  ^^^^2189  0/3
-  \@@_define_active_frac:Nw  ^^^^2152  1/{10}
-  \@@_define_active_frac:Nw  ^^^^2151  1/9
-  \@@_define_active_frac:Nw  ^^^^215b  1/8
-  \@@_define_active_frac:Nw  ^^^^2150  1/7
-  \@@_define_active_frac:Nw  ^^^^2159  1/6
-  \@@_define_active_frac:Nw  ^^^^2155  1/5
-  \@@_define_active_frac:Nw  ^^^^00bc  1/4
-  \@@_define_active_frac:Nw  ^^^^2153  1/3
-  \@@_define_active_frac:Nw  ^^^^215c  3/8
-  \@@_define_active_frac:Nw  ^^^^2156  2/5
-  \@@_define_active_frac:Nw  ^^^^00bd  1/2
-  \@@_define_active_frac:Nw  ^^^^2157  3/5
-  \@@_define_active_frac:Nw  ^^^^215d  5/8
-  \@@_define_active_frac:Nw  ^^^^2154  2/3
-  \@@_define_active_frac:Nw  ^^^^00be  3/4
-  \@@_define_active_frac:Nw  ^^^^2158  4/5
-  \@@_define_active_frac:Nw  ^^^^215a  5/6
-  \@@_define_active_frac:Nw  ^^^^215e  7/8
-  \group_end:
- }
-\@@_setup_active_frac:
+  {
+    \@@_mathactive_remap:nn {"2189}  { \@@_which_frac:nn {0} {3}  }
+    \@@_mathactive_remap:nn {"2152}  { \@@_which_frac:nn {1} {10} }
+    \@@_mathactive_remap:nn {"2151}  { \@@_which_frac:nn {1} {9}  }
+    \@@_mathactive_remap:nn {"215B}  { \@@_which_frac:nn {1} {8}  }
+    \@@_mathactive_remap:nn {"2150}  { \@@_which_frac:nn {1} {7}  }
+    \@@_mathactive_remap:nn {"2159}  { \@@_which_frac:nn {1} {6}  }
+    \@@_mathactive_remap:nn {"2155}  { \@@_which_frac:nn {1} {5}  }
+    \@@_mathactive_remap:nn {"00BC}  { \@@_which_frac:nn {1} {4}  }
+    \@@_mathactive_remap:nn {"2153}  { \@@_which_frac:nn {1} {3}  }
+    \@@_mathactive_remap:nn {"215C}  { \@@_which_frac:nn {3} {8}  }
+    \@@_mathactive_remap:nn {"2156}  { \@@_which_frac:nn {2} {5}  }
+    \@@_mathactive_remap:nn {"00BD}  { \@@_which_frac:nn {1} {2}  }
+    \@@_mathactive_remap:nn {"2157}  { \@@_which_frac:nn {3} {5}  }
+    \@@_mathactive_remap:nn {"215D}  { \@@_which_frac:nn {5} {8}  }
+    \@@_mathactive_remap:nn {"2154}  { \@@_which_frac:nn {2} {3}  }
+    \@@_mathactive_remap:nn {"00BE}  { \@@_which_frac:nn {3} {4}  }
+    \@@_mathactive_remap:nn {"2158}  { \@@_which_frac:nn {4} {5}  }
+    \@@_mathactive_remap:nn {"215A}  { \@@_which_frac:nn {5} {6}  }
+    \@@_mathactive_remap:nn {"215E}  { \@@_which_frac:nn {7} {8}  }
+  }
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\AtBeginDocument { \@@_setup_active_frac: }
+%    \end{macrocode}
+%
+%
 % \subsection{Synonyms and all the rest}
 %
 % These are symbols with multiple names. Eventually to be taken care of
@@ -214,9 +191,9 @@
 %    \begin{macrocode}
 \cs_set_eq:NN \latexe_underbar:n \underbar
 \renewcommand\underbar
- {
-  \mode_if_math:TF \mathunderbar \latexe_underbar:n
- }
+  {
+    \mode_if_math:TF \mathunderbar \latexe_underbar:n
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -226,15 +203,15 @@
 % We hope no-one will notice.
 %    \begin{macrocode}
 \@ifpackageloaded{amsmath}
- {
-  % define their own colon, perhaps I should just steal it. (It does look much better.)
- }
- {
-  \cs_set_protected:Npn \colon
-   {
-    \bool_if:NTF \g_@@_literal_colon_bool {:} { \mathpunct{:} }
-   }
- }
+  {
+    % define their own colon, perhaps I should just steal it. (It does look much better.)
+  }
+  {
+    \cs_set_protected:Npn \colon
+      {
+        \bool_if:NTF \g_@@_literal_colon_bool {:} { \mathpunct{:} }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -249,9 +226,11 @@
 % \end{macro}
 %
 % \paragraph{Symbols}
+%
 %    \begin{macrocode}
 \cs_set_protected:Npn \| {\Vert}
 %    \end{macrocode}
+%
 % \cs{mathinner} items:
 %    \begin{macrocode}
 \cs_set_protected:Npn \mathellipsis {\mathinner{\unicodeellipsis}}
@@ -261,18 +240,20 @@
 %    \begin{macrocode}
 \cs_set_eq:NN \@@_text_slash: \slash
 \cs_set_protected:Npn \slash
- {
-  \mode_if_math:TF {\mathslash} {\@@_text_slash:}
- }
+  {
+    \mode_if_math:TF {\mathslash} {\@@_text_slash:}
+  }
 %    \end{macrocode}
 %
+%
 % \subsubsection{\cs{not}}
 % \label{sec:negations}
 %
 % The situation of \cs{not} symbol is currently messy, in Unicode it is defined
 % as a combining mark so naturally it should be treated as a math accent,
-% however neither Lua\TeX\ nor \XeTeX\ correctly place it as it needs special
-% treatment compared to other accents, furthermore a math accent changes the
+% however \XeTeX\ does not correctly place it as it needs special
+% treatment compared to other accents.
+% Furthermore a math accent changes the
 % spacing of its nucleus, so \cs{not=} will be spaced as an ordinary not
 % relational symbol, which is undesired.
 %
@@ -283,52 +264,126 @@
 % This code is based on an answer to a TeX -- Stack Exchange question by Enrico
 % Gregorio\footnote{\url{http://tex.stackexchange.com/a/47260/729}}.
 %
+% \begin{macro}{\not}
 %    \begin{macrocode}
-\cs_new:Npn \@@_newnot:N #1
- {
-   \tl_set:Nx \l_not_token_name_tl { \token_to_str:N #1 }
-   \exp_args:Nx \tl_if_empty:nF { \tl_tail:V \l_not_token_name_tl }
-    {
-     \tl_set:Nx \l_not_token_name_tl { \tl_tail:V \l_not_token_name_tl }
-    }
-   \cs_if_exist:cTF { n \l_not_token_name_tl }
-    {
-     \use:c { n \l_not_token_name_tl }
-    }
-    {
-     \cs_if_exist:cTF { not \l_not_token_name_tl }
+\DeclareDocumentCommand \not {m}
+  {
+    \tl_set:Nx \l_@@_not_token_name_tl { \cs_to_str:N #1 }
+    \tl_if_empty:NT \l_@@_not_token_name_tl
       {
-       \use:c { not \l_not_token_name_tl }
+        \tl_set:Nx \l_@@_not_token_name_tl { \token_to_str:N #1 }
       }
+    \cs_if_exist:cTF { not \l_@@_not_token_name_tl }
       {
-       \@@_oldnot: #1
+        \use:c { not \l_@@_not_token_name_tl }
       }
-    }
- }
+      {
+        \cs_if_exist:cTF { n \l_@@_not_token_name_tl }
+          {
+            \use:c { n \l_@@_not_token_name_tl }
+          }
+          {
+            \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1
+          }
+      }
+  }
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\NewNegationCommand}
+% \begin{macro}{\RenewNegationCommand}
 %    \begin{macrocode}
-\cs_set_eq:NN \@@_oldnot: \not
-\AtBeginDocument{\cs_set_eq:NN \not \@@_newnot:N}
+\DeclareDocumentCommand \NewNegationCommand {mm}
+  {
+    \@@_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2}
+  }
 %    \end{macrocode}
+%
 %    \begin{macrocode}
-\cs_new_protected_nopar:Nn \@@_setup_negations:
- {
-  \cs_gset:cpn { not= }    { \neq }
-  \cs_gset:cpn { not< }    { \nless }
-  \cs_gset:cpn { not> }    { \ngtr }
-  \cs_gset:Npn  \ngets     { \nleftarrow }
-  \cs_gset:Npn  \nsimeq    { \nsime }
-  \cs_gset:Npn  \nequal    { \ne }
-  \cs_gset:Npn  \nle       { \nleq }
-  \cs_gset:Npn  \nge       { \ngeq }
-  \cs_gset:Npn  \ngreater  { \ngtr }
-  \cs_gset:Npn  \nforksnot { \forks }
- }
+\DeclareDocumentCommand \RenewNegationCommand {mm}
+  {
+    \@@_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2}
+  }
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\cs_set:Nn \@@_set_negation_command:Nnn
+  {
+    \tl_set:Nx \l_@@_not_token_name_tl { \cs_to_str:N #2 }
+    \tl_if_empty:NT \l_@@_not_token_name_tl
+      {
+        \tl_set:Nx \l_@@_not_token_name_tl { \token_to_str:N #2 }
+      }
+    #1 { not \l_@@_not_token_name_tl } { #3 }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
 %
+%    \begin{macrocode}
+\NewNegationCommand { = }    { \neq   }
+\NewNegationCommand { < }    { \nless }
+\NewNegationCommand { > }    { \ngtr  }
+\NewNegationCommand { \gets     } { \nleftarrow }
+\NewNegationCommand { \simeq    } { \nsime      }
+\NewNegationCommand { \equal    } { \ne         }
+\NewNegationCommand { \le       } { \nleq       }
+\NewNegationCommand { \ge       } { \ngeq       }
+\NewNegationCommand { \greater  } { \ngtr       }
+\NewNegationCommand { \forksnot } { \forks      }
+%    \end{macrocode}
 %
+%
+% \subsubsection{Full-width remapping}
+%
+% While this could be done with the full mathcode remapping machinery used
+% for the other purposes, it would be fairly redundant with plain ASCII.
+% Worse, this would slow down what is already an inefficient part of \pkg{unicode-math}.
+%
+% Instead we use mathactive to do a plain old mapping from full-width to ASCII directly.
+%
+% Until I get requests for it, I've not included symbols or punctuation here.
+%
+% \paragraph{Numbers}
+%
 %    \begin{macrocode}
+\int_step_inline:nnnn {0} {1} {9}
+  {
+    \@@_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}}
+  }
+%    \end{macrocode}
+%
+% \paragraph{Letters}
+%
+%    \begin{macrocode}
+\int_step_inline:nnnn {0} {1} {26}
+  {
+    \@@_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}}
+    \@@_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}}
+  }
+%    \end{macrocode}
+%
+%
+% \subsection{Legacy characters}
+%
+% \begin{macro}{\@@_undeclare_symbol:N}
+%    \begin{macrocode}
+\cs_new:Nn \@@_undeclare_symbol:N
+  {
+    \cs_set_protected:Npn #1
+      { \@@_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% If you have better ideas about what to do here, please mention.
+%    \begin{macrocode}
+\@@_undeclare_symbol:N \arrowvert
+\@@_undeclare_symbol:N \Arrowvert
+\@@_undeclare_symbol:N \bracevert
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 
@@ -343,7 +398,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontopt.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Keyval for `\setmathfont`
 
 % \section{Font loading options}
 %
@@ -21,79 +22,79 @@
 % \subsection{Script and scriptscript font options}
 %    \begin{macrocode}
 \keys_define:nn {unicode-math}
- {
-  script-features  .tl_set:N =  \l_@@_script_features_tl ,
-  sscript-features .tl_set:N = \l_@@_sscript_features_tl ,
-       script-font .tl_set:N =      \l_@@_script_font_tl ,
-      sscript-font .tl_set:N =     \l_@@_sscript_font_tl ,
- }
+  {
+    script-features  .tl_set:N =  \l_@@_script_features_tl ,
+    sscript-features .tl_set:N = \l_@@_sscript_features_tl ,
+         script-font .tl_set:N =      \l_@@_script_font_tl ,
+        sscript-font .tl_set:N =     \l_@@_sscript_font_tl ,
+  }
 %    \end{macrocode}
 %
 % \subsection{Range processing}
 % \seclabel{rangeproc}
 %
+% Locally redefined all math symbol commands to their slot number prefixed by a quark.
+% Similary for the math classes.
 %    \begin{macrocode}
 \keys_define:nn {unicode-math}
- {
-  range .code:n =
-   {
-    \bool_set_false:N \l_@@_init_bool
+  {
+    range .code:n =
+      {
+        \bool_set_false:N \l_@@_init_bool
+        \@@_range_init:
+        \group_begin:
+          \seq_map_inline:Nn \g_@@_mathclasses_seq
+            {
+              \cs_set:Npn ##1 { \use_none:n \q_unicode_math \exp_not:N ##1 }
+            }
+          \cs_set:Npn \_@@_sym:nnn ##1 ##2 ##3
+            {
+              \cs_set:Npn ##2 { \use_none:n \q_unicode_math ##1 }
+            }
+          \@@_input_math_symbol_table:
+          \@@_range_process:n {#1}
+        \group_end:
+      }
+  }
 %    \end{macrocode}
+%
+% \begin{macro}{\@@_range_init:}
 % Set processing functions if we're not defining the full Unicode math repetoire.
 % Math symbols are defined with \cmd\_@@_sym:nnn; see \secref{mathsymbol}
 % for the individual definitions
 %    \begin{macrocode}
+\cs_new:Nn \@@_range_init:
+  {
     \int_incr:N \g_@@_fam_int
     \tl_set:Nx \l_@@_symfont_label_tl {@@_fam\int_use:N\g_@@_fam_int}
     \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_parse:nnn
-    \cs_set_eq:NN \@@_set_mathalphabet_char:Nnn \@@_mathmap_parse:Nnn
     \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_parse:nnn
     \cs_set_eq:NN \@@_maybe_init_alphabet:n \use_none:n
-    \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_parse:nn
     \cs_set_eq:NN \@@_assign_delcode:nn \@@_assign_delcode_parse:nn
     \cs_set_eq:NN \@@_make_mathactive:nNN \@@_make_mathactive_parse:nNN
 %    \end{macrocode}
 % Proceed by filling up the various `range' seqs according to the user options.
 %    \begin{macrocode}
-    \seq_clear:N \l_@@_char_range_seq
-    \seq_clear:N \l_@@_mclass_range_seq
-    \seq_clear:N \l_@@_cmd_range_seq
-    \seq_clear:N \l_@@_mathalph_seq
-
-    \clist_map_inline:nn {#1}
-     {
-      \@@_if_mathalph_decl:nTF {##1}
-       {
-        \seq_put_right:Nx \l_@@_mathalph_seq
-         {
-          { \exp_not:V \l_@@_tmpa_tl }
-          { \exp_not:V \l_@@_tmpb_tl }
-          { \exp_not:V \l_@@_tmpc_tl }
-         }
-       }
-       {
+    \seq_gclear:N \g_@@_char_range_seq
+    \seq_gclear:N \g_@@_mclass_range_seq
+    \seq_gclear:N \g_@@_mathalph_seq
+  }
 %    \end{macrocode}
-% Four cases:
-% math class matching the known list;
-% single item that is a control sequence---command name;
-% single item that isn't---edge case, must be 0--9;
-% none of the above---char range.
+% \end{macro}
+%
+% \begin{macro}{\@@_range_process:}
 %    \begin{macrocode}
-        \seq_if_in:NnTF \g_@@_mathclasses_seq {##1}
-          { \seq_put_right:Nn \l_@@_mclass_range_seq {##1} }
-          {
-            \bool_lazy_and:nnTF { \tl_if_single_p:n {##1} } { \token_if_cs_p:N ##1 }
-              { \seq_put_right:Nn \l_@@_cmd_range_seq {##1} }
-              { \seq_put_right:Nn \l_@@_char_range_seq {##1} }
-          }
-       }
-     }
-   }
- }
+\cs_new:Nn \@@_range_process:n
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \@@_mathalph_decl:nF {##1} { \@@_range_decl:n {##1} }
+      }
+}
 %    \end{macrocode}
+% \end{macro}
 %
-%
-% \begin{macro}{\@@_if_mathalph_decl:nTF}
+% \begin{macro}{\@@_mathalph_decl:nF}
 % Possible forms of input:\\
 % |\mathscr|\\
 % |\mathscr->\mathup|\\
@@ -107,65 +108,95 @@
 % The remap style can also be |\mathcal->stixcal|, which I marginally prefer
 % in the general case.
 %    \begin{macrocode}
-\prg_new_conditional:Nnn \@@_if_mathalph_decl:n {TF}
- {
-  \tl_set:Nn  \l_@@_tmpa_tl {#1}
-  \tl_clear:N \l_@@_tmpb_tl
-  \tl_clear:N \l_@@_tmpc_tl
+\cs_new:Nn \@@_mathalph_decl:nF
+  {
 
-  \tl_if_in:NnT \l_@@_tmpa_tl {->}
-   { \exp_after:wN \@@_split_arrow:w \l_@@_tmpa_tl \q_nil }
+    \tl_set:Nn  \l_@@_tmpa_tl {#1}
+    \tl_clear:N \l_@@_tmpb_tl
+    \tl_clear:N \l_@@_tmpc_tl
 
-  \tl_if_in:NnT \l_@@_tmpa_tl {/}
-   { \exp_after:wN \@@_split_slash:w \l_@@_tmpa_tl \q_nil }
+    \tl_if_in:NnT \l_@@_tmpa_tl {->}
+      { \exp_after:wN \@@_split_arrow:w \l_@@_tmpa_tl \q_nil }
 
-  \tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:N \l_@@_tmpa_tl }
-  \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \math }
-  \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \sym }
-  \tl_trim_spaces:N \l_@@_tmpa_tl
+    \tl_if_in:NnT \l_@@_tmpa_tl {/}
+      { \exp_after:wN \@@_split_slash:w \l_@@_tmpa_tl \q_nil }
 
-  \tl_if_empty:NT \l_@@_tmpc_tl
-   { \tl_set_eq:NN \l_@@_tmpc_tl \l_@@_tmpa_tl }
+    \tl_set:Nx \l_@@_tmpa_tl { \tl_to_str:N \l_@@_tmpa_tl }
+    \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \math }
+    \exp_args:NNx \tl_remove_all:Nn \l_@@_tmpa_tl { \token_to_str:N \sym }
+    \tl_trim_spaces:N \l_@@_tmpa_tl
 
-  \seq_if_in:NVTF \g_@@_named_ranges_seq \l_@@_tmpa_tl
-   { \prg_return_true: } { \prg_return_false: }
- }
+    \tl_if_empty:NT \l_@@_tmpc_tl
+      { \tl_set_eq:NN \l_@@_tmpc_tl \l_@@_tmpa_tl }
+
+    \clist_if_in:NVT \g_@@_bad_alpha_clist \l_@@_tmpa_tl { \@@_error:n {range-not-bf-sf} }
+
+    \prop_if_exist:cTF {g_@@_named_range_ \l_@@_tmpa_tl _prop}
+      {
+        \seq_gput_right:Nx \g_@@_mathalph_seq
+          {
+            { \exp_not:V \l_@@_tmpa_tl }
+            { \exp_not:V \l_@@_tmpb_tl }
+            { \exp_not:V \l_@@_tmpc_tl }
+          }
+      }
+      {#2}
+  }
 %    \end{macrocode}
+%
 %    \begin{macrocode}
 \cs_set:Npn \@@_split_arrow:w #1->#2 \q_nil
- {
-  \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} }
-  \tl_set:Nx \l_@@_tmpc_tl { \tl_trim_spaces:n {#2} }
- }
+  {
+    \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} }
+    \tl_set:Nx \l_@@_tmpc_tl { \tl_trim_spaces:n {#2} }
+  }
 %    \end{macrocode}
 %    \begin{macrocode}
 \cs_set:Npn \@@_split_slash:w #1/#2 \q_nil
- {
-  \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} }
-  \tl_set:Nx \l_@@_tmpb_tl { \tl_trim_spaces:n {#2} }
- }
+  {
+    \tl_set:Nx \l_@@_tmpa_tl { \tl_trim_spaces:n {#1} }
+    \tl_set:Nx \l_@@_tmpb_tl { \tl_trim_spaces:n {#2} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% Pretty basic comma separated range processing.
-% Donald Arseneau's \pkg{selectp} package has a cleverer technique.
+% \begin{macro}{\@@_range_decl:n}
+%    \begin{macrocode}
+\cs_new_protected:Nn \@@_range_decl:n
+  {
+    \bool_lazy_and:nnTF { \tl_if_single_p:n {#1} } { \token_if_cs_p:N #1 }
+      {
+        \tl_if_in:VnTF #1 { \q_unicode_math }
+          {
+            \seq_if_in:NnTF \g__um_mathclasses_seq {#1}
+              { \seq_gput_right:Nn \g_@@_mclass_range_seq {#1} }
+              { \seq_gput_right:Nx \g_@@_char_range_seq   {#1} }
+          }
+          { \@@_error:nx {bad-cs-in-range} { \tl_to_str:n {#1} } }
+      }
+      {
+        \seq_gput_right:Nx \g_@@_char_range_seq {#1}
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
 %
-% \begin{macro}{\@@_if_char_spec:nNNT}
+%
+% \begin{macro}{\@@_if_char_spec:nNT}
 % \darg{Unicode character slot}
-% \darg{control sequence (character macro)}
 % \darg{control sequence (math class)}
 % \darg{code to execute}
-% This macro expands to |#4|
-% if any of its arguments are contained in \cmd\l_@@_char_range_seq.
+% This macro expands to |#3|
+% if any of its arguments are contained in \cmd\g_@@_char_range_seq.
 % This list can contain either character ranges (for checking with |#1|) or control sequences.
 % These latter can either be the command name of a specific character, \emph{or} the math
 % type of one (\eg, \cmd\mathbin).
 %
-% Character ranges are passed to \cs{@@_if_char_spec:nNNT}, which accepts input in the form shown in \tabref{ranges}.
+% Character ranges are passed to \cs{@@_if_char_spec:nNT}, which accepts input in the form shown in \tabref{ranges}.
 %
 % \begin{table}[htbp]
 % \centering
-% \topcaption{Ranges accepted by \cs{@@_if_char_spec:nNNT}.}
+% \topcaption{Ranges accepted by \cs{@@_if_char_spec:nNT}.}
 % \label{tab:ranges}
 % \begin{tabular}{>{\ttfamily}cc}
 % \textrm{Input} & Range \\
@@ -180,19 +211,18 @@
 % We have three tests, performed sequentially in order of execution time.
 % Any test finding a match jumps directly to the end.
 %    \begin{macrocode}
-\cs_new:Nn \@@_if_char_spec:nNNT
+\cs_new:Nn \@@_if_char_spec:nNT
   {
     % math class:
-    \seq_if_in:NnT \l_@@_mclass_range_seq {#3}
+    \seq_if_in:NnT \g_@@_mclass_range_seq {#2}
       { \use_none_delimit_by_q_nil:w }
 
-    % command name:
-    \seq_if_in:NnT \l_@@_cmd_range_seq {#2}
-      { \use_none_delimit_by_q_nil:w }
-
     % character slot:
-    \seq_map_inline:Nn \l_@@_char_range_seq
+    \seq_map_inline:Nn \g_@@_char_range_seq
       {
+        \@@_int_if_slot_is_last_in_range:nnT {#1} {##1}
+          { \seq_gremove_all:Nn \g_@@_char_range_seq {##1} }
+
         \@@_int_if_slot_in_range:nnT {#1} {##1}
           { \seq_map_break:n { \use_none_delimit_by_q_nil:w } }
       }
@@ -202,8 +232,11 @@
     \q_nil
     \use:n
       {
-        \clist_put_right:Nx \l_@@_char_nrange_clist { \int_eval:n {#1} }
-        #4
+        \cs_if_eq:NNT #2 \mathalpha
+          {
+            \clist_put_right:Nx \l_@@_mathmap_charints_clist { \int_eval:n {#1} }
+          }
+        #3
       }
   }
 %    \end{macrocode}
@@ -210,6 +243,9 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_int_if_slot_in_range:nnT}
+% Pretty basic comma separated range processing.
+% Donald Arseneau's \pkg{selectp} package has a cleverer technique.
+%
 % A `numrange' is like |-2,5-8,12,17-| (can be unsorted).
 %
 % Four cases, four argument types:
@@ -223,7 +259,9 @@
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_int_if_slot_in_range:nnT
-  { \@@_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} }
+  {
+    \@@_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -241,7 +279,28 @@
 %    \end{macrocode}
 % \end{macro}
 %
+%
 %    \begin{macrocode}
+\cs_new:Nn \@@_int_if_slot_is_last_in_range:nnT
+  {
+    \@@_numrange_last_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_set:Npn \@@_numrange_last_parse:nwT #1 #2 - #3 - #4 \q_stop #5
+  {
+    \tl_if_empty:nTF {#4} { \int_compare:nT {#1==#2} {#5} }
+      {
+    \tl_if_empty:nTF {#2} { \int_compare:nT {#1==#3} {#5} }
+      {
+                            \int_compare:nT {#1==#3} {#5}
+      } }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 
@@ -256,7 +315,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-fontparam.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,6 +1,7 @@
 %%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Cross-platform interface for font parameters
 
-% \section{Common interface for font parameters}
+% \section{Cross-platform interface for font parameters}
 %
 %    \begin{macrocode}
 %<*package>
@@ -134,18 +135,18 @@
 %    \begin{macrocode}
 \cs_new_protected_nopar:Nn \@@_font_param:nnnnn
 %<*XE>
-{
-  \@@_font_param_aux:ccnnnn { @@_ #1 :N } { @@_set_ #1 :Nn }
-    { #2 } { #3 } { #4 } { #5 }
-}
+  {
+    \@@_font_param_aux:ccnnnn { @@_ #1 :N } { @@_set_ #1 :Nn }
+      { #2 } { #3 } { #4 } { #5 }
+  }
 %</XE>
 %<*LU>
-{
-  \tl_set:Nn \l_@@_tmpa_tl { #1 }
-  \tl_remove_all:Nn \l_@@_tmpa_tl { _ }
-  \@@_font_param_aux:ccc { @@_ #1 :N } { @@_set_ #1 :Nn }
-    { Umath \l_@@_tmpa_tl }
-}
+  {
+    \tl_set:Nn \l_@@_tmpa_tl { #1 }
+    \tl_remove_all:Nn \l_@@_tmpa_tl { _ }
+    \@@_font_param_aux:ccc { @@_ #1 :N } { @@_set_ #1 :Nn }
+      { Umath \l_@@_tmpa_tl }
+  }
 %</LU>
 %    \end{macrocode}
 % \end{macro}
@@ -159,9 +160,9 @@
 % The \XeTeX\ font dimension numbers must be integer constants.
 %    \begin{macrocode}
 \cs_new_protected_nopar:Nn \@@_font_param:nnn
- {
-  \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 }
- }
+  {
+    \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -173,9 +174,9 @@
 % The \XeTeX\ font dimension number must be an integer constant.
 %    \begin{macrocode}
 \cs_new_protected_nopar:Nn \@@_font_param:nn
- {
-  \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 }
- }
+  {
+    \@@_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -198,13 +199,13 @@
 \cs_new_protected_nopar:Nn \@@_font_param_aux:NNnnnn
   {
     \cs_new_nopar:Npn #1 ##1
-     {
-      \@@_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 }
-     }
+      {
+        \@@_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 }
+      }
     \cs_new_protected_nopar:Npn #2 ##1 ##2
-     {
-      #1 ##1 \dim_eval:n { ##2 }
-     }
+      {
+        #1 ##1 \dim_eval:n { ##2 }
+      }
   }
 \cs_generate_variant:Nn \@@_font_param_aux:NNnnnn { cc }
 %</XE>
@@ -212,13 +213,13 @@
 \cs_new_protected_nopar:Nn \@@_font_param_aux:NNN
   {
     \cs_new_nopar:Npn #1 ##1
-     {
-      #3 ##1
-     }
+      {
+        #3 ##1
+      }
     \cs_new_protected_nopar:Npn #2 ##1 ##2
-     {
-      #3 ##1 \dim_eval:n { ##2 }
-     }
+      {
+        #3 ##1 \dim_eval:n { ##2 }
+      }
   }
 \cs_generate_variant:Nn \@@_font_param_aux:NNN { ccc }
 %</LU>
@@ -277,10 +278,8 @@
 %
 % \subsection{Historical commands}
 %
-% TODO: maybe no longer necessary?
-%
-% \begin{macro}{\@@_fontdimen_to_percent:nn}
-% \begin{macro}{\@@_fontdimen_to_scale:nn}
+% \begin{macro}{\@@_fontdimen_to_percent:nN}
+% \begin{macro}{\@@_fontdimen_to_scale:nN}
 % \darg{Font dimen number}
 % \darg{Font `variable'}
 % \cmd\fontdimen s |10|, |11|, and |65| aren't actually dimensions, they're percentage values given in units of |sp|.
@@ -288,36 +287,37 @@
 % \cs{@@_fontdimen_to_scale:nn} returns a dimension correspond to the current
 % font size relative proportion based on that percentage.
 %    \begin{macrocode}
-\cs_new:Nn \@@_fontdimen_to_percent:nn
- {
-  \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 }
- }
-\cs_new:Nn \@@_fontdimen_to_scale:nn
- {
-  \fp_eval:n {\@@_fontdimen_to_percent:nn {#1} {#2} * \f at size } pt
- }
+\cs_new:Nn \@@_fontdimen_to_percent:nN
+  {
+    \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 }
+  }
+\cs_new:Nn \@@_fontdimen_to_scale:nN
+  {
+    \fp_eval:n { \@@_fontdimen_to_percent:nN {#1} #2 * \f at size } pt
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\@@_mathstyle_scale:Nnn}
+% \begin{macro}{\@@_mathstyle_scale:NnnN}
 % \darg{A math style (\cs{scriptstyle}, say)}
 % \darg{Macro that takes a non-delimited length argument (like \cmd\kern)}
 % \darg{Length control sequence to be scaled according to the math style}
+% \darg{Math font face to use for the lookups}
 % This macro is used to scale the lengths reported by \cmd\fontdimen\ according to the scale factor for script- and scriptscript-size objects.
 %    \begin{macrocode}
-\cs_new:Nn \@@_mathstyle_scale:Nnn
- {
-  \ifx#1\scriptstyle
-    #2 \@@_fontdimen_to_percent:nn {10} \l_@@_font #3
-  \else
-    \ifx#1\scriptscriptstyle
-      #2 \@@_fontdimen_to_percent:nn {11} \l_@@_font #3
+\cs_new:Nn \@@_mathstyle_scale:NnnN
+  {
+    \ifx#1\scriptstyle
+      #2 \@@_fontdimen_to_percent:nN {10} #4 #3
     \else
-      #2 #3
+      \ifx#1\scriptscriptstyle
+        #2 \@@_fontdimen_to_percent:nN {11} #4 #3
+      \else
+        #2 #3
+      \fi
     \fi
-  \fi
- }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -336,7 +336,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-main.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of `\setmainfont`.
 
 % \section{The main \cs{setmathfont} macro}
 %
@@ -6,103 +7,75 @@
 %<*package>
 %    \end{macrocode}
 %
-% Using a |range| including large character sets such as \cmd\mathrel,
-% \cmd\mathalpha, \etc, is \emph{very slow}!
-% I hope to improve the performance somehow.
-%
 % \begin{macro}{\@@_setmathfont:nn}
+% \darg{keyval options}
+% \darg{font name/file}
 %    \begin{macrocode}
 \cs_set:Nn \@@_setmathfont:nn
   {
-    \tl_set:Nn \l_@@_fontname_tl {#2}
 %    \end{macrocode}
+% \begin{itemize}
+% \item Initialise all local variables.
+% \item
 % Erase any conception \LaTeX\ has of previously defined math symbol fonts;
 % this allows \cmd\DeclareSymbolFont\ at any point in the document.
-%    \begin{macrocode}
-    \cs_set_eq:NN \glb at currsize \scan_stop:
-%    \end{macrocode}
-% Initialise all local variabes:
-%    \begin{macrocode}
-    \@@_init:
-%    \end{macrocode}
+% \item
 % Grab the current size information:
 % (is this robust enough? Maybe it should be preceded by \cmd\normalsize).
 % The macro \cmd\S@\meta{size}
 % contains the definitions of the sizes used for maths letters, subscripts and subsubscripts in
 % \cmd\tf at size, \cmd\sf at size, and \cmd\ssf at size, respectively.
+% \end{itemize}
 %    \begin{macrocode}
+
+    \@@_init:n {#2}
+    \cs_set_eq:NN \glb at currsize \scan_stop:
     \cs_if_exist:cF { S@ \f at size } { \calculate at math@sizes }
-    \csname S@\f at size\endcsname
-%    \end{macrocode}
-% Parse options and tell people what's going on:
-%    \begin{macrocode}
+    \use:c { S@ \f at size }
+
     \keys_set_known:nnN {unicode-math} {#1} \l_@@_unknown_keys_clist
-    \bool_if:NT \l_@@_init_bool { \@@_log:n {default-math-font} }
-%    \end{macrocode}
-% Use \pkg{fontspec} to select a font to use.
-% After loading the font, we detect what sizes it recommends for scriptsize and scriptscriptsize, so after setting those values appropriately, we reload the font to take these into account.
-%    \begin{macrocode}
-%<debug>  \csname TIC\endcsname
-    \@@_fontspec_select_font:
-%<debug>  \csname TOC\endcsname
-    \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool }
+
+    \bool_if:NT \l_@@_init_bool
       {
+        \@@_fontspec_trial_font:
         \@@_declare_math_sizes:
-        \@@_fontspec_select_font:
       }
-%    \end{macrocode}
-% Now define |\l_@@_symfont_label_tl| as the \LaTeX\ math font to access everything:
-%    \begin{macrocode}
-    \cs_if_exist:cF { sym \l_@@_symfont_label_tl }
+    \@@_fontspec_select_font:
+    \@@_setup_math_fam:
+    \bool_if:NT \l_@@_init_bool
       {
-        \DeclareSymbolFont{\l_@@_symfont_label_tl}
-          {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault}
-      }
-    \SetSymbolFont{\l_@@_symfont_label_tl}{\l_@@_mversion_tl}
-      {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault}
-%    \end{macrocode}
-% Set the bold math version.
-%    \begin{macrocode}
-    \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal}
-      {
-        \SetSymbolFont{\l_@@_symfont_label_tl}{bold}
-          {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault}
-      }
-%    \end{macrocode}
-% Declare the math sizes (i.e., scaling of superscripts) for the specific
-% values for this font,
-% and set defaults for math fams two and three for legacy compatibility:
-%    \begin{macrocode}
-    \bool_if:nT { \l_@@_ot_math_bool && !\g_@@_mainfont_already_set_bool }
-      {
-        \bool_set_true:N \g_@@_mainfont_already_set_bool
         \@@_setup_legacy_fam_two:
         \@@_setup_legacy_fam_three:
       }
-%    \end{macrocode}
-% And now we input every single maths char.
-%    \begin{macrocode}
-%<debug>  \csname TIC\endcsname
+
     \@@_input_math_symbol_table:
-%<debug>  \csname TOC\endcsname
+
 %    \end{macrocode}
-% Finally,
 % \begin{itemize}
+% \item the `once-off' setup that doesn't need to be per-font
 % \item remap symbols that don't take their natural mathcode;
 % \item activate any symbols that need to be math-active;
 % \item assign delimiter codes for symbols that need to grow;
 % \item setup the maths alphabets (\cs{symbf} etc.) ---
 %       this is an extensive part of the code; see Section~\ref{sec:mathmap};
-% \item setup negations, which are handled on an ad hoc basis; see Section~\ref{sec:negations}.
 % \end{itemize}
 %    \begin{macrocode}
+    \bool_if:NT \l_@@_init_bool \@@_onceoff_setup:
     \@@_remap_symbols:
     \@@_setup_mathactives:
     \@@_setup_delcodes:
-%<debug>  \csname TIC\endcsname
     \@@_setup_alphabets:
-%<debug>  \csname TOC\endcsname
-    \@@_setup_negations:
+
+    %% TODO: what of the above should only be run for the "default"/"main" font?
+
+    \bool_if:NTF \l_@@_init_bool
+      {
+%<LU>   \@@_mathparam_store:
+        \@@_log:n {default-math-font}
+      }
+      {
+%<LU>   \@@_mathparam_restore:
+      }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -118,9 +91,8 @@
   {
     \cs_if_exist:NF \l_@@_fontname_tl
       {
-        % TODO: update this when lmmath-bold.otf is released
-        \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}]
-        \bool_set_false:N \g_@@_mainfont_already_set_bool
+        \setmathfont{latinmodern-math.otf}
+          [BoldFont={latinmodern-math.otf}]
       }
   }
 %    \end{macrocode}
@@ -129,38 +101,33 @@
 %
 % TODO: need a better way to do this for the general case. (Maybe a `reset' command option?)
 %
-% \begin{macro}{\@@_init:}
+% \begin{macro}{\@@_init:n}
+% Reset local variables.
+% Default to defining the font for every math symbol character.
 %    \begin{macrocode}
-\cs_new:Nn \@@_init:
+\cs_new:Nn \@@_init:n
   {
+    \tl_set:Nn \l_@@_fontname_tl {#1}
     \bool_set_true:N  \l_@@_ot_math_bool
-    \tl_set:Nn \l_@@_mversion_tl {normal}
+    \tl_set:Nn \l_@@_mversion_tl      {normal}
     \tl_set:Nn \l_@@_symfont_label_tl {operators}
-%    \end{macrocode}
-% Defaults for the script and scriptscript font.
-%    \begin{macrocode}
+
     \tl_set:Nn    \l_@@_script_features_tl  {Style=MathScript}
     \tl_set:Nn    \l_@@_sscript_features_tl {Style=MathScriptScript}
     \tl_set_eq:NN \l_@@_script_font_tl      \l_@@_fontname_tl
     \tl_set_eq:NN \l_@@_sscript_font_tl     \l_@@_fontname_tl
-%    \end{macrocode}
-% Default to defining the font for every math symbol character.
-%    \begin{macrocode}
+
     \bool_set_true:N \l_@@_init_bool
-    \seq_clear:N     \l_@@_char_range_seq
-    \clist_clear:N   \l_@@_char_nrange_clist
-    \seq_clear:N     \l_@@_mathalph_seq
+    \seq_gclear:N    \g_@@_char_range_seq
+    \clist_clear:N   \l_@@_mathmap_charints_clist
+    \seq_gclear:N    \g_@@_mathalph_seq
     \seq_clear:N     \l_@@_missing_alph_seq
-%    \end{macrocode}
-% Other range initialisations.
-%    \begin{macrocode}
-    \cs_set_eq:NN \_@@_sym:nnn \@@_process_symbol_noparse:nnn
-    \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn
-    \cs_set_eq:NN \@@_remap_symbol:nnn \@@_remap_symbol_noparse:nnn
-    \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n
-    \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn
-    \cs_set_eq:NN \@@_assign_delcode:nn \@@_assign_delcode_noparse:nn
-    \cs_set_eq:NN \@@_make_mathactive:nNN \@@_make_mathactive_noparse:nNN
+
+    \cs_set_eq:NN \_@@_sym:nnn                  \@@_process_symbol_noparse:nnn
+    \cs_set_eq:NN \@@_remap_symbol:nnn          \@@_remap_symbol_noparse:nnn
+    \cs_set_eq:NN \@@_maybe_init_alphabet:n     \@@_init_alphabet:n
+    \cs_set_eq:NN \@@_assign_delcode:nn         \@@_assign_delcode_noparse:nn
+    \cs_set_eq:NN \@@_make_mathactive:nNN       \@@_make_mathactive_noparse:nNN
   }
 %    \end{macrocode}
 % \end{macro}
@@ -167,78 +134,197 @@
 %
 % \begin{macro}{\@@_declare_math_sizes:}
 % Set the math sizes according to the recommended font parameters.
-% TODO: this shouldn't need to be per-engine; check out why the wrappers aren't used.
 %    \begin{macrocode}
+\tl_new:N \g_@@_main_font_cmd_tl
 \cs_new:Nn \@@_declare_math_sizes:
   {
-%<*LU>
-    \fp_compare:nF { \@@_script_style_size:n {ScriptPercentScaleDown} == 0 }
+    \dim_compare:nF { \fontdimen 10 \g_@@_trial_font == 0pt }
       {
         \DeclareMathSizes { \f at size } { \f at size }
-          { \@@_script_style_size:n {ScriptPercentScaleDown} }
-          { \@@_script_style_size:n {ScriptScriptPercentScaleDown} }
+          { \@@_fontdimen_to_scale:nN {10} \g_@@_trial_font }
+          { \@@_fontdimen_to_scale:nN {11} \g_@@_trial_font }
       }
-%</LU>
-%<*XE>
-    \dim_compare:nF { \fontdimen 10 \l_@@_font == 0pt }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\@@_fontspec_trial_font:}
+%    \begin{macrocode}
+\cs_new:Nn \@@_fontspec_trial_font:
+  {
+    \tl_set:Nx \l_@@_font_keyval_tl
       {
-        \DeclareMathSizes { \f at size } { \f at size }
-          { \@@_fontdimen_to_scale:nn {10} {\l_@@_font} }
-          { \@@_fontdimen_to_scale:nn {11} {\l_@@_font} }
+%<LU>   Renderer = Basic,
+        BoldItalicFont = {}, ItalicFont = {},
+        Script = Math,
+%<LU>   FontAdjustment = { \g_@@_luatex_copy_fontdimens_tl },
+        \l_@@_unknown_keys_clist
       }
-%</XE>
+
+    \fontspec_set_family:Nxn \l_@@_trial_family_tl {\l_@@_font_keyval_tl} {\l_@@_fontname_tl}
+
+    \group_begin:
+      \fontfamily { \l_@@_trial_family_tl } \selectfont
+      \@@_fontface_gset_eq:NV \g_@@_trial_font \font at name
+      \fontspec_if_script:nF {math}
+        {
+          \bool_gset_false:N \l_@@_ot_math_bool
+          \bool_gset_false:N \l_@@_init_bool
+        }
+    \group_end:
+
   }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_script_style_size:n}
-% Determine script- and scriptscriptstyle sizes using luaotfload:
-%   \begin{macrocode}
+% \begin{macro}{\@@_fontspec_select_font:}
+%    \begin{macrocode}
+\cs_new:Nn \@@_fontspec_select_font:
+  {
+    \fp_gset:Nn \g_@@_size_tfsf_fp   { (\f at size +\sf at size )/2 }
+    \fp_gset:Nn \g_@@_size_sfssf_fp  { (\sf at size+\ssf at size)/2 }
+
+    \tl_set:Nx \l_@@_font_keyval_tl
+      {
+%<LU>   Renderer = Basic,
+        BoldItalicFont = {}, ItalicFont = {},
+        Script = Math,
+        SizeFeatures =
+          {
+            {
+              Size = \fp_use:N \g_@@_size_tfsf_fp -
+            } ,
+            {
+              Size = \fp_use:N \g_@@_size_sfssf_fp - \fp_use:N \g_@@_size_tfsf_fp ,
+              Font = \l_@@_script_font_tl ,
+              \l_@@_script_features_tl
+            } ,
+            {
+              Size = - \fp_use:N \g_@@_size_sfssf_fp ,
+              Font = \l_@@_sscript_font_tl ,
+              \l_@@_sscript_features_tl
+            }
+          } ,
+%<LU>   FontAdjustment = { \g_@@_luatex_copy_fontdimens_tl },
+        \l_@@_unknown_keys_clist
+      }
+
+    \fontspec_set_family:Nxn \l_@@_family_tl {\l_@@_font_keyval_tl} {\l_@@_fontname_tl}
+
+    \int_gincr:N \g_@@_fonts_used_int
+    \group_begin:
+      \fontfamily { \l_@@_family_tl } \selectfont
+      \@@_fontface_gset_eq:cV {g_@@_mathfont_ \int_use:N \g_@@_fonts_used_int _font} \font at name
+      \tl_gset:Nx \g_@@_curr_font_cmd_tl { \exp_not:c {g_@@_mathfont_ \int_use:N \g_@@_fonts_used_int _font} }
+      \bool_if:NT \l_@@_init_bool
+				{
+					\@@_fontface_gset_eq:NV \l_@@_font \font at name
+				}
+      \fontspec_if_script:nF {math}
+        {
+          \bool_gset_false:N \l_@@_ot_math_bool
+          \bool_gset_false:N \l_@@_init_bool
+        }
+    \group_end:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+\tl_set:Nn \g_@@_main_font_cmd_tl  { \l_@@_font }
+\tl_set:Nn \g_@@_sqrt_font_cmd_tl  { \l_@@_font }
+\tl_set:Nn \g_@@_prime_font_cmd_tl { \l_@@_font }
+%    \end{macrocode}
+%
+% \begin{macro}{\g_@@_luatex_copy_fontdimens_tl}
+%    \begin{macrocode}
 %<*LU>
-\cs_new:Nn \@@_script_style_size:n
+\tl_const:Nn \g_@@_luatex_copy_fontdimens_tl
   {
-    \fp_eval:n {\directlua{tex.sprint(luaotfload.aux.get_math_dimension("l_@@_font","#1"))} * \f at size / 100 }
+    \@@_fontdimen_from_param:nn {10} {ScriptPercentScaleDown}
+    \@@_fontdimen_from_param:nn {11} {ScriptScriptPercentScaleDown}
+    \@@_fontdimen_from_param:nn {15} {AxisHeight}
+    \@@_fontdimen_from_param:nn {18} {SubscriptShiftDown}
+    \@@_fontdimen_from_param:nn {20} {SubscriptBaselineDropMin}
+    \@@_fontdimen_from_param:nn {21} {SuperscriptShiftUp}
+    \@@_fontdimen_from_param:nn {22} {SuperscriptShiftUpCramped}
+    \@@_fontdimen_from_param:nn {24} {SuperscriptBaselineDropMax}
+    \@@_fontdimen_from_param:nn {28} {UpperLimitGapMin}
+    \@@_fontdimen_from_param:nn {29} {UpperLimitBaselineRiseMin}
+    \@@_fontdimen_from_param:nn {30} {LowerLimitGapMin}
+    \@@_fontdimen_from_param:nn {31} {LowerLimitBaselineDropMin}
+    \@@_fontdimen_from_param:nn {32} {StackTopShiftUp}
+    \@@_fontdimen_from_param:nn {42} {FractionNumeratorShiftUp}
+    \@@_fontdimen_from_param:nn {43} {FractionNumeratorDisplayStyleShiftUp}
+    \@@_fontdimen_from_param:nn {44} {FractionDenominatorShiftDown}
+    \@@_fontdimen_from_param:nn {45} {FractionDenominatorDisplayStyleShiftDown}
+    \@@_fontdimen_from_param:nn {48} {FractionRuleThickness}
   }
 %</LU>
-%   \end{macrocode}
+%    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_setup_math_fam:}
+%    \begin{macrocode}
+\cs_new:Nn \@@_setup_math_fam:
+  {
+    \cs_if_exist:cF { sym \l_@@_symfont_label_tl }
+      {
+        \DeclareSymbolFont{\l_@@_symfont_label_tl}
+          {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault}
+      }
+    \SetSymbolFont{\l_@@_symfont_label_tl}{\l_@@_mversion_tl}
+      {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault}
+%    \end{macrocode}
+% Set the bold math version.
+%    \begin{macrocode}
+    \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal}
+      {
+        \SetSymbolFont{\l_@@_symfont_label_tl}{bold}
+          {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault}
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\@@_setup_legacy_fam_two:}
 % \TeX\ won't load the same font twice at the same scale, so we need to magnify this one by an imperceptable amount.
 %    \begin{macrocode}
 \cs_new:Nn \@@_setup_legacy_fam_two:
   {
-    \fontspec_set_family:Nxn \l_@@_family_tl
+    \fontspec_set_family:Nxn \l_@@_fam_two_tl
       {
         \l_@@_font_keyval_tl,
         Scale=1.00001,
         FontAdjustment =
           {
-            \@@_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax
-            \@@_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax
-            \@@_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax
-            \@@_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax
-            \@@_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax
-            \@@_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax
-            \@@_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax
-            \@@_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax
-            \@@_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax
-            \@@_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax
-            \@@_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax
-            \@@_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax
-            \@@_zero_fontparam:n   {20} % delim1 = FractionDelimiterDisplaySize
-            \@@_zero_fontparam:n   {21} % delim2 = FractionDelimiterSize
-            \@@_copy_fontparam:nnn {22} {15} {AxisHeight}\relax
+            \@@_copy_fontdimen:nnN { 8} {43} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN { 9} {42} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {10} {32} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {11} {45} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {12} {44} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {13} {21} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {14} {21} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {15} {22} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {16} {18} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {17} {18} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {18} {24} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {19} {20} \g_@@_main_font_cmd_tl
+            \@@_copy_fontdimen:nnN {22} {15} \g_@@_main_font_cmd_tl
+            \@@_zero_fontdimen:n   {20} % delim1 = FractionDelimiterDisplaySize
+            \@@_zero_fontdimen:n   {21} % delim2 = FractionDelimiterSize
          }
       } {\l_@@_fontname_tl}
 
     \SetSymbolFont{symbols}{\l_@@_mversion_tl}
-      {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault}
+      {\encodingdefault}{\l_@@_fam_two_tl}{\mddefault}{\updefault}
 
     \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal}
       {
         \SetSymbolFont{symbols}{bold}
-          {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault}
+          {\encodingdefault}{\l_@@_fam_two_tl}{\bfdefault}{\updefault}
       }
   }
 %    \end{macrocode}
@@ -249,70 +335,37 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_setup_legacy_fam_three:
   {
-    \fontspec_set_family:Nxn \l_@@_family_tl
+    \fontspec_set_family:Nxn \l_@@_fam_three_tl
       {
         \l_@@_font_keyval_tl,
         Scale=0.99999,
         FontAdjustment = {
-          \@@_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax
-          \@@_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax
-          \@@_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax
-          \@@_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax
-          \@@_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax
-          \@@_zero_fontparam:n   {13}
+          \@@_copy_fontdimen:nnN { 8} {48} \g_@@_main_font_cmd_tl
+          \@@_copy_fontdimen:nnN { 9} {28} \g_@@_main_font_cmd_tl
+          \@@_copy_fontdimen:nnN {10} {30} \g_@@_main_font_cmd_tl
+          \@@_copy_fontdimen:nnN {11} {29} \g_@@_main_font_cmd_tl
+          \@@_copy_fontdimen:nnN {12} {31} \g_@@_main_font_cmd_tl
+          \@@_zero_fontdimen:n   {13}
        }
       } {\l_@@_fontname_tl}
 
     \SetSymbolFont{largesymbols}{\l_@@_mversion_tl}
-      {\encodingdefault}{\l_@@_family_tl}{\mddefault}{\updefault}
+      {\encodingdefault}{\l_@@_fam_three_tl}{\mddefault}{\updefault}
 
     \str_if_eq_x:nnT {\l_@@_mversion_tl} {normal}
       {
         \SetSymbolFont{largesymbols}{bold}
-          {\encodingdefault}{\l_@@_family_tl}{\bfdefault}{\updefault}
+          {\encodingdefault}{\l_@@_fam_three_tl}{\bfdefault}{\updefault}
       }
   }
 %    \end{macrocode}
 % \end{macro}
 %
-%
-% \begin{macro}{\@@_fontspec_select_font:}
-% Select the font with \cs{fontspec} and define \cs{l_@@_font} from it.
+% \begin{macro}{\@@_onceoff_setup:}
 %    \begin{macrocode}
-\cs_new:Nn \@@_fontspec_select_font:
+\cs_new:Nn \@@_onceoff_setup:
   {
-    \tl_set:Nx \l_@@_font_keyval_tl {
-%<LU>     Renderer = Basic,
-      BoldItalicFont = {}, ItalicFont = {},
-      Script = Math,
-      SizeFeatures =
-        {
-          {
-            Size = \tf at size-
-          } ,
-          {
-            Size = \sf at size-\tf at size ,
-            Font = \l_@@_script_font_tl ,
-            \l_@@_script_features_tl
-          } ,
-          {
-            Size = -\sf at size ,
-            Font = \l_@@_sscript_font_tl ,
-            \l_@@_sscript_features_tl
-          }
-        } ,
-      \l_@@_unknown_keys_clist
-    }
-
-  \fontspec_set_fontface:NNxn \l_@@_font \l_@@_family_tl
-    {\l_@@_font_keyval_tl} {\l_@@_fontname_tl}
-%    \end{macrocode}
-% Check whether we're using a real maths font:
-%    \begin{macrocode}
-    \group_begin:
-      \fontfamily{\l_@@_family_tl}\selectfont
-      \fontspec_if_script:nF {math} {\bool_gset_false:N \l_@@_ot_math_bool}
-    \group_end:
+    \@@_set_delcode:nnn {operators} {`\.} {\c_zero}
   }
 %    \end{macrocode}
 % \end{macro}
@@ -334,7 +387,7 @@
 %    \begin{macrocode}
 \cs_set:Nn \@@_process_symbol_parse:nnn
   {
-    \@@_if_char_spec:nNNT {#1} {#2} {#3}
+    \@@_if_char_spec:nNT {#1} {#3}
       {
         \@@_process_symbol_noparse:nnn {#1} {#2} {#3}
       }
@@ -344,28 +397,29 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_remap_symbols:}
-% \begin{macro}{\@@_remap_symbol_noparse:nnn}
-% \begin{macro}{\@@_remap_symbol_parse:nnn}
 % This function is used to define the mathcodes for those chars which should
 % be mapped to a different glyph than themselves.
 %    \begin{macrocode}
-\cs_new:Npn \@@_remap_symbols:
+\cs_new:Nn \@@_remap_symbols:
   {
-    \@@_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus
-    \@@_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk"
+    \@@_remap_symbol:nnn {`\-} {\mathbin} {"2212}
+    \@@_remap_symbol:nnn {`\*} {\mathbin} {"02217}% text asterisk to "centred asterisk"
     \bool_if:NF \g_@@_literal_colon_bool
       {
-        \@@_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel)
+        \@@_remap_symbol:nnn {`\:} {\mathrel} {"02236}% colon to ratio (i.e., punct to rel)
       }
   }
 %    \end{macrocode}
 % \end{macro}
+%
+% \begin{macro}{\@@_remap_symbol_noparse:nnn}
+% \begin{macro}{\@@_remap_symbol_parse:nnn}
 % Where |\@@_remap_symbol:nnn| is defined to be one of these two, depending
 % on the range setup:
 %    \begin{macrocode}
 \cs_new:Nn \@@_remap_symbol_parse:nnn
   {
-    \@@_if_char_spec:nNNT {#3} {\@nil} {#2}
+    \@@_if_char_spec:nNT {#3} {#2}
       { \@@_remap_symbol_noparse:nnn {#1} {#2} {#3} }
   }
 \cs_new:Nn \@@_remap_symbol_noparse:nnn
@@ -383,16 +437,18 @@
 % But they don't need to be able to be typeset directly.
 %
 % \begin{macro}{\@@_setup_mathactives:}
+% TODO: if not an OpenType math font, we should ignore doing anything with primes.
+% This needs a revamped `range` feature, I think.
 %    \begin{macrocode}
 \cs_new:Npn \@@_setup_mathactives:
   {
-    \@@_make_mathactive:nNN {"2032} \@@_prime_single_mchar \mathord
-    \@@_make_mathactive:nNN {"2033} \@@_prime_double_mchar \mathord
-    \@@_make_mathactive:nNN {"2034} \@@_prime_triple_mchar \mathord
-    \@@_make_mathactive:nNN {"2057} \@@_prime_quad_mchar   \mathord
-    \@@_make_mathactive:nNN {"2035} \@@_backprime_single_mchar \mathord
-    \@@_make_mathactive:nNN {"2036} \@@_backprime_double_mchar \mathord
-    \@@_make_mathactive:nNN {"2037} \@@_backprime_triple_mchar \mathord
+		\@@_make_mathactive:nNN {"2032} \@@_prime_single_mchar \mathord
+		\@@_make_mathactive:nNN {"2033} \@@_prime_double_mchar \mathord
+		\@@_make_mathactive:nNN {"2034} \@@_prime_triple_mchar \mathord
+		\@@_make_mathactive:nNN {"2057} \@@_prime_quad_mchar   \mathord
+		\@@_make_mathactive:nNN {"2035} \@@_backprime_single_mchar \mathord
+		\@@_make_mathactive:nNN {"2036} \@@_backprime_double_mchar \mathord
+		\@@_make_mathactive:nNN {"2037} \@@_backprime_triple_mchar \mathord
     \@@_make_mathactive:nNN {`\'} \mathstraightquote \mathord
     \@@_make_mathactive:nNN {`\`} \mathbacktick      \mathord
   }
@@ -406,7 +462,7 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_make_mathactive_parse:nNN
   {
-    \@@_if_char_spec:nNNT {#1} #2 #3
+    \@@_if_char_spec:nNT {#1} #3
       { \@@_make_mathactive_noparse:nNN {#1} #2 #3 }
   }
 %    \end{macrocode}
@@ -420,6 +476,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
+%
 % \subsection{Delimiter codes}
 %
 % \begin{macro}{\@@_assign_delcode:nn}
@@ -433,7 +490,7 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_assign_delcode_parse:nn
   {
-    \@@_if_char_spec:nNNT {#2} {\@nil} {\@nil}
+    \@@_if_char_spec:nNT {#2} \@nil
       {
         \@@_assign_delcode_noparse:nn {#1} {#2}
       }
@@ -456,10 +513,6 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_setup_delcodes:
   {
-    % ensure \left. and \right. work:
-    \@@_set_delcode:nnn \l_@@_symfont_label_tl {`\.} {\c_zero}
-    % this is forcefully done to fix a bug -- indicates a larger problem!
-
     \@@_assign_delcode:nn {`\/}   {\g_@@_slash_delimiter_usv}
     \@@_assign_delcode:nn {"2044} {\g_@@_slash_delimiter_usv} % fracslash
     \@@_assign_delcode:nn {"2215} {\g_@@_slash_delimiter_usv} % divslash
@@ -538,7 +591,94 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsection{Fontdimens}
+%
 %    \begin{macrocode}
+%<*LU>
+%    \end{macrocode}
+%
+% \begin{macro}{\@@_mathparam_restore:}
+%    \begin{macrocode}
+\cs_set:Nn \@@_mathparam_restore:
+  {
+    \check at mathfonts
+    \tl_use:N \g_@@_mathparam_store_tl
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_mathparam_store:}
+%    \begin{macrocode}
+\cs_set:Nn \@@_mathparam_store:
+  {
+    \check at mathfonts
+    \tl_gset:Nx \g_@@_mathparam_store_tl
+      {
+        \@@_mathparam_store_aux:N \displaystyle
+        \@@_mathparam_store_aux:N \textstyle
+        \@@_mathparam_store_aux:N \scriptstyle
+        \@@_mathparam_store_aux:N \scriptscriptstyle
+      }
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_set:Nn \@@_mathparam_store_aux:N
+  {
+    \Umathquad                #1 = \the \Umathquad                #1
+    \Umathaxis                #1 = \the \Umathaxis                #1
+    \Umathoperatorsize        #1 = \the \Umathoperatorsize        #1
+    \Umathoverbarkern         #1 = \the \Umathoverbarkern         #1
+    \Umathoverbarrule         #1 = \the \Umathoverbarrule         #1
+    \Umathoverbarvgap         #1 = \the \Umathoverbarvgap         #1
+    \Umathunderbarkern        #1 = \the \Umathunderbarkern        #1
+    \Umathunderbarrule        #1 = \the \Umathunderbarrule        #1
+    \Umathunderbarvgap        #1 = \the \Umathunderbarvgap        #1
+    \Umathradicalkern         #1 = \the \Umathradicalkern         #1
+    \Umathradicalrule         #1 = \the \Umathradicalrule         #1
+    \Umathradicalvgap         #1 = \the \Umathradicalvgap         #1
+    \Umathradicaldegreebefore #1 = \the \Umathradicaldegreebefore #1
+    \Umathradicaldegreeafter  #1 = \the \Umathradicaldegreeafter  #1
+    \Umathradicaldegreeraise  #1 = \the \Umathradicaldegreeraise  #1
+    \Umathstackvgap           #1 = \the \Umathstackvgap           #1
+    \Umathstacknumup          #1 = \the \Umathstacknumup          #1
+    \Umathstackdenomdown      #1 = \the \Umathstackdenomdown      #1
+    \Umathfractionrule        #1 = \the \Umathfractionrule        #1
+    \Umathfractionnumvgap     #1 = \the \Umathfractionnumvgap     #1
+    \Umathfractionnumup       #1 = \the \Umathfractionnumup       #1
+    \Umathfractiondenomvgap   #1 = \the \Umathfractiondenomvgap   #1
+    \Umathfractiondenomdown   #1 = \the \Umathfractiondenomdown   #1
+    \Umathfractiondelsize     #1 = \the \Umathfractiondelsize     #1
+    \Umathlimitabovevgap      #1 = \the \Umathlimitabovevgap      #1
+    \Umathlimitabovebgap      #1 = \the \Umathlimitabovebgap      #1
+    \Umathlimitabovekern      #1 = \the \Umathlimitabovekern      #1
+    \Umathlimitbelowvgap      #1 = \the \Umathlimitbelowvgap      #1
+    \Umathlimitbelowbgap      #1 = \the \Umathlimitbelowbgap      #1
+    \Umathlimitbelowkern      #1 = \the \Umathlimitbelowkern      #1
+    \Umathoverdelimitervgap   #1 = \the \Umathoverdelimitervgap   #1
+    \Umathoverdelimiterbgap   #1 = \the \Umathoverdelimiterbgap   #1
+    \Umathunderdelimitervgap  #1 = \the \Umathunderdelimitervgap  #1
+    \Umathunderdelimiterbgap  #1 = \the \Umathunderdelimiterbgap  #1
+    \Umathsubshiftdrop        #1 = \the \Umathsubshiftdrop        #1
+    \Umathsubshiftdown        #1 = \the \Umathsubshiftdown        #1
+    \Umathsupshiftdrop        #1 = \the \Umathsupshiftdrop        #1
+    \Umathsupshiftup          #1 = \the \Umathsupshiftup          #1
+    \Umathsubsupshiftdown     #1 = \the \Umathsubsupshiftdown     #1
+    \Umathsubtopmax           #1 = \the \Umathsubtopmax           #1
+    \Umathsupbottommin        #1 = \the \Umathsupbottommin        #1
+    \Umathsupsubbottommax     #1 = \the \Umathsupsubbottommax     #1
+    \Umathsubsupvgap          #1 = \the \Umathsubsupvgap          #1
+    \Umathspaceafterscript    #1 = \the \Umathspaceafterscript    #1
+    \Umathconnectoroverlapmin #1 = \the \Umathconnectoroverlapmin #1
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</LU>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 
@@ -553,7 +693,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathmap.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,6 +1,7 @@
 %%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Setup of symbol alphabets.
 
-% \section{Mapping in maths alphabets}
+% \section{Defining the math alphabets per style}
 % \label{sec:mathmap}
 %
 %    \begin{macrocode}
@@ -7,411 +8,229 @@
 %<*package>
 %    \end{macrocode}
 %
-% Switching to a different style of alphabetic symbols was traditionally performed with
-% commands like \cmd\mathbf, which literally changes fonts to access alternate symbols.
-% This is not as simple with Unicode fonts.
-%
-% In traditional \TeX{} maths font setups, you simply switch between different `families' (\cmd\fam), which is analogous to changing from one font to another---a symbol such as `a' will be upright in one font, bold in another, and so on.
-% In pkg{unicode-math}, a different mechanism is used to switch between styles. For every letter (start with ascii a-zA-Z and numbers to keep things simple for now), they are assigned a `mathcode' with \cmd\Umathcode\ that maps from input letter to output font glyph slot. This is done with the equivalent of
-% \begin{Verbatim}
-% \Umathcode`\a = 7 1 "1D44E\relax
-% \Umathcode`\b = 7 1 "1D44F\relax
-% \Umathcode`\c = 7 1 "1D450\relax
-% ...
-% \end{Verbatim}
-% When switching from regular letters to, say, \cmd\mathrm, we now need to execute a new mapping:
-% \begin{Verbatim}
-% \Umathcode`\a = 7 1 `\a\relax
-% \Umathcode`\b = 7 1 `\b\relax
-% \Umathcode`\c = 7 1 `\c\relax
-% ...
-% \end{Verbatim}
-% This is fairly straightforward to perform when we're defining our own commands such as \cmd\symbf\ and so on. However, this means that `classical' \TeX\ font setups will break, because with the original mapping still in place, the engine will be attempting to insert unicode maths glyphs from a standard font.
-%
-% \subsection{Hooks into \LaTeXe}
-%
-% To overcome this, we patch \cs{use at mathgroup}.
-% (An alternative is to patch \cs{extract at alph@from at version}, which constructs the \cs{mathXYZ} commands, but this method fails if the command has been defined using \cs{DeclareSymbolFontAlphabet}.)
-% As far as I can tell, this is only used inside of commands such as \cs{mathXYZ}, so this shouldn't have any major side-effects.
-%
+% \begin{macro}{\@@_setup_alphabets:}
+% This function is called within \cs{setmathfont} to configure the
+% mapping between characters inside math styles. Three modes:
+% \begin{description}
+% \item[IMPLICIT] No ranges specified, set up everything
+% \item[EXPLICIT] Some ranges specified, set up what is requested only
+% \item[INHERIT]  Of the slots in the ranges specified, compare against
+%                 slots in each styled alphabet and only set up those needed
+% \end{description}
+% The INHERIT mode saves less time than I was hoping for but is still beneficial
+% in simple cases.
 %    \begin{macrocode}
-\cs_set:Npn \use at mathgroup #1 #2
- {
-  \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not!
-   {
-    \math at bgroup
-      \cs_if_eq:cNF {M@\f at encoding} #1 {#1}
-      \@@_switchto_literal:
-      \mathgroup #2 \relax
-    \math at egroup
-   }
- }
+\cs_new:Npn \@@_setup_alphabets:
+  {
+
+    \bool_if:NTF \l_@@_init_bool
+      {
+        % IMPLICIT
+        \@@_log:n {setup-implicit}
+        \seq_gset_eq:NN \g_@@_mathalph_seq \g_@@_default_mathalph_seq
+        \bool_set_true:N \l_@@_implicit_alph_bool
+        \@@_maybe_init_alphabet:n  {sf}
+        \@@_maybe_init_alphabet:n  {bf}
+        \@@_maybe_init_alphabet:n  {bfsf}
+        \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn
+        \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn
+        \@@_mathalph_map:
+        \seq_if_empty:NF \l_@@_missing_alph_seq { \@@_log:n { missing-alphabets } }
+      }
+      {
+        \seq_if_empty:NF \g_@@_mathalph_seq
+          {
+            % EXPLICIT
+            \@@_log:n {setup-explicit}
+            \bool_set_false:N \l_@@_implicit_alph_bool
+            \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn
+            \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn
+            \@@_mathalph_map:
+            \seq_if_empty:NF \l_@@_missing_alph_seq { \@@_log:n { missing-alphabets } }
+          }
+
+        % INHERIT
+        \clist_if_empty:NF \l_@@_mathmap_charints_clist
+          {
+            \seq_gclear:N \g_@@_mathalph_seq
+            \seq_map_inline:Nn \g_@@_default_mathalph_seq
+              {
+                \tl_set:No    \l_@@_style_tl       { \use_i:nnn   ##1 }
+                \clist_set:No \l_@@_alphabet_clist { \use_ii:nnn  ##1 }
+
+                \clist_map_inline:Nn \l_@@_alphabet_clist
+                  {
+                    \clist_map_inline:cn {g_@@_named_slots_ \l_@@_style_tl _ ####1 _clist}
+                      {
+                        \clist_map_inline:Nn \l_@@_mathmap_charints_clist
+                          {
+                            \@@_int_if_slot_in_range:nnT {################1} {########1}
+                              {
+                                \seq_gput_right:Nn \g_@@_mathalph_seq {##1}
+                                \clist_map_break:n { \clist_map_break:n { \clist_map_break: } }
+                              }
+                          }
+                      }
+                  }
+              }
+          }
+
+        \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_parse:nnn
+        \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_parse:nn
+        \@@_mathalph_map:
+      }
+  }
 %    \end{macrocode}
+% \end{macro}
 %
-% In LaTeX maths, the command |\operator at font| is defined that switches to the |operator| mathgroup. The classic example is the |\sin| in |$\sin{x}$|; essentially we're using |\mathrm| to typeset the upright symbols, but the syntax is |{\operator at font sin}|.
-% I thought that hooking into |\operator at font| would be hard because all other maths font selection in 2e uses |\mathrm{...}| style.
-% Then reading source2e a little more I stumbled upon:
-% \begin{macro}{\operator at font}
+% \begin{macro}{\@@_mathalph_map:}
 %    \begin{macrocode}
-\cs_set:Npn \operator at font
- {
-  \@@_switchto_literal:
-  \@fontswitch {} { \g_@@_operator_mathfont_tl }
- }
+\cs_set:Nn \@@_mathalph_map:
+  {
+   \seq_map_inline:Nn \g_@@_mathalph_seq
+      {
+        \tl_set:No    \l_@@_style_tl       { \use_i:nnn   ##1 }
+        \clist_set:No \l_@@_alphabet_clist { \use_ii:nnn  ##1 }
+        \tl_set:No    \l_@@_remap_style_tl { \use_iii:nnn ##1 }
+
+        % If no set of alphabets is defined:
+        \clist_if_empty:NT \l_@@_alphabet_clist
+          {
+            \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n
+            \prop_get:cnN { g_@@_named_range_ \l_@@_style_tl _prop }
+              { default-alpha } \l_@@_alphabet_clist
+          }
+
+        \@@_check_math_alphabet:
+        \@@_setup_math_alphabet:
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-%
-% \subsection{Setting styles}
-%
-% Algorithm for setting alphabet fonts.
-% By default, when |range| is empty, we are in \emph{implicit} mode.
-% If |range| contains the name of the math alphabet, we are in \emph{explicit}
-% mode and do things slightly differently.
-%
-% Implicit mode:
-% \begin{itemize}
-% \item Try and set all of the alphabet shapes.
-% \item Check for the first glyph of each alphabet to detect if the font supports each
-%       alphabet shape.
-% \item For alphabets that do exist, overwrite whatever's already there.
-% \item For alphabets that are not supported, \emph{do nothing}.
-%       (This includes leaving the old alphabet definition in place.)
-% \end{itemize}
-%
-% Explicit mode:
-% \begin{itemize}
-% \item Only set the alphabets specified.
-% \item Check for the first glyph of the alphabet to detect if the font contains
-%       the alphabet shape in the Unicode math plane.
-% \item For Unicode math alphabets, overwrite whatever's already there.
-% \item Otherwise, use the \ascii\ glyph slots instead.
-% \end{itemize}
-%
-%
-%
-% \subsection{Defining the math style macros}
-%
-% We call the different shapes that a math alphabet can be a `math style'.
-% Note that different alphabets can exist within the same math style. E.g.,
-% we call `bold' the math style |bf| and within it there are upper and lower
-% case Greek and Roman alphabets and Arabic numerals.
-%
-% \begin{macro}{\@@_prepare_mathstyle:n}
-% \darg{math style name (e.g., \texttt{it} or \texttt{bb})}
-% Define the high level math alphabet macros (\cs{mathit}, etc.) in terms of
-% unicode-math definitions. Use \cs{bgroup}/\cs{egroup} so s'scripts scan the
-% whole thing.
-%
-% The flag \cs{l_@@_mathstyle_tl} is for other applications to query the
-% current math style.
+% \begin{macro}{\@@_check_math_alphabet:}
+% First check that at least one of the alphabets for the font shape is defined
+% (this process is fast) \dots
 %    \begin{macrocode}
-\cs_new:Nn \@@_prepare_mathstyle:n
- {
-  \seq_put_right:Nn \g_@@_mathstyles_seq {#1}
-  \@@_init_alphabet:n {#1}
-  \cs_set:cpn {_@@_sym_#1_aux:n}
-   { \use:c {@@_switchto_#1:} \math at egroup }
-  \cs_set_protected:cpx {sym#1}
-   {
-    \exp_not:n
-     {
-      \math at bgroup
-      \mode_if_math:F
-        {
-          \egroup\expandafter
-          \non at alpherr\expandafter{\csname sym#1\endcsname\space}
-        }
-      \tl_set:Nn \l_@@_mathstyle_tl {#1}
-     }
-    \exp_not:c {_@@_sym_#1_aux:n}
-   }
- }
+\cs_new:Nn \@@_check_math_alphabet:
+  {
+    \clist_map_inline:Nn \l_@@_alphabet_clist
+      {
+        \tl_set:Nn \l_@@_alphabet_tl {##1}
+        \@@_if_alphabet_exists:nnTF \l_@@_style_tl \l_@@_alphabet_tl
+          {
+            \str_if_eq_x:nnTF {\l_@@_alphabet_tl} {misc}
+              {
+                \@@_maybe_init_alphabet:n \l_@@_style_tl
+                \clist_map_break:
+              }
+              {
+                \@@_glyph_if_exist:NnT \g_@@_curr_font_cmd_tl
+                  { \@@_to_usv:nn {\l_@@_style_tl} {\l_@@_alphabet_tl} }
+                  {
+                    \@@_maybe_init_alphabet:n \l_@@_style_tl
+                    \clist_map_break:
+                  }
+              }
+          }
+          {
+            \msg_warning:nnx {unicode-math} {no-alphabet}
+              { \l_@@_style_tl / \l_@@_alphabet_tl }
+          }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-%
-% \begin{macro}{\@@_init_alphabet:n}
-% \darg{math alphabet name (e.g., \texttt{it} or \texttt{bb})}
-% This macro initialises the macros used to set up a math alphabet.
-% First used when the math alphabet macro is first defined, but then used
-% later when redefining a particular maths alphabet.
+% \begin{macro}{\@@_setup_math_alphabet:}
+% \dots and then loop through them defining the individual ranges:
+% (currently this process is slow)
 %    \begin{macrocode}
-\cs_set:Nn \@@_init_alphabet:n
- {
-  \@@_log:nx {alph-initialise} {#1}
-  \cs_set_eq:cN {@@_switchto_#1:} \prg_do_nothing:
- }
+\cs_new:Nn \@@_setup_math_alphabet:
+  {
+    \clist_map_inline:Nn \l_@@_alphabet_clist
+      {
+        \tl_set:Nx \l_@@_alphabet_tl { \tl_trim_spaces:n {##1} }
+
+%<debug>\typeout{_setup_math_alphabet:~\l_@@_style_tl/\l_@@_alphabet_tl}
+
+        \@@_if_alphabet_exists:nnT {\l_@@_style_tl} {\l_@@_alphabet_tl}
+          {
+            \exp_args:No \tl_if_eq:nnTF \l_@@_alphabet_tl {misc}
+              {
+                \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)}
+                \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl}
+              }
+              {
+                \@@_glyph_if_exist:NnTF \g_@@_curr_font_cmd_tl { \@@_to_usv:nn {\l_@@_remap_style_tl} {\l_@@_alphabet_tl} }
+                  {
+                    \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)}
+                    \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl}
+                  }
+                  {
+                    \bool_if:NTF \l_@@_implicit_alph_bool
+                      {
+                        \seq_put_right:Nx \l_@@_missing_alph_seq
+                          {
+                            \@backslashchar sym \l_@@_style_tl \space
+                            (\tl_use:c{c_@@_math_alphabet_name_ \l_@@_alphabet_tl _tl})
+                          }
+                      }
+                      {
+                        \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {up}
+                      }
+                  }
+              }
+          }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsection{Definition of alphabets and styles}
-%
-% First of all, we break up unicode into `named ranges', such as |up|, |bb|, |sfup|, and so on, which refer to specific blocks of unicode that contain various symbols (usually alphabetical symbols).
-%
-%    \begin{macrocode}
-\cs_new:Nn \@@_new_named_range:n
- {
-  \prop_new:c {g_@@_named_range_#1_prop}
- }
-\clist_set:Nn \g_@@_named_ranges_clist
- {
-  up, it, tt, bfup, bfit, bb , bbit, scr, bfscr, cal, bfcal,
-  frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf
- }
-\clist_map_inline:Nn \g_@@_named_ranges_clist
- { \@@_new_named_range:n {#1} }
-%    \end{macrocode}
-%
-%
 % Each alphabet style needs to be configured.
 % This happens in Section~\ref{sec:setupalphabets}.
 %    \begin{macrocode}
 \cs_new:Nn \@@_new_alphabet_config:nnn
- {
-  \prop_if_exist:cF {g_@@_named_range_#1_prop}
-   { \@@_warning:nnn {no-named-range} {#1} {#2} }
+  {
+    \prop_if_exist:cF {g_@@_named_range_#1_prop}
+      { \@@_warning:nnn {no-named-range} {#1} {#2} }
 
-  \prop_gput:cnn {g_@@_named_range_#1_prop} { alpha_tl }
-    {
-     \prop_item:cn {g_@@_named_range_#1_prop} { alpha_tl }
-     {#2}
-    }
-  % Q: do I need to bother removing duplicates?
 
-  \cs_new:cn { @@_config_#1_#2:n } {#3}
- }
+    \prop_gput:cnn {g_@@_named_range_#1_prop} { alpha_tl }
+      {
+        \prop_item:cn {g_@@_named_range_#1_prop} { alpha_tl } {#2}
+      }
+    % Q: do I need to bother removing duplicates?
+
 %    \end{macrocode}
+% Create list of all chars defined in this named range:
 %    \begin{macrocode}
-\cs_new:Nn \@@_alphabet_config:nnn
- {
-  \use:c {@@_config_#1_#2:n} {#3}
- }
-%    \end{macrocode}
-%    \begin{macrocode}
-\prg_new_conditional:Nnn \@@_if_alphabet_exists:nn {T,TF}
- {
-  \cs_if_exist:cTF {@@_config_#1_#2:n}
-   \prg_return_true: \prg_return_false:
- }
-%    \end{macrocode}
-%
-% The linking between named ranges and symbol style commands happens here.
-% It's currently not using all of the machinery we're in the process of setting up above.
-% Baby steps.
-%    \begin{macrocode}
-\cs_new:Nn \@@_default_mathalph:nnn
- {
-  \seq_put_right:Nx \g_@@_named_ranges_seq { \tl_to_str:n {#1} }
-  \seq_put_right:Nn \g_@@_default_mathalph_seq {{#1}{#2}{#3}}
-  \prop_gput:cnn { g_@@_named_range_#1_prop } { default-alpha } {#2}
- }
-\@@_default_mathalph:nnn {up    } {latin,Latin,greek,Greek,num,misc} {up    }
-\@@_default_mathalph:nnn {it    } {latin,Latin,greek,Greek,misc}     {it    }
-\@@_default_mathalph:nnn {bb    } {latin,Latin,num,misc}             {bb    }
-\@@_default_mathalph:nnn {bbit  } {misc}                             {bbit  }
-\@@_default_mathalph:nnn {scr   } {latin,Latin}                      {scr   }
-\@@_default_mathalph:nnn {cal   } {Latin}                            {scr   }
-\@@_default_mathalph:nnn {bfcal } {Latin}                            {bfscr }
-\@@_default_mathalph:nnn {frak  } {latin,Latin}                      {frak  }
-\@@_default_mathalph:nnn {tt    } {latin,Latin,num}                  {tt    }
-\@@_default_mathalph:nnn {sfup  } {latin,Latin,num}                  {sfup  }
-\@@_default_mathalph:nnn {sfit  } {latin,Latin}                      {sfit  }
-\@@_default_mathalph:nnn {bfup  } {latin,Latin,greek,Greek,num,misc} {bfup  }
-\@@_default_mathalph:nnn {bfit  } {latin,Latin,greek,Greek,misc}     {bfit  }
-\@@_default_mathalph:nnn {bfscr } {latin,Latin}                      {bfscr }
-\@@_default_mathalph:nnn {bffrak} {latin,Latin}                      {bffrak}
-\@@_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup}
-\@@_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc}     {bfsfit}
-%    \end{macrocode}
-%
-% \subsubsection{Define symbol style commands}
-% Finally, all of the `symbol styles' commands are set up, which are the commands to access each of the named alphabet styles. There is not a one-to-one mapping between symbol style commands and named style ranges!
-%    \begin{macrocode}
-\clist_map_inline:nn
- {
-  up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf,
-  tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak,
-  normal, literal, sf, bf,
- }
- { \@@_prepare_mathstyle:n {#1} }
-%    \end{macrocode}
-%
-%
-% \subsubsection{New names for legacy textmath alphabet selection}
-% In case a package option overwrites, say, \cs{mathbf} with \cs{symbf}.
-%    \begin{macrocode}
-\clist_map_inline:nn
- { rm, it, bf, sf, tt }
- { \cs_set_eq:cc { mathtext #1 } { math #1 } }
-%    \end{macrocode}
-% Perhaps these should actually be defined using a hypothetical unicode-math interface to creating new such styles. To come.
-%
-%
-% \subsubsection{Replacing legacy pure-maths alphabets}
-% The following are alphabets which do not have a math/text ambiguity.
-%    \begin{macrocode}
-\clist_map_inline:nn
- {
-   normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
-   bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
- }
- {
-  \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } }
- }
-%    \end{macrocode}
-%
-%
-% \subsubsection{New commands for ambiguous alphabets}
-%    \begin{macrocode}
-\AtBeginDocument{
-\clist_map_inline:nn
- { rm, it, bf, sf, tt }
- {
-  \cs_set_protected:cpx { math #1 }
-   {
-    \exp_not:n { \bool_if:NTF  } \exp_not:c { g_@@_ math #1 _text_bool}
-     { \exp_not:c { mathtext #1 } }
-     { \exp_not:c { sym #1 } }
-   }
- }}
-%    \end{macrocode}
-%
-% \paragraph{Alias \cs{mathrm} as legacy name for \cs{mathup}}
-%    \begin{macrocode}
-\cs_set_protected:Npn \mathup { \mathrm }
-\cs_set_protected:Npn \symrm  { \symup  }
-%    \end{macrocode}
-%
-%
-%
-%
-% \subsection{Defining the math alphabets per style}
-%
-% \begin{macro}{\@@_setup_alphabets:}
-% This function is called within \cs{setmathfont} to configure the
-% mapping between characters inside math styles.
-%    \begin{macrocode}
-\cs_new:Npn \@@_setup_alphabets:
- {
-%    \end{macrocode}
-% If |range=| has been used to configure styles, those choices will be in
-% |\l_@@_mathalph_seq|. If not, set up the styles implicitly:
-%    \begin{macrocode}
-  \seq_if_empty:NTF \l_@@_mathalph_seq
-   {
-    \@@_log:n {setup-implicit}
-    \seq_set_eq:NN \l_@@_mathalph_seq \g_@@_default_mathalph_seq
-    \bool_set_true:N \l_@@_implicit_alph_bool
-    \@@_maybe_init_alphabet:n  {sf}
-    \@@_maybe_init_alphabet:n  {bf}
-    \@@_maybe_init_alphabet:n  {bfsf}
-   }
-%    \end{macrocode}
-% If |range=| has been used then we're in explicit mode:
-%    \begin{macrocode}
-   {
-    \@@_log:n {setup-explicit}
-    \bool_set_false:N \l_@@_implicit_alph_bool
-    \cs_set_eq:NN \@@_set_mathalphabet_char:nnn \@@_mathmap_noparse:nnn
-    \cs_set_eq:NN \@@_map_char_single:nn \@@_map_char_noparse:nn
-   }
+    \cs_new:cn { @@_config_#1_#2:n }
+      {
+        \clist_gclear_new:c {g_@@_named_slots_#1_#2_clist}
+        \tl_set:Nn \l_@@_curr_named_slot { g_@@_named_slots_#1_#2_clist }
+        #3
+        \clist_gremove_duplicates:c {g_@@_named_slots_#1_#2_clist}
+      }
 
-  % Now perform the mapping:
-  \seq_map_inline:Nn \l_@@_mathalph_seq
-   {
-    \tl_set:No    \l_@@_style_tl       { \use_i:nnn   ##1 }
-    \clist_set:No \l_@@_alphabet_clist { \use_ii:nnn  ##1 }
-    \tl_set:No    \l_@@_remap_style_tl { \use_iii:nnn ##1 }
-
-    % If no set of alphabets is defined:
-    \clist_if_empty:NT \l_@@_alphabet_clist
-     {
-      \cs_set_eq:NN \@@_maybe_init_alphabet:n \@@_init_alphabet:n
-      \prop_get:cnN { g_@@_named_range_ \l_@@_style_tl _prop }
-       { default-alpha } \l_@@_alphabet_clist
-     }
-
-    \@@_setup_math_alphabet:
-   }
-  \seq_if_empty:NF \l_@@_missing_alph_seq { \@@_log:n { missing-alphabets } }
- }
+  }
 %    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@@_setup_math_alphabet:}
 %    \begin{macrocode}
-\cs_new:Nn \@@_setup_math_alphabet:
- {
+\cs_new:Nn \@@_alphabet_config:nnn
+  {
+    \use:c {@@_config_#1_#2:n} {#3}
+  }
 %    \end{macrocode}
-% First check that at least one of the alphabets for the font shape is defined
-% (this process is fast) \dots
 %    \begin{macrocode}
-  \clist_map_inline:Nn \l_@@_alphabet_clist
-   {
-    \tl_set:Nn \l_@@_alphabet_tl {##1}
-    \@@_if_alphabet_exists:nnTF \l_@@_style_tl \l_@@_alphabet_tl
-     {
-      \str_if_eq_x:nnTF {\l_@@_alphabet_tl} {misc}
-       {
-        \@@_maybe_init_alphabet:n \l_@@_style_tl
-        \clist_map_break:
-       }
-       {
-        \@@_glyph_if_exist:NnT \l_@@_font { \@@_to_usv:nn {\l_@@_style_tl} {\l_@@_alphabet_tl} }
-         {
-          \@@_maybe_init_alphabet:n \l_@@_style_tl
-          \clist_map_break:
-         }
-       }
-     }
-     { \msg_warning:nnx {unicode-math} {no-alphabet} { \l_@@_style_tl / \l_@@_alphabet_tl } }
-   }
+\prg_new_conditional:Nnn \@@_if_alphabet_exists:nn {T,TF}
+  {
+    \cs_if_exist:cTF {@@_config_#1_#2:n}
+      \prg_return_true: \prg_return_false:
+  }
 %    \end{macrocode}
-% \dots and then loop through them defining the individual ranges:
-% (currently this process is slow)
-%    \begin{macrocode}
-%<debug>  \csname TIC\endcsname
-  \clist_map_inline:Nn \l_@@_alphabet_clist
-   {
-    \tl_set:Nx \l_@@_alphabet_tl { \tl_trim_spaces:n {##1} }
-    \cs_if_exist:cT {@@_config_ \l_@@_style_tl _ \l_@@_alphabet_tl :n}
-     {
-      \exp_args:No \tl_if_eq:nnTF \l_@@_alphabet_tl {misc}
-       {
-        \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)}
-        \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl}
-       }
-       {
-        \@@_glyph_if_exist:NnTF \l_@@_font { \@@_to_usv:nn {\l_@@_remap_style_tl} {\l_@@_alphabet_tl} }
-         {
-          \@@_log:nx {setup-alph} {sym \l_@@_style_tl~(\l_@@_alphabet_tl)}
-          \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {\l_@@_remap_style_tl}
-         }
-         {
-          \bool_if:NTF \l_@@_implicit_alph_bool
-           {
-            \seq_put_right:Nx \l_@@_missing_alph_seq
-             {
-              \@backslashchar sym \l_@@_style_tl \space
-              (\tl_use:c{c_@@_math_alphabet_name_ \l_@@_alphabet_tl _tl})
-             }
-           }
-           {
-            \@@_alphabet_config:nnn {\l_@@_style_tl} {\l_@@_alphabet_tl} {up}
-           }
-         }
-       }
-     }
-   }
-%<debug>  \csname TOC\endcsname
- }
-%    \end{macrocode}
-% \end{macro}
 %
+% \subsection{Mapping `naked’ math characters}
 %
-% \subsection{Mapping `naked' math characters}
-%
 % Before we show the definitions of the alphabet mappings using the functions
 % |\@@_alphabet_config:nnn \l_@@_style_tl {##1} {...}|, we first want to define some functions
 % to be used inside them to actually perform the character mapping.
@@ -426,15 +245,17 @@
 % \begin{macro}{\@@_map_char_parse:nn}
 %    \begin{macrocode}
 \cs_new:Nn \@@_map_char_noparse:nn
- { \@@_set_mathcode:nnnn {#1}{\mathalpha}{\l_@@_symfont_label_tl}{#2} }
+  {
+    \@@_set_mathcode:nnnn {#1} {\mathalpha} {\l_@@_symfont_label_tl} {#2}
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_map_char_parse:nn
- {
-  \@@_if_char_spec:nNNT {#1} {\@nil} {\mathalpha}
-   { \@@_map_char_noparse:nn {#1}{#2} }
- }
+  {
+    \@@_if_char_spec:nNT {#1} {\mathalpha}
+      { \@@_map_char_noparse:nn {#1}{#2} }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -441,16 +262,16 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_map_char_single:nnn}
-% \darg{char name (`dotlessi')}
+% \darg{char name (`dotlessi’)}
 % \darg{from alphabet(s)}
 % \darg{to alphabet}
 % Logical interface to \cs{@@_map_char_single:nn}.
 %    \begin{macrocode}
 \cs_new:Nn \@@_map_char_single:nnn
- {
-  \@@_map_char_single:nn { \@@_to_usv:nn {#1}{#3} }
-                         { \@@_to_usv:nn {#2}{#3} }
- }
+  {
+    \@@_map_char_single:nn { \@@_to_usv:nn {#1} {#3} }
+                           { \@@_to_usv:nn {#2} {#3} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -463,103 +284,109 @@
 % First the function with numbers:
 %    \begin{macrocode}
 \cs_set:Nn \@@_map_chars_range:nnn
- {
-  \int_step_inline:nnnn {0}{1}{#1-1}
-   { \@@_map_char_single:nn {#2+##1}{#3+##1} }
- }
+  {
+    \int_step_inline:nnnn {0} {1} {#1-1}
+      { \@@_map_char_single:nn {#2+##1} {#3+##1} }
+
+    \clist_gput_right:cx { \l_@@_curr_named_slot }
+      { \int_eval:n { #3 } - \int_eval:n { #3 + #1-1 } }
+  }
 %    \end{macrocode}
 % And the wrapper with names:
 %    \begin{macrocode}
 \cs_new:Nn \@@_map_chars_range:nnnn
- {
-  \@@_map_chars_range:nnn {#1} { \@@_to_usv:nn {#2}{#4} }
-                               { \@@_to_usv:nn {#3}{#4} }
- }
+  {
+    \@@_map_chars_range:nnn {#1} { \@@_to_usv:nn {#2} {#4} }
+                                 { \@@_to_usv:nn {#3} {#4} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsubsection{Functions for `normal' alphabet symbols}
+% \subsubsection{Functions for `normal’ alphabet symbols}
 %
 % \begin{macro}{\@@_set_normal_char:nnn}
 %    \begin{macrocode}
 \cs_set:Nn \@@_set_normal_char:nnn
- {
-  \@@_usv_if_exist:nnT {#3} {#1}
   {
-    \clist_map_inline:nn {#2}
-     {
-      \@@_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3}
-      \@@_map_char_single:nnn {##1} {#3} {#1}
-     }
+    \@@_usv_if_exist:nnT {#3} {#1}
+      {
+        \clist_map_inline:nn {#2}
+          {
+            \@@_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3}
+            \@@_map_char_single:nnn {##1} {#3} {#1}
+
+            \clist_gput_right:cx {\l_@@_curr_named_slot}
+              { \int_eval:n { \@@_to_usv:nn {#3} {#1} } }
+          }
+      }
   }
- }
 %    \end{macrocode}
 % \end{macro}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_normal_Latin:nn
- {
-  \clist_map_inline:nn {#1}
-   {
-    \@@_set_mathalphabet_Latin:nnn {normal} {##1} {#2}
-    \@@_map_chars_range:nnnn {26} {##1} {#2} {Latin}
-   }
- }
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \@@_set_mathalphabet_Latin:nnn {normal} {##1} {#2}
+        \@@_map_chars_range:nnnn {26} {##1} {#2} {Latin}
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_normal_latin:nn
- {
-  \clist_map_inline:nn {#1}
-   {
-    \@@_set_mathalphabet_latin:nnn {normal} {##1} {#2}
-    \@@_map_chars_range:nnnn {26} {##1} {#2} {latin}
-   }
- }
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \@@_set_mathalphabet_latin:nnn {normal} {##1} {#2}
+        \@@_map_chars_range:nnnn {26} {##1} {#2} {latin}
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_normal_greek:nn
- {
-  \clist_map_inline:nn {#1}
-   {
-    \@@_set_mathalphabet_greek:nnn {normal} {##1} {#2}
-    \@@_map_chars_range:nnnn {25} {##1} {#2} {greek}
-    \@@_map_char_single:nnn {##1} {#2} {epsilon}
-    \@@_map_char_single:nnn {##1} {#2} {vartheta}
-    \@@_map_char_single:nnn {##1} {#2} {varkappa}
-    \@@_map_char_single:nnn {##1} {#2} {phi}
-    \@@_map_char_single:nnn {##1} {#2} {varrho}
-    \@@_map_char_single:nnn {##1} {#2} {varpi}
-    \@@_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2}
-    \@@_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2}
-    \@@_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2}
-    \@@_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2}
-    \@@_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2}
-    \@@_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2}
-   }
- }
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \@@_set_mathalphabet_greek:nnn {normal} {##1} {#2}
+        \@@_map_chars_range:nnnn {25} {##1} {#2} {greek}
+        \@@_map_char_single:nnn {##1} {#2} {epsilon}
+        \@@_map_char_single:nnn {##1} {#2} {vartheta}
+        \@@_map_char_single:nnn {##1} {#2} {varkappa}
+        \@@_map_char_single:nnn {##1} {#2} {phi}
+        \@@_map_char_single:nnn {##1} {#2} {varrho}
+        \@@_map_char_single:nnn {##1} {#2} {varpi}
+        \@@_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2}
+        \@@_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2}
+        \@@_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2}
+        \@@_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2}
+        \@@_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2}
+        \@@_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2}
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_normal_Greek:nn
- {
-  \clist_map_inline:nn {#1}
-   {
-    \@@_set_mathalphabet_Greek:nnn {normal} {##1} {#2}
-    \@@_map_chars_range:nnnn {25} {##1} {#2} {Greek}
-    \@@_map_char_single:nnn {##1} {#2} {varTheta}
-    \@@_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2}
-   }
- }
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \@@_set_mathalphabet_Greek:nnn {normal} {##1} {#2}
+        \@@_map_chars_range:nnnn {25} {##1} {#2} {Greek}
+        \@@_map_char_single:nnn {##1} {#2} {varTheta}
+        \@@_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2}
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_normal_numbers:nn
- {
-  \@@_set_mathalphabet_numbers:nnn {normal} {#1} {#2}
-  \@@_map_chars_range:nnnn {10} {#1} {#2} {num}
- }
+  {
+    \@@_set_mathalphabet_numbers:nnn {normal} {#1} {#2}
+    \@@_map_chars_range:nnnn {10} {#1} {#2} {num}
+  }
 %    \end{macrocode}
 %
 %
@@ -567,45 +394,45 @@
 %
 % \subsubsection{Functions for setting up the maths alphabets}
 %
-% \begin{macro}{\@@_set_mathalphabet_char:Nnn}
+% \begin{macro}{\@@_set_mathalphabet_char:nnn}
+% \darg{Maths alphabet, \eg, `bb’}
+% \darg{Input slot, \eg, the slot for `A’ (comma separated)}
+% \darg{Output slot, \eg, the slot for `$\mathbb{A}$’}
 % This is a wrapper for either |\@@_mathmap_noparse:nnn| or
-% |\@@_mathmap_parse:Nnn|, depending on the context.
+% |\@@_mathmap_parse:nnn|, depending on the context.
 % \end{macro}
 %
 % \begin{macro}{\@@_mathmap_noparse:nnn}
-% \darg{Maths alphabet, \eg, `bb'}
-% \darg{Input slot(s), \eg, the slot for `A' (comma separated)}
-% \darg{Output slot, \eg, the slot for `$\mathbb{A}$'}
-% Adds \cs{@@_set_mathcode:nnnn} declarations to the specified maths alphabet's definition.
+% \darg{Maths alphabet, \eg, `bb’}
+% \darg{Input slot, \eg, the slot for `A’ (comma separated)}
+% \darg{Output slot, \eg, the slot for `$\mathbb{A}$’}
+% Adds \cs{@@_set_mathcode:nnnn} declarations to the specified maths alphabet’s definition.
 %    \begin{macrocode}
 \cs_new:Nn \@@_mathmap_noparse:nnn
- {
-  \clist_map_inline:nn {#2}
-   {
-    \tl_put_right:cx {@@_switchto_#1:}
-     {
-      \@@_set_mathcode:nnnn {##1} {\mathalpha} {\l_@@_symfont_label_tl} {#3}
-     }
-   }
- }
+  {
+    \tl_put_right:cx { @@_switchto_#1: }
+      {
+        \@@_set_mathcode:nnnn {#2} {\mathalpha} {\l_@@_symfont_label_tl} {#3}
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@@_mathmap_parse:nnn}
-% \darg{Maths alphabet, \eg, `bb'}
-% \darg{Input slot(s), \eg, the slot for `A' (comma separated)}
-% \darg{Output slot, \eg, the slot for `$\mathbb{A}$'}
-% When \cmd\@@_if_char_spec:nNNT\ is executed, it populates the \cmd\l_@@_char_nrange_clist\
+% \darg{Maths alphabet, \eg, `bb’}
+% \darg{Input slot, \eg, the slot for `A’ (comma separated)}
+% \darg{Output slot, \eg, the slot for `$\mathbb{A}$’}
+% When \cmd\@@_if_char_spec:nNT\ is executed, it populates the \cmd\l_@@_mathmap_charints_clist\
 % macro with slot numbers corresponding to the specified range. This range is used to
 % conditionally add \cs{@@_set_mathcode:nnnn} declaractions to the maths alphabet definition.
 %    \begin{macrocode}
 \cs_new:Nn \@@_mathmap_parse:nnn
- {
-  \clist_if_in:NnT \l_@@_char_nrange_clist {#3}
-   {
-    \@@_mathmap_noparse:nnn {#1}{#2}{#3}
-   }
- }
+  {
+    \exp_args:NNx \clist_if_in:NnT \l_@@_mathmap_charints_clist { \int_eval:n {#3} }
+      {
+        \@@_mathmap_noparse:nnn {#1} {#2} {#3}
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -616,34 +443,45 @@
 % \darg{char name to map}
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalphabet_char:nnnn
- {
-  \@@_set_mathalphabet_char:nnn {#1} { \@@_to_usv:nn {#2} {#4} }
-                                     { \@@_to_usv:nn {#3} {#4} }
- }
+  {
+    \@@_set_mathalphabet_char:nnn {#1} { \@@_to_usv:nn {#2} {#4} }
+                                       { \@@_to_usv:nn {#3} {#4} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@@_set_mathalph_range:nnnn}
 % \darg{Number of iterations}
-% \darg{Maths alphabet}
-% \darg{Starting input char (single)}
+% \darg{Sym command suffix}
+% \darg{Starting input char}
 % \darg{Starting output char}
 % Loops through character ranges setting \cmd\mathcode.
 % First the version that uses numbers:
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalph_range:nnnn
- {
-  \int_step_inline:nnnn {0} {1} {#1-1}
-    { \@@_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } }
- }
+  {
+    \int_step_inline:nnnn {0} {1} {#1-1}
+      { \@@_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } }
+  }
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_set_mathalph_range:nnnn}
+% \darg{Number of iterations}
+% \darg{Sym command suffix}
+% \darg{input style}
+% \darg{output style}
+% \darg{alphabet}
 % Then the wrapper version that uses names:
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalph_range:nnnnn
- {
-  \@@_set_mathalph_range:nnnn {#1} {#2} { \@@_to_usv:nn {#3} {#5} }
-                                        { \@@_to_usv:nn {#4} {#5} }
- }
+  {
+    \clist_gput_right:cx { \l_@@_curr_named_slot }
+      { \int_eval:n { \@@_to_usv:nn {#4} {#5} } - \int_eval:n { (#1-1)+\@@_to_usv:nn {#4} {#5} } }
+
+    \@@_set_mathalph_range:nnnn {#1} {#2} { \@@_to_usv:nn {#3} {#5} }
+                                          { \@@_to_usv:nn {#4} {#5} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -651,67 +489,70 @@
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalphabet_pos:nnnn
- {
-  \@@_usv_if_exist:nnT {#4} {#2}
-   {
-    \clist_map_inline:nn {#3}
-      { \@@_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} }
-   }
- }
+  {
+    \@@_usv_if_exist:nnT {#4} {#2}
+      {
+        \clist_map_inline:nn {#3}
+          { \@@_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} }
+
+        \clist_gput_right:cx {\l_@@_curr_named_slot}
+          { \int_eval:n { \@@_to_usv:nn {#4} {#2} } }
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalphabet_numbers:nnn
- {
-  \clist_map_inline:nn {#2}
-    { \@@_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} }
- }
+  {
+    \clist_map_inline:nn {#2}
+      { \@@_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalphabet_Latin:nnn
- {
-  \clist_map_inline:nn {#2}
-    { \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} }
- }
+  {
+    \clist_map_inline:nn {#2}
+      { \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalphabet_latin:nnn
- {
-  \clist_map_inline:nn {#2}
-   {
-    \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {h}
-   }
- }
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \@@_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {h}
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalphabet_Greek:nnn
- {
-  \clist_map_inline:nn {#2}
-   {
-    \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varTheta}
-   }
- }
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varTheta}
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_mathalphabet_greek:nnn
- {
-  \clist_map_inline:nn {#2}
-   {
-    \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {epsilon}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {vartheta}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varkappa}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {phi}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varrho}
-    \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varpi}
-   }
- }
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \@@_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {epsilon}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {vartheta}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varkappa}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {phi}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varrho}
+        \@@_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varpi}
+      }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -729,7 +570,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-mathtext.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The "math text" commands such as `\mathbf` and co.
 
 % \section{Maths text commands}
 %
@@ -11,38 +12,37 @@
 % \begin{macro}{\@@_setmathfontface:Nnn}
 %    \begin{macrocode}
 \keys_define:nn {@@_mathface}
- {
-  version .code:n =
-   { \tl_set:Nn \l_@@_mversion_tl {#1} }
- }
+  {
+    version .tl_set:N = \l_@@_mversion_tl
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_set:Nn \@@_setmathfontface:Nnn
- {
-  \tl_clear:N \l_@@_mversion_tl
+  {
+    \tl_clear:N \l_@@_mversion_tl
 
-  \keys_set_known:nnN {@@_mathface} {#2} \l_@@_keyval_clist
+    \keys_set_known:nnN {@@_mathface} {#2} \l_@@_keyval_clist
 
-  \exp_args:Nnx \fontspec_set_family:Nxn \l_@@_tmpa_tl
-   { ItalicFont={}, BoldFont={}, \exp_not:V \l_@@_keyval_clist } {#3}
+    \exp_args:Nnx \fontspec_set_family:Nxn \l_@@_tmpa_tl
+      { ItalicFont={}, BoldFont={}, \exp_not:V \l_@@_keyval_clist } {#3}
 
-  \tl_if_empty:NT \l_@@_mversion_tl
-   {
-    \tl_set:Nn \l_@@_mversion_tl {normal}
-    \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault}
-   }
+    \tl_if_empty:NT \l_@@_mversion_tl
+      {
+        \tl_set:Nn \l_@@_mversion_tl {normal}
+        \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault}
+      }
 
-  \SetMathAlphabet #1 {\l_@@_mversion_tl} {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault}
+    \SetMathAlphabet #1 {\l_@@_mversion_tl} {\g_fontspec_encoding_tl} {\l_@@_tmpa_tl} {\mddefault} {\updefault}
 
-  % integrate with fontspec's \setmathrm etc:
-  \tl_case:Nn #1
-   {
-    \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l_@@_tmpa_tl }
-    \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l_@@_tmpa_tl }
-    \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l_@@_tmpa_tl }
-   }
- }
+    % integrate with fontspec's \setmathrm etc:
+    \tl_case:Nn #1
+      {
+        \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l_@@_tmpa_tl }
+        \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l_@@_tmpa_tl }
+        \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l_@@_tmpa_tl }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -54,6 +54,7 @@
 % While we could now re-activate the way that \pkg{fontspec} does the following, because we can now change maths fonts whenever it's better to define new commands in \pkg{unicode-math} to define the \cs{mathXYZ} fonts.
 %
 % \subsubsection{Text font}
+%
 %    \begin{macrocode}
 \cs_generate_variant:Nn \tl_if_eq:nnT {o}
 \cs_set:Nn \__fontspec_setmainfont_hook:nn
@@ -62,12 +63,11 @@
       {
 %<XE>   \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2}
 %<LU>   \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2}
-        \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault
-        \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault
-        \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault
+        \__fontspec_setmathrm_hook:nn {#1} {#2}
       }
   }
-
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_set:Nn \__fontspec_setsansfont_hook:nn
   {
     \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault}
@@ -74,11 +74,11 @@
       {
 %<XE>   \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2}
 %<LU>   \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2}
-        \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault
-        \SetMathAlphabet\mathsf{bold}  \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault
+        \__fontspec_setmathsf_hook:nn {#1} {#2}
       }
   }
-
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_set:Nn \__fontspec_setmonofont_hook:nn
   {
     \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault}
@@ -85,8 +85,7 @@
       {
 %<XE>   \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2}
 %<LU>   \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2}
-        \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
-        \SetMathAlphabet\mathtt{bold}  \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
+        \__fontspec_setmathtt_hook:nn {#1} {#2}
       }
   }
 %    \end{macrocode}
@@ -100,6 +99,8 @@
     \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault
     \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault
   }
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_set:Nn \__fontspec_setboldmathrm_hook:nn
   {
     \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\updefault
@@ -106,11 +107,15 @@
     \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\bfdefault\updefault
     \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\itdefault
   }
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_set:Nn \__fontspec_setmathsf_hook:nn
   {
     \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault
     \SetMathAlphabet\mathsf{bold}  \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault
   }
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_set:Nn \__fontspec_setmathtt_hook:nn
   {
     \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
@@ -118,7 +123,28 @@
   }
 %    \end{macrocode}
 %
+% I can't quite remember the logic behind the following two.
+%
+% If \pkg{fontspec} has been loaded and \verb|\setmathsf| (etc) run, this
+% syncs things up:
 %    \begin{macrocode}
+\tl_if_eq:onF {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
+\tl_if_eq:onF {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
+\tl_if_eq:onF {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
+%    \end{macrocode}
+%
+% I suppose this is to make things work if neither fontspec or unicode-math
+% load any fonts: (I should check that)
+%    \begin{macrocode}
+\AtBeginDocument
+  {
+    \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
+    \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
+    \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 
@@ -133,7 +159,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-msg.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definitions of error, warning, and log messages.
 
 % \section{Error messages}
 % \seclabel{codemsg}
@@ -7,105 +8,119 @@
 %<*package>
 %    \end{macrocode}
 %
-% Wrapper functions:
 %    \begin{macrocode}
-\cs_new:Npn \@@_error:n   { \msg_error:nn   {unicode-math} }
-\cs_new:Npn \@@_warning:n { \msg_warning:nn {unicode-math} }
-\cs_new:Npn \@@_warning:nnn { \msg_warning:nnxx {unicode-math} }
-\cs_new:Npn \@@_log:n     { \msg_log:nn     {unicode-math} }
-\cs_new:Npn \@@_log:nx    { \msg_log:nnx    {unicode-math} }
+\char_set_catcode_space:n {32}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\msg_new:nnn {unicode-math} {no-tfrac}
+\@@_msg_new:nn {no-tfrac}
 {
-  Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\
-  Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math.
+  Small fraction command \protect\tfrac\ not defined.\\
+  Load amsmath or define it manually before loading unicode-math.
 }
-\msg_new:nnn {unicode-math} {default-math-font}
+\@@_msg_new:nn {default-math-font}
 {
-  Defining~ the~ default~ maths~ font~ as~ '\l_@@_fontname_tl'.
+  Defining the default maths font as '\l_@@_fontname_tl'.
 }
-\msg_new:nnn {unicode-math} {setup-implicit}
+\@@_msg_new:nn {setup-implicit}
 {
-  Setup~ alphabets:~ implicit~ mode.
+  Setup alphabets: implicit mode.
 }
-\msg_new:nnn {unicode-math} {setup-explicit}
+\@@_msg_new:nn {setup-explicit}
 {
-  Setup~ alphabets:~ explicit~ mode.
+  Setup alphabets: explicit mode.
 }
-\msg_new:nnn {unicode-math} {alph-initialise}
+\@@_msg_new:nn {alph-initialise}
 {
-  Initialising~ \@backslashchar math#1.
+  Initialising \@backslashchar math#1.
 }
-\msg_new:nnn {unicode-math} {setup-alph}
+\@@_msg_new:nn {setup-alph}
 {
-  Setup~ alphabet:~ #1.
+  Setup alphabet: #1.
 }
-\msg_new:nnn {unicode-math} {no-alphabet}
+\@@_msg_new:nn {no-alphabet}
 {
-  I~ am~ trying~ to~ set~ up~ alphabet~"#1"~ but~ there~ are~ no~ configuration~ settings~ for~ it.~
-  (See~ source~ file~ "unicode-math-alphabets.dtx"~ to~ debug.)
+  I am trying to set up alphabet"#1" but there are no configuration settings for it.
+  (See source file "unicode-math-alphabets.dtx" to debug.)
 }
-\msg_new:nnn { unicode-math } { no-named-range }
+\@@_msg_new:nn {no-named-range}
  {
-  I~ am~ trying~ to~ define~ new~ alphabet~ "#2"~ in~ range~ "#1",~ but~ range~ "#1"~ hasn't~ been~ defined~ yet.
+  I am trying to define new alphabet "#2" in range "#1", but range "#1" hasn't been defined yet.
  }
-\msg_new:nnn { unicode-math } { missing-alphabets }
+\@@_msg_new:nn {missing-alphabets}
  {
-  Missing~math~alphabets~in~font~ "\fontname\l_@@_font" \\ \\
+  Missingmathalphabetsinfont "\fontname\g_@@_curr_font_cmd_tl" \\ \\
   \seq_map_function:NN \l_@@_missing_alph_seq \@@_print_indent:n
  }
 \cs_new:Nn \@@_print_indent:n { \space\space\space\space #1 \\ }
-\msg_new:nnn {unicode-math} {macro-expected}
+\@@_msg_new:nn {macro-expected}
 {
-  I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't.
+  I've expected that #1 is a macro, but it isn't.
 }
-\msg_new:nnn {unicode-math} {wrong-meaning}
+\@@_msg_new:nn {wrong-meaning}
 {
-  I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2.
+  I've expected #1 to have the meaning #3, but it has the meaning #2.
 }
-\msg_new:nnn {unicode-math} {patch-macro}
+\@@_msg_new:nn {patch-macro}
 {
-  I'm~ going~ to~ patch~ macro~ #1.
+  I'm going to patch macro #1.
 }
-\msg_new:nnn { unicode-math } { mathtools-overbracket } {
-  Using~ \token_to_str:N \overbracket\ and~
-         \token_to_str:N \underbracket\ from~
-	 `mathtools'~ package.\\
+\@@_msg_new:nn {mathtools-overbracket} {
+  Using \token_to_str:N \overbracket\ and
+         \token_to_str:N \underbracket\ from
+	 `mathtools' package.\\
   \\
-  Use~ \token_to_str:N \Uoverbracket\ and~
-       \token_to_str:N \Uunderbracket\ for~
-       original~ `unicode-math'~ definition.
+  Use \token_to_str:N \Uoverbracket\ and
+       \token_to_str:N \Uunderbracket\ for
+       original `unicode-math' definition.
 }
-\msg_new:nnn { unicode-math } { mathtools-colon } {
-  I'm~ going~ to~ overwrite~ the~ following~ commands~ from~
-  the~ `mathtools'~ package: \\ \\
-  \ \ \ \ \token_to_str:N \dblcolon,~
-  \token_to_str:N \coloneqq,~
-  \token_to_str:N \Coloneqq,~
+\@@_msg_new:nn {mathtools-colon} {
+  I'm going to overwrite the following commands from
+  the `mathtools' package: \\ \\
+  \ \ \ \ \token_to_str:N \dblcolon,
+  \token_to_str:N \coloneqq,
+  \token_to_str:N \Coloneqq,
   \token_to_str:N \eqqcolon. \\ \\
-  Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like~
-  commands,~ using~ them~ will~ lead~ to~ inconsistencies.
+  Note that since I won't overwrite the other colon-like
+  commands, using them will lead to inconsistencies.
 }
-\msg_new:nnn { unicode-math } { colonequals } {
-  I'm~ going~ to~ overwrite~ the~ following~ commands~ from~
-  the~ `colonequals'~ package: \\ \\
-  \ \ \ \ \token_to_str:N \ratio,~
-          \token_to_str:N \coloncolon,~
+\@@_msg_new:nn {colonequals} {
+  I'm going to overwrite the following commands from
+  the `colonequals' package: \\ \\
+  \ \ \ \ \token_to_str:N \ratio,
+          \token_to_str:N \coloncolon,
           \token_to_str:N \minuscolon, \\
-  \ \ \ \ \token_to_str:N \colonequals,~
-          \token_to_str:N \equalscolon,~
+  \ \ \ \ \token_to_str:N \colonequals,
+          \token_to_str:N \equalscolon,
           \token_to_str:N \coloncolonequals. \\ \\
-  Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like~
-  commands,~ using~ them~ will~ lead~ to~ inconsistencies.~
-  Furthermore,~ changing~ \token_to_str:N \colonsep \c_space_tl
-  or~ \token_to_str:N \doublecolonsep \c_space_tl won't~ have~
-  any~ effect~ on~ the~ re-defined~ commands.
+  Note that since I won't overwrite the other colon-like
+  commands, using them will lead to inconsistencies.
+  Furthermore, changing \token_to_str:N \colonsep \c_space_tl
+  or \token_to_str:N \doublecolonsep \c_space_tl won't have
+  any effect on the re-defined commands.
 }
+\@@_msg_new:nn {bad-cs-in-range}
+  {
+    Command `#1` in math range is not recognised as a maths symbol.
+    Check file "unicode-math-table.tex" for allowable commands.
+  }
+\@@_msg_new:nn {legacy-char-not-supported}
+  {
+    Command `#1` is a legacy maths symbol that is not supported by unicode-math.
+  }
+\@@_msg_new:nn {range-not-bf-sf}
+  {
+    Range alphabets cannot include alphabets referring to `bf`, `sf`, or `bfsf`
+    since they relate to input commands not output glyphs.
+    Use `bfit` or `bfup` (etc.) to specify which.
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\char_set_catcode_ignore:n {32}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 
@@ -120,7 +135,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-opening.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Assorted initialisation tasks, including some low-level function definitions.
 
 % \section{Start of the package code}
 %
@@ -31,10 +32,21 @@
 % For \pkg{fontspec}:
 %    \begin{macrocode}
 \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx}
-\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx}
+\cs_generate_variant:Nn \prop_get:NnNTF {cx}
+\cs_generate_variant:Nn \tl_if_eq:nnF {o}
 %    \end{macrocode}
 %
 %
+% \subsection{Low level commands}
+%
+%    \begin{macrocode}
+\cs_set_eq:NN \@@_group_begin: \group_begin:
+\cs_set_eq:NN \@@_group_end:   \group_end:
+\cs_set_eq:NN \@@_group_begin_frozen: \@@_group_begin:
+\cs_set_eq:NN \@@_group_end_frozen:   \@@_group_end:
+%    \end{macrocode}
+%
+%
 % \subsection{Primitive font commands}
 %
 % What might end up being provided by the kernel.
@@ -52,6 +64,16 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_fontface_gset_eq:NN}
+%    \begin{macrocode}
+\cs_set_protected:Nn \@@_fontface_gset_eq:NN
+  {
+    \tex_global:D \tex_let:D #1 #2
+  }
+\cs_generate_variant:Nn \@@_fontface_gset_eq:NN {NV,cV}
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsubsection{Mathcode and friends}
 %
 % \begin{macro}{\@@_set_mathcode:nnnn}
@@ -133,30 +155,46 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_char_gmake_mathactive:N
   {
-    \global\mathcode `#1 = "8000 \scan_stop:
+    \tex_global:D \tex_mathcode:D `#1 = "8000 \scan_stop:
   }
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_new:Nn \@@_char_gmake_mathactive:n
   {
-    \global\mathcode #1 = "8000 \scan_stop:
+    \tex_global:D \tex_mathcode:D \int_eval:n {#1} = "8000 \scan_stop:
   }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\@@_mathactive_remap:nn}
+% Makes |#1| math-active and defines its meaning to be |#2|.
+% This is a global operation.
+%    \begin{macrocode}
+\cs_new:Nn \@@_mathactive_remap:nn
+  {
+    \group_begin:
+      \cs_set_protected:Npn \@@_tmp: {#2}
+      \@@_char_gmake_mathactive:n {#1}
+      \char_gset_active_eq:nN {#1} \@@_tmp:
+    \group_end:
+  }
+%    \end{macrocode}
+%
 % \subsubsection{Font parameters}
 %
-% \begin{macro}{\@@_copy_fontparam:nnn}
+% \begin{macro}{\@@_copy_fontdimen:nnN}
 %    \begin{macrocode}
-\cs_new:Nn \@@_copy_fontparam:nnn
+\cs_new:Nn \@@_copy_fontdimen:nnN
   {
-    \fontdimen #1 \font = \@@_get_fontparam:nn {#2} {#3}
+    \fontdimen #1 \font = \the \fontdimen #2 #3 \relax
   }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_zero_fontparam:n}
+% \begin{macro}{\@@_zero_fontdimen:n}
 %    \begin{macrocode}
-\cs_new:Nn \@@_zero_fontparam:n
+\cs_new:Nn \@@_zero_fontdimen:n
   {
     \fontdimen #1 \font = 0pt\relax
   }
@@ -163,13 +201,18 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_get_fontparam:nn}
+% \begin{macro}{\@@_fontdimen_from_param:Nnn}
+% This function extracts the math font dimen \verb|#3| from the font \verb|#1|
+% and sets fontdimen \verb|#2| of the same font to that value.
+%
+% Use \XeTeX's fontdimen approach because it's tidy. We don't need bells and whistles here.
 %    \begin{macrocode}
-\cs_new:Nn \@@_get_fontparam:nn
+%<*LU>
+\cs_new_protected:Nn \@@_fontdimen_from_param:nn
   {
-%<XE>    \the\fontdimen#1\l_@@_font\relax
-%<LU>    \directlua{fontspec.mathfontdimen("l_@@_font","#2")}
+    \fontdimen #1 \font = \directlua{fontspec.mathfontdimen(font.current(),"#2")}\relax
   }
+%</LU>
 %    \end{macrocode}
 % \end{macro}
 %
@@ -188,7 +231,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[TF]{\@@_usv_if_exist:nn}
+% \begin{macro}{\@@_usv_if_exist:nnTF}
 %    \begin{macrocode}
 \prg_new_conditional:Nnn \@@_usv_if_exist:nn {T,F,TF}
   {
@@ -225,12 +268,103 @@
   }
 %    \end{macrocode}
 %
+%
+% \subsection{Wrappers for message functions}
+%
+% Messages themselves are defined in \secref{codemsg}.
+%
 %    \begin{macrocode}
+\cs_new:Npn \@@_error:n     { \msg_error:nn     {unicode-math} }
+\cs_new:Npn \@@_error:nx    { \msg_error:nnx    {unicode-math} }
+\cs_new:Npn \@@_warning:n   { \msg_warning:nn   {unicode-math} }
+\cs_new:Npn \@@_warning:nnn { \msg_warning:nnxx {unicode-math} }
+\cs_new:Npn \@@_log:n       { \msg_log:nn       {unicode-math} }
+\cs_new:Npn \@@_log:nx      { \msg_log:nnx      {unicode-math} }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_generate_variant:Nn \msg_new:nnn  {nnx}
+\cs_generate_variant:Nn \msg_new:nnnn {nnxx}
+\cs_new:Nn \@@_msg_new:nn  { \msg_new:nnx  {unicode-math} {#1} { \tl_trim_spaces:n {#2} } }
+%    \end{macrocode}
+%
+%
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 
 \endinput
 
+
+% \subsection{Sow/reap}
+%
+% This might make it into the kernel; not sure.
+% Not actually used yet in the package!
+%
+% \begin{macro}{\__@@_sow_item:Nn}
+% Helper variables for constructing \verb|c|-type arguments.
+%    \begin{macrocode}
+\cs_new:Nn \__@@_sow_item:Nn  { l___sow___ \token_to_str:N #1 ___ #2 ___tl }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\__@@_sow_int:N}
+% Helper variables for constructing \verb|c|-type arguments.
+%    \begin{macrocode}
+\cs_new:Nn \__@@_sow_int:N  { l___sow___ \token_to_str:N #1 ___int }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_sow_prepare:N}
+%    \begin{macrocode}
+\cs_new:Nn \@@_sow_prepare:N
+  {
+    \tl_clear:N #1
+    \int_zero_new:c { \__@@_sow_int:N #1 }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_sow:Nn}
+%    \begin{macrocode}
+\cs_new:Nn \@@_sow:Nn
+  {
+    \int_incr:c { \__@@_sow_int:N #1 }
+    \tl_clear_new:c
+      {
+        \__@@_sow_item:Nn #1
+          { \int_use:c { \__@@_sow_int:N #1 } }
+      }
+    \tl_set:cn
+      {
+        \__@@_sow_item:Nn #1
+          { \int_use:c { \__@@_sow_int:N #1 } }
+      }
+      { #2 }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_sow_reap:N}
+%    \begin{macrocode}
+\cs_new:Nn \@@_sow_reap:N
+  {
+    \cs_set:Npn \__@@_sow_tmp:n ##1
+      {
+        \exp_not:v { \__@@_sow_item:Nn #1 {##1} }
+      }
+    \tl_set:Nx #1
+      {
+        \int_step_function:nnnN {1} {1}
+          { \int_use:c { \__@@_sow_int:N #1 } }
+          \__@@_sow_tmp:n
+      }
+
+  }
+%    \end{macrocode}
+% \end{macro}
+
+
 % /©
 %
 % ------------------------------------------------
@@ -240,7 +374,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-pkgopt.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Package options.
 
 % \section{setup and package options}
 %
@@ -10,17 +11,19 @@
 % To simplify the creation of option keys, let's iterate in pairs rather than worry about equals signs and commas.
 %    \begin{macrocode}
 \cs_new:Nn \@@_keys_choices:nn
- {
-  \cs_set:Npn \@@_keys_choices_fn:nn { \@@_keys_choices_aux:nnn {#1} }
-  \use:x
-   {
-    \exp_not:N \keys_define:nn {unicode-math}
-     {
-      #1 .choice: ,
-      \@@_tl_map_dbl:nN {#2} \@@_keys_choices_fn:nn
-     }
-   }
- }
+  {
+    \cs_set:Npn \@@_keys_choices_fn:nn { \@@_keys_choices_aux:nnn {#1} }
+    \use:x
+      {
+        \exp_not:N \keys_define:nn {unicode-math}
+          {
+            #1 .choice: ,
+            \@@_tl_map_dbl:nN {#2} \@@_keys_choices_fn:nn
+          }
+      }
+  }
+%    \end{macrocode}
+%    \begin{macrocode}
 \cs_new:Nn \@@_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , }
 %    \end{macrocode}
 %
@@ -45,41 +48,51 @@
 % \paragraph{Compatibility}
 %    \begin{macrocode}
 \@@_keys_choices:nn {mathup}
- {
-  {sym}  { \bool_set_false:N \g_@@_mathrm_text_bool }
-  {text} { \bool_set_true:N  \g_@@_mathrm_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g_@@_mathrm_text_bool }
+    {text} { \bool_set_true:N  \g_@@_mathrm_text_bool }
+  }
+%    \end{macrocode}
+%    \begin{macrocode}
 \@@_keys_choices:nn {mathrm}
- {
-  {sym}  { \bool_set_false:N \g_@@_mathrm_text_bool }
-  {text} { \bool_set_true:N  \g_@@_mathrm_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g_@@_mathrm_text_bool }
+    {text} { \bool_set_true:N  \g_@@_mathrm_text_bool }
+  }
+%    \end{macrocode}
+%    \begin{macrocode}
 \@@_keys_choices:nn {mathit}
- {
-  {sym}  { \bool_set_false:N \g_@@_mathit_text_bool }
-  {text} { \bool_set_true:N  \g_@@_mathit_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g_@@_mathit_text_bool }
+    {text} { \bool_set_true:N  \g_@@_mathit_text_bool }
+  }
+%    \end{macrocode}
+%    \begin{macrocode}
 \@@_keys_choices:nn {mathbf}
- {
-  {sym}  { \bool_set_false:N \g_@@_mathbf_text_bool }
-  {text} { \bool_set_true:N  \g_@@_mathbf_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g_@@_mathbf_text_bool }
+    {text} { \bool_set_true:N  \g_@@_mathbf_text_bool }
+  }
+%    \end{macrocode}
+%    \begin{macrocode}
 \@@_keys_choices:nn {mathsf}
- {
-  {sym}  { \bool_set_false:N \g_@@_mathsf_text_bool }
-  {text} { \bool_set_true:N  \g_@@_mathsf_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g_@@_mathsf_text_bool }
+    {text} { \bool_set_true:N  \g_@@_mathsf_text_bool }
+  }
+%    \end{macrocode}
+%    \begin{macrocode}
 \@@_keys_choices:nn {mathtt}
- {
-  {sym}  { \bool_set_false:N \g_@@_mathtt_text_bool }
-  {text} { \bool_set_true:N  \g_@@_mathtt_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g_@@_mathtt_text_bool }
+    {text} { \bool_set_true:N  \g_@@_mathtt_text_bool }
+  }
 %    \end{macrocode}
 %
 % \paragraph{math-style}
 %    \begin{macrocode}
 \@@_keys_choices:nn {normal-style}
- {
+  {
        {ISO} {
               \bool_set_false:N \g_@@_literal_bool
               \bool_set_false:N \g_@@_upGreek_bool
@@ -111,12 +124,12 @@
    {literal} {
               \bool_set_true:N  \g_@@_literal_bool
              }
- }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \@@_keys_choices:nn {math-style}
- {
+  {
       {ISO} {
              \unimathsetup { nabla=upright, partial=italic,
               normal-style=ISO, bold-style=ISO, sans-style=italic }
@@ -137,13 +150,13 @@
              \unimathsetup { colon=literal, nabla=literal, partial=literal,
                normal-style=literal, bold-style=literal, sans-style=literal }
             }
- }
+  }
 %    \end{macrocode}
 %
 % \paragraph{bold-style}
 %    \begin{macrocode}
 \@@_keys_choices:nn {bold-style}
- {
+  {
       {ISO} {
              \bool_set_false:N \g_@@_bfliteral_bool
              \bool_set_false:N \g_@@_bfupGreek_bool
@@ -168,17 +181,17 @@
   {literal} {
              \bool_set_true:N  \g_@@_bfliteral_bool
             }
- }
+  }
 %    \end{macrocode}
 %
 % \paragraph{sans-style}
 %    \begin{macrocode}
 \@@_keys_choices:nn {sans-style}
- {
-  {italic}  { \bool_set_false:N \g_@@_upsans_bool    }
-  {upright} { \bool_set_true:N  \g_@@_upsans_bool    }
-  {literal} { \bool_set_true:N  \g_@@_sfliteral_bool }
- }
+  {
+    {italic}  { \bool_set_false:N \g_@@_upsans_bool    }
+    {upright} { \bool_set_true:N  \g_@@_upsans_bool    }
+    {literal} { \bool_set_true:N  \g_@@_sfliteral_bool }
+  }
 %    \end{macrocode}
 %
 %
@@ -185,51 +198,55 @@
 % \paragraph{Nabla and partial}
 %    \begin{macrocode}
 \@@_keys_choices:nn {nabla}
- {
-  {upright} {
-              \bool_set_false:N \g_@@_literal_Nabla_bool
-              \bool_set_true:N  \g_@@_upNabla_bool
-            }
-  {italic}  {
-              \bool_set_false:N \g_@@_literal_Nabla_bool
-              \bool_set_false:N \g_@@_upNabla_bool
-            }
-  {literal} { \bool_set_true:N  \g_@@_literal_Nabla_bool }
- }
+  {
+    {upright} {
+                \bool_set_false:N \g_@@_literal_Nabla_bool
+                \bool_set_true:N  \g_@@_upNabla_bool
+              }
+    {italic}  {
+                \bool_set_false:N \g_@@_literal_Nabla_bool
+                \bool_set_false:N \g_@@_upNabla_bool
+              }
+    {literal} {
+                \bool_set_true:N  \g_@@_literal_Nabla_bool
+              }
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \@@_keys_choices:nn {partial}
- {
-  {upright} {
-              \bool_set_false:N \g_@@_literal_partial_bool
-              \bool_set_true:N  \g_@@_uppartial_bool
-            }
-  {italic}  {
-              \bool_set_false:N \g_@@_literal_partial_bool
-              \bool_set_false:N \g_@@_uppartial_bool
-            }
-  {literal} { \bool_set_true:N  \g_@@_literal_partial_bool }
- }
+  {
+   {upright} {
+               \bool_set_false:N \g_@@_literal_partial_bool
+               \bool_set_true:N  \g_@@_uppartial_bool
+             }
+   {italic}  {
+               \bool_set_false:N \g_@@_literal_partial_bool
+               \bool_set_false:N \g_@@_uppartial_bool
+             }
+   {literal} {
+               \bool_set_true:N  \g_@@_literal_partial_bool
+             }
+  }
 %    \end{macrocode}
 %
 % \paragraph{Colon style}
 %    \begin{macrocode}
 \@@_keys_choices:nn {colon}
- {
-  {literal} { \bool_set_true:N  \g_@@_literal_colon_bool }
-  {TeX}     { \bool_set_false:N \g_@@_literal_colon_bool }
- }
+  {
+    {literal} { \bool_set_true:N  \g_@@_literal_colon_bool }
+    {TeX}     { \bool_set_false:N \g_@@_literal_colon_bool }
+  }
 %    \end{macrocode}
 %
 % \paragraph{Slash delimiter style}
 %    \begin{macrocode}
 \@@_keys_choices:nn {slash-delimiter}
- {
-  {ascii} { \tl_set:Nn \g_@@_slash_delimiter_usv {"002F} }
-  {frac}  { \tl_set:Nn \g_@@_slash_delimiter_usv {"2044} }
-  {div}   { \tl_set:Nn \g_@@_slash_delimiter_usv {"2215} }
- }
+  {
+    {ascii} { \tl_set:Nn \g_@@_slash_delimiter_usv {"002F} }
+    {frac}  { \tl_set:Nn \g_@@_slash_delimiter_usv {"2044} }
+    {div}   { \tl_set:Nn \g_@@_slash_delimiter_usv {"2215} }
+  }
 %    \end{macrocode}
 %
 %
@@ -236,24 +253,24 @@
 % \paragraph{Active fraction style}
 %    \begin{macrocode}
 \@@_keys_choices:nn {active-frac}
- {
-   {small}
-   {
-    \cs_if_exist:NTF \tfrac
-     { \bool_set_true:N \l_@@_smallfrac_bool }
-     {
-      \@@_warning:n {no-tfrac}
+  {
+    {small}
+    {
+      \cs_if_exist:NTF \tfrac
+        { \bool_set_true:N \l_@@_smallfrac_bool }
+        {
+          \@@_warning:n {no-tfrac}
+          \bool_set_false:N \l_@@_smallfrac_bool
+        }
+      \use:c {@@_setup_active_frac:}
+    }
+
+    {normalsize}
+    {
       \bool_set_false:N \l_@@_smallfrac_bool
-     }
-    \use:c {@@_setup_active_frac:}
-   }
-
-   {normalsize}
-   {
-    \bool_set_false:N \l_@@_smallfrac_bool
-    \use:c {@@_setup_active_frac:}
-   }
- }
+      \use:c {@@_setup_active_frac:}
+    }
+  }
 %    \end{macrocode}
 %
 % \paragraph{Debug/tracing}
@@ -271,11 +288,11 @@
 %
 %    \begin{macrocode}
 \@@_keys_choices:nn {trace}
- {
-  {on}    {} % default
-  {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
-  {off}   { \msg_redirect_module:nnn { unicode-math } { log } { none } }
- }
+  {
+    {on}    {} % default
+    {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
+    {off}   { \msg_redirect_module:nnn { unicode-math } { log } { none } }
+  }
 %    \end{macrocode}
 %
 % \subsection{Defaults}
@@ -304,7 +321,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-primes.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The definitions needed for the input of primes.
 
 % \section{Primes}
 %
@@ -80,17 +81,17 @@
    {
     {1} { \@@_superscript:n {#1} }
     {2} {
-      \@@_glyph_if_exist:NnTF \l_@@_font {"2033}
+      \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2033}
         { \@@_superscript:n {\@@_prime_double_mchar} }
         { \@@_nprimes:Nn #1 {#2} }
     }
     {3} {
-      \@@_glyph_if_exist:NnTF \l_@@_font {"2034}
+      \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2034}
         { \@@_superscript:n {\@@_prime_triple_mchar} }
         { \@@_nprimes:Nn #1 {#2} }
     }
     {4} {
-      \@@_glyph_if_exist:NnTF \l_@@_font {"2057}
+      \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2057}
         { \@@_superscript:n {\@@_prime_quad_mchar} }
         { \@@_nprimes:Nn #1 {#2} }
     }
@@ -108,12 +109,12 @@
    {
     {1} { \@@_superscript:n {#1} }
     {2} {
-      \@@_glyph_if_exist:NnTF \l_@@_font {"2036}
+      \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2036}
         { \@@_superscript:n {\@@_backprime_double_mchar} }
         { \@@_nprimes:Nn #1 {#2} }
     }
     {3} {
-      \@@_glyph_if_exist:NnTF \l_@@_font {"2037}
+      \@@_glyph_if_exist:NnTF \g_@@_prime_font_cmd_tl {"2037}
         { \@@_superscript:n {\@@_backprime_triple_mchar} }
         { \@@_nprimes:Nn #1 {#2} }
     }
@@ -375,7 +376,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-setchar.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% General assignment of maths symbols.
 
 % \section{Setting up maths chars}
 %
@@ -41,9 +42,6 @@
 %
 % \subsection{Definitions of the active math characters}
 %
-% Now give \cmd\_@@_sym:nnn\ a definition in terms of \cmd\@@_cs_set_eq_active_char:Nw\
-% and we're good to go.
-%
 % Ensure catcodes are appropriate;
 % make sure |#| is an `other' so that we don't get confused with \cs{mathoctothorpe}.
 %    \begin{macrocode}
@@ -57,7 +55,7 @@
        { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence }
        {##3}
       {
-        \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ }
+        \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} }
       }
      }
     \@@_input_math_symbol_table:
@@ -114,6 +112,9 @@
      { \@@_set_math_overunder:Nnnn #2 {} {#1} {#4} }
     \mathunder
      { \@@_set_math_overunder:Nnnn #2 {bottom} {#1} {#4} }
+    \mathaccentoverlay
+%<LU>     { \@@_set_math_accent:Nnnn #2 {overlay~ fixed} {#1} {#4} }
+%<XE>     { \@@_set_math_accent:Nnnn #2 {} {#1} {#4} }
    }
  }
 %    \end{macrocode}
@@ -125,6 +126,7 @@
 \edef\mathunder{\string\mathunder}
 \edef\mathbotaccent{\string\mathbotaccent}
 \edef\mathaccentwide{\string\mathaccentwide}
+\edef\mathaccentoverlay{\string\mathaccentoverlay}
 \edef\mathbotaccentwide{\string\mathbotaccentwide}
 %    \end{macrocode}
 %
@@ -255,7 +257,8 @@
   \cs_gset_protected_nopar:Npx #1 ##1
    {
     \mathop
-     { \@@_accent:nnn {#2} {#3} {#4} {##1} }
+     { \@@_accent:nnn {#2} {#3} {#4} {{}##1} }
+     %      TODO: remove braces above ^^ which work around a LuaTeX bug
     \limits
    }
  }
@@ -278,7 +281,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sscript.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Setup for active chars needed to process subscript/superscript input chars.
 
 % \section{Unicode sub- and super-scripts}
 %
@@ -17,9 +18,7 @@
 %
 % Open question: should the superscript-like `modifiers' (\unichar{1D2C}
 % {modifier capital letter a} and on) be included here?
-%    \begin{macrocode}
-\group_begin:
-%    \end{macrocode}
+%
 % \paragraph{Superscripts}
 % Populate a property list with superscript characters; themselves as their
 % key, and their replacement as each key's value.
@@ -29,123 +28,43 @@
 % char and assign its meaning in one step.
 %    \begin{macrocode}
 \cs_new:Nn \@@_setup_active_superscript:nn
- {
-  \prop_gput:Nnn \g_@@_supers_prop   {#1} {#2}
-  \char_set_catcode_active:N #1
-  \@@_char_gmake_mathactive:N #1
-  \scantokens
-   {
-    \cs_gset:Npn #1
-     {
-      \tl_set:Nn \l_@@_ss_chain_tl {#2}
-      \cs_set_eq:NN \@@_sub_or_super:n \sp
-      \tl_set:Nn \l_@@_tmpa_tl {supers}
-      \@@_scan_sscript:
-     }
-   }
- }
+  {
+    \prop_gput:Nxn \g_@@_supers_prop { \int_eval:n {#1} } {#2}
+    \@@_mathactive_remap:nn {#1}
+       {
+        \tl_set:Nn \l_@@_ss_chain_tl {#2}
+        \cs_set_eq:NN \@@_sub_or_super:n \sp
+        \tl_set:Nn \l_@@_tmpa_tl {supers}
+        \@@_scan_sscript:
+       }
+  }
 %    \end{macrocode}
-% Bam:
+%
+% \paragraph{Subscripts}
 %    \begin{macrocode}
-\@@_setup_active_superscript:nn {^^^^2070} {0}
-\@@_setup_active_superscript:nn {^^^^00b9} {1}
-\@@_setup_active_superscript:nn {^^^^00b2} {2}
-\@@_setup_active_superscript:nn {^^^^00b3} {3}
-\@@_setup_active_superscript:nn {^^^^2074} {4}
-\@@_setup_active_superscript:nn {^^^^2075} {5}
-\@@_setup_active_superscript:nn {^^^^2076} {6}
-\@@_setup_active_superscript:nn {^^^^2077} {7}
-\@@_setup_active_superscript:nn {^^^^2078} {8}
-\@@_setup_active_superscript:nn {^^^^2079} {9}
-\@@_setup_active_superscript:nn {^^^^207a} {+}
-\@@_setup_active_superscript:nn {^^^^207b} {-}
-\@@_setup_active_superscript:nn {^^^^207c} {=}
-\@@_setup_active_superscript:nn {^^^^207d} {(}
-\@@_setup_active_superscript:nn {^^^^207e} {)}
-\@@_setup_active_superscript:nn {^^^^2071} {i}
-\@@_setup_active_superscript:nn {^^^^207f} {n}
-\@@_setup_active_superscript:nn {^^^^02b0} {h}
-\@@_setup_active_superscript:nn {^^^^02b2} {j}
-\@@_setup_active_superscript:nn {^^^^02b3} {r}
-\@@_setup_active_superscript:nn {^^^^02b7} {w}
-\@@_setup_active_superscript:nn {^^^^02b8} {y}
-%    \end{macrocode}
-% \paragraph{Subscripts} Ditto above.
-%    \begin{macrocode}
 \cs_new:Nn \@@_setup_active_subscript:nn
- {
-  \prop_gput:Nnn \g_@@_subs_prop   {#1} {#2}
-  \char_set_catcode_active:N #1
-  \@@_char_gmake_mathactive:N #1
-  \scantokens
-   {
-    \cs_gset:Npn #1
-     {
-      \tl_set:Nn \l_@@_ss_chain_tl {#2}
-      \cs_set_eq:NN \@@_sub_or_super:n \sb
-      \tl_set:Nn \l_@@_tmpa_tl {subs}
-      \@@_scan_sscript:
-     }
-   }
- }
+  {
+    \prop_gput:Nxn \g_@@_subs_prop { \int_eval:n {#1} } {#2}
+    \@@_mathactive_remap:nn {#1}
+      {
+        \tl_set:Nn \l_@@_ss_chain_tl {#2}
+        \cs_set_eq:NN \@@_sub_or_super:n \sb
+        \tl_set:Nn \l_@@_tmpa_tl {subs}
+        \@@_scan_sscript:
+      }
+  }
 %    \end{macrocode}
-% A few more subscripts than superscripts:
-%    \begin{macrocode}
-\@@_setup_active_subscript:nn {^^^^2080} {0}
-\@@_setup_active_subscript:nn {^^^^2081} {1}
-\@@_setup_active_subscript:nn {^^^^2082} {2}
-\@@_setup_active_subscript:nn {^^^^2083} {3}
-\@@_setup_active_subscript:nn {^^^^2084} {4}
-\@@_setup_active_subscript:nn {^^^^2085} {5}
-\@@_setup_active_subscript:nn {^^^^2086} {6}
-\@@_setup_active_subscript:nn {^^^^2087} {7}
-\@@_setup_active_subscript:nn {^^^^2088} {8}
-\@@_setup_active_subscript:nn {^^^^2089} {9}
-\@@_setup_active_subscript:nn {^^^^208a} {+}
-\@@_setup_active_subscript:nn {^^^^208b} {-}
-\@@_setup_active_subscript:nn {^^^^208c} {=}
-\@@_setup_active_subscript:nn {^^^^208d} {(}
-\@@_setup_active_subscript:nn {^^^^208e} {)}
-\@@_setup_active_subscript:nn {^^^^2090} {a}
-\@@_setup_active_subscript:nn {^^^^2091} {e}
-\@@_setup_active_subscript:nn {^^^^2095} {h}
-\@@_setup_active_subscript:nn {^^^^1d62} {i}
-\@@_setup_active_subscript:nn {^^^^2c7c} {j}
-\@@_setup_active_subscript:nn {^^^^2096} {k}
-\@@_setup_active_subscript:nn {^^^^2097} {l}
-\@@_setup_active_subscript:nn {^^^^2098} {m}
-\@@_setup_active_subscript:nn {^^^^2099} {n}
-\@@_setup_active_subscript:nn {^^^^2092} {o}
-\@@_setup_active_subscript:nn {^^^^209a} {p}
-\@@_setup_active_subscript:nn {^^^^1d63} {r}
-\@@_setup_active_subscript:nn {^^^^209b} {s}
-\@@_setup_active_subscript:nn {^^^^209c} {t}
-\@@_setup_active_subscript:nn {^^^^1d64} {u}
-\@@_setup_active_subscript:nn {^^^^1d65} {v}
-\@@_setup_active_subscript:nn {^^^^2093} {x}
-\@@_setup_active_subscript:nn {^^^^1d66} {\beta}
-\@@_setup_active_subscript:nn {^^^^1d67} {\gamma}
-\@@_setup_active_subscript:nn {^^^^1d68} {\rho}
-\@@_setup_active_subscript:nn {^^^^1d69} {\phi}
-\@@_setup_active_subscript:nn {^^^^1d6a} {\chi}
-%    \end{macrocode}
 %
-%    \begin{macrocode}
-\group_end:
-%    \end{macrocode}
-% The scanning command, which collects a chain of subscripts or a chain
+% \paragraph{The scanning command}
+% Collects a chain of subscripts or a chain
 % of superscripts and then typesets what it has collected.
 %    \begin{macrocode}
-\cs_new:Npn \@@_scan_sscript:
- {
-  \@@_scan_sscript:TF
-   {
-    \@@_scan_sscript:
-   }
-   {
-    \@@_sub_or_super:n {\l_@@_ss_chain_tl}
-   }
- }
+\cs_new:Nn \@@_scan_sscript:
+  {
+    \@@_scan_sscript:TF
+      { \@@_scan_sscript: }
+      { \@@_sub_or_super:n {\l_@@_ss_chain_tl} }
+  }
 %    \end{macrocode}
 % We do not skip spaces when scanning ahead, and we explicitly wish to
 % bail out on encountering a space or a brace.  These cases are filtered
@@ -157,28 +76,101 @@
 % The \cs{group_align_safe_begin:} and \cs{group_align_safe_end:} are
 % needed in case |#3| is |&|.
 %    \begin{macrocode}
-\cs_new:Npn \@@_scan_sscript:TF #1#2
- {
-  \peek_N_type:TF
-   {
-    \group_align_safe_begin:
-    \@@_scan_sscript_aux:nnN {#1} {#2}
-   }
-   {#2}
- }
-\cs_new:Npn \@@_scan_sscript_aux:nnN #1#2#3
- {
-  \prop_get:cnNTF {g_@@_\l_@@_tmpa_tl _prop} {#3} \l_@@_tmpb_tl
-   {
-    \tl_put_right:NV \l_@@_ss_chain_tl \l_@@_tmpb_tl
-    \group_align_safe_end:
-    #1
-   }
-   { \group_align_safe_end: #2 #3 }
- }
+\cs_new:Nn \@@_scan_sscript:TF
+  {
+    \peek_N_type:TF
+      {
+        \group_align_safe_begin:
+        \@@_scan_sscript_aux:nnN {#1} {#2}
+      }
+      {#2}
+  }
 %    \end{macrocode}
+% The look-ahead for the sscripts doesn't try to peek inside the lookahead.
+%    \begin{macrocode}
+\cs_new:Nn \@@_scan_sscript_aux:nnN
+  {
+    \tl_set:Nx \l_@@_tmpa_key_tl { \tl_to_str:n {#3} }
+    \prop_get:cxNTF {g_@@_\l_@@_tmpa_tl _prop}
+      { \int_eval:n { \exp_after:wN ` \l_@@_tmpa_key_tl } }
+      \l_@@_tmpb_tl
+      {
+        \tl_put_right:NV \l_@@_ss_chain_tl \l_@@_tmpb_tl
+        \group_align_safe_end:
+        #1
+      }
+      { \group_align_safe_end: #2 #3 }
+  }
+%    \end{macrocode}
 %
+% \paragraph{Definitions}
+% Superscripts.
+%    \begin{macrocode}
+\@@_setup_active_superscript:nn {"2070} {0}
+\@@_setup_active_superscript:nn {"00B9} {1}
+\@@_setup_active_superscript:nn {"00B2} {2}
+\@@_setup_active_superscript:nn {"00B3} {3}
+\@@_setup_active_superscript:nn {"2074} {4}
+\@@_setup_active_superscript:nn {"2075} {5}
+\@@_setup_active_superscript:nn {"2076} {6}
+\@@_setup_active_superscript:nn {"2077} {7}
+\@@_setup_active_superscript:nn {"2078} {8}
+\@@_setup_active_superscript:nn {"2079} {9}
+\@@_setup_active_superscript:nn {"207A} {+}
+\@@_setup_active_superscript:nn {"207B} {-}
+\@@_setup_active_superscript:nn {"207C} {=}
+\@@_setup_active_superscript:nn {"207D} {(}
+\@@_setup_active_superscript:nn {"207E} {)}
+\@@_setup_active_superscript:nn {"2071} {i}
+\@@_setup_active_superscript:nn {"207F} {n}
+\@@_setup_active_superscript:nn {"02B0} {h}
+\@@_setup_active_superscript:nn {"02B2} {j}
+\@@_setup_active_superscript:nn {"02B3} {r}
+\@@_setup_active_superscript:nn {"02B7} {w}
+\@@_setup_active_superscript:nn {"02B8} {y}
+%    \end{macrocode}
+% A few more subscripts than superscripts:
+%    \begin{macrocode}
+\@@_setup_active_subscript:nn {"2080} {0}
+\@@_setup_active_subscript:nn {"2081} {1}
+\@@_setup_active_subscript:nn {"2082} {2}
+\@@_setup_active_subscript:nn {"2083} {3}
+\@@_setup_active_subscript:nn {"2084} {4}
+\@@_setup_active_subscript:nn {"2085} {5}
+\@@_setup_active_subscript:nn {"2086} {6}
+\@@_setup_active_subscript:nn {"2087} {7}
+\@@_setup_active_subscript:nn {"2088} {8}
+\@@_setup_active_subscript:nn {"2089} {9}
+\@@_setup_active_subscript:nn {"208A} {+}
+\@@_setup_active_subscript:nn {"208B} {-}
+\@@_setup_active_subscript:nn {"208C} {=}
+\@@_setup_active_subscript:nn {"208D} {(}
+\@@_setup_active_subscript:nn {"208E} {)}
+\@@_setup_active_subscript:nn {"2090} {a}
+\@@_setup_active_subscript:nn {"2091} {e}
+\@@_setup_active_subscript:nn {"2095} {h}
+\@@_setup_active_subscript:nn {"1D62} {i}
+\@@_setup_active_subscript:nn {"2C7C} {j}
+\@@_setup_active_subscript:nn {"2096} {k}
+\@@_setup_active_subscript:nn {"2097} {l}
+\@@_setup_active_subscript:nn {"2098} {m}
+\@@_setup_active_subscript:nn {"2099} {n}
+\@@_setup_active_subscript:nn {"2092} {o}
+\@@_setup_active_subscript:nn {"209A} {p}
+\@@_setup_active_subscript:nn {"1D63} {r}
+\@@_setup_active_subscript:nn {"209B} {s}
+\@@_setup_active_subscript:nn {"209C} {t}
+\@@_setup_active_subscript:nn {"1D64} {u}
+\@@_setup_active_subscript:nn {"1D65} {v}
+\@@_setup_active_subscript:nn {"2093} {x}
+\@@_setup_active_subscript:nn {"1D66} {\beta}
+\@@_setup_active_subscript:nn {"1D67} {\gamma}
+\@@_setup_active_subscript:nn {"1D68} {\rho}
+\@@_setup_active_subscript:nn {"1D69} {\phi}
+\@@_setup_active_subscript:nn {"1D6A} {\chi}
+%    \end{macrocode}
 %
+%
 %    \begin{macrocode}
 %</package>
 %    \end{macrocode}
@@ -194,7 +186,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Added: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -0,0 +1,289 @@
+%%^^A%% um-code-sym-commands.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of "math symbol alphabet" commands such as `\symbf` and co.
+
+% \section{Mapping in maths alphabets}
+% \label{sec:symcmd}
+%
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+%
+% Switching to a different style of alphabetic symbols was traditionally performed with
+% commands like \cmd\mathbf, which literally changes fonts to access alternate symbols.
+% This is not as simple with Unicode fonts.
+%
+% In traditional \TeX{} maths font setups, you simply switch between different `families' (\cmd\fam), which is analogous to changing from one font to another---a symbol such as `a' will be upright in one font, bold in another, and so on.
+% In pkg{unicode-math}, a different mechanism is used to switch between styles. For every letter (start with ascii a-zA-Z and numbers to keep things simple for now), they are assigned a `mathcode' with \cmd\Umathcode\ that maps from input letter to output font glyph slot. This is done with the equivalent of
+% \begin{Verbatim}
+% \Umathcode`\a = 7 1 "1D44E\relax
+% \Umathcode`\b = 7 1 "1D44F\relax
+% \Umathcode`\c = 7 1 "1D450\relax
+% ...
+% \end{Verbatim}
+% When switching from regular letters to, say, \cmd\mathrm, we now need to execute a new mapping:
+% \begin{Verbatim}
+% \Umathcode`\a = 7 1 `\a\relax
+% \Umathcode`\b = 7 1 `\b\relax
+% \Umathcode`\c = 7 1 `\c\relax
+% ...
+% \end{Verbatim}
+% This is fairly straightforward to perform when we're defining our own commands such as \cmd\symbf\ and so on. However, this means that `classical' \TeX\ font setups will break, because with the original mapping still in place, the engine will be attempting to insert unicode maths glyphs from a standard font.
+%
+% \subsection{Hooks into \LaTeXe}
+%
+% To overcome this, we patch \cs{use at mathgroup}.
+% (An alternative is to patch \cs{extract at alph@from at version}, which constructs the \cs{mathXYZ} commands, but this method fails if the command has been defined using \cs{DeclareSymbolFontAlphabet}.)
+% As far as I can tell, this is only used inside of commands such as \cs{mathXYZ}, so this shouldn't have any major side-effects.
+%
+%    \begin{macrocode}
+\cs_set:Npn \use at mathgroup #1 #2
+  {
+    \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not!
+      {
+        \math at bgroup
+          \cs_if_eq:cNF {M@\f at encoding} #1 {#1}
+          \@@_switchto_literal:
+          \mathgroup #2 \relax
+        \math at egroup
+      }
+  }
+%    \end{macrocode}
+%
+% In LaTeX maths, the command |\operator at font| is defined that switches to the |operator| mathgroup. The classic example is the |\sin| in |$\sin{x}$|; essentially we’re using |\mathrm| to typeset the upright symbols, but the syntax is |{\operator at font sin}|.
+% I thought that hooking into |\operator at font| would be hard because all other maths font selection in 2e uses |\mathrm{...}| style.
+% Then reading source2e a little more I stumbled upon \cs{@fontswitch}.
+% Reimplement that here to avoid \cs{bgroup}/\cs{egroup}.
+% \begin{macro}{\operator at font}
+%    \begin{macrocode}
+\cs_set:Npn \operator at font
+  {
+    \@@_switchto_literal:
+    \@@_fontswitch:n { \g_@@_operator_mathfont_tl }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_fontswitch:n}
+%    \begin{macrocode}
+\cs_set:Nn \@@_fontswitch:n
+  {
+    \mode_if_math:T
+      {
+        \cs_set_eq:NN \math at bgroup     \scan_stop:
+        \cs_set_eq:NN \@@_group_begin: \scan_stop:
+        \cs_set:Npn \@@_group_end:
+          {
+            \cs_set_eq:NN \@@_group_begin: \@@_group_begin_frozen:
+            \cs_set_eq:NN \@@_group_end:   \@@_group_end_frozen:
+            \cs_set_eq:NN \math at bgroup \@@math at bgroup
+            \cs_set_eq:NN \math at egroup \@@math at egroup
+          }
+        \cs_set_eq:NN \math at egroup \@@_group_end:
+        #1 \scan_stop:
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Setting styles}
+%
+% Algorithm for setting alphabet fonts.
+% By default, when |range| is empty, we are in \emph{implicit} mode.
+% If |range| contains the name of the math alphabet, we are in \emph{explicit}
+% mode and do things slightly differently.
+%
+% Implicit mode:
+% \begin{itemize}
+% \item Try and set all of the alphabet shapes.
+% \item Check for the first glyph of each alphabet to detect if the font supports each
+%       alphabet shape.
+% \item For alphabets that do exist, overwrite whatever’s already there.
+% \item For alphabets that are not supported, \emph{do nothing}.
+%       (This includes leaving the old alphabet definition in place.)
+% \end{itemize}
+%
+% Explicit mode:
+% \begin{itemize}
+% \item Only set the alphabets specified.
+% \item Check for the first glyph of the alphabet to detect if the font contains
+%       the alphabet shape in the Unicode math plane.
+% \item For Unicode math alphabets, overwrite whatever’s already there.
+% \item Otherwise, use the \ascii\ glyph slots instead.
+% \end{itemize}
+%
+%
+%
+% \subsection{Defining the math style macros}
+%
+% We call the different shapes that a math alphabet can be a `math style’.
+% Note that different alphabets can exist within the same math style. E.g.,
+% we call `bold’ the math style |bf| and within it there are upper and lower
+% case Greek and Roman alphabets and Arabic numerals.
+%
+% \begin{macro}{\@@_prepare_mathstyle:n}
+% \darg{math style name (e.g., \texttt{it} or \texttt{bb})}
+% Define the high level math alphabet macros (\cs{mathit}, etc.) in terms of
+% unicode-math definitions. Use \cs{bgroup}/\cs{egroup} so s’scripts scan the
+% whole thing.
+%
+% The flag \cs{l_@@_mathstyle_tl} is for other applications to query the
+% current math style.
+%    \begin{macrocode}
+\cs_new:Nn \@@_prepare_mathstyle:n
+  {
+    \seq_gput_right:Nn \g_@@_mathstyles_seq {#1}
+    \@@_init_alphabet:n {#1}
+    \cs_set_protected:cpx {sym#1} ##1
+      {
+        \@@_group_begin:
+          \exp_not:n
+            {
+              \mode_if_math:F
+                {
+                  \exp_args:Nc \non at alpherr {sym#1}
+                }
+              \tl_set:Nn \l_@@_mathstyle_tl {#1}
+            }
+          \exp_not:c {@@_switchto_#1:} ##1
+        \@@_group_end:
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@@_init_alphabet:n}
+% \darg{math alphabet name (e.g., \texttt{it} or \texttt{bb})}
+% This macro initialises the macros used to set up a math alphabet.
+% First used when the math alphabet macro is first defined, but then used
+% later when redefining a particular maths alphabet.
+%    \begin{macrocode}
+\cs_set:Nn \@@_init_alphabet:n
+  {
+    \@@_log:nx {alph-initialise} {#1}
+    \cs_set_eq:cN {@@_switchto_#1:} \prg_do_nothing:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsection{Definition of alphabets and styles}
+%
+%
+% The linking between named ranges and symbol style commands happens here.
+% It’s currently not using all of the machinery we’re in the process of setting up above.
+% Baby steps.
+%    \begin{macrocode}
+\cs_new:Nn \@@_default_mathalph:nnn
+  {
+    \prop_new:c {g_@@_named_range_#1_prop}
+    \seq_gput_right:Nn \g_@@_default_mathalph_seq {{#1}{#2}{#3}}
+    \prop_gput:cnn { g_@@_named_range_#1_prop } { default-alpha } {#2}
+  }
+%    \end{macrocode}
+%    \begin{macrocode}
+\@@_default_mathalph:nnn {up    } {latin,Latin,greek,Greek,num,misc} {up    }
+\@@_default_mathalph:nnn {it    } {latin,Latin,greek,Greek,misc}     {it    }
+\@@_default_mathalph:nnn {bb    } {latin,Latin,num,misc}             {bb    }
+\@@_default_mathalph:nnn {bbit  } {misc}                             {bbit  }
+\@@_default_mathalph:nnn {scr   } {latin,Latin}                      {scr   }
+\@@_default_mathalph:nnn {cal   } {Latin}                            {scr   }
+\@@_default_mathalph:nnn {bfcal } {Latin}                            {bfscr }
+\@@_default_mathalph:nnn {frak  } {latin,Latin}                      {frak  }
+\@@_default_mathalph:nnn {tt    } {latin,Latin,num}                  {tt    }
+\@@_default_mathalph:nnn {sfup  } {latin,Latin,num}                  {sfup  }
+\@@_default_mathalph:nnn {sfit  } {latin,Latin}                      {sfit  }
+\@@_default_mathalph:nnn {bfup  } {latin,Latin,greek,Greek,num,misc} {bfup  }
+\@@_default_mathalph:nnn {bfit  } {latin,Latin,greek,Greek,misc}     {bfit  }
+\@@_default_mathalph:nnn {bfscr } {latin,Latin}                      {bfscr }
+\@@_default_mathalph:nnn {bffrak} {latin,Latin}                      {bffrak}
+\@@_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup}
+\@@_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc}     {bfsfit}
+%    \end{macrocode}
+%
+% \subsubsection{Define symbol style commands}
+% Finally, all of the `symbol styles’ commands are set up, which are the commands to access each of the named alphabet styles. There is not a one-to-one mapping between symbol style commands and named style ranges!
+%    \begin{macrocode}
+\clist_map_inline:nn
+  {
+    up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf,
+    tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak,
+    normal, literal, sf, bf,
+  }
+  {
+    \@@_prepare_mathstyle:n {#1}
+  }
+%    \end{macrocode}
+%
+%
+% \subsubsection{New names for legacy textmath alphabet selection}
+% In case a package option overwrites, say, \cs{mathbf} with \cs{symbf}.
+%    \begin{macrocode}
+\clist_map_inline:nn
+  { rm, it, bf, sf, tt }
+  { \cs_set_eq:cc { mathtext #1 } { math #1 } }
+%    \end{macrocode}
+% Perhaps these should actually be defined using a hypothetical unicode-math interface to creating new such styles. To come.
+%
+%
+% \subsubsection{Replacing legacy pure-maths alphabets}
+% The following are alphabets which do not have a math/text ambiguity.
+%    \begin{macrocode}
+\clist_map_inline:nn
+  {
+    normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
+    bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
+  }
+  {
+    \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } }
+  }
+%    \end{macrocode}
+%
+%
+% \subsubsection{New commands for ambiguous alphabets}
+%
+%    \begin{macrocode}
+\AtBeginDocument
+  {
+    \clist_map_inline:nn
+      { rm, it, bf, sf, tt }
+      {
+        \cs_set_protected:cpx { math #1 }
+        {
+          \exp_not:n { \bool_if:NTF  } \exp_not:c { g_@@_ math #1 _text_bool}
+            { \exp_not:c { mathtext #1 } }
+            { \exp_not:c { sym #1 } }
+        }
+      }
+  }
+%    \end{macrocode}
+%
+% \paragraph{Alias \cs{mathrm} as legacy name for \cs{mathup}}
+%    \begin{macrocode}
+\cs_set_protected:Npn \mathup { \mathrm }
+\cs_set_protected:Npn \symrm  { \symup  }
+%    \end{macrocode}
+%
+%
+%    \begin{macrocode}
+%</package>
+%    \end{macrocode}
+
+\endinput
+
+% /©
+%
+% ------------------------------------------------
+% The UNICODE-MATH package  <wspr.io/unicode-math>
+% ------------------------------------------------
+% This package is free software and may be redistributed and/or modified under
+% the conditions of the LaTeX Project Public License, version 1.3c or higher
+% (your choice): <http://www.latex-project.org/lppl/>.
+% ------------------------------------------------
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
+% Copyright 2010-2017  Philipp Stephani
+% Copyright 2011-2017  Joseph Wright
+% Copyright 2012-2015  Khaled Hosny
+% ------------------------------------------------
+%
+% ©/


Property changes on: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-sym-commands.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-ui.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The xparse user interface top-level definitions.
 
 % \section{The user interface commands}
 %
@@ -91,7 +92,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-usv.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Mapping of mathematical unicode slots for alphabets.
 
 % \section{Alphabet Unicode positions}
 %
@@ -11,317 +12,321 @@
 %    \end{macrocode}
 %
 % \paragraph{Alphabets}
+% `Normal':
 %    \begin{macrocode}
-\usv_set:nnn {normal}  {num}  {48}
-\usv_set:nnn {normal}  {Latin}{"1D434}
-\usv_set:nnn {normal}  {latin}{"1D44E}
-\usv_set:nnn {normal}  {Greek}{"1D6E2}
-\usv_set:nnn {normal}  {greek}{"1D6FC}
-\usv_set:nnn {normal}{varTheta}  {"1D6F3}
-\usv_set:nnn {normal}{epsilon}{"1D716}
-\usv_set:nnn {normal}{vartheta}  {"1D717}
-\usv_set:nnn {normal}{varkappa}  {"1D718}
-\usv_set:nnn {normal}{phi}    {"1D719}
-\usv_set:nnn {normal}{varrho}    {"1D71A}
-\usv_set:nnn {normal}{varpi}     {"1D71B}
-\usv_set:nnn {normal}    {Nabla}{"1D6FB}
-\usv_set:nnn {normal}    {partial}{"1D715}
-
-\usv_set:nnn {up}  {num}  {48}
-\usv_set:nnn {up}  {Latin}{65}
-\usv_set:nnn {up}  {latin}{97}
-\usv_set:nnn {up}  {Greek}{"391}
-\usv_set:nnn {up}  {greek}{"3B1}
-\usv_set:nnn {it}  {Latin}{"1D434}
-\usv_set:nnn {it}  {latin}{"1D44E}
-\usv_set:nnn {it}  {Greek}{"1D6E2}
-\usv_set:nnn {it}  {greek}{"1D6FC}
-\usv_set:nnn {bb}  {num}  {"1D7D8}
-\usv_set:nnn {bb}  {Latin}{"1D538}
-\usv_set:nnn {bb}  {latin}{"1D552}
-\usv_set:nnn {scr} {Latin}{"1D49C}
-\usv_set:nnn {cal} {Latin}{"1D49C}
-\usv_set:nnn {scr} {latin}{"1D4B6}
-\usv_set:nnn {frak}{Latin}{"1D504}
-\usv_set:nnn {frak}{latin}{"1D51E}
-\usv_set:nnn {sf}  {num}  {"1D7E2}
-\usv_set:nnn {sfup}{num}  {"1D7E2}
-\usv_set:nnn {sfit}{num}  {"1D7E2}
-\usv_set:nnn {sfup}{Latin}{"1D5A0}
-\usv_set:nnn {sf}  {Latin}{"1D5A0}
-\usv_set:nnn {sfup}{latin}{"1D5BA}
-\usv_set:nnn {sf}  {latin}{"1D5BA}
-\usv_set:nnn {sfit}{Latin}{"1D608}
-\usv_set:nnn {sfit}{latin}{"1D622}
-\usv_set:nnn {tt}  {num}  {"1D7F6}
-\usv_set:nnn {tt}  {Latin}{"1D670}
-\usv_set:nnn {tt}  {latin}{"1D68A}
+\usv_set:nnn {normal} {num}      {48}
+\usv_set:nnn {normal} {Latin}    {"1D434}
+\usv_set:nnn {normal} {latin}    {"1D44E}
+\usv_set:nnn {normal} {Greek}    {"1D6E2}
+\usv_set:nnn {normal} {greek}    {"1D6FC}
+\usv_set:nnn {normal} {varTheta} {"1D6F3}
+\usv_set:nnn {normal} {epsilon}  {"1D716}
+\usv_set:nnn {normal} {vartheta} {"1D717}
+\usv_set:nnn {normal} {varkappa} {"1D718}
+\usv_set:nnn {normal} {phi}      {"1D719}
+\usv_set:nnn {normal} {varrho}   {"1D71A}
+\usv_set:nnn {normal} {varpi}    {"1D71B}
+\usv_set:nnn {normal} {Nabla}    {"1D6FB}
+\usv_set:nnn {normal} {partial}  {"1D715}
 %    \end{macrocode}
-% Bold:
+% Regular weights:
 %    \begin{macrocode}
-\usv_set:nnn {bf}    {num}  {"1D7CE}
-\usv_set:nnn {bfup}  {num}  {"1D7CE}
-\usv_set:nnn {bfit}  {num}  {"1D7CE}
-\usv_set:nnn {bfup}  {Latin}{"1D400}
-\usv_set:nnn {bfup}  {latin}{"1D41A}
-\usv_set:nnn {bfup}  {Greek}{"1D6A8}
-\usv_set:nnn {bfup}  {greek}{"1D6C2}
-\usv_set:nnn {bfit}  {Latin}{"1D468}
-\usv_set:nnn {bfit}  {latin}{"1D482}
-\usv_set:nnn {bfit}  {Greek}{"1D71C}
-\usv_set:nnn {bfit}  {greek}{"1D736}
-\usv_set:nnn {bffrak}{Latin}{"1D56C}
-\usv_set:nnn {bffrak}{latin}{"1D586}
-\usv_set:nnn {bfscr} {Latin}{"1D4D0}
-\usv_set:nnn {bfcal} {Latin}{"1D4D0}
-\usv_set:nnn {bfscr} {latin}{"1D4EA}
-\usv_set:nnn {bfsf}  {num}  {"1D7EC}
-\usv_set:nnn {bfsfup}{num}  {"1D7EC}
-\usv_set:nnn {bfsfit}{num}  {"1D7EC}
-\usv_set:nnn {bfsfup}{Latin}{"1D5D4}
-\usv_set:nnn {bfsfup}{latin}{"1D5EE}
-\usv_set:nnn {bfsfup}{Greek}{"1D756}
-\usv_set:nnn {bfsfup}{greek}{"1D770}
-\usv_set:nnn {bfsfit}{Latin}{"1D63C}
-\usv_set:nnn {bfsfit}{latin}{"1D656}
-\usv_set:nnn {bfsfit}{Greek}{"1D790}
-\usv_set:nnn {bfsfit}{greek}{"1D7AA}
+\usv_set:nnn {up}   {num}   {48}
+\usv_set:nnn {up}   {Latin} {65}
+\usv_set:nnn {up}   {latin} {97}
+\usv_set:nnn {up}   {Greek} {"391}
+\usv_set:nnn {up}   {greek} {"3B1}
+\usv_set:nnn {it}   {Latin} {"1D434}
+\usv_set:nnn {it}   {latin} {"1D44E}
+\usv_set:nnn {it}   {Greek} {"1D6E2}
+\usv_set:nnn {it}   {greek} {"1D6FC}
+\usv_set:nnn {bb}   {num}   {"1D7D8}
+\usv_set:nnn {bb}   {Latin} {"1D538}
+\usv_set:nnn {bb}   {latin} {"1D552}
+\usv_set:nnn {scr}  {Latin} {"1D49C}
+\usv_set:nnn {cal}  {Latin} {"1D49C}
+\usv_set:nnn {scr}  {latin} {"1D4B6}
+\usv_set:nnn {frak} {Latin} {"1D504}
+\usv_set:nnn {frak} {latin} {"1D51E}
+\usv_set:nnn {sf}   {num}   {"1D7E2}
+\usv_set:nnn {sfup} {num}   {"1D7E2}
+\usv_set:nnn {sfit} {num}   {"1D7E2}
+\usv_set:nnn {sfup} {Latin} {"1D5A0}
+\usv_set:nnn {sf}   {Latin} {"1D5A0}
+\usv_set:nnn {sfup} {latin} {"1D5BA}
+\usv_set:nnn {sf}   {latin} {"1D5BA}
+\usv_set:nnn {sfit} {Latin} {"1D608}
+\usv_set:nnn {sfit} {latin} {"1D622}
+\usv_set:nnn {tt}   {num}   {"1D7F6}
+\usv_set:nnn {tt}   {Latin} {"1D670}
+\usv_set:nnn {tt}   {latin} {"1D68A}
 %    \end{macrocode}
-%
+% Bold weights:
 %    \begin{macrocode}
-\usv_set:nnn {bfsf}{Latin}{ \bool_if:NTF \g_@@_upLatin_bool   \g_@@_bfsfup_Latin_usv \g_@@_bfsfit_Latin_usv }
-\usv_set:nnn {bfsf}{latin}{ \bool_if:NTF \g_@@_uplatin_bool   \g_@@_bfsfup_latin_usv \g_@@_bfsfit_latin_usv }
-\usv_set:nnn {bfsf}{Greek}{ \bool_if:NTF \g_@@_upGreek_bool   \g_@@_bfsfup_Greek_usv \g_@@_bfsfit_Greek_usv }
-\usv_set:nnn {bfsf}{greek}{ \bool_if:NTF \g_@@_upgreek_bool   \g_@@_bfsfup_greek_usv \g_@@_bfsfit_greek_usv }
-\usv_set:nnn {bf}  {Latin}{ \bool_if:NTF \g_@@_bfupLatin_bool \g_@@_bfup_Latin_usv   \g_@@_bfit_Latin_usv   }
-\usv_set:nnn {bf}  {latin}{ \bool_if:NTF \g_@@_bfuplatin_bool \g_@@_bfup_latin_usv   \g_@@_bfit_latin_usv   }
-\usv_set:nnn {bf}  {Greek}{ \bool_if:NTF \g_@@_bfupGreek_bool \g_@@_bfup_Greek_usv   \g_@@_bfit_Greek_usv   }
-\usv_set:nnn {bf}  {greek}{ \bool_if:NTF \g_@@_bfupgreek_bool \g_@@_bfup_greek_usv   \g_@@_bfit_greek_usv   }
+\usv_set:nnn {bf}     {num}   {"1D7CE}
+\usv_set:nnn {bfup}   {num}   {"1D7CE}
+\usv_set:nnn {bfit}   {num}   {"1D7CE}
+\usv_set:nnn {bfup}   {Latin} {"1D400}
+\usv_set:nnn {bfup}   {latin} {"1D41A}
+\usv_set:nnn {bfup}   {Greek} {"1D6A8}
+\usv_set:nnn {bfup}   {greek} {"1D6C2}
+\usv_set:nnn {bfit}   {Latin} {"1D468}
+\usv_set:nnn {bfit}   {latin} {"1D482}
+\usv_set:nnn {bfit}   {Greek} {"1D71C}
+\usv_set:nnn {bfit}   {greek} {"1D736}
+\usv_set:nnn {bffrak} {Latin} {"1D56C}
+\usv_set:nnn {bffrak} {latin} {"1D586}
+\usv_set:nnn {bfscr}  {Latin} {"1D4D0}
+\usv_set:nnn {bfcal}  {Latin} {"1D4D0}
+\usv_set:nnn {bfscr}  {latin} {"1D4EA}
+\usv_set:nnn {bfsf}   {num}   {"1D7EC}
+\usv_set:nnn {bfsfup} {num}   {"1D7EC}
+\usv_set:nnn {bfsfit} {num}   {"1D7EC}
+\usv_set:nnn {bfsfup} {Latin} {"1D5D4}
+\usv_set:nnn {bfsfup} {latin} {"1D5EE}
+\usv_set:nnn {bfsfup} {Greek} {"1D756}
+\usv_set:nnn {bfsfup} {greek} {"1D770}
+\usv_set:nnn {bfsfit} {Latin} {"1D63C}
+\usv_set:nnn {bfsfit} {latin} {"1D656}
+\usv_set:nnn {bfsfit} {Greek} {"1D790}
+\usv_set:nnn {bfsfit} {greek} {"1D7AA}
 %    \end{macrocode}
-% Greek variants:
+% The `auto' bolds:
 %    \begin{macrocode}
-\usv_set:nnn {up}{varTheta}  {"3F4}
-\usv_set:nnn {up}{Digamma}   {"3DC}
-\usv_set:nnn {up}{epsilon}{"3F5}
-\usv_set:nnn {up}{vartheta}  {"3D1}
-\usv_set:nnn {up}{varkappa}  {"3F0}
-\usv_set:nnn {up}{phi}    {"3D5}
-\usv_set:nnn {up}{varrho}    {"3F1}
-\usv_set:nnn {up}{varpi}     {"3D6}
-\usv_set:nnn {up}{digamma}   {"3DD}
+\usv_set:nnn {bfsf} {Latin} { \bool_if:NTF \g_@@_upLatin_bool   \g_@@_bfsfup_Latin_usv \g_@@_bfsfit_Latin_usv }
+\usv_set:nnn {bfsf} {latin} { \bool_if:NTF \g_@@_uplatin_bool   \g_@@_bfsfup_latin_usv \g_@@_bfsfit_latin_usv }
+\usv_set:nnn {bfsf} {Greek} { \bool_if:NTF \g_@@_upGreek_bool   \g_@@_bfsfup_Greek_usv \g_@@_bfsfit_Greek_usv }
+\usv_set:nnn {bfsf} {greek} { \bool_if:NTF \g_@@_upgreek_bool   \g_@@_bfsfup_greek_usv \g_@@_bfsfit_greek_usv }
+\usv_set:nnn {bf}   {Latin} { \bool_if:NTF \g_@@_bfupLatin_bool \g_@@_bfup_Latin_usv   \g_@@_bfit_Latin_usv   }
+\usv_set:nnn {bf}   {latin} { \bool_if:NTF \g_@@_bfuplatin_bool \g_@@_bfup_latin_usv   \g_@@_bfit_latin_usv   }
+\usv_set:nnn {bf}   {Greek} { \bool_if:NTF \g_@@_bfupGreek_bool \g_@@_bfup_Greek_usv   \g_@@_bfit_Greek_usv   }
+\usv_set:nnn {bf}   {greek} { \bool_if:NTF \g_@@_bfupgreek_bool \g_@@_bfup_greek_usv   \g_@@_bfit_greek_usv   }
 %    \end{macrocode}
+% \paragraph{Greek variants}
+% Upright:
+%    \begin{macrocode}
+\usv_set:nnn {up} {varTheta} {"3F4}
+\usv_set:nnn {up} {Digamma}  {"3DC}
+\usv_set:nnn {up} {epsilon}  {"3F5}
+\usv_set:nnn {up} {vartheta} {"3D1}
+\usv_set:nnn {up} {varkappa} {"3F0}
+\usv_set:nnn {up} {phi}      {"3D5}
+\usv_set:nnn {up} {varrho}   {"3F1}
+\usv_set:nnn {up} {varpi}    {"3D6}
+\usv_set:nnn {up} {digamma}  {"3DD}
+%    \end{macrocode}
 % Bold:
 %    \begin{macrocode}
-\usv_set:nnn {bfup}{varTheta}  {"1D6B9}
-\usv_set:nnn {bfup}{Digamma}   {"1D7CA}
-\usv_set:nnn {bfup}{epsilon}{"1D6DC}
-\usv_set:nnn {bfup}{vartheta}  {"1D6DD}
-\usv_set:nnn {bfup}{varkappa}  {"1D6DE}
-\usv_set:nnn {bfup}{phi}    {"1D6DF}
-\usv_set:nnn {bfup}{varrho}    {"1D6E0}
-\usv_set:nnn {bfup}{varpi}     {"1D6E1}
-\usv_set:nnn {bfup}{digamma}   {"1D7CB}
+\usv_set:nnn {bfup} {varTheta} {"1D6B9}
+\usv_set:nnn {bfup} {Digamma}  {"1D7CA}
+\usv_set:nnn {bfup} {epsilon}  {"1D6DC}
+\usv_set:nnn {bfup} {vartheta} {"1D6DD}
+\usv_set:nnn {bfup} {varkappa} {"1D6DE}
+\usv_set:nnn {bfup} {phi}      {"1D6DF}
+\usv_set:nnn {bfup} {varrho}   {"1D6E0}
+\usv_set:nnn {bfup} {varpi}    {"1D6E1}
+\usv_set:nnn {bfup} {digamma}  {"1D7CB}
 %    \end{macrocode}
-% Italic Greek variants:
+% Italic:
 %    \begin{macrocode}
-\usv_set:nnn {it}{varTheta}  {"1D6F3}
-\usv_set:nnn {it}{epsilon}{"1D716}
-\usv_set:nnn {it}{vartheta}  {"1D717}
-\usv_set:nnn {it}{varkappa}  {"1D718}
-\usv_set:nnn {it}{phi}    {"1D719}
-\usv_set:nnn {it}{varrho}    {"1D71A}
-\usv_set:nnn {it}{varpi}     {"1D71B}
+\usv_set:nnn {it} {varTheta} {"1D6F3}
+\usv_set:nnn {it} {epsilon}  {"1D716}
+\usv_set:nnn {it} {vartheta} {"1D717}
+\usv_set:nnn {it} {varkappa} {"1D718}
+\usv_set:nnn {it} {phi}      {"1D719}
+\usv_set:nnn {it} {varrho}   {"1D71A}
+\usv_set:nnn {it} {varpi}    {"1D71B}
 %    \end{macrocode}
 % Bold italic:
 %    \begin{macrocode}
-\usv_set:nnn {bfit}{varTheta}  {"1D72D}
-\usv_set:nnn {bfit}{epsilon}{"1D750}
-\usv_set:nnn {bfit}{vartheta}  {"1D751}
-\usv_set:nnn {bfit}{varkappa}  {"1D752}
-\usv_set:nnn {bfit}{phi}    {"1D753}
-\usv_set:nnn {bfit}{varrho}    {"1D754}
-\usv_set:nnn {bfit}{varpi}     {"1D755}
+\usv_set:nnn {bfit} {varTheta} {"1D72D}
+\usv_set:nnn {bfit} {epsilon}  {"1D750}
+\usv_set:nnn {bfit} {vartheta} {"1D751}
+\usv_set:nnn {bfit} {varkappa} {"1D752}
+\usv_set:nnn {bfit} {phi}      {"1D753}
+\usv_set:nnn {bfit} {varrho}   {"1D754}
+\usv_set:nnn {bfit} {varpi}    {"1D755}
 %    \end{macrocode}
 % Bold sans:
 %    \begin{macrocode}
-\usv_set:nnn {bfsfup}{varTheta}  {"1D767}
-\usv_set:nnn {bfsfup}{epsilon}{"1D78A}
-\usv_set:nnn {bfsfup}{vartheta}  {"1D78B}
-\usv_set:nnn {bfsfup}{varkappa}  {"1D78C}
-\usv_set:nnn {bfsfup}{phi}    {"1D78D}
-\usv_set:nnn {bfsfup}{varrho}    {"1D78E}
-\usv_set:nnn {bfsfup}{varpi}     {"1D78F}
+\usv_set:nnn {bfsfup} {varTheta} {"1D767}
+\usv_set:nnn {bfsfup} {epsilon}  {"1D78A}
+\usv_set:nnn {bfsfup} {vartheta} {"1D78B}
+\usv_set:nnn {bfsfup} {varkappa} {"1D78C}
+\usv_set:nnn {bfsfup} {phi}      {"1D78D}
+\usv_set:nnn {bfsfup} {varrho}   {"1D78E}
+\usv_set:nnn {bfsfup} {varpi}    {"1D78F}
 %    \end{macrocode}
 % Bold sans italic:
 %    \begin{macrocode}
-\usv_set:nnn {bfsfit}{varTheta}  {"1D7A1}
-\usv_set:nnn {bfsfit}{epsilon}{"1D7C4}
-\usv_set:nnn {bfsfit}{vartheta}  {"1D7C5}
-\usv_set:nnn {bfsfit}{varkappa}  {"1D7C6}
-\usv_set:nnn {bfsfit}{phi}    {"1D7C7}
-\usv_set:nnn {bfsfit}{varrho}    {"1D7C8}
-\usv_set:nnn {bfsfit}{varpi}     {"1D7C9}
+\usv_set:nnn {bfsfit} {varTheta} {"1D7A1}
+\usv_set:nnn {bfsfit} {epsilon}  {"1D7C4}
+\usv_set:nnn {bfsfit} {vartheta} {"1D7C5}
+\usv_set:nnn {bfsfit} {varkappa} {"1D7C6}
+\usv_set:nnn {bfsfit} {phi}      {"1D7C7}
+\usv_set:nnn {bfsfit} {varrho}   {"1D7C8}
+\usv_set:nnn {bfsfit} {varpi}    {"1D7C9}
 %    \end{macrocode}
 % Nabla:
 %    \begin{macrocode}
-\usv_set:nnn {up}    {Nabla}{"02207}
-\usv_set:nnn {it}    {Nabla}{"1D6FB}
-\usv_set:nnn {bfup}  {Nabla}{"1D6C1}
-\usv_set:nnn {bfit}  {Nabla}{"1D735}
-\usv_set:nnn {bfsfup}{Nabla}{"1D76F}
-\usv_set:nnn {bfsfit}{Nabla}{"1D7A9}
+\usv_set:nnn {up}     {Nabla} {"02207}
+\usv_set:nnn {it}     {Nabla} {"1D6FB}
+\usv_set:nnn {bfup}   {Nabla} {"1D6C1}
+\usv_set:nnn {bfit}   {Nabla} {"1D735}
+\usv_set:nnn {bfsfup} {Nabla} {"1D76F}
+\usv_set:nnn {bfsfit} {Nabla} {"1D7A9}
 %    \end{macrocode}
 % Partial:
 %    \begin{macrocode}
-\usv_set:nnn {up}    {partial}{"02202}
-\usv_set:nnn {it}    {partial}{"1D715}
-\usv_set:nnn {bfup}  {partial}{"1D6DB}
-\usv_set:nnn {bfit}  {partial}{"1D74F}
-\usv_set:nnn {bfsfup}{partial}{"1D789}
-\usv_set:nnn {bfsfit}{partial}{"1D7C3}
+\usv_set:nnn {up}     {partial} {"02202}
+\usv_set:nnn {it}     {partial} {"1D715}
+\usv_set:nnn {bfup}   {partial} {"1D6DB}
+\usv_set:nnn {bfit}   {partial} {"1D74F}
+\usv_set:nnn {bfsfup} {partial} {"1D789}
+\usv_set:nnn {bfsfit} {partial} {"1D7C3}
 %    \end{macrocode}
+%
 % \paragraph{Exceptions}
-% These are need for mapping with the exceptions in other alphabets:
-% (coming up)
+% Upright uppercase:
 %    \begin{macrocode}
-\usv_set:nnn {up}{B}{`\B}
-\usv_set:nnn {up}{C}{`\C}
-\usv_set:nnn {up}{D}{`\D}
-\usv_set:nnn {up}{E}{`\E}
-\usv_set:nnn {up}{F}{`\F}
-\usv_set:nnn {up}{H}{`\H}
-\usv_set:nnn {up}{I}{`\I}
-\usv_set:nnn {up}{L}{`\L}
-\usv_set:nnn {up}{M}{`\M}
-\usv_set:nnn {up}{N}{`\N}
-\usv_set:nnn {up}{P}{`\P}
-\usv_set:nnn {up}{Q}{`\Q}
-\usv_set:nnn {up}{R}{`\R}
-\usv_set:nnn {up}{Z}{`\Z}
+\usv_set:nnn {up} {B} {`\B}
+\usv_set:nnn {up} {C} {`\C}
+\usv_set:nnn {up} {D} {`\D}
+\usv_set:nnn {up} {E} {`\E}
+\usv_set:nnn {up} {F} {`\F}
+\usv_set:nnn {up} {H} {`\H}
+\usv_set:nnn {up} {I} {`\I}
+\usv_set:nnn {up} {L} {`\L}
+\usv_set:nnn {up} {M} {`\M}
+\usv_set:nnn {up} {N} {`\N}
+\usv_set:nnn {up} {P} {`\P}
+\usv_set:nnn {up} {Q} {`\Q}
+\usv_set:nnn {up} {R} {`\R}
+\usv_set:nnn {up} {Z} {`\Z}
 %    \end{macrocode}
-%
+% Italic uppercase:
 %    \begin{macrocode}
-\usv_set:nnn {it}{B}{"1D435}
-\usv_set:nnn {it}{C}{"1D436}
-\usv_set:nnn {it}{D}{"1D437}
-\usv_set:nnn {it}{E}{"1D438}
-\usv_set:nnn {it}{F}{"1D439}
-\usv_set:nnn {it}{H}{"1D43B}
-\usv_set:nnn {it}{I}{"1D43C}
-\usv_set:nnn {it}{L}{"1D43F}
-\usv_set:nnn {it}{M}{"1D440}
-\usv_set:nnn {it}{N}{"1D441}
-\usv_set:nnn {it}{P}{"1D443}
-\usv_set:nnn {it}{Q}{"1D444}
-\usv_set:nnn {it}{R}{"1D445}
-\usv_set:nnn {it}{Z}{"1D44D}
+\usv_set:nnn {it} {B} {"1D435}
+\usv_set:nnn {it} {C} {"1D436}
+\usv_set:nnn {it} {D} {"1D437}
+\usv_set:nnn {it} {E} {"1D438}
+\usv_set:nnn {it} {F} {"1D439}
+\usv_set:nnn {it} {H} {"1D43B}
+\usv_set:nnn {it} {I} {"1D43C}
+\usv_set:nnn {it} {L} {"1D43F}
+\usv_set:nnn {it} {M} {"1D440}
+\usv_set:nnn {it} {N} {"1D441}
+\usv_set:nnn {it} {P} {"1D443}
+\usv_set:nnn {it} {Q} {"1D444}
+\usv_set:nnn {it} {R} {"1D445}
+\usv_set:nnn {it} {Z} {"1D44D}
 %    \end{macrocode}
-%
+% Upright lowercase (needed for later mappings):
 %    \begin{macrocode}
-\usv_set:nnn {up}{d}{`\d}
-\usv_set:nnn {up}{e}{`\e}
-\usv_set:nnn {up}{g}{`\g}
-\usv_set:nnn {up}{h}{`\h}
-\usv_set:nnn {up}{i}{`\i}
-\usv_set:nnn {up}{j}{`\j}
-\usv_set:nnn {up}{o}{`\o}
+\usv_set:nnn {up} {d} {`\d}
+\usv_set:nnn {up} {e} {`\e}
+\usv_set:nnn {up} {g} {`\g}
+\usv_set:nnn {up} {h} {`\h}
+\usv_set:nnn {up} {i} {`\i}
+\usv_set:nnn {up} {j} {`\j}
+\usv_set:nnn {up} {o} {`\o}
 %    \end{macrocode}
-%
+% Italic lowercase:
 %    \begin{macrocode}
-\usv_set:nnn {it}{d}{"1D451}
-\usv_set:nnn {it}{e}{"1D452}
-\usv_set:nnn {it}{g}{"1D454}
-\usv_set:nnn {it}{h}{"0210E}
-\usv_set:nnn {it}{i}{"1D456}
-\usv_set:nnn {it}{j}{"1D457}
-\usv_set:nnn {it}{o}{"1D45C}
+\usv_set:nnn {it} {d} {"1D451}
+\usv_set:nnn {it} {e} {"1D452}
+\usv_set:nnn {it} {g} {"1D454}
+\usv_set:nnn {it} {h} {"0210E}
+\usv_set:nnn {it} {i} {"1D456}
+\usv_set:nnn {it} {j} {"1D457}
+\usv_set:nnn {it} {o} {"1D45C}
 %    \end{macrocode}
 % Latin `h':
 %    \begin{macrocode}
-\usv_set:nnn {bb}    {h}{"1D559}
-\usv_set:nnn {tt}    {h}{"1D691}
-\usv_set:nnn {scr}   {h}{"1D4BD}
-\usv_set:nnn {frak}  {h}{"1D525}
-\usv_set:nnn {bfup}  {h}{"1D421}
-\usv_set:nnn {bfit}  {h}{"1D489}
-\usv_set:nnn {sfup}  {h}{"1D5C1}
-\usv_set:nnn {sfit}  {h}{"1D629}
-\usv_set:nnn {bffrak}{h}{"1D58D}
-\usv_set:nnn {bfscr} {h}{"1D4F1}
-\usv_set:nnn {bfsfup}{h}{"1D5F5}
-\usv_set:nnn {bfsfit}{h}{"1D65D}
+\usv_set:nnn {bb}     {h} {"1D559}
+\usv_set:nnn {tt}     {h} {"1D691}
+\usv_set:nnn {scr}    {h} {"1D4BD}
+\usv_set:nnn {frak}   {h} {"1D525}
+\usv_set:nnn {bfup}   {h} {"1D421}
+\usv_set:nnn {bfit}   {h} {"1D489}
+\usv_set:nnn {sfup}   {h} {"1D5C1}
+\usv_set:nnn {sfit}   {h} {"1D629}
+\usv_set:nnn {bffrak} {h} {"1D58D}
+\usv_set:nnn {bfscr}  {h} {"1D4F1}
+\usv_set:nnn {bfsfup} {h} {"1D5F5}
+\usv_set:nnn {bfsfit} {h} {"1D65D}
 %    \end{macrocode}
 % Dotless `i' and `j:
 %    \begin{macrocode}
-\usv_set:nnn {up}{dotlessi}{"00131}
-\usv_set:nnn {up}{dotlessj}{"00237}
-\usv_set:nnn {it}{dotlessi}{"1D6A4}
-\usv_set:nnn {it}{dotlessj}{"1D6A5}
+\usv_set:nnn {up} {dotlessi} {"00131}
+\usv_set:nnn {up} {dotlessj} {"00237}
+\usv_set:nnn {it} {dotlessi} {"1D6A4}
+\usv_set:nnn {it} {dotlessj} {"1D6A5}
 %    \end{macrocode}
 % Blackboard:
 %    \begin{macrocode}
-\usv_set:nnn {bb}{C}{"2102}
-\usv_set:nnn {bb}{H}{"210D}
-\usv_set:nnn {bb}{N}{"2115}
-\usv_set:nnn {bb}{P}{"2119}
-\usv_set:nnn {bb}{Q}{"211A}
-\usv_set:nnn {bb}{R}{"211D}
-\usv_set:nnn {bb}{Z}{"2124}
-\usv_set:nnn {up}{Pi}       {"003A0}
-\usv_set:nnn {up}{pi}       {"003C0}
-\usv_set:nnn {up}{Gamma}    {"00393}
-\usv_set:nnn {up}{gamma}    {"003B3}
-\usv_set:nnn {up}{summation}{"02211}
-\usv_set:nnn {it}{Pi}       {"1D6F1}
-\usv_set:nnn {it}{pi}       {"1D70B}
-\usv_set:nnn {it}{Gamma}    {"1D6E4}
-\usv_set:nnn {it}{gamma}    {"1D6FE}
-\usv_set:nnn {bb}{Pi}       {"0213F}
-\usv_set:nnn {bb}{pi}       {"0213C}
-\usv_set:nnn {bb}{Gamma}    {"0213E}
-\usv_set:nnn {bb}{gamma}    {"0213D}
-\usv_set:nnn {bb}{summation}{"02140}
+\usv_set:nnn {bb} {C}         {"2102}
+\usv_set:nnn {bb} {H}         {"210D}
+\usv_set:nnn {bb} {N}         {"2115}
+\usv_set:nnn {bb} {P}         {"2119}
+\usv_set:nnn {bb} {Q}         {"211A}
+\usv_set:nnn {bb} {R}         {"211D}
+\usv_set:nnn {bb} {Z}         {"2124}
+\usv_set:nnn {up} {Pi}        {"003A0}
+\usv_set:nnn {up} {pi}        {"003C0}
+\usv_set:nnn {up} {Gamma}     {"00393}
+\usv_set:nnn {up} {gamma}     {"003B3}
+\usv_set:nnn {up} {summation} {"02211}
+\usv_set:nnn {it} {Pi}        {"1D6F1}
+\usv_set:nnn {it} {pi}        {"1D70B}
+\usv_set:nnn {it} {Gamma}     {"1D6E4}
+\usv_set:nnn {it} {gamma}     {"1D6FE}
+\usv_set:nnn {bb} {Pi}        {"0213F}
+\usv_set:nnn {bb} {pi}        {"0213C}
+\usv_set:nnn {bb} {Gamma}     {"0213E}
+\usv_set:nnn {bb} {gamma}     {"0213D}
+\usv_set:nnn {bb} {summation} {"02140}
 %    \end{macrocode}
 % Italic blackboard:
 %    \begin{macrocode}
-\usv_set:nnn {bbit}{D}{"2145}
-\usv_set:nnn {bbit}{d}{"2146}
-\usv_set:nnn {bbit}{e}{"2147}
-\usv_set:nnn {bbit}{i}{"2148}
-\usv_set:nnn {bbit}{j}{"2149}
+\usv_set:nnn {bbit} {D} {"2145}
+\usv_set:nnn {bbit} {d} {"2146}
+\usv_set:nnn {bbit} {e} {"2147}
+\usv_set:nnn {bbit} {i} {"2148}
+\usv_set:nnn {bbit} {j} {"2149}
 %    \end{macrocode}
-% Script exceptions:
+% Script:
 %    \begin{macrocode}
-\usv_set:nnn {scr}{B}{"212C}
-\usv_set:nnn {scr}{E}{"2130}
-\usv_set:nnn {scr}{F}{"2131}
-\usv_set:nnn {scr}{H}{"210B}
-\usv_set:nnn {scr}{I}{"2110}
-\usv_set:nnn {scr}{L}{"2112}
-\usv_set:nnn {scr}{M}{"2133}
-\usv_set:nnn {scr}{R}{"211B}
-\usv_set:nnn {scr}{e}{"212F}
-\usv_set:nnn {scr}{g}{"210A}
-\usv_set:nnn {scr}{o}{"2134}
+\usv_set:nnn {scr} {B} {"212C}
+\usv_set:nnn {scr} {E} {"2130}
+\usv_set:nnn {scr} {F} {"2131}
+\usv_set:nnn {scr} {H} {"210B}
+\usv_set:nnn {scr} {I} {"2110}
+\usv_set:nnn {scr} {L} {"2112}
+\usv_set:nnn {scr} {M} {"2133}
+\usv_set:nnn {scr} {R} {"211B}
+\usv_set:nnn {scr} {e} {"212F}
+\usv_set:nnn {scr} {g} {"210A}
+\usv_set:nnn {scr} {o} {"2134}
 %    \end{macrocode}
-%
+% Caligraphic:
 %    \begin{macrocode}
-\usv_set:nnn {cal}{B}{"212C}
-\usv_set:nnn {cal}{E}{"2130}
-\usv_set:nnn {cal}{F}{"2131}
-\usv_set:nnn {cal}{H}{"210B}
-\usv_set:nnn {cal}{I}{"2110}
-\usv_set:nnn {cal}{L}{"2112}
-\usv_set:nnn {cal}{M}{"2133}
-\usv_set:nnn {cal}{R}{"211B}
+\usv_set:nnn {cal} {B} {"212C}
+\usv_set:nnn {cal} {E} {"2130}
+\usv_set:nnn {cal} {F} {"2131}
+\usv_set:nnn {cal} {H} {"210B}
+\usv_set:nnn {cal} {I} {"2110}
+\usv_set:nnn {cal} {L} {"2112}
+\usv_set:nnn {cal} {M} {"2133}
+\usv_set:nnn {cal} {R} {"211B}
 %    \end{macrocode}
-% Fractur exceptions:
+% Fractur:
 %    \begin{macrocode}
-\usv_set:nnn {frak}{C}{"212D}
-\usv_set:nnn {frak}{H}{"210C}
-\usv_set:nnn {frak}{I}{"2111}
-\usv_set:nnn {frak}{R}{"211C}
-\usv_set:nnn {frak}{Z}{"2128}
+\usv_set:nnn {frak} {C} {"212D}
+\usv_set:nnn {frak} {H} {"210C}
+\usv_set:nnn {frak} {I} {"2111}
+\usv_set:nnn {frak} {R} {"211C}
+\usv_set:nnn {frak} {Z} {"2128}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -578,7 +583,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-code-variables.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Declaration of all code-level variables used in the package.
 
 % \section{Variable initialisation}
 %
@@ -7,7 +8,7 @@
 %    \end{macrocode}
 %
 %
-% \paragraph{Conditionals}
+% \subsection{bool}
 %
 % True if using a proper OpenType font with unicode maths
 %    \begin{macrocode}
@@ -17,7 +18,6 @@
 %    \begin{macrocode}
 \bool_new:N \l_@@_init_bool
 \bool_new:N \l_@@_implicit_alph_bool
-\bool_new:N \g_@@_mainfont_already_set_bool
 %    \end{macrocode}
 % For \opt{math-style}:
 %    \begin{macrocode}
@@ -55,11 +55,16 @@
 \bool_new:N \g_@@_mathtt_text_bool
 %    \end{macrocode}
 %
-% \paragraph{Variables}
+% \subsection{int}
+%
 %    \begin{macrocode}
 \int_new:N \g_@@_fam_int
+\int_new:N \g_@@_fonts_used_int
+\int_new:N \l_@@_primecount_int
 %    \end{macrocode}
 %
+% \subsection{tl}
+%
 % For displaying in warning messages, etc.:
 %    \begin{macrocode}
 \tl_const:Nn \c_@@_math_alphabet_name_latin_tl {Latin,~lowercase}
@@ -82,29 +87,56 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\seq_new:N \l_@@_missing_alph_seq
-\seq_new:N \l_@@_mathalph_seq
-\seq_new:N \l_@@_char_range_seq
-\seq_new:N \l_@@_mclass_range_seq
-\seq_new:N \l_@@_cmd_range_seq
+\tl_new:N \g_@@_slash_delimiter_usv
+\tl_new:N \g_@@_mathtable_tl
+\tl_new:N \g_@@_fontname_tl
+\tl_new:N \g_@@_mversion_tl
+\tl_new:N \g_@@_symfont_tl
+\tl_new:N \g_@@_font_keyval_tl
+\tl_new:N \g_@@_family_tl
+\tl_new:N \g_@@_style_tl
+\tl_new:N \g_@@_remap_style_tl
+\tl_new:N \l_@@_not_token_name_tl
+\tl_new:N \g_@@_curr_font_cmd_tl
+\tl_new:N \g_@@_sqrt_font_cmd_tl
+\tl_new:N \g_@@_prime_font_cmd_tl
 %    \end{macrocode}
 %
-% \begin{macro}{\g_@@_alphabets_seq}
-% Each of math `style' (bfup, sfit, etc.) usually contains one or more `alphabets', which are currently |latin|, |Latin|, |greek|, |Greek|, |num|, and |misc|, although there's an implicit potential for more.
-% |misc| is not included in the official list to avoid checking code.
+% \begin{macro}{\g_@@_mathparam_store_tl}
+% Used to store and restore the math parameters used in Lua\TeX.
+% This is done to `save' the values of the \emph{first} (or main)
+% maths font loaded, rather than (as per Lua\TeX\ defaults) the last.
 %    \begin{macrocode}
-\clist_new:N  \g_@@_alphabets_seq
-\clist_set:Nn \g_@@_alphabets_seq { latin, Latin, greek, Greek, num }
+%<*LU>
+\tl_new:N \g_@@_mathparam_store_tl
+%</LU>
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsection{clist}
+%
 %    \begin{macrocode}
-\clist_new:N \g_@@_named_ranges_clist
 \clist_new:N \g_@@_char_nrange_clist
 \clist_new:N \g_@@_unknown_keys_clist
 \clist_new:N \g_@@_alphabet_clist
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\clist_new:N \g_@@_bad_alpha_clist
+\clist_put_right:Nx \g_@@_bad_alpha_clist { \tl_to_str:n {bf} }
+\clist_put_right:Nx \g_@@_bad_alpha_clist { \tl_to_str:n {sf} }
+\clist_put_right:Nx \g_@@_bad_alpha_clist { \tl_to_str:n {bfsf} }
+%    \end{macrocode}
+%
+% \subsection{seq}
+%
+%    \begin{macrocode}
+\seq_new:N \l_@@_missing_alph_seq
+\seq_new:N \g_@@_mathalph_seq
+\seq_new:N \g_@@_char_range_seq
+\seq_new:N \g_@@_mclass_range_seq
+%    \end{macrocode}
+%
 % \begin{macro}{\g_@@_mathclasses_seq}
 % Every math class.
 %    \begin{macrocode}
@@ -115,12 +147,11 @@
      \mathop,
     \mathopen,\mathclose,
     \mathfence,\mathover,\mathunder,
-     \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide
+     \mathaccent,\mathaccentoverlay,\mathbotaccent,\mathaccentwide,\mathbotaccentwide
   }
 %    \end{macrocode}
 % \end{macro}
 %
-
 % \begin{macro}{\g_@@_default_mathalph_seq}
 % This sequence stores the alphabets in each math style.
 %    \begin{macrocode}
@@ -129,39 +160,47 @@
 % \end{macro}
 %
 % \begin{macro}{\g_@@_mathstyles_seq}
-% This is every `named range' and every `math style' known to \pkg{unicode-math}.
+% This is every `math style' known to \pkg{unicode-math}.
 % A named range is such as "bfit" and "sfit", which are also math styles (with \cs{symbfit} and \cs{symsfit}).
 % `Mathstyles' are a superset of named ranges and also include commands such as \cs{symbf} and \cs{symsf}.
 %
 % N.B. for parsing purposes `named ranges' are defined as strings!
 %    \begin{macrocode}
-\seq_new:N \g_@@_named_ranges_seq
 \seq_new:N \g_@@_mathstyles_seq
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsection{prop}
+%
 %    \begin{macrocode}
-\muskip_new:N \g_@@_primekern_muskip
-\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }% arbitrary
-\int_new:N \l_@@_primecount_int
 \prop_new:N \g_@@_supers_prop
 \prop_new:N \g_@@_subs_prop
-\tl_new:N \l_not_token_name_tl
 %    \end{macrocode}
 %
+% \subsection{muskip}
+%
 %    \begin{macrocode}
-\tl_new:N \g_@@_slash_delimiter_usv
-\tl_new:N \g_@@_mathtable_tl
-\tl_new:N \g_@@_fontname_tl
-\tl_new:N \g_@@_mversion_tl
-\tl_new:N \g_@@_symfont_tl
-\tl_new:N \g_@@_font_keyval_tl
-\tl_new:N \g_@@_family_tl
-\tl_new:N \g_@@_style_tl
-\tl_new:N \g_@@_remap_style_tl
+\muskip_new:N \g_@@_primekern_muskip
+\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }% arbitrary
 %    \end{macrocode}
 %
+% \subsection{fp}
+%
 %    \begin{macrocode}
+\fp_new:N \g_@@_size_tfsf_fp
+\fp_new:N \g_@@_size_sfssf_fp
+%    \end{macrocode}
+%
+% \subsection{quark}
+%
+% \begin{macro}{\q_unicode_math}
+% Used as a flag within control sequences to check they're recognised by the package.
+%    \begin{macrocode}
+\quark_new:N \q_unicode_math
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 
@@ -176,7 +215,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-legacyfontdimen.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,76 +0,0 @@
-%%^^A%% um-doc-legacyfontdimen.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\section{Legacy \TeX\ font dimensions}
-
-\centerline{%
-\begin{tabular}[t]{@{}lp{4cm}@{}}
-\toprule
-\multicolumn{2}{@{}c@{}}{Text fonts} \\
-\midrule
-$\phi_1$ & slant per pt                \\
-$\phi_2$ & interword space             \\
-$\phi_3$ & interword stretch           \\
-$\phi_4$ & interword shrink            \\
-$\phi_5$ & x-height                    \\
-$\phi_6$ & quad width                  \\
-$\phi_7$ & extra space                 \\
-$\phi_8$ & cap height (\XeTeX\ only)   \\
-\bottomrule
-\end{tabular}
-\quad
-\begin{tabular}[t]{@{}lp{4cm}@{}}
-\toprule
-\multicolumn{2}{@{}c@{}}{Maths font, \cs{fam}2} \\
-\midrule
-$\sigma_5$    & x height                    \\
-$\sigma_6$    & quad                        \\
-$\sigma_8$    & num1                        \\
-$\sigma_9$    & num2                        \\
-$\sigma_{10}$ & num3                        \\
-$\sigma_{11}$ & denom1                      \\
-$\sigma_{12}$ & denom2                      \\
-$\sigma_{13}$ & sup1                        \\
-$\sigma_{14}$ & sup2                        \\
-$\sigma_{15}$ & sup3                        \\
-$\sigma_{16}$ & sub1                        \\
-$\sigma_{17}$ & sub2                        \\
-$\sigma_{18}$ & sup drop                    \\
-$\sigma_{19}$ & sub drop                    \\
-$\sigma_{20}$ & delim1                      \\
-$\sigma_{21}$ & delim2                      \\
-$\sigma_{22}$ & axis height                 \\
-\bottomrule
-\end{tabular}
-\quad
-\begin{tabular}[t]{@{}lp{4cm}@{}}
-\toprule
-\multicolumn{2}{@{}c@{}}{Maths font, \cs{fam}3} \\
-\midrule
-$\xi_8$    & default rule thickness      \\
-$\xi_9$    & big op spacing1             \\
-$\xi_{10}$ & big op spacing2             \\
-$\xi_{11}$ & big op spacing3             \\
-$\xi_{12}$ & big op spacing4             \\
-$\xi_{13}$ & big op spacing5             \\
-\bottomrule
-\end{tabular}
-}
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-mathfontdimen.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,151 +0,0 @@
-%%^^A%% um-doc-mathfontdimen.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\section{\Hologo{XeTeX} math font dimensions}
-
-These are the extended \cmd\fontdimen s available for suitable fonts
-in \XeTeX. Note that Lua\TeX\ takes an alternative route, and this package
-will eventually provide a wrapper interface to the two (I hope).
-
-\newcounter{mfdimen}
-\setcounter{mfdimen}{9}
-\newcommand\mathfontdimen[2]{^^A
-  \stepcounter{mfdimen}^^A
-  \themfdimen & {\scshape\small #1} & #2\vspace{0.5ex} \tabularnewline}
-
-\begin{longtable}{
-  @{}c>{\raggedright\parfillskip=0pt}p{4cm}>{\raggedright}p{7cm}@{}}
-\toprule \cmd\fontdimen & Dimension name & Description\tabularnewline\midrule \endhead
-\bottomrule\endfoot
-\mathfontdimen{Script\-Percent\-Scale\-Down}
-{Percentage of scaling down for script level 1. Suggested value: 80\%.}
-\mathfontdimen{Script\-Script\-Percent\-Scale\-Down}
-{Percentage of scaling down for script level 2 (Script\-Script). Suggested value: 60\%.}
-\mathfontdimen{Delimited\-Sub\-Formula\-Min\-Height}
-{Minimum height required for a delimited expression to be treated as a subformula. Suggested value: normal line height\,×\,1.5.}
-\mathfontdimen{Display\-Operator\-Min\-Height}
-{Minimum height of n-ary operators (such as integral and summation) for formulas in display mode.}
-\mathfontdimen{Math\-Leading}
-{White space to be left between math formulas to ensure proper line spacing. For example, for applications that treat line gap as a part of line ascender, formulas with ink  going above (os2.sTypoAscender + os2.sTypoLineGap – MathLeading) or with ink going below os2.sTypoDescender will result in increasing line height.}
-\mathfontdimen{Axis\-Height}
-{Axis height of the font. }
-\mathfontdimen{Accent\-Base\-Height}
-{Maximum (ink) height of accent base that does not require raising the accents. Suggested: x-height of the font (os2.sxHeight) plus any possible overshots. }
-\mathfontdimen{Flattened\-Accent\-Base\-Height}
-{Maximum (ink) height of accent base that does not require flattening the accents. Suggested: cap height of the font (os2.sCapHeight).}
-\mathfontdimen{Subscript\-Shift\-Down}
-{The standard shift down applied to subscript elements. Positive for moving in the downward direction. Suggested: os2.ySubscriptYOffset.}
-\mathfontdimen{Subscript\-Top\-Max}
-{Maximum allowed height of the (ink) top of subscripts that does not require moving subscripts further down. Suggested: /5 x-height.}
-\mathfontdimen{Subscript\-Baseline\-Drop\-Min}
-{Minimum allowed drop of the baseline of subscripts relative to the (ink) bottom of the base. Checked for bases that are treated as a box or extended shape. Positive for subscript baseline dropped below the base bottom.}
-\mathfontdimen{Superscript\-Shift\-Up}
-{Standard shift up applied to superscript elements. Suggested: os2.ySuperscriptYOffset.}
-\mathfontdimen{Superscript\-Shift\-Up\-Cramped}
-{Standard shift of superscripts relative to the base, in cramped style.}
-\mathfontdimen{Superscript\-Bottom\-Min}
-{Minimum allowed height of the (ink) bottom of superscripts that does not require moving subscripts further up. Suggested: ¼ x-height.}
-\mathfontdimen{Superscript\-Baseline\-Drop\-Max}
-{Maximum allowed drop of the baseline of superscripts relative to the (ink) top of the base. Checked for bases that are treated as a box or extended shape. Positive for superscript baseline below the base top.}
-\mathfontdimen{Sub\-Superscript\-Gap\-Min}
-{Minimum gap between the superscript and subscript ink. Suggested: 4×default rule thickness.}
-\mathfontdimen{Superscript\-Bottom\-Max\-With\-Subscript}
-{The maximum level to which the (ink) bottom of superscript can be pushed to increase the gap between superscript and subscript, before subscript starts being moved down.
-Suggested: /5 x-height.}
-\mathfontdimen{Space\-After\-Script}
-{Extra white space to be added after each subscript and superscript. Suggested: 0.5pt for a 12 pt font.}
-\mathfontdimen{Upper\-Limit\-Gap\-Min}
-{Minimum gap between the (ink) bottom of the upper limit, and the (ink) top of the base operator. }
-\mathfontdimen{Upper\-Limit\-Baseline\-Rise\-Min}
-{Minimum distance between baseline of upper limit and (ink) top of the base operator.}
-\mathfontdimen{Lower\-Limit\-Gap\-Min}
-{Minimum gap between (ink) top of the lower limit, and (ink) bottom of the base operator.}
-\mathfontdimen{Lower\-Limit\-Baseline\-Drop\-Min}
-{Minimum distance between baseline of the lower limit and (ink) bottom of the base operator.}
-\mathfontdimen{Stack\-Top\-Shift\-Up}
-{Standard shift up applied to the top element of a stack.}
-\mathfontdimen{Stack\-Top\-Display\-Style\-Shift\-Up}
-{Standard shift up applied to the top element of a stack in display style.}
-\mathfontdimen{Stack\-Bottom\-Shift\-Down}
-{Standard shift down applied to the bottom element of a stack. Positive for moving in the downward direction.}
-\mathfontdimen{Stack\-Bottom\-Display\-Style\-Shift\-Down}
-{Standard shift down applied to the bottom element of a stack in display style. Positive for moving in the downward direction.}
-\mathfontdimen{Stack\-Gap\-Min}
-{Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element. Suggested: 3×default rule thickness.}
-\mathfontdimen{Stack\-Display\-Style\-Gap\-Min}
-{Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element in display style. Suggested: 7×default rule thickness.}
-\mathfontdimen{Stretch\-Stack\-Top\-Shift\-Up}
-{Standard shift up applied to the top element of the stretch stack.}
-\mathfontdimen{Stretch\-Stack\-Bottom\-Shift\-Down}
-{Standard shift down applied to the bottom element of the stretch stack. Positive for moving in the downward direction.}
-\mathfontdimen{Stretch\-Stack\-Gap\-Above\-Min}
-{Minimum gap between the ink of the stretched element, and the (ink) bottom of the element above. Suggested: Upper\-Limit\-Gap\-Min}
-\mathfontdimen{Stretch\-Stack\-Gap\-Below\-Min}
-{Minimum gap between the ink of the stretched element, and the (ink) top of the element below. Suggested: Lower\-Limit\-Gap\-Min.}
-\mathfontdimen{Fraction\-Numerator\-Shift\-Up}
-{Standard shift up applied to the numerator. }
-\mathfontdimen{Fraction\-Numerator\-Display\-Style\-Shift\-Up}
-{Standard shift up applied to the numerator in display style. Suggested: Stack\-Top\-Display\-Style\-Shift\-Up.}
-\mathfontdimen{Fraction\-Denominator\-Shift\-Down}
-{Standard shift down applied to the denominator. Positive for moving in the downward direction.}
-\mathfontdimen{Fraction\-Denominator\-Display\-Style\-Shift\-Down}
-{Standard shift down applied to the denominator in display style. Positive for moving in the downward direction. Suggested: Stack\-Bottom\-Display\-Style\-Shift\-Down.}
-\mathfontdimen{Fraction\-Numerator\-Gap\-Min}
-{Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar. Suggested: default rule thickness}
-\mathfontdimen{Fraction\-Num\-Display\-Style\-Gap\-Min}
-{Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar in display style. Suggested: 3×default rule thickness.}
-\mathfontdimen{Fraction\-Rule\-Thickness}
-{Thickness of the fraction bar. Suggested: default rule thickness.}
-\mathfontdimen{Fraction\-Denominator\-Gap\-Min}
-{Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar. Suggested: default rule thickness}
-\mathfontdimen{Fraction\-Denom\-Display\-Style\-Gap\-Min}
-{Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar in display style. Suggested: 3×default rule thickness.}
-\mathfontdimen{Skewed\-Fraction\-Horizontal\-Gap}
-{Horizontal distance between the top and bottom elements of a skewed fraction.}
-\mathfontdimen{Skewed\-Fraction\-Vertical\-Gap}
-{Vertical distance between the ink of the top and bottom elements of a skewed fraction.}
-\mathfontdimen{Overbar\-Vertical\-Gap}
-{Distance between the overbar and the (ink) top of he base. Suggested: 3×default rule thickness.}
-\mathfontdimen{Overbar\-Rule\-Thickness}
-{Thickness of overbar. Suggested: default rule thickness.}
-\mathfontdimen{Overbar\-Extra\-Ascender}
-{Extra white space reserved above the overbar. Suggested: default rule thickness.}
-\mathfontdimen{Underbar\-Vertical\-Gap}
-{Distance between underbar and (ink) bottom of the base. Suggested: 3×default rule thickness.}
-\mathfontdimen{Underbar\-Rule\-Thickness}
-{Thickness of underbar. Suggested: default rule thickness.}
-\mathfontdimen{Underbar\-Extra\-Descender}
-{Extra white space reserved below the underbar. Always positive. Suggested: default rule thickness.}
-\mathfontdimen{Radical\-Vertical\-Gap}
-{Space between the (ink) top of the expression and the bar over it. Suggested: 1¼ default rule thickness.}
-\mathfontdimen{Radical\-Display\-Style\-Vertical\-Gap}
-{Space between the (ink) top of the expression and the bar over it. Suggested: default rule thickness + ¼ x-height. }
-\mathfontdimen{Radical\-Rule\-Thickness}
-{Thickness of the radical rule. This is the thickness of the rule in designed or constructed radical signs. Suggested: default rule thickness.}
-\mathfontdimen{Radical\-Extra\-Ascender}
-{Extra white space reserved above the radical. Suggested: Radical\-Rule\-Thickness.}
-\mathfontdimen{Radical\-Kern\-Before\-Degree}
-{Extra horizontal kern before the degree of a radical, if such is present. Suggested: 5/18 of em.}
-\mathfontdimen{Radical\-Kern\-After\-Degree}
-{Negative kern after the degree of a radical, if such is present. Suggested: −10/18 of em.}
-\mathfontdimen{Radical\-Degree\-Bottom\-Raise\-Percent}
-{Height of the bottom of the radical degree, if such is present, in proportion to the ascender of the radical sign. Suggested: 60\%.}
-\end{longtable}
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-nfsssummary.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,84 +0,0 @@
-%%^^A%% um-doc-nfsssummary.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\section{Documenting maths support in the NFSS}
-
-In the following, \meta{NFSS decl.} stands for something like |{T1}{lmr}{m}{n}|.
-
-\begin{description}
-\item[Maths symbol fonts] Fonts for symbols: $\propto$, $\leq$, $\rightarrow$
-
-\cmd\DeclareSymbolFont\marg{name}\meta{NFSS decl.}\\
-Declares a named maths font such as |operators| from which symbols are defined with \cmd\DeclareMathSymbol.
-
-\item[Maths alphabet fonts] Fonts for {\font\1=cmmi10 at 10pt\1 ABC}\,–\,{\font\1=cmmi10 at 10pt\1 xyz}, {\font\1=eufm10 at 10pt\1 ABC}\,–\,{\font\1=cmsy10 at 10pt\1 XYZ}, etc.
-
-\cmd\DeclareMathAlphabet\marg{cmd}\meta{NFSS decl.}
-
-For commands such as \cmd\mathbf, accessed
-through maths mode that are unaffected by the current text font, and which are used for
-alphabetic symbols in the \ascii\ range.
-
-\cmd\DeclareSymbolFontAlphabet\marg{cmd}\marg{name}
-
-Alternative (and optimisation) for \cmd\DeclareMathAlphabet\ if a single font is being used
-for both alphabetic characters (as above) and symbols.
-
-\item[Maths `versions'] Different maths weights can be defined with the following, switched
-in text with the \cmd\mathversion\marg{maths version} command.
-
-\cmd\SetSymbolFont\marg{name}\marg{maths version}\meta{NFSS decl.}\\
-\cmd\SetMathAlphabet\marg{cmd}\marg{maths version}\meta{NFSS decl.}
-
-\item[Maths symbols] Symbol definitions in maths for both characters (=) and macros (\cmd\eqdef):
-\cmd\DeclareMathSymbol\marg{symbol}\marg{type}\marg{named font}\marg{slot}
-This is the macro that actually defines which font each symbol comes from and how they behave.
-\end{description}
-Delimiters and radicals use wrappers around \TeX's \cmd\delimiter/\cmd\radical\ primitives,
-which are re-designed in \XeTeX. The syntax used in \LaTeX's NFSS is therefore not so relevant here.
-\begin{description}
-\item[Delimiters] A special class of maths symbol which enlarge themselves in certain contexts.
-
-\cmd\DeclareMathDelimiter\marg{symbol}\marg{type}\marg{sym.\ font}\marg{slot}\marg{sym.\ font}\marg{slot}
-
-\item[Radicals] Similar to delimiters (\cmd\DeclareMathRadical\ takes the same syntax) but
-behave `weirdly'.
-\end{description}
-In those cases, glyph slots in \emph{two} symbol fonts are required; one for the small (`regular') case,
-the other for situations when the glyph is larger. This is not the case in \XeTeX.
-
-Accents are not included yet.
-
-\paragraph{Summary}
-
-For symbols, something like:
-\begin{Verbatim}
-\def\DeclareMathSymbol#1#2#3#4{
-  \global\mathchardef#1"\mathchar at type#2
-    \expandafter\hexnumber@\csname sym#2\endcsname
-    {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}}
-\end{Verbatim}
-For characters, something like:
-\begin{Verbatim}
-\def\DeclareMathSymbol#1#2#3#4{
-  \global\mathcode`#1"\mathchar at type#2
-    \expandafter\hexnumber@\csname sym#2\endcsname
-    {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}}
-\end{Verbatim}
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-stixextract.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,38 +0,0 @@
-%%^^A%% um-doc-stixextract.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\section{\STIX\ table data extraction}\label{part:awk}
-
-The source for the \TeX\ names for the very large number of mathematical
-glyphs are provided via Barbara Beeton's table file for the \STIX\ project
-(|ams.org/STIX|). A version is located at
-|http://www.ams.org/STIX/bnb/stix-tbl.asc|
-but check |http://www.ams.org/STIX/| for more up-to-date info.
-
-This table is converted into a form suitable for reading by \TeX.
-A single file is produced containing all (more than 3298) symbols.
-Future optimisations might include generating various (possibly overlapping) subsets
-so not all definitions must be read just to redefine a small range of symbols.
-Performance for now seems to be acceptable without such measures.
-
-This file is currently developed outside this DTX file. It will be
-incorporated when the final version is ready. (I know this is not how
-things are supposed to work!)
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-doc-style.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,129 +0,0 @@
-%%^^A%% um-doc-style.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\makeatletter
-\input{unicode-math.dtx}
-\GetFileInfo{unicode-math.dtx}
-\let\umfiledate\filedate
-\let\umfileversion\fileversion
-
-\CheckSum{0}
-\EnableCrossrefs
-\CodelineIndex
-\setcounter{IndexColumns}{2}
-
-\usepackage[svgnames]{xcolor}
-\usepackage[inline]{enumitem}
-\usepackage{array,booktabs,calc,enumitem,fancyvrb,graphicx,ifthen,longtable,refstyle,subfig,topcapt,url,varioref,underscore}
-\setcounter{LTchunksize}{100}
-\usepackage[slash-delimiter=frac,nabla=literal]{unicode-math}
-\usepackage{metalogo,hologo}
-
-\fvset{fontsize=\small,xleftmargin=2em}
-\usepackage[it]{titlesec}
-
-\setmainfont{texgyrepagella}%
- [
-  Extension = .otf ,
-  UprightFont = *-regular ,
-  ItalicFont = *-italic ,
-  BoldFont = *-bold ,
-  BoldItalicFont = *-bolditalic ,
- ]
-\setsansfont{Iwona}%
- [
-  Scale=MatchLowercase,
-  Extension = .otf,
-  UprightFont = *-Regular,
-  ItalicFont  = *-Italic,
-  BoldFont    = *-Bold,
-  BoldItalicFont = *-BoldItalic,
- ]
-\setmonofont{Inconsolatazi4-Regular.otf}%
- [
-  Scale=MatchLowercase,
-  BoldFont=Inconsolatazi4-Bold.otf
- ]
-
-\setmathfont{texgyrepagella-math.otf}
-\setmathfont[version=xits]{xits-math.otf}
-\newfontface\umfont{xits-math.otf}
-
-\usepackage{hypdoc}
-\hypersetup{linktocpage}
-
-% work around some issue turning | into "j" inside mathsf in the definition of \Module:
-% (also prettify)
-\def\Module#1{{\footnotesize\color{red}$\langle$\texttt{#1}$\rangle$}}
-
-\linespread{1.1}
-\frenchspacing
-
-\definecolor{niceblue}{rgb}{0.2,0.4,0.8}
-
-\def\theCodelineNo{\textcolor{niceblue}{\sffamily\tiny\arabic{CodelineNo}}}
-
-\newcommand*\name[1]{{#1}}
-\newcommand*\pkg[1]{\textsf{#1}}
-\newcommand*\feat[1]{\texttt{#1}}
-\newcommand*\opt[1]{\texttt{#1}}
-
-\newcommand*\note[1]{\unskip\footnote{#1}}
-
-\let\latin\textit
-\def\eg{\latin{e.g.}}
-\def\Eg{\latin{E.g.}}
-\def\ie{\latin{i.e.}}
-\def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}}
-
-\def\STIX{\textsc{stix}}
-\def\MacOSX{Mac~OS~X}
-\def\ascii{\textsc{ascii}}
-\def\OMEGA{Omega}
-
-\newcounter{argument}
-
-\makeatletter
-\g at addto@macro\endmacro{\setcounter{argument}{0}}
-\makeatother
-
-\newcommand*\darg[1]{%
-  \stepcounter{argument}%
-  {\ttfamily\char`\#\theargument~:~}#1\par\noindent\ignorespaces
-}
-\newcommand*\doarg[1]{%
-  \stepcounter{argument}%
-  {\ttfamily\makebox[0pt][r]{[}\char`\#\theargument]:~}#1\par\noindent\ignorespaces
-}
-
-\newcommand\codeline[1]{\par{\centering#1\par\noindent}\ignorespaces}
-
-\newcommand\unichar[1]{\textsc{u}+\texttt{\small#1}}
-
-\setlength\parindent{2em}
-
-\def \MakePrivateLetters {%
-  \catcode`\@=11\relax
-  \catcode`\_=11\relax
-  \catcode`\:=11\relax
-}
-
-\makeatother
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/um-doc.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/um-doc.tex	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/um-doc.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,1137 +0,0 @@
-%%^^A%% um-doc.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\begin{abstract}
-\noindent
-This document describes the \pkg{unicode-math} package, which is
-intended as an implementation of Unicode
-maths for \LaTeX\ using the \XeTeX\ and Lua\TeX\ typesetting engines.
-With this package, changing maths fonts is as easy as changing
-text fonts --- and there are more and more maths fonts appearing now.
-Maths input can also be simplified with Unicode since literal glyphs may be
-entered instead of control sequences in your document source.
-
-The package provides support for both \XeTeX\ and Lua\TeX. The different
-engines provide differing levels of support for Unicode maths.
-Please let us know of any troubles.
-
-Alongside this documentation file, you should be able to find a minimal
-example demonstrating the use of the package,
-`\texttt{unimath-example.ltx}'. It also comes with a separate document,
-`\texttt{unimath-symbols.pdf}',
-containing a complete listing of mathematical symbols defined by
-\pkg{unicode-math}, including comparisons between different fonts.
-
-Finally, while the STIX fonts may be used with this package, accessing
-their alphabets in their `private user area' is not yet supported.
-(Of these additional alphabets there is a separate caligraphic design
-distinct to the script design already included.)
-Better support for the STIX fonts is planned for an upcoming revision of the
-package after any problems have been ironed out with the initial version.
-
-\end{abstract}
-
-\newpage
-\tableofcontents
-
-\clearpage
-\section{Introduction}
-
-This document describes the \pkg{unicode-math} package, which is an
-\emph{experimental} implementation of a macro to Unicode glyph encoding for
-mathematical characters.
-
-Users who desire to specify maths alphabets only (Greek and Latin letters,
-and Arabic numerals)
-may wish to use Andrew Moschou's \pkg{mathspec} package instead.
-(\XeTeX-only at time of writing.)
-
-\section{Acknowledgements}
-
-Many thanks to:
-Microsoft for developing the mathematics extension to OpenType as part of
-Microsoft Office~2007;
-Jonathan Kew for implementing Unicode math support in \XeTeX;
-Taco Hoekwater for implementing Unicode math support in \LuaTeX;
-Barbara Beeton for her prodigious effort compiling the definitive list of Unicode math
-glyphs and their \LaTeX\ names (inventing them where necessary), and also
-for her thoughtful replies to my sometimes incessant questions;
-Philipp Stephani for extending the package to support \LuaTeX.
-Ross Moore and Chris Rowley have provided moral and technical support
-from the very early days with great insight into the issues we face trying
-to extend and use \TeX\ in the future.
-Apostolos Syropoulos, Joel Salomon, Khaled Hosny, and Mariusz Wodzicki
-have been fantastic beta testers.
-
-\section{Getting started}
-
-Load \pkg{unicode-math} as a regular \LaTeX\ package. It should be loaded
-after any other maths or font-related package in case it needs to overwrite
-their definitions. Here's an example using the filename syntax to load the \TeX\ Gyre Pagella Math font: (this works for both \XeLaTeX\ and \LuaLaTeX)
-\begin{Verbatim}
-\usepackage{amsmath} % if desired
-\usepackage{unicode-math}
-\setmathfont{texgyrepagella-math.otf}
-\end{Verbatim}
-
-Once the package is loaded, traditional TFM-based maths fonts are no longer supported;
-you can only switch to a different OpenType maths font using the \cs{setmathfont} command.
-If you do not load an OpenType maths font before |\begin{document}|, Latin Modern Math (see above) will be loaded automatically.
-
-\subsection{New commands}
-\LaTeX, since the first version of \LaTeXe, changed the math group
-selection from, say, |{\bf x}| to |\mathbf{x}|. It introduced commands
-such as |\mathbf|, |\mathit|, |\mathsf|, |\mathtt| and |\mathcal|,
-besides |\mathnormal|.  This was not only done to maintain the analogy
-with |\textbf|, |\textit| and so on, but with the precise purpose of
-loading the needed math groups (or math families) on demand and not
-allocating them if not required by the document.
-
-The introduction of \pkg{unicode-math} posed new problems. For
-instance, there is a big difference between say |fit| as an operator
-name in boldface type and the product of three boldface variables.
-With legacy \TeX{} engines, |\mathbf{fit}| would use a ligature and
-the same would happen with the input |\mathbf{f}\mathbf{i}\mathbf{t}|.
-For the latter case, the user should probably use |\mathbf{f\/}|.
-
-However, there is another important point from a \emph{conceptual}
-point of view. A boldface variable name should be printed using the
-\emph{math font}, whereas a boldface operator name should be printed
-using the \emph{text font}. OpenType math fonts make this distinction
-feasible, because they contain several math alphabets. Of course a
-boldface text~`x' will not differ much (or at all) from a boldface
-math~`x', but this is not the point: they \emph{should} be considered
-different, because the former is |U+0078| in Unicode, the latter is
-|U+1D431|.
-
-When discussing the matter, it soon appeared clear that \emph{two}
-different commands are needed: one for using text boldface in math,
-one for using math boldface. Only the document's author can know
-whether one or the other is needed. The decision was to split off
-the two meanings by using either |\mathbf| (for the boldface text font
-in math) or |\symbf| (for the bold math font).
-
-To be more detailed, most alphabet commands are provided with the
-\cs{math...} prefix synonyms, but there are five `legacy' font alphabets
-that intentionally behave somewhat different.  These are \cs{mathup},
-\cs{mathit}, \cs{mathbf}, \cs{mathsf}, and \cs{mathtt}.  (N.B.:
-\cs{mathrm} is defined as a synonym for \cs{mathup}, but the latter is
-prefered as it is a script-agnostic term.)
-
-The \cs{symbf} command switches to single-letter mathematical symbols
-(generally within the same OpenType font).  The \cs{mathbf} command
-switches to a text font that is set up to behave correctly in
-mathematics, and should be used for multi-letter identifiers.  These
-could be denoted `text math alphabets'; further details are discussed
-in \secref{mathselect}.  Additional similar `text math alphabet'
-commands can be defined using the \cs{setmathfontface} command
-discussed in \secref{mathselect}.  To control the behaviour of the
-default text math alphabet commands to behave in a
-backwards-compatible mode, see the package options described in
-\secref{textmathlegacy}.
-
-\begin{table}\centering
-  \topcaption{New \pkg{unicode-math} commands.}
-  \tablabel{symvsmath}
-  \begin{tabular}{lll}
-    \toprule
-    \pkg{unicode-math} command & Synonym \\
-    \midrule
-    |\symup|      &               \\
-    |\symit|      &               \\
-    |\symbf|      &               \\
-    |\symsf|      &               \\
-    |\symtt|      &               \\
-    \midrule
-    |\symnormal|  & |\mathnormal| \\
-    |\symliteral| &               \\
-    |\symbfup|    & |\mathbfup|   \\
-    |\symbfit|    & |\mathbfit|   \\
-    |\symsfup|    & |\mathsfup|   \\
-    |\symsfit|    & |\mathsfit|   \\
-    |\symbfsfup|  & |\mathbfsfup| \\
-    |\symbfsfit|  & |\mathbfsfit| \\
-    |\symbfsf|    & |\mathbfsf|   \\
-    |\symbb|      & |\mathbb|     \\
-    |\symbbit|    & |\mathbbit|   \\
-    |\symscr|     & |\mathscr|    \\
-    |\symbfscr|   & |\mathbfscr|  \\
-    |\symcal|     & |\mathcal|    \\
-    |\symbfcal|   & |\mathbfcal|  \\
-    |\symfrak|    & |\mathfrak|   \\
-    |\symbffrak|  & |\mathbffrak| \\
-    \bottomrule
-  \end{tabular}
-\end{table}
-
-Thus \pkg{unicode-math} provides a number of commands (such as
-|\symbfsf|) to select specific `symbol alphabets' within the unicode
-maths font, with usage, e.g., |$\symbfsf{g}$|${}\to\symbfsf{g}$.  The
-full listing is shown in \Tabref{symvsmath}.  For backwards
-compatibility, many of these are also defined with `familiar' synonyms
-such as |\mathbfsf|.  However, where possible the `sym' prefix
-commands should be preferred, as certain synonyms may become
-deprecated in time. The |\symliteral| command is described in
-\secref{math-style}.
-
-
-
-\subsection{Package options}
-Package options may be set when the package as loaded or at any later
-stage with the \cs{unimathsetup} command. Therefore, the following two
-examples are equivalent:
-\begin{Verbatim}
-\usepackage[math-style=TeX]{unicode-math}
-% OR
-\usepackage{unicode-math}
-\unimathsetup{math-style=TeX}
-\end{Verbatim}
-Note, however, that some package options affects how maths is initialised
-and changing an option such as |math-style| will not take effect until a
-new maths font is set up.
-
-Package options may \emph{also} be used when declaring new maths fonts,
-passed via options to the \cs{setmathfont} command.
-Therefore, the following two examples are equivalent:
-\begin{Verbatim}
-\unimathsetup{math-style=TeX}
-\setmathfont{Cambria Math}
-% OR
-\setmathfont{Cambria Math}[math-style=TeX]
-\end{Verbatim}
-
-A summary list of package options is shown in \tabref{pkgopt}.
-See following sections for more information.
-
-\begin{table}\centering
-  \topcaption{Package options.}
-  \tablabel{pkgopt}
-  \begin{tabular}{lll}
-    \toprule
-    Option & Description & See\dots \\
-    \midrule
-    |math-style| & Style of letters & \secref{math-style} \\
-    |bold-style| & Style of bold letters & \secref{bold-style} \\
-    |sans-style| & Style of sans serif letters & \secref{sans-style} \\
-    |nabla|      & Style of the nabla symbol & \secref{nabla} \\
-    |partial|    & Style of the partial symbol & \secref{partial} \\
-    |colon| & Behaviour of \cs{colon} & \secref{colon} \\
-    |slash-delimiter| & Glyph to use for `stretchy' slash & \secref{slash-delimiter} \\
-    \bottomrule
-  \end{tabular}
-\end{table}
-
-
-\section{Unicode maths font setup}
-
-In the ideal case, a single Unicode font will contain all maths glyphs we
-need. The file |unicode-math-table.tex| (based on Barbara Beeton's \STIX\ table)
-provides the mapping between Unicode
-maths glyphs and macro names (all 3298 — or however many — of them!). A
-single command
-\codeline{\cmd\setmathfont\marg{font name}\oarg{font features}}
-implements this for every every symbol and alphabetic variant.
-That means |x| to $x$, |\xi| to $\xi$, |\leq| to $\leq$, etc., |\symscr{H}|
-to $\symscr{H}$ and so on, all for Unicode glyphs within a single font.
-
-This package deals well with Unicode characters for maths
-input. This includes using literal Greek letters in formulae,
-resolving to upright or italic depending on preference.
-
-Font features specific to \pkg{unicode-math} are shown in \tabref{mathfontfeatures}.
-Package options (see \tabref{pkgopt}) may also be used.
-Other \pkg{fontspec} features are also valid.
-
-\begin{table}\centering
-  \topcaption{Maths font options.}
-  \tablabel{mathfontfeatures}
-  \begin{tabular}{lll}
-    \toprule
-    Option & Description & See\dots \\
-    \midrule
-    |range| & Style of letters & \secref{range} \\
-    |script-font| & Font to use for sub- and super-scripts & \secref{sscript} \\
-    |script-features| & Font features for sub- and super-scripts & \secref{sscript} \\
-    |sscript-font| & Font to use for nested sub- and super-scripts & \secref{sscript} \\
-    |sscript-features| & Font features for nested sub- and super-scripts & \secref{sscript} \\
-    \bottomrule
-  \end{tabular}
-\end{table}
-
-\subsection{Using multiple fonts}
-\seclabel{range}
-
-There will probably be few cases where a single Unicode maths font suffices
-(simply due to glyph coverage). The \STIX\ font comes to mind as a
-possible exception. It will therefore be necessary to delegate specific
-Unicode ranges of glyphs to separate fonts:
-  \codeline{\cmd\setmathfont\marg{font name}|[range=|\meta{unicode range}|,|\meta{font features}|]|}
-where \meta{unicode range} is a comma-separated list of Unicode slot numbers and ranges such as |{"27D0-"27EB,"27FF,"295B-"297F}|.
-Note that \TeX's syntax for accessing the slot number of a character, such as |`\+|, will also work here.
-
-You may also use the macro for accessing the glyph, such as \cs{int}, or whole collection of symbols with the same math type, such as \cs{mathopen}, or complete math styles such as \cs{symbb}.
-(Only numerical slots, however, can be used in ranged declarations.)
-
-\subsubsection{Control over alphabet ranges}
-
-As discussed earlier, Unicode mathematics consists of a number of `alphabet styles' within a single font. In \pkg{unicode-math}, these ranges are indicated with the following (hopefully self-explanatory) labels:
-\begin{quote}\ttfamily
-\ExplSyntaxOn
-\clist_use:Nn \g__um_named_ranges_clist {\,,\,~}
-\ExplSyntaxOff
-\end{quote}
-Fonts can be selected for specified ranges only using the following syntax, in which case all other maths font setup remains untouched:
-\begin{itemize}
-\item |[range=bb]| to use the font for `|bb|' letters only.
-\item |[range=bfsfit/{greek,Greek}]| for Greek lowercase and uppercase only (also with |latin|, |Latin|, |num| as possible options for Latin lower-/upper-case and numbers, resp.).
-\item |[range=up->sfup]| to map to different output styles.
-\end{itemize}
-
-Note that `meta-styles' such as `|bf|' and `|sf|' are not included here since they are context dependent. Use |[range=bfup]| and |[range=bfit]| to effect changes to the particular ranges selected by `|bf|' (and similarly for `|sf|').
-
-If a particular math style is not defined in the font, we fall back onto the lower-base plane (i.e., `upright') glyphs.
-Therefore, to use an \ascii-encoded fractur font, for example, write
-\begin{Verbatim}
-  \setmathfont{SomeFracturFont}[range=frak]
-\end{Verbatim}
-and because the math plane fractur glyphs will be missing, \pkg{unicode-math} will know to use the \ascii\ ones instead.
-If necessary this behaviour can be forced with |[range=frak->up]|, since the `|up|' range corresponds to \ascii\ letters.
-
-%If you wanted to swap the maths symbols with sans serif forms, it would be possible to write |[range={up->sfup,it->sfit}]|.
-%Note, however, that at present Unicode does not encode glyphs for sans serif Greek (\tabref{mathalphabets}).
-
-Users of the impressive Minion Math fonts (commercial) may use remapping to access the bold glyphs using:
-\begin{Verbatim}
-  \setmathfont{MinionMath-Regular.otf}
-  \setmathfont{MinionMath-Bold.otf}[range={bfup->up,bfit->it}]
-\end{Verbatim}
-To set up the complete range of optical sizes for these fonts, a font declaration such as the following may be used: (adjust may be desired according to the font size of the document)
-\begin{Verbatim}
-\setmathfont{Minion Math}[
- SizeFeatures = {
-  {Size =      -6.01,  Font = MinionMath-Tiny},
-  {Size =  6.01-8.41,  Font = MinionMath-Capt},
-  {Size =  8.41-13.01, Font = MinionMath-Regular},
-  {Size = 13.01-19.91, Font = MinionMath-Subh},
-  {Size = 19.91-,      Font = MinionMath-Disp}
- }]
-
-\setmathfont{Minion Math}[range = {bfup->up,bfit->it},
- SizeFeatures = {
-  {Size =      -6.01,  Font = MinionMath-BoldTiny},
-  {Size =  6.01-8.41,  Font = MinionMath-BoldCapt},
-  {Size =  8.41-13.01, Font = MinionMath-Bold},
-  {Size = 13.01-19.91, Font = MinionMath-BoldSubh},
-  {Size = 19.91-,      Font = MinionMath-BoldDisp}
- }]
-\end{Verbatim}
-\textbf{v0.8:} Note that in previous versions of \pkg{unicode-math}, these features were labelled |[range=\mathbb]| and so on. This old syntax is still supported for backwards compatibility, but is now discouraged.
-
-
-\subsection{Script and scriptscript fonts/features}
-\seclabel{sscript}
-
-Cambria Math uses OpenType font features to activate smaller optical sizes
-for scriptsize and scriptscriptsize symbols (the $B$ and $C$, respectively,
-in $A_{B_C}$).
-Other typefaces (such as Minion Math) may use entirely separate font files.
-
-The features |script-font| and |sscript-font| allow alternate fonts to be
-selected for the script and scriptscript sizes, and |script-features| and
-|sscript-features| to apply different OpenType features to them.
-
-By default |script-features| is defined as |Style=MathScript| and |sscript-features| is |Style=MathScriptScript|.
-These correspond to the two levels of OpenType's |ssty| feature tag.
-If the |(s)script-features| options are specified manually, you must
-additionally specify the |Style| options as above.
-
-
-\subsection{Maths `versions'}
-
-\LaTeX\ uses a concept known as `maths versions' to switch math fonts
-mid-document.
-This is useful because it is more efficient than loading a complete maths
-font from scratch every time---especially with thousands of glyphs in the case of Unicode maths!
-The canonical example for maths versions is to select a `bold' maths font
-which might be suitable for section headings, say.
-(Not everyone agrees with this typesetting choice, though; be careful.)
-
-To select a new maths font in a particular version, use the syntax
-  \codeline{\cmd\setmathfont\marg{font name}|[version=|\meta{version name}|,|\meta{font features}|]|}
-and to switch between maths versions mid-document use the standard \LaTeX\ command
-\cmd\mathversion\marg{version name}.
-
-
-\subsection{Legacy maths `alphabet' commands}
-\seclabel{mathselect}
-
-\LaTeX\ traditionally uses \cs{DeclareMathAlphabet} and \cs{SetMathAlphabet} to define document commands such as \cs{mathit}, \cs{mathbf}, and so on.
-While these commands can still be used, \pkg{unicode-math} defines a wrapper command to assist with the creation of new such maths alphabet commands.
-This command is known as \cs{setmathface} in symmetry with \pkg{fontspec}'s \cs{newfontface} command; it takes syntax:
-\begin{quote}
-  \cmd\setmathfontface\meta{command}\marg{font name}|[|\meta{font features}|]|
-
-  \makebox[0pt][l]{\cmd\setmathfontface\meta{command}\marg{font name}|[||version=|\meta{version name}|,|\meta{font features}|]|}
-\end{quote}
-For example, if you want to define a new legacy maths alphabet font \cs{mathittt}:
-\begin{verbatim}
-  \setmathfontface\mathittt{texgyrecursor-italic.otf}
-  ...
-  $\mathittt{foo} = \mathittt{a} + \mathittt{b}$
-\end{verbatim}
-
-
-\subsubsection{Default `text math' fonts}
-
-The five `text math' fonts, discussed above, are: \cs{mathrm}, \cs{mathbf}, \cs{mathit}, \cs{mathsf}, and \cs{mathtt}.
-These commands are also defined with their original definition under synonyms \cs{mathtextrm}, \cs{mathtextbf}, and so on.
-
-When selecting document fonts using \pkg{fontspec} commands such as \cs{setmainfont}, \pkg{unicode-math} inserts some additional code into \pkg{fontspec} that keeps the current default fonts `in sync' with their corresponding \cs{mathrm} commands, etc.
-
-For example, in standard \LaTeX, \cs{mathsf} doesn't change even if the main document font is changed using |\renewcommand\sfdefault{...}|. With \pkg{unicode-math} loaded, after writing |\setsansfont{Helvetica}|, \cs{mathsf} will now be set in Helvetica.
-
-If the \cs{mathsf} font is set explicitly at any time in the preamble, this `auto-following' does not occur. The legacy math font switches can be defined either with commands defined by \pkg{fontspec} (|\setmathrm|, |\setmathsf|, etc.) or using the more general |\setmathfontface\mathsf| interface defined by \pkg{unicode-math}.
-
-
-\subsubsection{Replacing `text math' fonts by symbols}
-\seclabel{textmathlegacy}
-
-For certain types of documents that use legacy input syntax, it may be preferable to have |\mathbf| behave as if it were |\symbf| en masse (et cetera respectively).
-A series of package options (\tabref{legacyfontswitch}) are provided to facilitate switching the definition of \cs{mathXYZ} for the five legacy text math font definitions.
-
-For example, if in a particular document |\mathbf| is used only for choosing symbols of vectors and matrices, a dedicated symbol font (|\symbf|) will produce better spacing and will better match the main math font.
-In that case loading |unicode-math| with the |mathbf=sym| will achieve the desired result.
-
-\begin{table}
-  \centering
-  \topcaption{Maths text font configuration options. Note that \cs{mathup} and \cs{mathrm} are aliases of each other and cannot be configured separately.}
-  \tablabel{legacyfontswitch}
-  \begin{tabular}{lll}
-    \toprule
-    Defaults (from `text' font) & From `maths symbols' \\
-    \midrule
-    |mathrm=text| &   |mathrm=sym |  \\
-    |mathup=text|\rlap{$^\ast$} &   |mathup=sym|{}\rlap{$^\ast$}  \\
-    |mathit=text| &   |mathit=sym |  \\
-    |mathsf=text| &   |mathsf=sym |  \\
-    |mathbf=text| &   |mathbf=sym |  \\
-    |mathtt=text| &   |mathtt=sym |  \\
-    \bottomrule
-  \end{tabular}
-\end{table}
-
-
-\subsubsection{Operator font}
-
-\LaTeX\ defines an internal command \cs{operator at font} for typesetting elements such as |\sin| and |\cos|.
-This font is selected from the legacy |operators| NFSS `MathAlphabet', which is no longer relevant in the context of \pkg{unicode-math}.
-By default, the \cs{operator at font} command is defined to switch to the \cs{mathrm} font.
-You may now change these using the command:
-\begin{Verbatim}
-\setoperatorfont\mathit
-\end{Verbatim}
-Or, to select a \pkg{unicode-math} range:
-\begin{Verbatim}
-\setoperatorfont\symscr
-\end{Verbatim}
-\setoperatorfont\symscr
-For example, after the latter above, |$\sin x$| will produce `$\sin x$'.
-
-\mathversion{normal}
-\setoperatorfont\mathrm
-
-
-\section{Maths input}
-
-\XeTeX's Unicode support allows maths input through two methods. Like
-classical \TeX, macros such as \cmd\alpha, \cmd\sum, \cmd\pm, \cmd\leq, and
-so on, provide verbose access to the entire repertoire of characters defined
-by Unicode. The literal characters themselves may be used instead, for more
-readable input files.
-
-\subsection{Math `style'}
-\seclabel{math-style}
-
-Classically, \TeX\ uses italic lowercase Greek letters and \emph{upright}
-uppercase Greek letters for variables in mathematics. This is contrary to
-the \textsc{iso} standards of using italic forms for both upper- and lowercase.
-Furthermore, in various historical contexts, often associated with French typesetting, it was common to use upright uppercase \emph{Latin} letters as well as upright
-upper- and lowercase Greek, but italic lowercase latin. Finally, it is not unknown to use upright letters
-for all characters, as seen in the Euler fonts.
-
-The \pkg{unicode-math} package accommodates these possibilities with the
-option \opt{math-style} that takes one of four (case sensitive) arguments:
-\opt{TeX}, \opt{ISO}, \opt{french}, or \opt{upright}.\footnote{Interface inspired by Walter Schmidt's \pkg{lucimatx} package.}
-The \opt{math-style} options' effects are shown in brief in \tabref{math-style}.
-
-The philosophy behind the interface to the mathematical symbols
-lies in \LaTeX's attempt of separating content and formatting. Because input
-source text may come from a variety of places, the upright and
-`mathematical' italic Latin and Greek alphabets are \emph{unified} from the
-point of view of having a specified meaning in the source text. That is, to
-get a mathematical ‘$x$’, either the \ascii\ (`keyboard') letter |x| may
-be typed, or the actual Unicode character may be used. Similarly for Greek
-letters. The upright or italic forms are then chosen based on the
-|math-style| package option.
-
-If glyphs are desired that do not map as per the package option (for
-example, an upright `g' is desired but typing |$g$| yields `$g$'),
-\emph{markup} is required to specify this; to follow from the example:
-|\symup{g}|.
-Maths style commands such as \cmd\symup\ are detailed later.
-
-\paragraph{`Literal' interface}
-Some may not like this convention of normalising their input.
-For them, an upright |x| is an upright `x' and that's that.
-(This will be the case when obtaining source text from copy/pasting PDF or
-Microsoft Word documents, for example.)
-For these users, the |literal| option to |math-style| will effect this behaviour.
-The \cs{symliteral}\marg{syms} command can also be used, regardless of package setting, to force the style to match the literal input characters.
-This is a `mirror' to \cs{symnormal}\marg{syms} (also alias \cs{mathnormal}) which `resets' the character mapping in its argument to that originally set up through package options.
-
-\begin{table}
-  \centering
-  \topcaption{Effects of the \opt{math-style} package option.}
-  \tablabel{math-style}
-  \begin{tabular}{@{}>{\ttfamily}lcc@{}}
-    \toprule
-      & \multicolumn{2}{c}{Example} \\
-       \cmidrule(l){2-3}
-      \rmfamily Package option & Latin & Greek \\
-    \midrule
-      math-style=ISO & $(a,z,B,X)$ & $\symit{(\alpha,\beta,\Gamma,\Xi)}$ \\
-      math-style=TeX & $(a,z,B,X)$ & $(\symit\alpha,\symit\beta,\symup\Gamma,\symup\Xi)$ \\
-      math-style=french & $(a,z,\symup B,\symup X)$ & $(\symup\alpha,\symup\beta,\symup\Gamma,\symup\Xi)$ \\
-      math-style=upright & $(\symup a,\symup z,\symup B,\symup X)$ & $(\symup\alpha,\symup\beta,\symup\Gamma,\symup\Xi)$ \\
-    \bottomrule
-  \end{tabular}
-\end{table}
-
-
-\subsection{Bold style}
-\seclabel{bold-style}
-
-Similar as in the previous section, ISO standards differ somewhat to \TeX's
-conventions (and classical typesetting) for `boldness' in mathematics. In
-the past, it has been customary to use bold \emph{upright} letters to denote
-things like vectors and matrices. For example, \( \symbfup{M} =
-(\mitM_x,\mitM_y,\mitM_z) \). Presumably, this was due to the relatively
-scarcity of bold italic fonts in the pre-digital typesetting era.
-It has been suggested by some that \emph{italic} bold symbols should be used nowadays instead, but this practise is certainly not widespread.
-
-Bold Greek letters have simply been bold variant glyphs of their regular
-weight, as in \( \mbfitxi = (\mitxi_\mitr,\mitxi_\mitphi,\mitxi_\mittheta)
-\).
-Confusingly, the syntax in \LaTeX\ traditionally has been different for obtaining `normal' bold symbols in Latin and Greek: \cmd\mathbf\ in the former (`$\symbfup{M}$'), and \cmd\bm\ (or
-\cmd\boldsymbol, deprecated) in the latter (`$\mbfitxi$').
-
-In \pkg{unicode-math}, the \cmd\symbf\ command works directly with both
-Greek and Latin maths characters and depending on package option
-either switches to upright for Latin letters (|bold-style=TeX|) as well or
-keeps them italic (|bold-style=ISO|).
-To match the package options for non-bold characters, with option
-|bold-style=upright| all bold characters are upright, and
-|bold-style=literal| does not change the upright/italic shape of the letter.
-The \opt{bold-style} options' effects are shown in brief in \tabref{bold-style}.
-
-Upright and italic bold mathematical letters input as direct Unicode
-characters are normalised with the same rules. For example, with
-|bold-style=TeX|, a literal bold italic latin character will be typeset
-upright.
-
-Note that \opt{bold-style} is independent of \opt{math-style}, although if
-the former is not specified then matching defaults are chosen based on the
-latter.
-
-\begin{table}
-  \centering
-  \topcaption{Effects of the \opt{bold-style} package option.}
-  \tablabel{bold-style}
-  \begin{tabular}{@{}>{\ttfamily}lcc@{}}
-    \toprule
-      & \multicolumn{2}{c}{Example} \\
-       \cmidrule(l){2-3}
-      \rmfamily Package option & Latin & Greek \\
-    \midrule
-      bold-style=ISO & $(\symbfit a, \symbfit z, \symbfit B, \symbfit X)$ & $(\symbfit\alpha, \symbfit\beta, \symbfit\Gamma, \symbfit\Xi)$ \\
-      bold-style=TeX & $(\symbfup a,\symbfup z,\symbfup B,\symbfup X)$ & $(\symbfit\alpha, \symbfit\beta,\symbfup \Gamma,\symbfup \Xi)$ \\
-      bold-style=upright & $(\symbfup a,\symbfup z,\symbfup B,\symbfup X)$ & $(\symbfup \alpha,\symbfup \beta,\symbfup \Gamma,\symbfup \Xi)$ \\
-    \bottomrule
-  \end{tabular}
-\end{table}
-
-
-\subsection{Sans serif style}
-\seclabel{sans-style}
-
-Unicode contains upright and italic, medium and bold mathematical style characters.
-These may be explicitly selected with the \cs{mathsfup}, \cs{mathsfit}, \cs{mathbfsfup}, and \cs{mathbfsfit}
-commands discussed in \secref{all-math-alphabets}.
-
-How should the generic \cs{mathsf} behave? Unlike bold, sans serif is used much more sparingly
-in mathematics. I've seen recommendations to typeset tensors in sans serif italic
-or sans serif italic bold (e.g., examples in the \pkg{isomath} and \pkg{mattens} packages).
-But \LaTeX's \cs{mathsf} is \textsl{upright} sans serif.
-
-Therefore I reluctantly add the package options |[sans-style=upright]| and |[sans-style=italic]| to control the behaviour of \cs{mathsf}.
-The |upright| style sets up the command to use upright sans serif, including Greek;
-the |italic| style switches to using italic in both Latin and Greek.
-In other words, this option simply changes the meaning of \cs{mathsf} to either \cs{mathsfup} or \cs{mathsfit}, respectively.
-Please let me know if more granular control is necessary here.
-
-There is also a |[sans-style=literal]| setting, set automatically with |[math-style=literal]|, which retains the uprightness of the input characters used when selecting the sans serif output.
-
-\subsubsection{What about bold sans serif?}
-
-While you might want your bold upright and your sans serif italic, I don't believe you'd also want
-your bold sans serif upright (or all vice versa, if that's even conceivable). Therefore, bold sans
-serif follows from the setting for sans serif; it is completely independent of the setting for bold.
-
-In other words, \cs{mathbfsf} is either \cs{mathbfsfup} or \cs{mathbfsfit} based on |[sans-style=upright]| or |[sans-style=italic]|, respectively. And \texttt{[sans-style = literal]} causes \cs{mathbfsf} to retain the same italic or upright shape as the input, and turns it bold sans serif.
-
-N.B.: there is no medium-weight sans serif Greek range in Unicode.
-Therefore, |\symsf{\alpha}| does not make sense (it produces `$\symsf{\alpha}$'), while |\symbfsf{\alpha}| gives `$\symbfsfup{\alpha}$' or `$\symbfsfit{\alpha}$' according to the |sans-style|.
-
-\subsection{All (the rest) of the mathematical styles}
-\seclabel{all-math-alphabets}
-
-Unicode contains separate codepoints for most if not all variations of style
-shape one may wish to use in mathematical notation. The complete list is shown
-in \tabref{mathalphabets}. Some of these have been covered in the previous sections.
-
-The math font switching commands do not nest; therefore if you want
-sans serif bold, you must write |\symbfsf{...}| rather than |\symbf{\symsf{...}}|.
-This may change in the future.
-
-\begin{table}
-\caption{Mathematical styles defined in Unicode. Black dots indicate an style exists in the font specified; blue dots indicate shapes that should always be taken from the upright font even in the italic style. See main text for description of \cs{mathbbit}.}
-\tablabel{mathalphabets}
-\centering
-\def\Y{\textbullet}
-\def\M{\textcolor[rgb]{0.5,0.5,1}{\textbullet}}
-\begin{tabular}{@{} lll l ccc @{}}
-\toprule
-\multicolumn{3}{c}{Font} & & \multicolumn{3}{c}{Alphabet} \\
-\cmidrule(r){1-3}
-\cmidrule(l){5-7}
-Style & Shape & Series & Switch & Latin & Greek & Numerals \\
-\midrule
-Serif      & Upright & Normal & \cs{mathup}     & \Y & \Y & \Y  \\
-           &         & Bold   & \cs{mathbfup}   & \Y & \Y & \Y  \\
-           & Italic  & Normal & \cs{mathit}     & \Y & \Y & \M  \\
-           &         & Bold   & \cs{mathbfit}   & \Y & \Y & \M  \\
-Sans serif & Upright & Normal & \cs{mathsfup}   & \Y &    & \Y  \\
-           & Italic  & Normal & \cs{mathsfit}   & \Y &    & \M  \\
-           & Upright & Bold   & \cs{mathbfsfup} & \Y & \Y & \Y  \\
-           & Italic  & Bold   & \cs{mathbfsfit} & \Y & \Y & \M  \\
-Typewriter & Upright & Normal & \cs{mathtt}     & \Y &    & \Y  \\
-Double-struck & Upright & Normal & \cs{mathbb}     & \Y &    & \Y  \\
-              & Italic  & Normal & \cs{mathbbit}   & \Y &    &  \\
-Script     & Upright & Normal & \cs{mathscr}    & \Y &    &     \\
-           &         & Bold   & \cs{mathbfscr}  & \Y &    &     \\
-Fraktur    & Upright & Normal & \cs{mathfrak}   & \Y &    &     \\
-           &         & Bold   & \cs{mathbffrac} & \Y &    &     \\
-\bottomrule
-\end{tabular}
-\end{table}
-
-\subsubsection{Double-struck}
-
-The double-struck style (also known as `blackboard bold') consists of
-upright Latin letters $\{\symbb{a}$--$\symbb{z}$,$\symbb{A}$$\symbb{Z}\}$,
-numerals $\symbb{0}$--$\symbb{9}$, summation symbol $\symbb\sum$, and four
-Greek letters only: $\{\symbb{\gamma\pi\Gamma\Pi}\}$.
-
-While |\symbb{\sum}| does produce a double-struck summation symbol,
-its limits aren't properly aligned. Therefore,
-either the literal character or the control sequence \cs{Bbbsum} are
-recommended instead.
-
-There are also five Latin \emph{italic} double-struck letters: $\symbbit{Ddeij}$.
-These can be accessed (if not with their literal characters or control sequences)
-with the \cs{mathbbit} style switch, but note that only those five letters
-will give the expected output.
-
-\subsubsection{Caligraphic vs.\ Script variants}
-
-The Unicode maths encoding contains a style for `Script' letters,
-and while by default \cs{mathcal} and \cs{mathscr}
-are synonyms, there are some situations when a
-separate `Caligraphic' style is needed as well.
-
-If a font contains alternate glyphs for a separat caligraphic style,
-they can be selected explicitly as shown below.
-This feature is currently only supported by the XITS~Math font, where
-the caligraphic letters are accessed with the same glyph slots as the
-script letters but with the first stylistic set feature (|ss01|) applied.
-\begin{verbatim}
-  \setmathfont{xits-math.otf}[range={cal,bfcal},StylisticSet=1]
-\end{verbatim}
-An example is shown below.
-\begin{quote}
-\setmathfont{xits-math.otf}[range=scr]
-\setmathfont{xits-math.otf}[range=cal,StylisticSet=1]
-The Script style (\cs{mathscr}) in XITS Math is: $\symscr{ABCXYZ}$\par
-The Caligraphic style (\cs{mathcal}) in XITS Math is: $\symcal{ABCXYZ}$
-\end{quote}
-
-
-\subsection{Miscellanea}
-
-\subsubsection{Nabla}
-\seclabel{nabla}
-
- The symbol $\nabla$ comes in the six forms shown in \tabref{nabla}.
- We want an individual option to specify whether we want upright or italic
- nabla by default (when either upright or italic nabla is used in the
- source). \TeX\ classically uses an upright nabla, and \textsc{iso}
- standards agree with this convention.
- The package options |nabla=upright| and
- |nabla=italic| switch between the two choices, and |nabla=literal| respects
- the shape of the input character. This is then inherited
- through \cmd\symbf; \cmd\symit\ and \cmd\symup\ can be used to force one
- way or the other.
-
-|nabla=italic| is the default. |nabla=literal| is
-activated automatically after |math-style=literal|.
-
-\begin{table}
-  \begin{minipage}[b]{0.49\textwidth}
-  \centering
-  \topcaption{The various forms of nabla.}
-  \tablabel{nabla}
-  \let \tmpshow\empty
-  \begin{tabular}{@{}llc@{}}
-      \toprule
-    \multicolumn{2}{@{}l}{Description} & Glyph
-     \\ \cmidrule(r){1-2}\cmidrule(l){3-3}
-    Upright & Serif & $\symup\nabla$ \\
-    & Bold serif & $\symbfup\nabla$ \\
-    & Bold sans & $\symbfsfup\nabla$ \\
-      \cmidrule(lr){1-2}\cmidrule(lr){3-3}
-    Italic & Serif & $\symit\nabla$ \\
-    & Bold serif & $\symbfit\nabla$ \\
-    & Bold sans  & $\symbfsfit\nabla$ \\
-      \bottomrule
-  \end{tabular}
-  \end{minipage}\hfill
-  \begin{minipage}[b]{0.49\textwidth}
-  \centering
-  \topcaption{The partial differential.}
-  \tablabel{partial}
-  \begin{tabular}{@{}llc@{}}
-      \toprule
-    \multicolumn{2}{@{}l}{Description} & Glyph
-     \\ \cmidrule(r){1-2}\cmidrule(l){3-3}
-    Regular   & Upright & $\symup\partial$ \\
-              & Italic  & $\symit\partial$ \\
-    Bold      & Upright & $\symbfup\partial$ \\
-              & Italic  & $\symbfit\partial$ \\
-    Sans bold & Upright & $\symbfsfup\partial$ \\
-              & Italic  & $\symbfsfit\partial$ \\
-      \bottomrule
-  \end{tabular}
-  \end{minipage}
-\end{table}
-
-
-\subsubsection{Partial}
-\seclabel{partial}
-
-The same applies to the symbols \unichar{2202} partial differential and
-\unichar{1D715} math italic partial differential.
-
-At time of writing, both the Cambria Math and STIX fonts display these
-two glyphs in the same italic style, but this is hopefully a bug that will
-be corrected in the future~--- the `plain' partial differential should
-really have an upright shape.
-
-Use the |partial=upright| or |partial=italic| package options to specify
-which one you would like, or |partial=literal| to have the same character
-used in the output as was used for the input.
-The default is (always, unless someone requests and
-argues otherwise) |partial=italic|.\footnote{A good argument would revolve
-around some international standards body recommending upright over italic.
-I just don't have the time right now to look it up.} |partial=literal|
-is activated following |math-style=literal|.
-
-See \tabref{partial} for the variations on the partial differential symbol.
-
-
-\subsubsection{Primes}
-
-Primes ($x'$) may be input in several ways. You may use any combination
-the \ascii\ straight quote (\texttt{\char`\'}) or the Unicode prime \unichar{2032}
-($'$); when multiple primes occur next to each other, they chain
-together to form double, triple, or quadruple primes if the font contains
-pre-drawn glyphs. The individual prime glyphs are accessed, as usual,
-with the \cs{prime} command, and the double-, triple-, and quadruple-prime
-glyphs are available with \cs{dprime}, \cs{trprime}, and \cs{qprime},
-respectively.
-
-If the font does not contain the pre-drawn glyphs or more than four primes
-are used, the single prime glyph is used multiple times with a negative
-kern to get the spacing right. There is no user interface to adjust this
-negative kern yet (because I haven't decided what it should look like);
-if you need to, write something like this:
-\begin{Verbatim}
-\ExplSyntaxOn
-\muskip_gset:Nn \g_@@_primekern_muskip { -\thinmuskip/2 }
-\ExplySyntaxOff
-\end{Verbatim}
-Backwards or reverse primes behave in exactly the same way; use the \ascii\
-back tick (\texttt{\char`\`}) or the Unicode reverse prime \unichar{2035}
-({\umfont\char"2035}).
-The command to access the backprime is \cs{backprime}, and
-multiple backwards primes can accessed with \cs{backdprime},
-\cs{backtrprime}, and \cs{backqprime}.
-
-In all cases above, no error checking is performed if you attempt to
-access a multi-prime glyph in a font that doesn't contain one. For this
-reason, it may be safer to write |x''''| instead of |x\qprime|
-in general.
-
-If you ever need to enter the straight quote |'| or the backtick |`| in
-maths mode, these glyphs can be accessed with \cs{mathstraightquote} and
-\cs{mathbacktick}.
-
-\subsubsection{Unicode subscripts and superscripts}
-
-You may, if you wish, use Unicode subscripts and superscripts in your
-source document. For basic expressions, the use of these characters
-can make the input more readable.
-Adjacent sub- or super-scripts will be concatenated into a single
-expression.
-
-The range of subscripts and superscripts supported by this package
-are shown in \figref{superscripts,subscripts}. Please request more if
-you think it is appropriate.
-
-\begin{figure}\centering
-\fbox{\fontspec{CharisSILR.ttf}\Large
-A
-^^^^2070 ^^^^00b9 ^^^^00b2 ^^^^00b3 ^^^^2074 ^^^^2075 ^^^^2076 ^^^^2077
-^^^^2078 ^^^^2079 ^^^^207a ^^^^207b ^^^^207c ^^^^207d ^^^^207e ^^^^2071
-^^^^207f ^^^^207f ^^^^02b0 ^^^^02b2 ^^^^02b3 ^^^^02b7 ^^^^02b8
-Z}
-\caption{
-  The Unicode superscripts supported as input characters.
-  These are the literal glyphs from Charis SIL,
-  not the output seen when used for maths input.
-  The `A' and `Z' are to provide context for the size and
-  location of the superscript glyphs.
-}
-\figlabel{superscripts}
-\end{figure}
-
-\begin{figure}\centering
-\fbox{\fontspec{CharisSILR.ttf}\Large
-A
-^^^^2080 ^^^^2081 ^^^^2082 ^^^^2083 ^^^^2084 ^^^^2085 ^^^^2086 ^^^^2087
-^^^^2088 ^^^^2089 ^^^^208a ^^^^208b ^^^^208c ^^^^208d ^^^^208e ^^^^2090
-^^^^2091 ^^^^1d62 ^^^^2092 ^^^^1d63 ^^^^1d64 ^^^^1d65 ^^^^2093 ^^^^1d66
-^^^^1d67 ^^^^1d68 ^^^^1d69 ^^^^1d6a
-Z}
-\caption{
-  The Unicode subscripts supported as input characters.
-  See note from \figref{superscripts}.
-}
-\figlabel{subscripts}
-\end{figure}
-
-\subsubsection{Colon}
-\seclabel{colon}
-
-The colon is one of the few confusing characters of Unicode maths.
-In \TeX, \texttt{:} is defined as a colon with relation spacing: `$a:b$'.
-While \cs{colon} is defined as a colon with punctuation spacing: `$a\colon b$'.
-
-In Unicode, \unichar{003A} {colon} is defined as a punctuation symbol,
-while \unichar{2236} {ratio} is the colon-like symbol used in mathematics to denote
-ratios and other things.
-
-This breaks the usual straightforward mapping from control sequence to Unicode input character
-to (the same) Unicode glyph.
-
-To preserve input compatibility, we remap the \ascii\ input character `\texttt{:}' to \unichar{2236}.
-Typing a literal \unichar{2236} char will result in the same output.
-If \pkg{amsmath} is loaded, then the definition of \cs{colon} is inherited from there
-(it looks like a punctuation colon with additional space around it).
-Otherwise, \cs{colon} is made to output a colon with \cs{mathpunct} spacing.
-
-The package option |colon=literal| forces \ascii\ input `|:|' to be printed as \cs{mathcolon} instead.
-
-
-\subsubsection{Slashes and backslashes}
-\seclabel{slash-delimiter}
-
-There are several slash-like symbols defined in Unicode. The complete list is shown in \tabref{slashes}.
-
-\begin{table}\centering
-\caption{Slashes and backslashes.}
-\tablabel{slashes}
-\begin{tabular}{@{}cl@{}cl@{}}
-\toprule
-Slot & Name & Glyph & Command  \\
-\midrule
-\unichar{002F} & \textsc{solidus}                 & \umfont \char"002F & \cs{slash} \\
-\unichar{2044} & \textsc{fraction slash}          & \umfont \char"2044 & \cs{fracslash} \\
-\unichar{2215} & \textsc{division slash}          & \umfont \char"2215 & \cs{divslash} \\
-\unichar{29F8} & \textsc{big solidus}             & \umfont \char"29F8 & \cs{xsol} \\
-\midrule
-\unichar{005C} & \textsc{reverse solidus}         & \umfont \char"005C & \cs{backslash} \\
-\unichar{2216} & \textsc{set minus}               & \umfont \char"2216 & \cs{smallsetminus} \\
-\unichar{29F5} & \textsc{reverse solidus operator}& \umfont \char"29F5 & \cs{setminus} \\
-\unichar{29F9} & \textsc{big reverse solidus}     & \umfont \char"29F9 & \cs{xbsol} \\
-\bottomrule
-\end{tabular}
-\end{table}
-
-In regular \LaTeX\ we can write \cs{left}\cs{slash}\dots\cs{right}\cs{backslash}
-and so on and obtain extensible delimiter-like symbols. Not all of the Unicode slashes
-are suitable for this (and do not have the font support to do it).
-
-\paragraph{Slash}
-
-Of \unichar{2044} {fraction slash}, TR25 says that it is:
-\begin{quote}
-\dots used to build up simple fractions in running text\dots
-however parsers of mathematical texts should be prepared to handle fraction slash
-when it is received from other sources.
-\end{quote}
-
-\unichar{2215} {division slash} should be used when division is represented
-without a built-up fraction; $\pi\approx22/7$, for example.
-
-\unichar{29F8} {big solidus} is a `big operator' (like $\sum$).
-
-\paragraph{Backslash}
-
-The \unichar{005C} {reverse solidus} character \cs{backslash} is used for denoting
-double cosets: $A\backslash B$. (So I'm led to believe.)
-It may be used as a `stretchy' delimiter if supported by the font.
-
-MathML uses \unichar{2216} {set minus} like this: $A\smallsetminus B$.\footnote{\S4.4.5.11 \url{http://www.w3.org/TR/MathML3/}}
-The \LaTeX\ command name \cs{smallsetminus} is used for backwards compatibility.
-
-Presumably, \unichar{29F5} {reverse solidus operator} is intended to
-be used in a similar way, but it could also (perhaps?) be used to
-represent `inverse division': $\pi\approx7\mathbin{\backslash}22$.^^A
-\footnote{This is valid syntax in the Octave and Matlab programming languages,
-in which it means matrix inverse pre-multiplication. I.e., $A\mathbin{\backslash} B\equiv A^{-1}B$.}
-The \LaTeX\ name for this character is \cs{setminus}.
-
-Finally, \unichar{29F9} {big reverse solidus} is a `big operator' (like $\sum$).
-
-\paragraph{How to use all of these things}
-
-Unfortunately, font support for the above characters/glyphs is rather inconsistent.
-In Cambria Math, the only slash that grows (say when writing
-\[
-\left.\left[\begin{array}{cc} a & b \\ c & d\end{array}\right]\middle\slash
-      \left[\begin{array}{cc} 1 & 1 \\ 1 & 0\end{array}\right] \right.\quad )
-\]
-is the \textsc{fraction slash}, which we just established above is
-sort of only supposed to be used in text.
-
-Of the above characters, the following are allowed to be used after
-\cs{left}, \cs{middle}, and \cs{right}:
-\begin{itemize}
-\item \cs{fracslash};
-\item \cs{slash}; and,
-\item \cs{backslash} (the only reverse slash).
-\end{itemize}
-
-However, we assume that there is only \emph{one} stretchy slash
-in the font; this is assumed by default to be \unichar{002F} {solidus}.
-Writing \cs{left/} or \cs{left}\cs{slash} or \cs{left}\cs{fracslash}
-will all result in the same stretchy delimiter being used.
-
-The delimiter used can be changed with the |slash-delimiter| package option.
-Allowed values are |ascii|, |frac|, and |div|, corresponding to the respective
-Unicode slots.
-
-For example: as mentioned above, Cambria Math's stretchy slash is
-\unichar{2044} {fraction slash}. When using Cambria Math, then
-\pkg{unicode-math} should be loaded with the |slash-delimiter=frac| option.
-(This should be a font option rather than a package option, but
-it will change soon.)
-
-
-\subsubsection{Growing and non-growing accents}
-\seclabel{growing-accents}
-
-There are a few accents for which \TeX\ has both non-growing and growing
-versions.  Among these are \cs{hat} and \cs{tilde}; the corresponding growing
-versions are called \cs{widehat} and \cs{widetilde}, respectively.
-
-Older versions of \XeTeX\ and \LuaTeX\ did not support this distinction,
-however, and \emph{all} accents there were growing automatically. (I.e.,
-\cs{hat} and \cs{widehat} are equivalent.) As of \LuaTeX\ v0.65 and \XeTeX\
-v0.9998, these wide/non-wide commands will again behave in their expected
-manner.
-
-
-\subsubsection{Pre-drawn fraction characters}
-
-Pre-drawn fractions \unichar{00BC}--\unichar{00BE}, \unichar{2150}--\unichar{215E}
-are not suitable for use in mathematics output. However, they can be useful
-as input characters to abbreviate common fractions.
-\begin{center}
-\fontspec{DejaVuSerif.ttf} ^^A available in TeX Live 2012 if not earlier
-¼ ½ ¾  ↉ ⅐ ⅑ ⅒ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞
-\end{center}
-For example, instead of writing `|\tfrac12 x|', you may consider it more readable to have
-`|½x|' in the source instead.
-
-If the \cs{tfrac} command exists (i.e., if \pkg{amsmath} is loaded or
-you have specially defined \cs{tfrac} for this purpose), it will be used
-to typeset the fractions. If not, regular \cs{frac} will be used. The command
-to use (\cs{tfrac} or \cs{frac}) can be forced either way with the package
-option |active-frac=small| or |active-frac=normalsize|, respectively.
-
-\subsubsection{Circles}
-
-Unicode defines a large number of different types of circles for a variety
-of mathematical purposes. There are thirteen alone just considering the
-all white and all black ones, shown in \tabref{circles}.
-
-\LaTeX\ defines considerably fewer: \cs{circ} and \cs{bigcirc} for white;
-\cs{bullet} for black. This package maps those commands to \cs{vysmwhtcircle},
-\cs{mdlgwhtcircle}, and \cs{smblkcircle}, respectively.
-
-\begin{table}\centering
-\def\showchar#1#2#3{ \textsc{u}+{\small\ttfamily #1} & \texttt{\string#3} & \umfont \char"#1 \\}
-\begin{tabular}{@{}llc@{}}
-\toprule
-Slot & Command & Glyph \\
-\midrule
-\showchar{00B7}{centerdot}{\cdotp}
-\showchar{22C5}{small middle dot}{\cdot}
-\showchar{2219}{bullet operator}{\vysmblkcircle}
-\showchar{2022}{round bullet, filled}{\smblkcircle}
-\showchar{2981}{z notation spot}{\mdsmblkcircle}
-\showchar{26AB}{medium black circle}{\mdblkcircle}
-\showchar{25CF}{circle, filled}{\mdlgblkcircle}
-\showchar{2B24}{black large circle}{\lgblkcircle}
-\bottomrule
-\end{tabular}
-\def\showchar#1#2#3{ \umfont \char"#1 & \texttt{\string#3} & \textsc{u}+{\small\ttfamily #1} \\}
-\begin{tabular}{@{}cll@{}}
-\toprule
-Glyph & Command & Slot \\
-\midrule
-\\
-\\
-\showchar{2218}{composite function (small circle)}{\vysmwhtcircle}
-\showchar{25E6}{white bullet}{\smwhtcircle}
-\showchar{26AC}{medium small white circle}{\mdsmwhtcircle}
-\showchar{26AA}{medium white circle}{\mdwhtcircle}
-\showchar{25CB}{large circle}{\mdlgwhtcircle}
-\showchar{25EF}{large circle}{\lgwhtcircle}
-\bottomrule
-\end{tabular}
-\caption{Filled and hollow Unicode circles.}
-\tablabel{circles}
-\end{table}
-
-\subsubsection{Triangles}
-
-While there aren't as many different sizes of triangle as there are circle,
-there's some important distinctions to make between a few similar characters. See \tabref{uptriangles} for the full summary.
-
-These triangles all have different intended meanings. Note for backwards
-compatibility with \TeX, \unichar{25B3} has \emph{two} different mappings
-in \pkg{unicode-math}. \cs{bigtriangleup} is intended as a binary operator
-whereas \cs{triangle} is intended to be used as a letter-like symbol.
-
-But you're better off if you're using the latter form to indicate an
-increment to use the glyph intended for this purpose, \unichar{2206}: $\increment x$.
-
-Finally, given that $\triangle$ and $\increment$ are provided for you
-already, it is better off to only use upright Greek Delta $\Delta$ if you're
-actually using it as a symbolic entity such as a variable on its own.
-
-\begin{table}\centering
-\begin{tabular}{@{}llcl@{}}
-\toprule
-Slot & Command & Glyph & Class \\
-\midrule
-\unichar{25B5} & \cs{vartriangle}      & \umfont \char"25B5 & binary \\
-\unichar{25B3} & \cs{bigtriangleup}    & \umfont \char"25B3 & binary \\
-\unichar{25B3} & \cs{triangle}         & \umfont \char"25B3 & ordinary \\
-\unichar{2206} & \cs{increment}        & \umfont \char"2206 & ordinary \\
-\unichar{0394} & \cs{mathup}\cs{Delta} & \umfont \char"0394 & ordinary \\
-\bottomrule
-\end{tabular}
-\caption{Different upwards pointing triangles.}
-\tablabel{uptriangles}
-\end{table}
-
-\iffalse
-\subsubsection{Normalising some input characters}
-
-I believe
-all variant forms should be used as legal input that is normalised to
-a consistent output glyph, because we want to be fault-tolerant in the input.
-Here are the duplicates:
-\begin{quote}\obeylines
-\unichar {251} {latin small letter alpha}
-\unichar {25B} {latin small letter epsilon}
-\unichar {263} {latin small letter gamma}
-\unichar {269} {latin small letter iota}
-\unichar {278} {latin small letter phi}
-\unichar {28A} {latin small letter upsilon}
-\unichar {190} {latin capital letter epsilon}
-\unichar {194} {latin capital letter gamma}
-\unichar {196} {latin capital letter iota}
-\unichar {1B1} {latin capital letter upsilon}
-\end{quote}
-
-(Not yet implemented.)
-\fi
-
-\section{Advanced}
-
-\subsection{Warning messages}
-
-This package can produce a number of informational messages to try and inform the user when something might be going wrong due to package conflicts or something else.
-As an experimental feature, these can be turn off on an individual basis with the package option |warnings-off| which takes a comma-separated list of warnings to suppress.
-A warning will give you its name when printed on the console output; e.g.,
-\begin{Verbatim}
-  * unicode-math warning: "mathtools-colon"
-  *
-  * ... <warning message> ...
-\end{Verbatim}
-This warning could be suppressed by loading the package as follows:
-\begin{Verbatim}
-  \usepackage[warnings-off={mathtools-colon}]{unicode-math}
-\end{Verbatim}
-
-\subsection{Programmer's interface}
-
-(Tentative and under construction.)
-If you are writing some code that needs to know the current
-maths style (\cs{mathbf}, \cs{mathit}, etc.), you can query the
-variable \cs{l_@@_mathstyle_tl}. It will contain the maths style
-without the leading `math' string; for example,
-|\symbf { \show \l_@@_mathstyle_tl }|
-will produce `bf'.
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math-code.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,39 +0,0 @@
-%%^^A%% unicode-math-code.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\documentclass[a4paper]{ltxdoc}
-\input{um-doc-style.tex}
-\begin{document}
-
-\title{Experimental Unicode mathematical typesetting: The \pkg{unicode-math} package}
-\author{\itshape Will Robertson\\\itshape Philipp Stephani, Joseph Wright, Khaled Hosny\\\url{http://github.com/wspr/unicode-math}}
-\date{\umfiledate \qquad \umfileversion}
-
-\maketitle
-\tableofcontents
-
-\def\DTX#1{\clearpage\part{#1}\DocInput{#1}}
-\DTXFILES
-
-\clearpage
-\PrintIndex
-
-\end{document}
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Metadata for the package code, including files and versioning
 
 % \section{Package declaration}
 %
@@ -22,11 +23,13 @@
   \DTX{um-code-fontopt.dtx}
   \DTX{um-code-fontparam.dtx}
   \DTX{um-code-mathmap.dtx}
+  \DTX{um-code-sym-commands.dtx}
+  \DTX{um-code-alphabets.dtx}
   \DTX{um-code-epilogue.dtx}
   \DTX{um-code-primes.dtx}
   \DTX{um-code-sscript.dtx}
   \DTX{um-code-compat.dtx}
-  \DTX{um-code-alphabets.dtx}
+  \DTX{um-code-amsmath.dtx}
 }
 %</dtx>
 %    \end{macrocode}
@@ -52,7 +55,7 @@
 \ProvidesFile{unicode-math.dtx}
 %</dtx>
 %<*base|package>
-  [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX]
+  [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX]
 %</base|package>
 %    \end{macrocode}
 
@@ -67,7 +70,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ins	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% unicode-math.ins -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Docstrip installer.
 
 \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
 \input unicode-math.dtx\relax
@@ -23,17 +24,19 @@
 \nopostamble
 \askforoverwritefalse
 
+\def\FROM#1#2{\from{#1}{#2}}
+\def\FROMDEBUG#1#2{\from{#1}{#2,debug}}
+\ifx\DEBUG\undefined\else\let\FROM\FROMDEBUG\fi
+
 \generate{\file{unicode-math.sty}{
-    \from{unicode-math.dtx}{base}
-    \from{um-code-base.dtx}{base}
+    \FROM{unicode-math.dtx}{base}
+    \FROM{um-code-base.dtx}{base}
   }}
 
-\ifx\UMDEBUG\undefined\def\UMDEBUG{}\else\def\UMDEBUG{,debug}\fi
-
-\def\DTX#1{\from{#1}{package,XE\UMDEBUG}}
+\def\DTX#1{\FROM{#1}{package,XE}}
 \generate{\file{unicode-math-xetex.sty}{\DTXFILES}}
 
-\def\DTX#1{\from{#1}{package,LU\UMDEBUG}}
+\def\DTX#1{\FROM{#1}{package,LU}}
 \generate{\file{unicode-math-luatex.sty}{\DTXFILES}}
 
 \endbatchfile
@@ -48,7 +51,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/unicode-math.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,42 +0,0 @@
-%%^^A%% unicode-math.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\documentclass[a4paper]{ltxdoc}
-\input{um-doc-style.tex}
-\begin{document}
-
-\title{Experimental Unicode mathematical typesetting: The \pkg{unicode-math} package}
-\author{\itshape Will Robertson\\\itshape Philipp Stephani, Joseph Wright, Khaled Hosny\\\url{http://github.com/wspr/unicode-math}}
-\date{\umfiledate \qquad \umfileversion}
-
-\maketitle
-
-\input{um-doc.tex}
-
-\clearpage
-\appendix
-
-\input{um-doc-stixextract.tex}
-\input{um-doc-nfsssummary.tex}
-\input{um-doc-legacyfontdimen.tex}
-\input{um-doc-mathfontdimen.tex}
-
-\end{document}
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/unimath-example.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,68 +0,0 @@
-%%^^A%% unimath-example.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-%%%%%%%%%%%%%%%%%%%%%%%
-% UNICODE-MATH EXAMPLE FILE
-%%%%%%%%%%%%%%%%%%%%%%%
-
-\documentclass{article}
-
-% Load fontspec and define a document font:
-\usepackage{fontspec}
-\setmainfont{texgyrepagella-regular.otf}
-
-% Load unicode-math and define a math font:
-\usepackage{unicode-math}
-\setmathfont{texgyrepagella-math.otf}
-
-\begin{document}
-\title{An example of \textsf{unicode-math}}
-\author{Will Robertson}
-\maketitle
-
-This is an example of the \textsf{unicode-math} package.
-It allows you to write maths with Unicode input and to use fonts that contain Unicode mathematical glyphs. Follow along in the source code to see how it works.
-
-After loading the package and selecting a font, you shouldn't need to change much to continue to write maths as always.
-\[
-   F(s)=\symscr L \{f(t)\}=\int_0^\infty \symup e^{-st}f(t)\,\symup d t
-\]
-
-The style of Latin and Greek letters is set up by default to match the output of standard \LaTeX: Latin letters and Greek lowercase letters are italic, and Greek uppercase letters are upright. These can be configured with the \texttt{math-style} package option.
-
-One very important feature to recognise is that bold maths now works consistently for both Latin and Greek letters. By default, \verb|\symbf| will turn a Latin letter bold and upright, and a Greek letter will remain italic and also become bold. For example:
-\[
-  \symbf{a} = a\,\symbf{I} \qquad \symbf{\beta} = \beta\,\symbf{I}
-\]
-This behaviour can be configured with the \texttt{bold-style} package option.
-
-In the examples above, I've used \LaTeX\ commands to input characters like \verb|\beta|, \verb|\infty|, and so on. These may now be typed directly into the source of the document:
-\[
-   𝐉 = ∇×𝐇 \qquad 𝐁 = μ₀(𝐌 + 𝐇)
-\]
-\[
-  ∫₀³ xⁿφ₁₂(x)\,ⅆx
-\]
-It does not matter if you use upright or italic characters; they will be normalised according to the setting of the \texttt{math-style} and \texttt{bold-style} options.
-
-And that's a brief introduction to the package. Please see the documentation for further details. This is a new package; feedback, suggestions, and bug reports are all most welcome.
-
-\end{document}
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Deleted: trunk/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/source/latex/unicode-math/unimath-symbols.ltx	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,502 +0,0 @@
-%%^^A%% unimath-symbols.ltx -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-%!TEX TS-program = LuaLaTeX
-
-%%%%%%%%%%%%%%%%%%%%%%%
-% SYMBOLS DEFINED BY UNICODE-MATH
-%%%%%%%%%%%%%%%%%%%%%%%
-
-\documentclass[final]{article}
-\makeatletter
-
-\usepackage{ragged2e,setspace,booktabs,catchfile,shortvrb,geometry,metalogo,textcomp,longtable,tabu,hyperref}
-
-\geometry{margin=3cm}
-\hypersetup{colorlinks,linkcolor=black}
-
-\def\cmd#1{\texttt{\textbackslash\expandafter\@gobble\string#1}}
-
-\usepackage{fontspec}
-\setmainfont{texgyrepagella}%
- [
-  Extension = .otf ,
-  UprightFont = *-regular,
-  ItalicFont = *-italic,
-  BoldFont = *-bold,
-  BoldItalicFont = *-bolditalic,
-  Ligatures=TeX,
-  Numbers={Lowercase,Monospaced},
- ]
-\usepackage[math-style=literal,bold-style=literal]{unicode-math}
-
-\ExplSyntaxOn
-\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {c}
-
-\def\defmathfont#1#2#3{
-  \newcounter{#1}
-  \setcounter{#1}{-1}
-  \setmathfont[version=#1,SizeFeatures={
-      {Size=-10, Colour=999999},
-      {Size=10-, Colour=#3}}]{#2}
-  \fontspec_set_fontface:cNnn {#1} \x {ItalicFont={},BoldFont={}} {#2}
-}
-\ExplSyntaxOff
-
-\defmathfont{lm}{latinmodern-math.otf}{CC6666}
-\defmathfont{xits}{xits-math.otf}{CCCC66}
-\defmathfont{stix}{STIXMath-Regular.otf}{AA66CC}
-\defmathfont{cambria}{Cambria Math}{66CCCC}
-\defmathfont{asana}{Asana-Math.otf}{6666CC}
-\defmathfont{pagella}{texgyrepagella-math.otf}{AA6666}
-\defmathfont{dejavu}{texgyredejavu-math.otf}{AACC66}
-\defmathfont{euler}{euler.otf}{CC66CC}
-
-\def\INPUT{\input{unicode-math-table.tex}}
-\def\TABLE{%
-\par\noindent
-\begin{longtabu}[l]{@{}lcccccccclX[l]@{}}
-  \toprule
-  \textsc{usv} & M & X & S & C & A & P & D & E & Macro & Description \\
-  \midrule \endhead
-  \INPUT\\
-  \bottomrule
-\end{longtabu}
-}
-\makeatletter
-\def\USV#1{\footnotesize\scshape\MakeLowercase{u+\@gobble#1}}
-\makeatother
-\def\CMD#1{\footnotesize\cmd#1}
-\def\DESC#1{%
-  \begin{spacing}{0.5}
-    \RaggedRight\scriptsize #1%
-  \end{spacing}
-}
-
-\newcommand\SHOW[1]{%
-  \def\UnicodeMathSymbol##1##2##3##4{%
-    \def\1{#1}\def\2{##3}%
-    \ifx\1\2\PRINTLINE{##1}{##2}{##4}\fi
-  }%
-  \TABLE
-}
-\ExplSyntaxOn
-\def\PRINTLINE#1#2#3{
-    \def\tempa{
-      \USV{#1} &
-      \SYMB{#2}{lm}{#1} &
-      \SYMB{#2}{xits}{#1} &
-      \SYMB{#2}{stix}{#1} &
-      \SYMB{#2}{cambria}{#1} &
-      \SYMB{#2}{asana}{#1} &
-      \SYMB{#2}{pagella}{#1} &
-      \SYMB{#2}{dejavu}{#1} &
-      \SYMB{#2}{euler}{#1} &
-      \CMD{#2}
-      \tl_if_in:NnT \PLAIN {#2}
-        {
-          \makebox[0pt][l]
-            { \color[gray]{0.7} \textsuperscript{\sffamily (p)} }
-        }
-      \tl_if_in:NnT \LTXSYM {#2}
-        {
-          \makebox[0pt][l]
-            { \color[gray]{0.7} \textsuperscript{\sffamily (l)} }
-        }
-      \tl_if_in:NnT \AMSSYMB {#2}
-        {
-          \makebox[0pt][l]
-            { \color[gray]{0.7} \textsuperscript{\sffamily (a)} }
-        }
-      &
-      \DESC{#3} \\
-    }%
-    \expandafter\tempa
-}
-\ExplSyntaxOff
-\def\SYMB#1#2#3{%
-  \expandafter\iffontchar\csname#2\endcsname #3\relax
-    \refstepcounter{#2}%
-    \mathversion{#2}%
-    $\displaystyle#1$%
-  \fi
-}
-
-\def\PLAIN{\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda\mu\nu\xi\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega\varepsilon\vartheta\varpi\varrho\varsigma\varphi\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega
-%
-\aleph\hbar\imath\jmath\ell\wp\Re\Im\partial\infty\prime\emptyset\nabla\surd\top\bot\angle\triangle\forall\exists\neg\flat\natural\sharp\clubsuit\diamondsuit\heartsuit\spadesuit
-%
-\coprod\bigvee\bigwedge\biguplus\bigcap\bigcup\int\prod\sum\bigotimes\bigoplus\bigodot\oint\bigsqcup\smallint
-%
-\triangleleft\triangleright\bigtriangleup\bigtriangledown\wedge\land\vee\lor\cap\cup\ddagger\dagger\sqcap\sqcup\uplus\amalg\diamond\bullet\wr\div\odot\oslash\otimes\ominus\oplus\mp\pm\circ\bigcirc\setminus\cdot\ast\times\star\propto\sqsubseteq\sqsupseteq\parallel\mid\dashv\vdash\nearrow\searrow\nwarrow\swarrow\Leftrightarrow\Leftarrow\Rightarrow\neq\ne\lnot\leq\le\geq\ge\succ\prec\approx\succeq\preceq\supset\subset\supseteq\subseteq\in\ni\owns\gg\ll\not\leftrightarrow\leftarrow\gets\rightarrow\to\mapstochar\mapsto\sim\simeq\perp\equiv\asymp\smile\frown\leftharpoonup\leftharpoondown\rightharpoonup\rightharpoondown
-%
-\joinrel\relbar\Relbar\lhook\hookrightarrow\rhook\hookleftarrow\bowtie\models\Longrightarrow\longrightarrow\longleftarrow\Longleftarrow\longmapsto\longleftrightarrow\Longleftrightarrow\iff
-%
-\ldotp\cdotp\colon\ldots\cdots\vdots\ddots
-%
-\acute\grave\ddot\tilde\bar\breve\check\hat\vec\dot\widetilde\widehat
-%
-\overrightarrow\overleftarrow\overbrace\underbrace\lmoustache\rmoustache\lgroup\rgroup\arrowvert\Arrowvert\bracevert\Vert\vert\uparrow\downarrow\updownarrow\Uparrow\Downarrow\Updownarrow\backslash\rangle\langle\rbrace\lbrace\rceil\lceil\rfloor\lfloor\sqrt}
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/
-
-\def\LTXSYM{
-\cong
-\notin
-\rightleftharpoons
-\doteq
-\mathring
-}
-
-\def\AMSSYMB{\boxdot\boxplus\boxtimes\square\blacksquare\centerdot\lozenge\blacklozenge\circlearrowright\circlearrowleft\leftrightharpoons\boxminus\Vdash\Vvdash\vDash\twoheadrightarrow\twoheadleftarrow\leftleftarrows\rightrightarrows\upuparrows\downdownarrows\upharpoonright\restriction\downharpoonright\upharpoonleft\downharpoonleft\rightarrowtail\leftarrowtail\leftrightarrows\rightleftarrows\Lsh\Rsh\rightsquigarrow\leftrightsquigarrow\looparrowleft\looparrowright\circeq\succsim\gtrsim\gtrapprox\multimap\therefore\because\doteqdot\Doteq\triangleq\precsim\lesssim\lessapprox\eqslantless\eqslantgtr\curlyeqprec\curlyeqsucc\preccurlyeq\leqq\leqslant\lessgtr\backprime\risingdotseq\fallingdotseq\succcurlyeq\geqq\geqslant\gtrless\vartriangleright\vartriangleleft\trianglerighteq\trianglelefteq\bigstar\between\blacktriangledown\blacktriangleright\blacktriangleleft\vartriangle\blacktriangle\triangledown\eqcirc\lesseqgtr\gtreqless\lesseqqgtr\gtreqqless\Rrightarrow\Lleftarrow\veebar\barwedge\doublebarwedge\measuredangle\sphericalangle\varpropto\smallsmile\smallfrown\Subset\Supset\Cup\doublecup\Cap\doublecap\curlywedge\curlyvee\leftthreetimes\rightthreetimes\subseteqq\supseteqq\bumpeq\Bumpeq\lll\llless\ggg\gggtr\circledS\pitchfork\dotplus\backsim\backsimeq\complement\intercal\circledcirc\circledast\circleddash\lvertneqq\gvertneqq\nleq\ngeq\nless\ngtr\nprec\nsucc\lneqq\gneqq\nleqslant\ngeqslant\lneq\gneq\npreceq\nsucceq\precnsim\succnsim\lnsim\gnsim\nleqq\ngeqq\precneqq\succneqq\precnapprox\succnapprox\lnapprox\gnapprox\nsim\ncong\diagup\diagdown\varsubsetneq\varsupsetneq\nsubseteqq\nsupseteqq\subsetneqq\supsetneqq\varsubsetneqq\varsupsetneqq\subsetneq\supsetneq\nsubseteq\nsupseteq\nparallel\nmid\nshortmid\nshortparallel\nvdash\nVdash\nvDash\nVDash\ntrianglerighteq\ntrianglelefteq\ntriangleleft\ntriangleright\nleftarrow\nrightarrow\nLeftarrow\nRightarrow\nLeftrightarrow\nleftrightarrow\divideontimes\varnothing\nexists\Finv\Game\eth\eqsim\beth\gimel\daleth\lessdot\gtrdot\ltimes\rtimes\shortmid\shortparallel\smallsetminu!
 s\thicksim\thickapprox\approxeq\succapprox\precapprox\curvearrowleft\curvearrowright\digamma\varkappa\Bbbk\hslash\backepsilon}
-
-\input{unicode-math.dtx}
-\makeatletter
-\def\GetFileInfo#1{%
-  \def\filename{#1}%
-  \def\@tempb##1 ##2 ##3\relax##4\relax{%
-    \def\filedate{##1}%
-    \def\fileversion{##2}%
-    \def\fileinfo{##3}}%
-  \edef\@tempa{\csname ver@#1\endcsname}%
-  \expandafter\@tempb\@tempa\relax? ? \relax\relax}
-\makeatother
-\GetFileInfo{unicode-math.dtx}
-\let\umfiledate\filedate
-\let\umfileversion\fileversion
-
-\begin{document}
-\MakeShortVerb\|
-\title{Every symbol (most symbols) defined by \textsf{unicode-math}}
-\author{Will Robertson}
-\date{\umfiledate \qquad \umfileversion}
-\maketitle
-
-This document uses the file \texttt{unicode-math-table.tex}
-to print every symbol defined by the \textsf{unicode-math}
-package.
-Use this document to find the command name or the Unicode glyph slot for a symbol that you wish to use.
-The following fonts are shown: (with approximate symbol counts)
-\begin{itemize}
-\item[M] \mathversion{lm} $\mathup{Latin\ Modern\ Math}$ (\ref{count:lm})
-\item[X] \mathversion{xits} $\mathup{XITS\ Math}$ (\ref{count:xits})
-\item[S] \mathversion{stix} $\mathup{STIX\ Math}$ (\ref{count:stix})
-\item[C] \mathversion{cambria} $\mathup{Cambria\ Math}$ (\ref{count:cambria})
-\item[A] \mathversion{asana} $\mathup{Asana\ Math}$ (\ref{count:asana})
-\item[P] \mathversion{pagella} $\mathup{TeX\ Gyre\ Pagella\ Math}$ (\ref{count:pagella})
-\item[D] \mathversion{dejavu} $\mathup{DejaVu\ Math\ TeX\ Gyre}$ (\ref{count:dejavu})
-\item[E] \mathversion{euler} $\mathup{Neo\ Euler}$ (\ref{count:euler})
-\end{itemize}
-Note that there are addition maths fonts in the `\TeX\ Gyre' collection which aren't included here.
-
-Symbols defined in Plain \TeX\ are indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (p)}} after their macro name.
-\LaTeX\ follows Plain \TeX, but defines a handful more, indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (l)}}
-Symbols defined in \textsf{amssymb} are indicated with {\color[gray]{0.6} \textsuperscript{\sffamily (a)}}.
-
-\tableofcontents
-
-\clearpage
-\section{Opening symbols, \cmd\mathopen}
-\begingroup
-\def\sqrt{\sqrtsign{}}
-\def\longdivision{\longdivisionsign{}}
-\SHOW\mathopen
-\endgroup
-
-\clearpage
-\section{Closing symbols, \cmd\mathclose}
-\SHOW\mathclose
-
-\clearpage
-\section{Fence symbols, \cmd\mathfence}
-\SHOW\mathfence
-
-\section{Punctuation symbols, \cmd\mathpunct}
-\SHOW\mathpunct
-
-\section{`Over' symbols, \cmd\mathover}
-\begingroup
-\def\SYMB#1#2#3{%
-  \expandafter\iffontchar\csname#2\endcsname #3\relax
-    \refstepcounter{#2}%
-    \mathversion{#2}%
-    $\displaystyle #1{\mitx+\mity}$%
-  \fi
-}
-\SHOW\mathover
-\endgroup
-
-
-\section{`Under' symbols, \cmd\mathunder}
-\begingroup
-\def\SYMB#1#2#3{%
-  \expandafter\iffontchar\csname#2\endcsname #3\relax
-    \refstepcounter{#2}%
-    \mathversion{#2}%
-    $\displaystyle #1{\mitx+\mity}$%
-  \fi
-}
-\SHOW\mathunder
-\endgroup
-
-\clearpage
-\section{Accents, \cmd\mathaccent}
-
-Note that accents will only be properly placed if used with an OpenType font with the necessary information.
-
-\begingroup
-\def\SYMB#1#2#3{%
-  \expandafter\iffontchar\csname#2\endcsname #3\relax
-    \refstepcounter{#2}%
-    \mathversion{#2}%
-    $\displaystyle#1 \mitx$%
-  \fi
-}
-\SHOW\mathaccent
-\endgroup
-
-\section{Bottom accents, \cmd\mathbotaccent}
-\begingroup
-\def\SYMB#1#2#3{%
-  \expandafter\iffontchar\csname#2\endcsname #3\relax
-    \refstepcounter{#2}%
-    \mathversion{#2}%
-    $\displaystyle#1 \mitx$%
-  \fi
-}
-\SHOW\mathbotaccent
-\endgroup
-
-\clearpage
-\section{Big operators, \cmd\mathop}
-
-Of the operators shown below, a subset need to be flagged by \textsf{unicode-math} for \cmd\nolimits\ adjustments.
-The limits behaviour as specified by \textsf{unicode-math} are shown with grey subscripts and superscripts.
-\begingroup
-\def\SYMB#1#2#3{%
-  \expandafter\iffontchar\csname#2\endcsname #3\relax
-    \stepcounter{#2}%
-    \mathversion{#2}%
-    $\displaystyle#1_0^1$%
-  \fi
-}
-\SHOW\mathop
-\endgroup
-
-\section{Binary relations, \cmd\mathbin}
-\SHOW\mathbin
-
-\clearpage
-\section{Ordinary symbols, \cmd\mathord}
-\SHOW\mathord
-
-\clearpage
-\section{Relation symbols, \cmd\mathrel}
-\SHOW\mathrel
-
-\clearpage
-\section{Alphabetical symbols, \cmd\mathalpha}
-
-% first read in all \mathalpha symbols into a variable:
-\ExplSyntaxOn
-\cs_set:Npn \UnicodeMathSymbol #1#2#3#4 {
-  \str_if_eq:nnT {\mathalpha} {#3} {
-    \exp_not:n { \UnicodeMathSymbol {#1}{#2}{#3}{#4} }
-  }
-}
-\CatchFileEdef
-  \ALPHA{unicode-math-table.tex}
-  {\char_set_catcode_space:N \ }
-
-% now each time we print an alphabet we remove the slot;
-% this ensures we won't miss anything
-
-\def\INPUT{\ALPHA}
-\cs_new:Npn \SLOTS #1#2 {
-  \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 {
-    \bool_lazy_and:nnT
-      { \int_compare_p:n {##1 >= #1} }
-      { \int_compare_p:n {##1 <= #2} }
-      {
-        \PRINTLINE{##1}{##2}{##4}
-      }
-  }
-  \TABLE
-  \cs_set:Npn \UnicodeMathSymbol ##1##2##3##4 {
-    \bool_lazy_or:nnT
-      { \int_compare_p:n {##1 > #2} }
-      { \int_compare_p:n {##1 < #1} }
-      {
-        \exp_not:n { \UnicodeMathSymbol {##1}{##2}{##3}{##4} }
-      }
-  }
-  \edef\ALPHA{\ALPHA}
-}
-
-\ExplSyntaxOff
-
-\subsection{Normal weight}
-
-\subsubsection{Upright Greek, uppercase}
-\SLOTS{"00391}{"003A9}
-
-\subsubsection{Upright Greek, lowercase}
-\SLOTS{"003B1}{"003F5}
-
-\subsubsection{Italic, Latin, uppercase}
-\SLOTS{"1D434}{"1D44D}
-
-\subsubsection{Italic, Latin, lowercase}
-\SLOTS{"1D44E}{"1D467}
-
-\subsubsection{Italic Greek, uppercase}
-\SLOTS{"1D6E2}{"1D6FA}
-
-\subsubsection{Italic Greek, lowercase}
-\SLOTS{"1D6FC}{"1D71B}
-
-\subsubsection{Script, Latin, uppercase}
-\SLOTS{"1D49C}{"1D4B5}
-
-\subsubsection{Script, Latin, lowercase}
-\SLOTS{"1D4B6}{"1D4CF}
-
-\subsubsection{Fraktur, Latin, uppercase}
-\SLOTS{"1D504}{"1D51C}
-
-\subsubsection{Fraktur, Latin, lowercase}
-\SLOTS{"1D51E}{"1D537}
-
-\subsubsection{Blackboard, Latin, uppercase}
-\SLOTS{"1D538}{"1D550}
-
-\subsubsection{Blackboard, Latin, lowercase}
-\SLOTS{"1D552}{"1D56B}
-
-\subsubsection{Sans serif, Latin, uppercase}
-\SLOTS{"1D5A0}{"1D5B9}
-
-\subsubsection{Sans serif, Latin, lowercase}
-\SLOTS{"1D5BA}{"1D5D3}
-
-\subsubsection{Italic sans serif, Latin, uppercase}
-\SLOTS{"1D608}{"1D621}
-
-\subsubsection{Italic sans serif, Latin, lowercase}
-\SLOTS{"1D622}{"1D63B}
-
-\subsubsection{Typewriter, Latin, uppercase}
-\SLOTS{"1D670}{"1D689}
-
-\subsubsection{Typewriter, Latin, lowercase}
-\SLOTS{"1D68A}{"1D6A3}
-
-\subsection{Bold}
-
-\subsubsection{Bold, Latin, uppercase}
-\SLOTS{"1D400}{"1D419}
-
-\subsubsection{Bold, Latin, lowercase}
-\SLOTS{"1D41A}{"1D433}
-
-\subsubsection{Bold Greek, uppercase}
-\SLOTS{"1D6A8}{"1D6C0}
-
-\subsubsection{Bold Greek, lowercase}
-\SLOTS{"1D6C2}{"1D6E1}
-
-\subsubsection{Bold italic, Latin, uppercase}
-\SLOTS{"1D468}{"1D481}
-
-\subsubsection{Bold italic, Latin, lowercase}
-\SLOTS{"1D482}{"1D49B}
-
-\subsubsection{Bold italic Greek, uppercase}
-\SLOTS{"1D71C}{"1D734}
-
-\subsubsection{Bold italic Greek, lowercase}
-\SLOTS{"1D736}{"1D755}
-
-\subsubsection{Bold script, Latin, uppercase}
-\SLOTS{"1D4D0}{"1D4E9}
-
-\subsubsection{Bold script, Latin, lowercase}
-\SLOTS{"1D4EA}{"1D503}
-
-\subsubsection{Bold fraktur, Latin, uppercase}
-\SLOTS{"1D56C}{"1D585}
-
-\subsubsection{Bold fraktur, Latin, lowercase}
-\SLOTS{"1D586}{"1D59F}
-
-\subsubsection{Bold sans serif, Latin, uppercase}
-\SLOTS{"1D5D4}{"1D5ED}
-
-\subsubsection{Bold sans serif, Latin, lowercase}
-\SLOTS{"1D5EE}{"1D607}
-
-\subsubsection{Bold italic sans serif, Latin, uppercase}
-\SLOTS{"1D63C}{"1D655}
-
-\subsubsection{Bold italic sans serif, Latin, lowercase}
-\SLOTS{"1D656}{"1D66F}
-
-\subsubsection{Bold sans serif Greek, uppercase}
-\SLOTS{"1D756}{"1D76E}
-
-\subsubsection{Bold sans serif Greek, lowercase}
-\SLOTS{"1D770}{"1D78F}
-
-\subsubsection{Bold italic sans serif Greek, uppercase}
-\SLOTS{"1D790}{"1D7A8}
-
-\subsubsection{Bold italic sans serif Greek, lowercase}
-\SLOTS{"1D7AA}{"1D7C9}
-
-\subsection{Miscellaneous}
-\def\UnicodeMathSymbol#1#2#3#4{\PRINTLINE{#1}{#2}{#4}}
-\TABLE
-
-\refstepcounter{lm}\label{count:lm}
-\refstepcounter{xits}\label{count:xits}
-\refstepcounter{stix}\label{count:stix}
-\refstepcounter{cambria}\label{count:cambria}
-\refstepcounter{asana}\label{count:asana}
-\refstepcounter{pagella}\label{count:pagella}
-\refstepcounter{euler}\label{count:euler}
-\refstepcounter{dejavu}\label{count:dejavu}
-
-\end{document}
-
-\endinput
-
-% /©
-%
-% ------------------------------------------------
-% The UNICODE-MATH package  <wspr.io/unicode-math>
-% ------------------------------------------------
-% This package is free software and may be redistributed and/or modified under
-% the conditions of the LaTeX Project Public License, version 1.3c or higher
-% (your choice): <http://www.latex-project.org/lppl/>.
-% ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
-% Copyright 2010-2017  Philipp Stephani
-% Copyright 2011-2017  Joseph Wright
-% Copyright 2012-2015  Khaled Hosny
-% ------------------------------------------------
-%
-% ©/

Modified: trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty	2018-01-07 23:46:58 UTC (rev 46240)
@@ -19,11 +19,13 @@
 %% um-code-fontopt.dtx  (with options: `package,LU')
 %% um-code-fontparam.dtx  (with options: `package,LU')
 %% um-code-mathmap.dtx  (with options: `package,LU')
+%% um-code-sym-commands.dtx  (with options: `package,LU')
+%% um-code-alphabets.dtx  (with options: `package,LU')
 %% um-code-epilogue.dtx  (with options: `package,LU')
 %% um-code-primes.dtx  (with options: `package,LU')
 %% um-code-sscript.dtx  (with options: `package,LU')
 %% um-code-compat.dtx  (with options: `package,LU')
-%% um-code-alphabets.dtx  (with options: `package,LU')
+%% um-code-amsmath.dtx  (with options: `package,LU')
 %% ------------------------------------------------
 %% The UNICODE-MATH package  <wspr.io/unicode-math>
 %% ------------------------------------------------
@@ -37,20 +39,28 @@
 %% Copyright 2012-2015  Khaled Hosny
 %% ------------------------------------------------
 %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Metadata for the package code, including files and versioning
 
 \ProvidesPackage{unicode-math-luatex}
-  [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX]
+  [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX]
 
 %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine.
 
 
 %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Assorted initialisation tasks, including some low-level function definitions.
 
 \RequirePackage{lualatex-math}
 \ExplSyntaxOn
 \cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: }
 \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx}
-\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx}
+\cs_generate_variant:Nn \prop_get:NnNTF {cx}
+\cs_generate_variant:Nn \tl_if_eq:nnF {o}
+\cs_set_eq:NN \__um_group_begin: \group_begin:
+\cs_set_eq:NN \__um_group_end:   \group_end:
+\cs_set_eq:NN \__um_group_begin_frozen: \__um_group_begin:
+\cs_set_eq:NN \__um_group_end_frozen:   \__um_group_end:
 \prg_new_conditional:Nnn \__um_glyph_if_exist:Nn {p,TF,T,F}
   {
     \etex_iffontchar:D #1 #2 \scan_stop:
@@ -59,6 +69,11 @@
       \prg_return_false:
     \fi:
   }
+\cs_set_protected:Nn \__um_fontface_gset_eq:NN
+  {
+    \tex_global:D \tex_let:D #1 #2
+  }
+\cs_generate_variant:Nn \__um_fontface_gset_eq:NN {NV,cV}
 \cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4
   {
     \Umathcode \int_eval:n {#1} =
@@ -93,23 +108,31 @@
   }
 \cs_new:Nn \__um_char_gmake_mathactive:N
   {
-    \global\mathcode `#1 = "8000 \scan_stop:
+    \tex_global:D \tex_mathcode:D `#1 = "8000 \scan_stop:
   }
 \cs_new:Nn \__um_char_gmake_mathactive:n
   {
-    \global\mathcode #1 = "8000 \scan_stop:
+    \tex_global:D \tex_mathcode:D \int_eval:n {#1} = "8000 \scan_stop:
   }
-\cs_new:Nn \__um_copy_fontparam:nnn
+\cs_new:Nn \__um_mathactive_remap:nn
   {
-    \fontdimen #1 \font = \__um_get_fontparam:nn {#2} {#3}
+    \group_begin:
+      \cs_set_protected:Npn \__um_tmp: {#2}
+      \__um_char_gmake_mathactive:n {#1}
+      \char_gset_active_eq:nN {#1} \__um_tmp:
+    \group_end:
   }
-\cs_new:Nn \__um_zero_fontparam:n
+\cs_new:Nn \__um_copy_fontdimen:nnN
   {
+    \fontdimen #1 \font = \the \fontdimen #2 #3 \relax
+  }
+\cs_new:Nn \__um_zero_fontdimen:n
+  {
     \fontdimen #1 \font = 0pt\relax
   }
-\cs_new:Nn \__um_get_fontparam:nn
+\cs_new_protected:Nn \__um_fontdimen_from_param:nn
   {
-    \directlua{fontspec.mathfontdimen("l__um_font","#2")}
+    \fontdimen #1 \font = \directlua{fontspec.mathfontdimen(font.current(),"#2")}\relax
   }
 \cs_new:Nn \usv_set:nnn  { \tl_const:cn { c__um_#1_#2_usv } {#3} }
 \cs_new:Nn \__um_to_usv:nn {       \use:c { c__um_#1_#2_usv } }
@@ -137,13 +160,22 @@
   {
     \tl_remove_once:Nn \@preamblecmds {\do#1}
   }
+\cs_new:Npn \__um_error:n     { \msg_error:nn     {unicode-math} }
+\cs_new:Npn \__um_error:nx    { \msg_error:nnx    {unicode-math} }
+\cs_new:Npn \__um_warning:n   { \msg_warning:nn   {unicode-math} }
+\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} }
+\cs_new:Npn \__um_log:n       { \msg_log:nn       {unicode-math} }
+\cs_new:Npn \__um_log:nx      { \msg_log:nnx      {unicode-math} }
+\cs_generate_variant:Nn \msg_new:nnn  {nnx}
+\cs_generate_variant:Nn \msg_new:nnnn {nnxx}
+\cs_new:Nn \__um_msg_new:nn  { \msg_new:nnx  {unicode-math} {#1} { \tl_trim_spaces:n {#2} } }
 
 %%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Declaration of all code-level variables used in the package.
 
 \bool_new:N \l__um_ot_math_bool
 \bool_new:N \l__um_init_bool
 \bool_new:N \l__um_implicit_alph_bool
-\bool_new:N \g__um_mainfont_already_set_bool
 \bool_new:N \g__um_literal_bool
 \bool_new:N \g__um_upLatin_bool
 \bool_new:N \g__um_uplatin_bool
@@ -168,6 +200,8 @@
 \bool_new:N \g__um_mathsf_text_bool
 \bool_new:N \g__um_mathtt_text_bool
 \int_new:N \g__um_fam_int
+\int_new:N \g__um_fonts_used_int
+\int_new:N \l__um_primecount_int
 \tl_const:Nn \c__um_math_alphabet_name_latin_tl {Latin,~lowercase}
 \tl_const:Nn \c__um_math_alphabet_name_Latin_tl {Latin,~uppercase}
 \tl_const:Nn \c__um_math_alphabet_name_greek_tl {Greek,~lowercase}
@@ -178,17 +212,31 @@
 \tl_new:N \l__um_radicals_tl
 \tl_new:N \l__um_nolimits_tl
 \tl_new:N \g__um_operator_mathfont_tl
-\seq_new:N \l__um_missing_alph_seq
-\seq_new:N \l__um_mathalph_seq
-\seq_new:N \l__um_char_range_seq
-\seq_new:N \l__um_mclass_range_seq
-\seq_new:N \l__um_cmd_range_seq
-\clist_new:N  \g__um_alphabets_seq
-\clist_set:Nn \g__um_alphabets_seq { latin, Latin, greek, Greek, num }
-\clist_new:N \g__um_named_ranges_clist
+\tl_new:N \g__um_slash_delimiter_usv
+\tl_new:N \g__um_mathtable_tl
+\tl_new:N \g__um_fontname_tl
+\tl_new:N \g__um_mversion_tl
+\tl_new:N \g__um_symfont_tl
+\tl_new:N \g__um_font_keyval_tl
+\tl_new:N \g__um_family_tl
+\tl_new:N \g__um_style_tl
+\tl_new:N \g__um_remap_style_tl
+\tl_new:N \l__um_not_token_name_tl
+\tl_new:N \g__um_curr_font_cmd_tl
+\tl_new:N \g__um_sqrt_font_cmd_tl
+\tl_new:N \g__um_prime_font_cmd_tl
+\tl_new:N \g__um_mathparam_store_tl
 \clist_new:N \g__um_char_nrange_clist
 \clist_new:N \g__um_unknown_keys_clist
 \clist_new:N \g__um_alphabet_clist
+\clist_new:N \g__um_bad_alpha_clist
+\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bf} }
+\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {sf} }
+\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bfsf} }
+\seq_new:N \l__um_missing_alph_seq
+\seq_new:N \g__um_mathalph_seq
+\seq_new:N \g__um_char_range_seq
+\seq_new:N \g__um_mclass_range_seq
 \seq_new:N \g__um_mathclasses_seq
 \seq_set_from_clist:Nn \g__um_mathclasses_seq
   {
@@ -196,29 +244,20 @@
      \mathop,
     \mathopen,\mathclose,
     \mathfence,\mathover,\mathunder,
-     \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide
+     \mathaccent,\mathaccentoverlay,\mathbotaccent,\mathaccentwide,\mathbotaccentwide
   }
-
 \seq_new:N \g__um_default_mathalph_seq
-\seq_new:N \g__um_named_ranges_seq
 \seq_new:N \g__um_mathstyles_seq
+\prop_new:N \g__um_supers_prop
+\prop_new:N \g__um_subs_prop
 \muskip_new:N \g__um_primekern_muskip
 \muskip_gset:Nn \g__um_primekern_muskip { -\thinmuskip/2 }% arbitrary
-\int_new:N \l__um_primecount_int
-\prop_new:N \g__um_supers_prop
-\prop_new:N \g__um_subs_prop
-\tl_new:N \l_not_token_name_tl
-\tl_new:N \g__um_slash_delimiter_usv
-\tl_new:N \g__um_mathtable_tl
-\tl_new:N \g__um_fontname_tl
-\tl_new:N \g__um_mversion_tl
-\tl_new:N \g__um_symfont_tl
-\tl_new:N \g__um_font_keyval_tl
-\tl_new:N \g__um_family_tl
-\tl_new:N \g__um_style_tl
-\tl_new:N \g__um_remap_style_tl
+\fp_new:N \g__um_size_tfsf_fp
+\fp_new:N \g__um_size_sfssf_fp
+\quark_new:N \q_unicode_math
 
 %%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The (underdeveloped) API to interface with the package internals.
 
 \cs_new:Nn \unimath_get_mathstyle:
  {
@@ -226,6 +265,7 @@
  }
 
 %%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The xparse user interface top-level definitions.
 
 \NewDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} }
 \NewDocumentCommand \setmathfont { O{} m O{} }
@@ -252,19 +292,20 @@
   }
 
 %%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Package options.
 
 \cs_new:Nn \__um_keys_choices:nn
- {
-  \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} }
-  \use:x
-   {
-    \exp_not:N \keys_define:nn {unicode-math}
-     {
-      #1 .choice: ,
-      \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn
-     }
-   }
- }
+  {
+    \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} }
+    \use:x
+      {
+        \exp_not:N \keys_define:nn {unicode-math}
+          {
+            #1 .choice: ,
+            \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn
+          }
+      }
+  }
 \cs_new:Nn \__um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , }
 \cs_new:Nn \__um_tl_map_dbl:nN
   {
@@ -278,37 +319,37 @@
     \__um_tl_map_dbl:Nnn #1
  }
 \__um_keys_choices:nn {mathup}
- {
-  {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
+  }
 \__um_keys_choices:nn {mathrm}
- {
-  {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
+  }
 \__um_keys_choices:nn {mathit}
- {
-  {sym}  { \bool_set_false:N \g__um_mathit_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathit_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathit_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathit_text_bool }
+  }
 \__um_keys_choices:nn {mathbf}
- {
-  {sym}  { \bool_set_false:N \g__um_mathbf_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathbf_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathbf_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathbf_text_bool }
+  }
 \__um_keys_choices:nn {mathsf}
- {
-  {sym}  { \bool_set_false:N \g__um_mathsf_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathsf_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathsf_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathsf_text_bool }
+  }
 \__um_keys_choices:nn {mathtt}
- {
-  {sym}  { \bool_set_false:N \g__um_mathtt_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathtt_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathtt_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathtt_text_bool }
+  }
 \__um_keys_choices:nn {normal-style}
- {
+  {
        {ISO} {
               \bool_set_false:N \g__um_literal_bool
               \bool_set_false:N \g__um_upGreek_bool
@@ -340,9 +381,9 @@
    {literal} {
               \bool_set_true:N  \g__um_literal_bool
              }
- }
+  }
 \__um_keys_choices:nn {math-style}
- {
+  {
       {ISO} {
              \unimathsetup { nabla=upright, partial=italic,
               normal-style=ISO, bold-style=ISO, sans-style=italic }
@@ -363,9 +404,9 @@
              \unimathsetup { colon=literal, nabla=literal, partial=literal,
                normal-style=literal, bold-style=literal, sans-style=literal }
             }
- }
+  }
 \__um_keys_choices:nn {bold-style}
- {
+  {
       {ISO} {
              \bool_set_false:N \g__um_bfliteral_bool
              \bool_set_false:N \g__um_bfupGreek_bool
@@ -390,67 +431,71 @@
   {literal} {
              \bool_set_true:N  \g__um_bfliteral_bool
             }
- }
+  }
 \__um_keys_choices:nn {sans-style}
- {
-  {italic}  { \bool_set_false:N \g__um_upsans_bool    }
-  {upright} { \bool_set_true:N  \g__um_upsans_bool    }
-  {literal} { \bool_set_true:N  \g__um_sfliteral_bool }
- }
+  {
+    {italic}  { \bool_set_false:N \g__um_upsans_bool    }
+    {upright} { \bool_set_true:N  \g__um_upsans_bool    }
+    {literal} { \bool_set_true:N  \g__um_sfliteral_bool }
+  }
 \__um_keys_choices:nn {nabla}
- {
-  {upright} {
-              \bool_set_false:N \g__um_literal_Nabla_bool
-              \bool_set_true:N  \g__um_upNabla_bool
-            }
-  {italic}  {
-              \bool_set_false:N \g__um_literal_Nabla_bool
-              \bool_set_false:N \g__um_upNabla_bool
-            }
-  {literal} { \bool_set_true:N  \g__um_literal_Nabla_bool }
- }
+  {
+    {upright} {
+                \bool_set_false:N \g__um_literal_Nabla_bool
+                \bool_set_true:N  \g__um_upNabla_bool
+              }
+    {italic}  {
+                \bool_set_false:N \g__um_literal_Nabla_bool
+                \bool_set_false:N \g__um_upNabla_bool
+              }
+    {literal} {
+                \bool_set_true:N  \g__um_literal_Nabla_bool
+              }
+  }
 \__um_keys_choices:nn {partial}
- {
-  {upright} {
-              \bool_set_false:N \g__um_literal_partial_bool
-              \bool_set_true:N  \g__um_uppartial_bool
-            }
-  {italic}  {
-              \bool_set_false:N \g__um_literal_partial_bool
-              \bool_set_false:N \g__um_uppartial_bool
-            }
-  {literal} { \bool_set_true:N  \g__um_literal_partial_bool }
- }
+  {
+   {upright} {
+               \bool_set_false:N \g__um_literal_partial_bool
+               \bool_set_true:N  \g__um_uppartial_bool
+             }
+   {italic}  {
+               \bool_set_false:N \g__um_literal_partial_bool
+               \bool_set_false:N \g__um_uppartial_bool
+             }
+   {literal} {
+               \bool_set_true:N  \g__um_literal_partial_bool
+             }
+  }
 \__um_keys_choices:nn {colon}
- {
-  {literal} { \bool_set_true:N  \g__um_literal_colon_bool }
-  {TeX}     { \bool_set_false:N \g__um_literal_colon_bool }
- }
+  {
+    {literal} { \bool_set_true:N  \g__um_literal_colon_bool }
+    {TeX}     { \bool_set_false:N \g__um_literal_colon_bool }
+  }
 \__um_keys_choices:nn {slash-delimiter}
- {
-  {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} }
-  {frac}  { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} }
-  {div}   { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} }
- }
+  {
+    {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} }
+    {frac}  { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} }
+    {div}   { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} }
+  }
 \__um_keys_choices:nn {active-frac}
- {
-   {small}
-   {
-    \cs_if_exist:NTF \tfrac
-     { \bool_set_true:N \l__um_smallfrac_bool }
-     {
-      \__um_warning:n {no-tfrac}
+  {
+    {small}
+    {
+      \cs_if_exist:NTF \tfrac
+        { \bool_set_true:N \l__um_smallfrac_bool }
+        {
+          \__um_warning:n {no-tfrac}
+          \bool_set_false:N \l__um_smallfrac_bool
+        }
+      \use:c {__um_setup_active_frac:}
+    }
+
+    {normalsize}
+    {
       \bool_set_false:N \l__um_smallfrac_bool
-     }
-    \use:c {__um_setup_active_frac:}
-   }
-
-   {normalsize}
-   {
-    \bool_set_false:N \l__um_smallfrac_bool
-    \use:c {__um_setup_active_frac:}
-   }
- }
+      \use:c {__um_setup_active_frac:}
+    }
+  }
 \keys_define:nn {unicode-math}
   {
     warnings-off .code:n =
@@ -460,11 +505,11 @@
       }
   }
 \__um_keys_choices:nn {trace}
- {
-  {on}    {} % default
-  {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
-  {off}   { \msg_redirect_module:nnn { unicode-math } { log } { none } }
- }
+  {
+    {on}    {} % default
+    {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
+    {off}   { \msg_redirect_module:nnn { unicode-math } { log } { none } }
+  }
 \unimathsetup {math-style=TeX}
 \unimathsetup {slash-delimiter=ascii}
 \unimathsetup {trace=off}
@@ -473,348 +518,362 @@
 \ProcessKeysOptions {unicode-math}
 
 %%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definitions of error, warning, and log messages.
 
-\cs_new:Npn \__um_error:n   { \msg_error:nn   {unicode-math} }
-\cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} }
-\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} }
-\cs_new:Npn \__um_log:n     { \msg_log:nn     {unicode-math} }
-\cs_new:Npn \__um_log:nx    { \msg_log:nnx    {unicode-math} }
-\msg_new:nnn {unicode-math} {no-tfrac}
+\char_set_catcode_space:n {32}
+\__um_msg_new:nn {no-tfrac}
 {
-  Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\
-  Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math.
+  Small fraction command \protect\tfrac\ not defined.\\
+  Load amsmath or define it manually before loading unicode-math.
 }
-\msg_new:nnn {unicode-math} {default-math-font}
+\__um_msg_new:nn {default-math-font}
 {
-  Defining~ the~ default~ maths~ font~ as~ '\l__um_fontname_tl'.
+  Defining the default maths font as '\l__um_fontname_tl'.
 }
-\msg_new:nnn {unicode-math} {setup-implicit}
+\__um_msg_new:nn {setup-implicit}
 {
-  Setup~ alphabets:~ implicit~ mode.
+  Setup alphabets: implicit mode.
 }
-\msg_new:nnn {unicode-math} {setup-explicit}
+\__um_msg_new:nn {setup-explicit}
 {
-  Setup~ alphabets:~ explicit~ mode.
+  Setup alphabets: explicit mode.
 }
-\msg_new:nnn {unicode-math} {alph-initialise}
+\__um_msg_new:nn {alph-initialise}
 {
-  Initialising~ \@backslashchar math#1.
+  Initialising \@backslashchar math#1.
 }
-\msg_new:nnn {unicode-math} {setup-alph}
+\__um_msg_new:nn {setup-alph}
 {
-  Setup~ alphabet:~ #1.
+  Setup alphabet: #1.
 }
-\msg_new:nnn {unicode-math} {no-alphabet}
+\__um_msg_new:nn {no-alphabet}
 {
-  I~ am~ trying~ to~ set~ up~ alphabet~"#1"~ but~ there~ are~ no~ configuration~ settings~ for~ it.~
-  (See~ source~ file~ "unicode-math-alphabets.dtx"~ to~ debug.)
+  I am trying to set up alphabet"#1" but there are no configuration settings for it.
+  (See source file "unicode-math-alphabets.dtx" to debug.)
 }
-\msg_new:nnn { unicode-math } { no-named-range }
+\__um_msg_new:nn {no-named-range}
  {
-  I~ am~ trying~ to~ define~ new~ alphabet~ "#2"~ in~ range~ "#1",~ but~ range~ "#1"~ hasn't~ been~ defined~ yet.
+  I am trying to define new alphabet "#2" in range "#1", but range "#1" hasn't been defined yet.
  }
-\msg_new:nnn { unicode-math } { missing-alphabets }
+\__um_msg_new:nn {missing-alphabets}
  {
-  Missing~math~alphabets~in~font~ "\fontname\l__um_font" \\ \\
+  Missingmathalphabetsinfont "\fontname\g__um_curr_font_cmd_tl" \\ \\
   \seq_map_function:NN \l__um_missing_alph_seq \__um_print_indent:n
  }
 \cs_new:Nn \__um_print_indent:n { \space\space\space\space #1 \\ }
-\msg_new:nnn {unicode-math} {macro-expected}
+\__um_msg_new:nn {macro-expected}
 {
-  I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't.
+  I've expected that #1 is a macro, but it isn't.
 }
-\msg_new:nnn {unicode-math} {wrong-meaning}
+\__um_msg_new:nn {wrong-meaning}
 {
-  I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2.
+  I've expected #1 to have the meaning #3, but it has the meaning #2.
 }
-\msg_new:nnn {unicode-math} {patch-macro}
+\__um_msg_new:nn {patch-macro}
 {
-  I'm~ going~ to~ patch~ macro~ #1.
+  I'm going to patch macro #1.
 }
-\msg_new:nnn { unicode-math } { mathtools-overbracket } {
-  Using~ \token_to_str:N \overbracket\ and~
-         \token_to_str:N \underbracket\ from~
- `mathtools'~ package.\\
+\__um_msg_new:nn {mathtools-overbracket} {
+  Using \token_to_str:N \overbracket\ and
+         \token_to_str:N \underbracket\ from
+ `mathtools' package.\\
   \\
-  Use~ \token_to_str:N \Uoverbracket\ and~
-       \token_to_str:N \Uunderbracket\ for~
-       original~ `unicode-math'~ definition.
+  Use \token_to_str:N \Uoverbracket\ and
+       \token_to_str:N \Uunderbracket\ for
+       original `unicode-math' definition.
 }
-\msg_new:nnn { unicode-math } { mathtools-colon } {
-  I'm~ going~ to~ overwrite~ the~ following~ commands~ from~
-  the~ `mathtools'~ package: \\ \\
-  \ \ \ \ \token_to_str:N \dblcolon,~
-  \token_to_str:N \coloneqq,~
-  \token_to_str:N \Coloneqq,~
+\__um_msg_new:nn {mathtools-colon} {
+  I'm going to overwrite the following commands from
+  the `mathtools' package: \\ \\
+  \ \ \ \ \token_to_str:N \dblcolon,
+  \token_to_str:N \coloneqq,
+  \token_to_str:N \Coloneqq,
   \token_to_str:N \eqqcolon. \\ \\
-  Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like~
-  commands,~ using~ them~ will~ lead~ to~ inconsistencies.
+  Note that since I won't overwrite the other colon-like
+  commands, using them will lead to inconsistencies.
 }
-\msg_new:nnn { unicode-math } { colonequals } {
-  I'm~ going~ to~ overwrite~ the~ following~ commands~ from~
-  the~ `colonequals'~ package: \\ \\
-  \ \ \ \ \token_to_str:N \ratio,~
-          \token_to_str:N \coloncolon,~
+\__um_msg_new:nn {colonequals} {
+  I'm going to overwrite the following commands from
+  the `colonequals' package: \\ \\
+  \ \ \ \ \token_to_str:N \ratio,
+          \token_to_str:N \coloncolon,
           \token_to_str:N \minuscolon, \\
-  \ \ \ \ \token_to_str:N \colonequals,~
-          \token_to_str:N \equalscolon,~
+  \ \ \ \ \token_to_str:N \colonequals,
+          \token_to_str:N \equalscolon,
           \token_to_str:N \coloncolonequals. \\ \\
-  Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like~
-  commands,~ using~ them~ will~ lead~ to~ inconsistencies.~
-  Furthermore,~ changing~ \token_to_str:N \colonsep \c_space_tl
-  or~ \token_to_str:N \doublecolonsep \c_space_tl won't~ have~
-  any~ effect~ on~ the~ re-defined~ commands.
+  Note that since I won't overwrite the other colon-like
+  commands, using them will lead to inconsistencies.
+  Furthermore, changing \token_to_str:N \colonsep \c_space_tl
+  or \token_to_str:N \doublecolonsep \c_space_tl won't have
+  any effect on the re-defined commands.
 }
+\__um_msg_new:nn {bad-cs-in-range}
+  {
+    Command `#1` in math range is not recognised as a maths symbol.
+    Check file "unicode-math-table.tex" for allowable commands.
+  }
+\__um_msg_new:nn {legacy-char-not-supported}
+  {
+    Command `#1` is a legacy maths symbol that is not supported by unicode-math.
+  }
+\__um_msg_new:nn {range-not-bf-sf}
+  {
+    Range alphabets cannot include alphabets referring to `bf`, `sf`, or `bfsf`
+    since they relate to input commands not output glyphs.
+    Use `bfit` or `bfup` (etc.) to specify which.
+  }
+\char_set_catcode_ignore:n {32}
 
 %%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Mapping of mathematical unicode slots for alphabets.
 
-\usv_set:nnn {normal}  {num}  {48}
-\usv_set:nnn {normal}  {Latin}{"1D434}
-\usv_set:nnn {normal}  {latin}{"1D44E}
-\usv_set:nnn {normal}  {Greek}{"1D6E2}
-\usv_set:nnn {normal}  {greek}{"1D6FC}
-\usv_set:nnn {normal}{varTheta}  {"1D6F3}
-\usv_set:nnn {normal}{epsilon}{"1D716}
-\usv_set:nnn {normal}{vartheta}  {"1D717}
-\usv_set:nnn {normal}{varkappa}  {"1D718}
-\usv_set:nnn {normal}{phi}    {"1D719}
-\usv_set:nnn {normal}{varrho}    {"1D71A}
-\usv_set:nnn {normal}{varpi}     {"1D71B}
-\usv_set:nnn {normal}    {Nabla}{"1D6FB}
-\usv_set:nnn {normal}    {partial}{"1D715}
+\usv_set:nnn {normal} {num}      {48}
+\usv_set:nnn {normal} {Latin}    {"1D434}
+\usv_set:nnn {normal} {latin}    {"1D44E}
+\usv_set:nnn {normal} {Greek}    {"1D6E2}
+\usv_set:nnn {normal} {greek}    {"1D6FC}
+\usv_set:nnn {normal} {varTheta} {"1D6F3}
+\usv_set:nnn {normal} {epsilon}  {"1D716}
+\usv_set:nnn {normal} {vartheta} {"1D717}
+\usv_set:nnn {normal} {varkappa} {"1D718}
+\usv_set:nnn {normal} {phi}      {"1D719}
+\usv_set:nnn {normal} {varrho}   {"1D71A}
+\usv_set:nnn {normal} {varpi}    {"1D71B}
+\usv_set:nnn {normal} {Nabla}    {"1D6FB}
+\usv_set:nnn {normal} {partial}  {"1D715}
+\usv_set:nnn {up}   {num}   {48}
+\usv_set:nnn {up}   {Latin} {65}
+\usv_set:nnn {up}   {latin} {97}
+\usv_set:nnn {up}   {Greek} {"391}
+\usv_set:nnn {up}   {greek} {"3B1}
+\usv_set:nnn {it}   {Latin} {"1D434}
+\usv_set:nnn {it}   {latin} {"1D44E}
+\usv_set:nnn {it}   {Greek} {"1D6E2}
+\usv_set:nnn {it}   {greek} {"1D6FC}
+\usv_set:nnn {bb}   {num}   {"1D7D8}
+\usv_set:nnn {bb}   {Latin} {"1D538}
+\usv_set:nnn {bb}   {latin} {"1D552}
+\usv_set:nnn {scr}  {Latin} {"1D49C}
+\usv_set:nnn {cal}  {Latin} {"1D49C}
+\usv_set:nnn {scr}  {latin} {"1D4B6}
+\usv_set:nnn {frak} {Latin} {"1D504}
+\usv_set:nnn {frak} {latin} {"1D51E}
+\usv_set:nnn {sf}   {num}   {"1D7E2}
+\usv_set:nnn {sfup} {num}   {"1D7E2}
+\usv_set:nnn {sfit} {num}   {"1D7E2}
+\usv_set:nnn {sfup} {Latin} {"1D5A0}
+\usv_set:nnn {sf}   {Latin} {"1D5A0}
+\usv_set:nnn {sfup} {latin} {"1D5BA}
+\usv_set:nnn {sf}   {latin} {"1D5BA}
+\usv_set:nnn {sfit} {Latin} {"1D608}
+\usv_set:nnn {sfit} {latin} {"1D622}
+\usv_set:nnn {tt}   {num}   {"1D7F6}
+\usv_set:nnn {tt}   {Latin} {"1D670}
+\usv_set:nnn {tt}   {latin} {"1D68A}
+\usv_set:nnn {bf}     {num}   {"1D7CE}
+\usv_set:nnn {bfup}   {num}   {"1D7CE}
+\usv_set:nnn {bfit}   {num}   {"1D7CE}
+\usv_set:nnn {bfup}   {Latin} {"1D400}
+\usv_set:nnn {bfup}   {latin} {"1D41A}
+\usv_set:nnn {bfup}   {Greek} {"1D6A8}
+\usv_set:nnn {bfup}   {greek} {"1D6C2}
+\usv_set:nnn {bfit}   {Latin} {"1D468}
+\usv_set:nnn {bfit}   {latin} {"1D482}
+\usv_set:nnn {bfit}   {Greek} {"1D71C}
+\usv_set:nnn {bfit}   {greek} {"1D736}
+\usv_set:nnn {bffrak} {Latin} {"1D56C}
+\usv_set:nnn {bffrak} {latin} {"1D586}
+\usv_set:nnn {bfscr}  {Latin} {"1D4D0}
+\usv_set:nnn {bfcal}  {Latin} {"1D4D0}
+\usv_set:nnn {bfscr}  {latin} {"1D4EA}
+\usv_set:nnn {bfsf}   {num}   {"1D7EC}
+\usv_set:nnn {bfsfup} {num}   {"1D7EC}
+\usv_set:nnn {bfsfit} {num}   {"1D7EC}
+\usv_set:nnn {bfsfup} {Latin} {"1D5D4}
+\usv_set:nnn {bfsfup} {latin} {"1D5EE}
+\usv_set:nnn {bfsfup} {Greek} {"1D756}
+\usv_set:nnn {bfsfup} {greek} {"1D770}
+\usv_set:nnn {bfsfit} {Latin} {"1D63C}
+\usv_set:nnn {bfsfit} {latin} {"1D656}
+\usv_set:nnn {bfsfit} {Greek} {"1D790}
+\usv_set:nnn {bfsfit} {greek} {"1D7AA}
+\usv_set:nnn {bfsf} {Latin} { \bool_if:NTF \g__um_upLatin_bool   \g__um_bfsfup_Latin_usv \g__um_bfsfit_Latin_usv }
+\usv_set:nnn {bfsf} {latin} { \bool_if:NTF \g__um_uplatin_bool   \g__um_bfsfup_latin_usv \g__um_bfsfit_latin_usv }
+\usv_set:nnn {bfsf} {Greek} { \bool_if:NTF \g__um_upGreek_bool   \g__um_bfsfup_Greek_usv \g__um_bfsfit_Greek_usv }
+\usv_set:nnn {bfsf} {greek} { \bool_if:NTF \g__um_upgreek_bool   \g__um_bfsfup_greek_usv \g__um_bfsfit_greek_usv }
+\usv_set:nnn {bf}   {Latin} { \bool_if:NTF \g__um_bfupLatin_bool \g__um_bfup_Latin_usv   \g__um_bfit_Latin_usv   }
+\usv_set:nnn {bf}   {latin} { \bool_if:NTF \g__um_bfuplatin_bool \g__um_bfup_latin_usv   \g__um_bfit_latin_usv   }
+\usv_set:nnn {bf}   {Greek} { \bool_if:NTF \g__um_bfupGreek_bool \g__um_bfup_Greek_usv   \g__um_bfit_Greek_usv   }
+\usv_set:nnn {bf}   {greek} { \bool_if:NTF \g__um_bfupgreek_bool \g__um_bfup_greek_usv   \g__um_bfit_greek_usv   }
+\usv_set:nnn {up} {varTheta} {"3F4}
+\usv_set:nnn {up} {Digamma}  {"3DC}
+\usv_set:nnn {up} {epsilon}  {"3F5}
+\usv_set:nnn {up} {vartheta} {"3D1}
+\usv_set:nnn {up} {varkappa} {"3F0}
+\usv_set:nnn {up} {phi}      {"3D5}
+\usv_set:nnn {up} {varrho}   {"3F1}
+\usv_set:nnn {up} {varpi}    {"3D6}
+\usv_set:nnn {up} {digamma}  {"3DD}
+\usv_set:nnn {bfup} {varTheta} {"1D6B9}
+\usv_set:nnn {bfup} {Digamma}  {"1D7CA}
+\usv_set:nnn {bfup} {epsilon}  {"1D6DC}
+\usv_set:nnn {bfup} {vartheta} {"1D6DD}
+\usv_set:nnn {bfup} {varkappa} {"1D6DE}
+\usv_set:nnn {bfup} {phi}      {"1D6DF}
+\usv_set:nnn {bfup} {varrho}   {"1D6E0}
+\usv_set:nnn {bfup} {varpi}    {"1D6E1}
+\usv_set:nnn {bfup} {digamma}  {"1D7CB}
+\usv_set:nnn {it} {varTheta} {"1D6F3}
+\usv_set:nnn {it} {epsilon}  {"1D716}
+\usv_set:nnn {it} {vartheta} {"1D717}
+\usv_set:nnn {it} {varkappa} {"1D718}
+\usv_set:nnn {it} {phi}      {"1D719}
+\usv_set:nnn {it} {varrho}   {"1D71A}
+\usv_set:nnn {it} {varpi}    {"1D71B}
+\usv_set:nnn {bfit} {varTheta} {"1D72D}
+\usv_set:nnn {bfit} {epsilon}  {"1D750}
+\usv_set:nnn {bfit} {vartheta} {"1D751}
+\usv_set:nnn {bfit} {varkappa} {"1D752}
+\usv_set:nnn {bfit} {phi}      {"1D753}
+\usv_set:nnn {bfit} {varrho}   {"1D754}
+\usv_set:nnn {bfit} {varpi}    {"1D755}
+\usv_set:nnn {bfsfup} {varTheta} {"1D767}
+\usv_set:nnn {bfsfup} {epsilon}  {"1D78A}
+\usv_set:nnn {bfsfup} {vartheta} {"1D78B}
+\usv_set:nnn {bfsfup} {varkappa} {"1D78C}
+\usv_set:nnn {bfsfup} {phi}      {"1D78D}
+\usv_set:nnn {bfsfup} {varrho}   {"1D78E}
+\usv_set:nnn {bfsfup} {varpi}    {"1D78F}
+\usv_set:nnn {bfsfit} {varTheta} {"1D7A1}
+\usv_set:nnn {bfsfit} {epsilon}  {"1D7C4}
+\usv_set:nnn {bfsfit} {vartheta} {"1D7C5}
+\usv_set:nnn {bfsfit} {varkappa} {"1D7C6}
+\usv_set:nnn {bfsfit} {phi}      {"1D7C7}
+\usv_set:nnn {bfsfit} {varrho}   {"1D7C8}
+\usv_set:nnn {bfsfit} {varpi}    {"1D7C9}
+\usv_set:nnn {up}     {Nabla} {"02207}
+\usv_set:nnn {it}     {Nabla} {"1D6FB}
+\usv_set:nnn {bfup}   {Nabla} {"1D6C1}
+\usv_set:nnn {bfit}   {Nabla} {"1D735}
+\usv_set:nnn {bfsfup} {Nabla} {"1D76F}
+\usv_set:nnn {bfsfit} {Nabla} {"1D7A9}
+\usv_set:nnn {up}     {partial} {"02202}
+\usv_set:nnn {it}     {partial} {"1D715}
+\usv_set:nnn {bfup}   {partial} {"1D6DB}
+\usv_set:nnn {bfit}   {partial} {"1D74F}
+\usv_set:nnn {bfsfup} {partial} {"1D789}
+\usv_set:nnn {bfsfit} {partial} {"1D7C3}
+\usv_set:nnn {up} {B} {`\B}
+\usv_set:nnn {up} {C} {`\C}
+\usv_set:nnn {up} {D} {`\D}
+\usv_set:nnn {up} {E} {`\E}
+\usv_set:nnn {up} {F} {`\F}
+\usv_set:nnn {up} {H} {`\H}
+\usv_set:nnn {up} {I} {`\I}
+\usv_set:nnn {up} {L} {`\L}
+\usv_set:nnn {up} {M} {`\M}
+\usv_set:nnn {up} {N} {`\N}
+\usv_set:nnn {up} {P} {`\P}
+\usv_set:nnn {up} {Q} {`\Q}
+\usv_set:nnn {up} {R} {`\R}
+\usv_set:nnn {up} {Z} {`\Z}
+\usv_set:nnn {it} {B} {"1D435}
+\usv_set:nnn {it} {C} {"1D436}
+\usv_set:nnn {it} {D} {"1D437}
+\usv_set:nnn {it} {E} {"1D438}
+\usv_set:nnn {it} {F} {"1D439}
+\usv_set:nnn {it} {H} {"1D43B}
+\usv_set:nnn {it} {I} {"1D43C}
+\usv_set:nnn {it} {L} {"1D43F}
+\usv_set:nnn {it} {M} {"1D440}
+\usv_set:nnn {it} {N} {"1D441}
+\usv_set:nnn {it} {P} {"1D443}
+\usv_set:nnn {it} {Q} {"1D444}
+\usv_set:nnn {it} {R} {"1D445}
+\usv_set:nnn {it} {Z} {"1D44D}
+\usv_set:nnn {up} {d} {`\d}
+\usv_set:nnn {up} {e} {`\e}
+\usv_set:nnn {up} {g} {`\g}
+\usv_set:nnn {up} {h} {`\h}
+\usv_set:nnn {up} {i} {`\i}
+\usv_set:nnn {up} {j} {`\j}
+\usv_set:nnn {up} {o} {`\o}
+\usv_set:nnn {it} {d} {"1D451}
+\usv_set:nnn {it} {e} {"1D452}
+\usv_set:nnn {it} {g} {"1D454}
+\usv_set:nnn {it} {h} {"0210E}
+\usv_set:nnn {it} {i} {"1D456}
+\usv_set:nnn {it} {j} {"1D457}
+\usv_set:nnn {it} {o} {"1D45C}
+\usv_set:nnn {bb}     {h} {"1D559}
+\usv_set:nnn {tt}     {h} {"1D691}
+\usv_set:nnn {scr}    {h} {"1D4BD}
+\usv_set:nnn {frak}   {h} {"1D525}
+\usv_set:nnn {bfup}   {h} {"1D421}
+\usv_set:nnn {bfit}   {h} {"1D489}
+\usv_set:nnn {sfup}   {h} {"1D5C1}
+\usv_set:nnn {sfit}   {h} {"1D629}
+\usv_set:nnn {bffrak} {h} {"1D58D}
+\usv_set:nnn {bfscr}  {h} {"1D4F1}
+\usv_set:nnn {bfsfup} {h} {"1D5F5}
+\usv_set:nnn {bfsfit} {h} {"1D65D}
+\usv_set:nnn {up} {dotlessi} {"00131}
+\usv_set:nnn {up} {dotlessj} {"00237}
+\usv_set:nnn {it} {dotlessi} {"1D6A4}
+\usv_set:nnn {it} {dotlessj} {"1D6A5}
+\usv_set:nnn {bb} {C}         {"2102}
+\usv_set:nnn {bb} {H}         {"210D}
+\usv_set:nnn {bb} {N}         {"2115}
+\usv_set:nnn {bb} {P}         {"2119}
+\usv_set:nnn {bb} {Q}         {"211A}
+\usv_set:nnn {bb} {R}         {"211D}
+\usv_set:nnn {bb} {Z}         {"2124}
+\usv_set:nnn {up} {Pi}        {"003A0}
+\usv_set:nnn {up} {pi}        {"003C0}
+\usv_set:nnn {up} {Gamma}     {"00393}
+\usv_set:nnn {up} {gamma}     {"003B3}
+\usv_set:nnn {up} {summation} {"02211}
+\usv_set:nnn {it} {Pi}        {"1D6F1}
+\usv_set:nnn {it} {pi}        {"1D70B}
+\usv_set:nnn {it} {Gamma}     {"1D6E4}
+\usv_set:nnn {it} {gamma}     {"1D6FE}
+\usv_set:nnn {bb} {Pi}        {"0213F}
+\usv_set:nnn {bb} {pi}        {"0213C}
+\usv_set:nnn {bb} {Gamma}     {"0213E}
+\usv_set:nnn {bb} {gamma}     {"0213D}
+\usv_set:nnn {bb} {summation} {"02140}
+\usv_set:nnn {bbit} {D} {"2145}
+\usv_set:nnn {bbit} {d} {"2146}
+\usv_set:nnn {bbit} {e} {"2147}
+\usv_set:nnn {bbit} {i} {"2148}
+\usv_set:nnn {bbit} {j} {"2149}
+\usv_set:nnn {scr} {B} {"212C}
+\usv_set:nnn {scr} {E} {"2130}
+\usv_set:nnn {scr} {F} {"2131}
+\usv_set:nnn {scr} {H} {"210B}
+\usv_set:nnn {scr} {I} {"2110}
+\usv_set:nnn {scr} {L} {"2112}
+\usv_set:nnn {scr} {M} {"2133}
+\usv_set:nnn {scr} {R} {"211B}
+\usv_set:nnn {scr} {e} {"212F}
+\usv_set:nnn {scr} {g} {"210A}
+\usv_set:nnn {scr} {o} {"2134}
+\usv_set:nnn {cal} {B} {"212C}
+\usv_set:nnn {cal} {E} {"2130}
+\usv_set:nnn {cal} {F} {"2131}
+\usv_set:nnn {cal} {H} {"210B}
+\usv_set:nnn {cal} {I} {"2110}
+\usv_set:nnn {cal} {L} {"2112}
+\usv_set:nnn {cal} {M} {"2133}
+\usv_set:nnn {cal} {R} {"211B}
+\usv_set:nnn {frak} {C} {"212D}
+\usv_set:nnn {frak} {H} {"210C}
+\usv_set:nnn {frak} {I} {"2111}
+\usv_set:nnn {frak} {R} {"211C}
+\usv_set:nnn {frak} {Z} {"2128}
 
-\usv_set:nnn {up}  {num}  {48}
-\usv_set:nnn {up}  {Latin}{65}
-\usv_set:nnn {up}  {latin}{97}
-\usv_set:nnn {up}  {Greek}{"391}
-\usv_set:nnn {up}  {greek}{"3B1}
-\usv_set:nnn {it}  {Latin}{"1D434}
-\usv_set:nnn {it}  {latin}{"1D44E}
-\usv_set:nnn {it}  {Greek}{"1D6E2}
-\usv_set:nnn {it}  {greek}{"1D6FC}
-\usv_set:nnn {bb}  {num}  {"1D7D8}
-\usv_set:nnn {bb}  {Latin}{"1D538}
-\usv_set:nnn {bb}  {latin}{"1D552}
-\usv_set:nnn {scr} {Latin}{"1D49C}
-\usv_set:nnn {cal} {Latin}{"1D49C}
-\usv_set:nnn {scr} {latin}{"1D4B6}
-\usv_set:nnn {frak}{Latin}{"1D504}
-\usv_set:nnn {frak}{latin}{"1D51E}
-\usv_set:nnn {sf}  {num}  {"1D7E2}
-\usv_set:nnn {sfup}{num}  {"1D7E2}
-\usv_set:nnn {sfit}{num}  {"1D7E2}
-\usv_set:nnn {sfup}{Latin}{"1D5A0}
-\usv_set:nnn {sf}  {Latin}{"1D5A0}
-\usv_set:nnn {sfup}{latin}{"1D5BA}
-\usv_set:nnn {sf}  {latin}{"1D5BA}
-\usv_set:nnn {sfit}{Latin}{"1D608}
-\usv_set:nnn {sfit}{latin}{"1D622}
-\usv_set:nnn {tt}  {num}  {"1D7F6}
-\usv_set:nnn {tt}  {Latin}{"1D670}
-\usv_set:nnn {tt}  {latin}{"1D68A}
-\usv_set:nnn {bf}    {num}  {"1D7CE}
-\usv_set:nnn {bfup}  {num}  {"1D7CE}
-\usv_set:nnn {bfit}  {num}  {"1D7CE}
-\usv_set:nnn {bfup}  {Latin}{"1D400}
-\usv_set:nnn {bfup}  {latin}{"1D41A}
-\usv_set:nnn {bfup}  {Greek}{"1D6A8}
-\usv_set:nnn {bfup}  {greek}{"1D6C2}
-\usv_set:nnn {bfit}  {Latin}{"1D468}
-\usv_set:nnn {bfit}  {latin}{"1D482}
-\usv_set:nnn {bfit}  {Greek}{"1D71C}
-\usv_set:nnn {bfit}  {greek}{"1D736}
-\usv_set:nnn {bffrak}{Latin}{"1D56C}
-\usv_set:nnn {bffrak}{latin}{"1D586}
-\usv_set:nnn {bfscr} {Latin}{"1D4D0}
-\usv_set:nnn {bfcal} {Latin}{"1D4D0}
-\usv_set:nnn {bfscr} {latin}{"1D4EA}
-\usv_set:nnn {bfsf}  {num}  {"1D7EC}
-\usv_set:nnn {bfsfup}{num}  {"1D7EC}
-\usv_set:nnn {bfsfit}{num}  {"1D7EC}
-\usv_set:nnn {bfsfup}{Latin}{"1D5D4}
-\usv_set:nnn {bfsfup}{latin}{"1D5EE}
-\usv_set:nnn {bfsfup}{Greek}{"1D756}
-\usv_set:nnn {bfsfup}{greek}{"1D770}
-\usv_set:nnn {bfsfit}{Latin}{"1D63C}
-\usv_set:nnn {bfsfit}{latin}{"1D656}
-\usv_set:nnn {bfsfit}{Greek}{"1D790}
-\usv_set:nnn {bfsfit}{greek}{"1D7AA}
-\usv_set:nnn {bfsf}{Latin}{ \bool_if:NTF \g__um_upLatin_bool   \g__um_bfsfup_Latin_usv \g__um_bfsfit_Latin_usv }
-\usv_set:nnn {bfsf}{latin}{ \bool_if:NTF \g__um_uplatin_bool   \g__um_bfsfup_latin_usv \g__um_bfsfit_latin_usv }
-\usv_set:nnn {bfsf}{Greek}{ \bool_if:NTF \g__um_upGreek_bool   \g__um_bfsfup_Greek_usv \g__um_bfsfit_Greek_usv }
-\usv_set:nnn {bfsf}{greek}{ \bool_if:NTF \g__um_upgreek_bool   \g__um_bfsfup_greek_usv \g__um_bfsfit_greek_usv }
-\usv_set:nnn {bf}  {Latin}{ \bool_if:NTF \g__um_bfupLatin_bool \g__um_bfup_Latin_usv   \g__um_bfit_Latin_usv   }
-\usv_set:nnn {bf}  {latin}{ \bool_if:NTF \g__um_bfuplatin_bool \g__um_bfup_latin_usv   \g__um_bfit_latin_usv   }
-\usv_set:nnn {bf}  {Greek}{ \bool_if:NTF \g__um_bfupGreek_bool \g__um_bfup_Greek_usv   \g__um_bfit_Greek_usv   }
-\usv_set:nnn {bf}  {greek}{ \bool_if:NTF \g__um_bfupgreek_bool \g__um_bfup_greek_usv   \g__um_bfit_greek_usv   }
-\usv_set:nnn {up}{varTheta}  {"3F4}
-\usv_set:nnn {up}{Digamma}   {"3DC}
-\usv_set:nnn {up}{epsilon}{"3F5}
-\usv_set:nnn {up}{vartheta}  {"3D1}
-\usv_set:nnn {up}{varkappa}  {"3F0}
-\usv_set:nnn {up}{phi}    {"3D5}
-\usv_set:nnn {up}{varrho}    {"3F1}
-\usv_set:nnn {up}{varpi}     {"3D6}
-\usv_set:nnn {up}{digamma}   {"3DD}
-\usv_set:nnn {bfup}{varTheta}  {"1D6B9}
-\usv_set:nnn {bfup}{Digamma}   {"1D7CA}
-\usv_set:nnn {bfup}{epsilon}{"1D6DC}
-\usv_set:nnn {bfup}{vartheta}  {"1D6DD}
-\usv_set:nnn {bfup}{varkappa}  {"1D6DE}
-\usv_set:nnn {bfup}{phi}    {"1D6DF}
-\usv_set:nnn {bfup}{varrho}    {"1D6E0}
-\usv_set:nnn {bfup}{varpi}     {"1D6E1}
-\usv_set:nnn {bfup}{digamma}   {"1D7CB}
-\usv_set:nnn {it}{varTheta}  {"1D6F3}
-\usv_set:nnn {it}{epsilon}{"1D716}
-\usv_set:nnn {it}{vartheta}  {"1D717}
-\usv_set:nnn {it}{varkappa}  {"1D718}
-\usv_set:nnn {it}{phi}    {"1D719}
-\usv_set:nnn {it}{varrho}    {"1D71A}
-\usv_set:nnn {it}{varpi}     {"1D71B}
-\usv_set:nnn {bfit}{varTheta}  {"1D72D}
-\usv_set:nnn {bfit}{epsilon}{"1D750}
-\usv_set:nnn {bfit}{vartheta}  {"1D751}
-\usv_set:nnn {bfit}{varkappa}  {"1D752}
-\usv_set:nnn {bfit}{phi}    {"1D753}
-\usv_set:nnn {bfit}{varrho}    {"1D754}
-\usv_set:nnn {bfit}{varpi}     {"1D755}
-\usv_set:nnn {bfsfup}{varTheta}  {"1D767}
-\usv_set:nnn {bfsfup}{epsilon}{"1D78A}
-\usv_set:nnn {bfsfup}{vartheta}  {"1D78B}
-\usv_set:nnn {bfsfup}{varkappa}  {"1D78C}
-\usv_set:nnn {bfsfup}{phi}    {"1D78D}
-\usv_set:nnn {bfsfup}{varrho}    {"1D78E}
-\usv_set:nnn {bfsfup}{varpi}     {"1D78F}
-\usv_set:nnn {bfsfit}{varTheta}  {"1D7A1}
-\usv_set:nnn {bfsfit}{epsilon}{"1D7C4}
-\usv_set:nnn {bfsfit}{vartheta}  {"1D7C5}
-\usv_set:nnn {bfsfit}{varkappa}  {"1D7C6}
-\usv_set:nnn {bfsfit}{phi}    {"1D7C7}
-\usv_set:nnn {bfsfit}{varrho}    {"1D7C8}
-\usv_set:nnn {bfsfit}{varpi}     {"1D7C9}
-\usv_set:nnn {up}    {Nabla}{"02207}
-\usv_set:nnn {it}    {Nabla}{"1D6FB}
-\usv_set:nnn {bfup}  {Nabla}{"1D6C1}
-\usv_set:nnn {bfit}  {Nabla}{"1D735}
-\usv_set:nnn {bfsfup}{Nabla}{"1D76F}
-\usv_set:nnn {bfsfit}{Nabla}{"1D7A9}
-\usv_set:nnn {up}    {partial}{"02202}
-\usv_set:nnn {it}    {partial}{"1D715}
-\usv_set:nnn {bfup}  {partial}{"1D6DB}
-\usv_set:nnn {bfit}  {partial}{"1D74F}
-\usv_set:nnn {bfsfup}{partial}{"1D789}
-\usv_set:nnn {bfsfit}{partial}{"1D7C3}
-\usv_set:nnn {up}{B}{`\B}
-\usv_set:nnn {up}{C}{`\C}
-\usv_set:nnn {up}{D}{`\D}
-\usv_set:nnn {up}{E}{`\E}
-\usv_set:nnn {up}{F}{`\F}
-\usv_set:nnn {up}{H}{`\H}
-\usv_set:nnn {up}{I}{`\I}
-\usv_set:nnn {up}{L}{`\L}
-\usv_set:nnn {up}{M}{`\M}
-\usv_set:nnn {up}{N}{`\N}
-\usv_set:nnn {up}{P}{`\P}
-\usv_set:nnn {up}{Q}{`\Q}
-\usv_set:nnn {up}{R}{`\R}
-\usv_set:nnn {up}{Z}{`\Z}
-\usv_set:nnn {it}{B}{"1D435}
-\usv_set:nnn {it}{C}{"1D436}
-\usv_set:nnn {it}{D}{"1D437}
-\usv_set:nnn {it}{E}{"1D438}
-\usv_set:nnn {it}{F}{"1D439}
-\usv_set:nnn {it}{H}{"1D43B}
-\usv_set:nnn {it}{I}{"1D43C}
-\usv_set:nnn {it}{L}{"1D43F}
-\usv_set:nnn {it}{M}{"1D440}
-\usv_set:nnn {it}{N}{"1D441}
-\usv_set:nnn {it}{P}{"1D443}
-\usv_set:nnn {it}{Q}{"1D444}
-\usv_set:nnn {it}{R}{"1D445}
-\usv_set:nnn {it}{Z}{"1D44D}
-\usv_set:nnn {up}{d}{`\d}
-\usv_set:nnn {up}{e}{`\e}
-\usv_set:nnn {up}{g}{`\g}
-\usv_set:nnn {up}{h}{`\h}
-\usv_set:nnn {up}{i}{`\i}
-\usv_set:nnn {up}{j}{`\j}
-\usv_set:nnn {up}{o}{`\o}
-\usv_set:nnn {it}{d}{"1D451}
-\usv_set:nnn {it}{e}{"1D452}
-\usv_set:nnn {it}{g}{"1D454}
-\usv_set:nnn {it}{h}{"0210E}
-\usv_set:nnn {it}{i}{"1D456}
-\usv_set:nnn {it}{j}{"1D457}
-\usv_set:nnn {it}{o}{"1D45C}
-\usv_set:nnn {bb}    {h}{"1D559}
-\usv_set:nnn {tt}    {h}{"1D691}
-\usv_set:nnn {scr}   {h}{"1D4BD}
-\usv_set:nnn {frak}  {h}{"1D525}
-\usv_set:nnn {bfup}  {h}{"1D421}
-\usv_set:nnn {bfit}  {h}{"1D489}
-\usv_set:nnn {sfup}  {h}{"1D5C1}
-\usv_set:nnn {sfit}  {h}{"1D629}
-\usv_set:nnn {bffrak}{h}{"1D58D}
-\usv_set:nnn {bfscr} {h}{"1D4F1}
-\usv_set:nnn {bfsfup}{h}{"1D5F5}
-\usv_set:nnn {bfsfit}{h}{"1D65D}
-\usv_set:nnn {up}{dotlessi}{"00131}
-\usv_set:nnn {up}{dotlessj}{"00237}
-\usv_set:nnn {it}{dotlessi}{"1D6A4}
-\usv_set:nnn {it}{dotlessj}{"1D6A5}
-\usv_set:nnn {bb}{C}{"2102}
-\usv_set:nnn {bb}{H}{"210D}
-\usv_set:nnn {bb}{N}{"2115}
-\usv_set:nnn {bb}{P}{"2119}
-\usv_set:nnn {bb}{Q}{"211A}
-\usv_set:nnn {bb}{R}{"211D}
-\usv_set:nnn {bb}{Z}{"2124}
-\usv_set:nnn {up}{Pi}       {"003A0}
-\usv_set:nnn {up}{pi}       {"003C0}
-\usv_set:nnn {up}{Gamma}    {"00393}
-\usv_set:nnn {up}{gamma}    {"003B3}
-\usv_set:nnn {up}{summation}{"02211}
-\usv_set:nnn {it}{Pi}       {"1D6F1}
-\usv_set:nnn {it}{pi}       {"1D70B}
-\usv_set:nnn {it}{Gamma}    {"1D6E4}
-\usv_set:nnn {it}{gamma}    {"1D6FE}
-\usv_set:nnn {bb}{Pi}       {"0213F}
-\usv_set:nnn {bb}{pi}       {"0213C}
-\usv_set:nnn {bb}{Gamma}    {"0213E}
-\usv_set:nnn {bb}{gamma}    {"0213D}
-\usv_set:nnn {bb}{summation}{"02140}
-\usv_set:nnn {bbit}{D}{"2145}
-\usv_set:nnn {bbit}{d}{"2146}
-\usv_set:nnn {bbit}{e}{"2147}
-\usv_set:nnn {bbit}{i}{"2148}
-\usv_set:nnn {bbit}{j}{"2149}
-\usv_set:nnn {scr}{B}{"212C}
-\usv_set:nnn {scr}{E}{"2130}
-\usv_set:nnn {scr}{F}{"2131}
-\usv_set:nnn {scr}{H}{"210B}
-\usv_set:nnn {scr}{I}{"2110}
-\usv_set:nnn {scr}{L}{"2112}
-\usv_set:nnn {scr}{M}{"2133}
-\usv_set:nnn {scr}{R}{"211B}
-\usv_set:nnn {scr}{e}{"212F}
-\usv_set:nnn {scr}{g}{"210A}
-\usv_set:nnn {scr}{o}{"2134}
-\usv_set:nnn {cal}{B}{"212C}
-\usv_set:nnn {cal}{E}{"2130}
-\usv_set:nnn {cal}{F}{"2131}
-\usv_set:nnn {cal}{H}{"210B}
-\usv_set:nnn {cal}{I}{"2110}
-\usv_set:nnn {cal}{L}{"2112}
-\usv_set:nnn {cal}{M}{"2133}
-\usv_set:nnn {cal}{R}{"211B}
-\usv_set:nnn {frak}{C}{"212D}
-\usv_set:nnn {frak}{H}{"210C}
-\usv_set:nnn {frak}{I}{"2111}
-\usv_set:nnn {frak}{R}{"211C}
-\usv_set:nnn {frak}{Z}{"2128}
-
 %%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% General assignment of maths symbols.
 
 \cs_new:Npn \__um_symbol_setup:
  {
@@ -835,7 +894,7 @@
        { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence }
        {##3}
       {
-        \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ }
+        \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} }
       }
      }
     \__um_input_math_symbol_table:
@@ -875,6 +934,8 @@
      { \__um_set_math_overunder:Nnnn #2 {} {#1} {#4} }
     \mathunder
      { \__um_set_math_overunder:Nnnn #2 {bottom} {#1} {#4} }
+    \mathaccentoverlay
+     { \__um_set_math_accent:Nnnn #2 {overlay~ fixed} {#1} {#4} }
    }
  }
 \edef\mathfence{\string\mathfence}
@@ -882,6 +943,7 @@
 \edef\mathunder{\string\mathunder}
 \edef\mathbotaccent{\string\mathbotaccent}
 \edef\mathaccentwide{\string\mathaccentwide}
+\edef\mathaccentoverlay{\string\mathaccentoverlay}
 \edef\mathbotaccentwide{\string\mathbotaccentwide}
 \cs_new:Nn \__um_set_big_operator:nnn
  {
@@ -938,43 +1000,44 @@
   \cs_gset_protected_nopar:Npx #1 ##1
    {
     \mathop
-     { \__um_accent:nnn {#2} {#3} {#4} {##1} }
+     { \__um_accent:nnn {#2} {#3} {#4} {{}##1} }
+     %      TODO: remove braces above ^^ which work around a LuaTeX bug
     \limits
    }
  }
 
 %%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The "math text" commands such as `\mathbf` and co.
 
 \keys_define:nn {__um_mathface}
- {
-  version .code:n =
-   { \tl_set:Nn \l__um_mversion_tl {#1} }
- }
+  {
+    version .tl_set:N = \l__um_mversion_tl
+  }
 \cs_set:Nn \__um_setmathfontface:Nnn
- {
-  \tl_clear:N \l__um_mversion_tl
+  {
+    \tl_clear:N \l__um_mversion_tl
 
-  \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist
+    \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist
 
-  \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl
-   { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3}
+    \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl
+      { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3}
 
-  \tl_if_empty:NT \l__um_mversion_tl
-   {
-    \tl_set:Nn \l__um_mversion_tl {normal}
-    \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
-   }
+    \tl_if_empty:NT \l__um_mversion_tl
+      {
+        \tl_set:Nn \l__um_mversion_tl {normal}
+        \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
+      }
 
-  \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
+    \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
 
-  % integrate with fontspec's \setmathrm etc:
-  \tl_case:Nn #1
-   {
-    \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl }
-    \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl }
-    \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl }
-   }
- }
+    % integrate with fontspec's \setmathrm etc:
+    \tl_case:Nn #1
+      {
+        \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl }
+        \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl }
+        \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl }
+      }
+  }
 \cs_generate_variant:Nn \tl_if_eq:nnT {o}
 \cs_set:Nn \__fontspec_setmainfont_hook:nn
   {
@@ -981,29 +1044,23 @@
     \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault}
       {
    \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2}
-        \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault
-        \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault
-        \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault
+        \__fontspec_setmathrm_hook:nn {#1} {#2}
       }
   }
-
 \cs_set:Nn \__fontspec_setsansfont_hook:nn
   {
     \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault}
       {
    \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2}
-        \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault
-        \SetMathAlphabet\mathsf{bold}  \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault
+        \__fontspec_setmathsf_hook:nn {#1} {#2}
       }
   }
-
 \cs_set:Nn \__fontspec_setmonofont_hook:nn
   {
     \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault}
       {
    \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2}
-        \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
-        \SetMathAlphabet\mathtt{bold}  \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
+        \__fontspec_setmathtt_hook:nn {#1} {#2}
       }
   }
 \cs_set:Nn \__fontspec_setmathrm_hook:nn
@@ -1028,48 +1085,60 @@
     \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
     \SetMathAlphabet\mathtt{bold}  \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
   }
+\tl_if_eq:onF {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
+\tl_if_eq:onF {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
+\tl_if_eq:onF {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
+\AtBeginDocument
+  {
+    \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
+    \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
+    \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
+  }
 
 %%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of `\setmainfont`.
 
 \cs_set:Nn \__um_setmathfont:nn
   {
-    \tl_set:Nn \l__um_fontname_tl {#2}
+
+    \__um_init:n {#2}
     \cs_set_eq:NN \glb at currsize \scan_stop:
-    \__um_init:
     \cs_if_exist:cF { S@ \f at size } { \calculate at math@sizes }
-    \csname S@\f at size\endcsname
+    \use:c { S@ \f at size }
+
     \keys_set_known:nnN {unicode-math} {#1} \l__um_unknown_keys_clist
-    \bool_if:NT \l__um_init_bool { \__um_log:n {default-math-font} }
-    \__um_fontspec_select_font:
-    \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
+
+    \bool_if:NT \l__um_init_bool
       {
+        \__um_fontspec_trial_font:
         \__um_declare_math_sizes:
-        \__um_fontspec_select_font:
       }
-    \cs_if_exist:cF { sym \l__um_symfont_label_tl }
+    \__um_fontspec_select_font:
+    \__um_setup_math_fam:
+    \bool_if:NT \l__um_init_bool
       {
-        \DeclareSymbolFont{\l__um_symfont_label_tl}
-          {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
-      }
-    \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl}
-      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
-    \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
-      {
-        \SetSymbolFont{\l__um_symfont_label_tl}{bold}
-          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
-      }
-    \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
-      {
-        \bool_set_true:N \g__um_mainfont_already_set_bool
         \__um_setup_legacy_fam_two:
         \__um_setup_legacy_fam_three:
       }
+
     \__um_input_math_symbol_table:
+
+    \bool_if:NT \l__um_init_bool \__um_onceoff_setup:
     \__um_remap_symbols:
     \__um_setup_mathactives:
     \__um_setup_delcodes:
     \__um_setup_alphabets:
-    \__um_setup_negations:
+
+    %% TODO: what of the above should only be run for the "default"/"main" font?
+
+    \bool_if:NTF \l__um_init_bool
+      {
+   \__um_mathparam_store:
+        \__um_log:n {default-math-font}
+      }
+      {
+   \__um_mathparam_restore:
+      }
   }
 \AtBeginDocument { \__um_load_lm_if_necessary: }
 \cs_new:Nn \__um_load_lm_if_necessary:
@@ -1076,137 +1145,218 @@
   {
     \cs_if_exist:NF \l__um_fontname_tl
       {
-        % TODO: update this when lmmath-bold.otf is released
-        \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}]
-        \bool_set_false:N \g__um_mainfont_already_set_bool
+        \setmathfont{latinmodern-math.otf}
+          [BoldFont={latinmodern-math.otf}]
       }
   }
-\cs_new:Nn \__um_init:
+\cs_new:Nn \__um_init:n
   {
+    \tl_set:Nn \l__um_fontname_tl {#1}
     \bool_set_true:N  \l__um_ot_math_bool
-    \tl_set:Nn \l__um_mversion_tl {normal}
+    \tl_set:Nn \l__um_mversion_tl      {normal}
     \tl_set:Nn \l__um_symfont_label_tl {operators}
+
     \tl_set:Nn    \l__um_script_features_tl  {Style=MathScript}
     \tl_set:Nn    \l__um_sscript_features_tl {Style=MathScriptScript}
     \tl_set_eq:NN \l__um_script_font_tl      \l__um_fontname_tl
     \tl_set_eq:NN \l__um_sscript_font_tl     \l__um_fontname_tl
+
     \bool_set_true:N \l__um_init_bool
-    \seq_clear:N     \l__um_char_range_seq
-    \clist_clear:N   \l__um_char_nrange_clist
-    \seq_clear:N     \l__um_mathalph_seq
+    \seq_gclear:N    \g__um_char_range_seq
+    \clist_clear:N   \l__um_mathmap_charints_clist
+    \seq_gclear:N    \g__um_mathalph_seq
     \seq_clear:N     \l__um_missing_alph_seq
-    \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_noparse:nnn
-    \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
-    \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_noparse:nnn
-    \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
-    \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
-    \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_noparse:nn
-    \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_noparse:nNN
+
+    \cs_set_eq:NN \__um_sym:nnn                  \__um_process_symbol_noparse:nnn
+    \cs_set_eq:NN \__um_remap_symbol:nnn          \__um_remap_symbol_noparse:nnn
+    \cs_set_eq:NN \__um_maybe_init_alphabet:n     \__um_init_alphabet:n
+    \cs_set_eq:NN \__um_assign_delcode:nn         \__um_assign_delcode_noparse:nn
+    \cs_set_eq:NN \__um_make_mathactive:nNN       \__um_make_mathactive_noparse:nNN
   }
+\tl_new:N \g__um_main_font_cmd_tl
 \cs_new:Nn \__um_declare_math_sizes:
   {
-    \fp_compare:nF { \__um_script_style_size:n {ScriptPercentScaleDown} == 0 }
+    \dim_compare:nF { \fontdimen 10 \g__um_trial_font == 0pt }
       {
         \DeclareMathSizes { \f at size } { \f at size }
-          { \__um_script_style_size:n {ScriptPercentScaleDown} }
-          { \__um_script_style_size:n {ScriptScriptPercentScaleDown} }
+          { \__um_fontdimen_to_scale:nN {10} \g__um_trial_font }
+          { \__um_fontdimen_to_scale:nN {11} \g__um_trial_font }
       }
   }
-\cs_new:Nn \__um_script_style_size:n
+\cs_new:Nn \__um_fontspec_trial_font:
   {
-    \fp_eval:n {\directlua{tex.sprint(luaotfload.aux.get_math_dimension("l__um_font","#1"))} * \f at size / 100 }
+    \tl_set:Nx \l__um_font_keyval_tl
+      {
+   Renderer = Basic,
+        BoldItalicFont = {}, ItalicFont = {},
+        Script = Math,
+   FontAdjustment = { \g__um_luatex_copy_fontdimens_tl },
+        \l__um_unknown_keys_clist
+      }
+
+    \fontspec_set_family:Nxn \l__um_trial_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl}
+
+    \group_begin:
+      \fontfamily { \l__um_trial_family_tl } \selectfont
+      \__um_fontface_gset_eq:NV \g__um_trial_font \font at name
+      \fontspec_if_script:nF {math}
+        {
+          \bool_gset_false:N \l__um_ot_math_bool
+          \bool_gset_false:N \l__um_init_bool
+        }
+    \group_end:
+
   }
+\cs_new:Nn \__um_fontspec_select_font:
+  {
+    \fp_gset:Nn \g__um_size_tfsf_fp   { (\f at size +\sf at size )/2 }
+    \fp_gset:Nn \g__um_size_sfssf_fp  { (\sf at size+\ssf at size)/2 }
+
+    \tl_set:Nx \l__um_font_keyval_tl
+      {
+   Renderer = Basic,
+        BoldItalicFont = {}, ItalicFont = {},
+        Script = Math,
+        SizeFeatures =
+          {
+            {
+              Size = \fp_use:N \g__um_size_tfsf_fp -
+            } ,
+            {
+              Size = \fp_use:N \g__um_size_sfssf_fp - \fp_use:N \g__um_size_tfsf_fp ,
+              Font = \l__um_script_font_tl ,
+              \l__um_script_features_tl
+            } ,
+            {
+              Size = - \fp_use:N \g__um_size_sfssf_fp ,
+              Font = \l__um_sscript_font_tl ,
+              \l__um_sscript_features_tl
+            }
+          } ,
+   FontAdjustment = { \g__um_luatex_copy_fontdimens_tl },
+        \l__um_unknown_keys_clist
+      }
+
+    \fontspec_set_family:Nxn \l__um_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl}
+
+    \int_gincr:N \g__um_fonts_used_int
+    \group_begin:
+      \fontfamily { \l__um_family_tl } \selectfont
+      \__um_fontface_gset_eq:cV {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} \font at name
+      \tl_gset:Nx \g__um_curr_font_cmd_tl { \exp_not:c {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} }
+      \bool_if:NT \l__um_init_bool
+{
+\__um_fontface_gset_eq:NV \l__um_font \font at name
+}
+      \fontspec_if_script:nF {math}
+        {
+          \bool_gset_false:N \l__um_ot_math_bool
+          \bool_gset_false:N \l__um_init_bool
+        }
+    \group_end:
+  }
+\tl_set:Nn \g__um_main_font_cmd_tl  { \l__um_font }
+\tl_set:Nn \g__um_sqrt_font_cmd_tl  { \l__um_font }
+\tl_set:Nn \g__um_prime_font_cmd_tl { \l__um_font }
+\tl_const:Nn \g__um_luatex_copy_fontdimens_tl
+  {
+    \__um_fontdimen_from_param:nn {10} {ScriptPercentScaleDown}
+    \__um_fontdimen_from_param:nn {11} {ScriptScriptPercentScaleDown}
+    \__um_fontdimen_from_param:nn {15} {AxisHeight}
+    \__um_fontdimen_from_param:nn {18} {SubscriptShiftDown}
+    \__um_fontdimen_from_param:nn {20} {SubscriptBaselineDropMin}
+    \__um_fontdimen_from_param:nn {21} {SuperscriptShiftUp}
+    \__um_fontdimen_from_param:nn {22} {SuperscriptShiftUpCramped}
+    \__um_fontdimen_from_param:nn {24} {SuperscriptBaselineDropMax}
+    \__um_fontdimen_from_param:nn {28} {UpperLimitGapMin}
+    \__um_fontdimen_from_param:nn {29} {UpperLimitBaselineRiseMin}
+    \__um_fontdimen_from_param:nn {30} {LowerLimitGapMin}
+    \__um_fontdimen_from_param:nn {31} {LowerLimitBaselineDropMin}
+    \__um_fontdimen_from_param:nn {32} {StackTopShiftUp}
+    \__um_fontdimen_from_param:nn {42} {FractionNumeratorShiftUp}
+    \__um_fontdimen_from_param:nn {43} {FractionNumeratorDisplayStyleShiftUp}
+    \__um_fontdimen_from_param:nn {44} {FractionDenominatorShiftDown}
+    \__um_fontdimen_from_param:nn {45} {FractionDenominatorDisplayStyleShiftDown}
+    \__um_fontdimen_from_param:nn {48} {FractionRuleThickness}
+  }
+\cs_new:Nn \__um_setup_math_fam:
+  {
+    \cs_if_exist:cF { sym \l__um_symfont_label_tl }
+      {
+        \DeclareSymbolFont{\l__um_symfont_label_tl}
+          {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+      }
+    \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl}
+      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+    \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
+      {
+        \SetSymbolFont{\l__um_symfont_label_tl}{bold}
+          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+      }
+  }
 \cs_new:Nn \__um_setup_legacy_fam_two:
   {
-    \fontspec_set_family:Nxn \l__um_family_tl
+    \fontspec_set_family:Nxn \l__um_fam_two_tl
       {
         \l__um_font_keyval_tl,
         Scale=1.00001,
         FontAdjustment =
           {
-            \__um_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax
-            \__um_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax
-            \__um_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax
-            \__um_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax
-            \__um_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax
-            \__um_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax
-            \__um_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax
-            \__um_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax
-            \__um_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax
-            \__um_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax
-            \__um_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax
-            \__um_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax
-            \__um_zero_fontparam:n   {20} % delim1 = FractionDelimiterDisplaySize
-            \__um_zero_fontparam:n   {21} % delim2 = FractionDelimiterSize
-            \__um_copy_fontparam:nnn {22} {15} {AxisHeight}\relax
+            \__um_copy_fontdimen:nnN { 8} {43} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN { 9} {42} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {10} {32} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {11} {45} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {12} {44} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {13} {21} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {14} {21} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {15} {22} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {16} {18} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {17} {18} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {18} {24} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {19} {20} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {22} {15} \g__um_main_font_cmd_tl
+            \__um_zero_fontdimen:n   {20} % delim1 = FractionDelimiterDisplaySize
+            \__um_zero_fontdimen:n   {21} % delim2 = FractionDelimiterSize
          }
       } {\l__um_fontname_tl}
 
     \SetSymbolFont{symbols}{\l__um_mversion_tl}
-      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+      {\encodingdefault}{\l__um_fam_two_tl}{\mddefault}{\updefault}
 
     \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
       {
         \SetSymbolFont{symbols}{bold}
-          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+          {\encodingdefault}{\l__um_fam_two_tl}{\bfdefault}{\updefault}
       }
   }
 \cs_new:Nn \__um_setup_legacy_fam_three:
   {
-    \fontspec_set_family:Nxn \l__um_family_tl
+    \fontspec_set_family:Nxn \l__um_fam_three_tl
       {
         \l__um_font_keyval_tl,
         Scale=0.99999,
         FontAdjustment = {
-          \__um_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax
-          \__um_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax
-          \__um_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax
-          \__um_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax
-          \__um_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax
-          \__um_zero_fontparam:n   {13}
+          \__um_copy_fontdimen:nnN { 8} {48} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN { 9} {28} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN {10} {30} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN {11} {29} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN {12} {31} \g__um_main_font_cmd_tl
+          \__um_zero_fontdimen:n   {13}
        }
       } {\l__um_fontname_tl}
 
     \SetSymbolFont{largesymbols}{\l__um_mversion_tl}
-      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+      {\encodingdefault}{\l__um_fam_three_tl}{\mddefault}{\updefault}
 
     \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
       {
         \SetSymbolFont{largesymbols}{bold}
-          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+          {\encodingdefault}{\l__um_fam_three_tl}{\bfdefault}{\updefault}
       }
   }
-\cs_new:Nn \__um_fontspec_select_font:
+\cs_new:Nn \__um_onceoff_setup:
   {
-    \tl_set:Nx \l__um_font_keyval_tl {
-     Renderer = Basic,
-      BoldItalicFont = {}, ItalicFont = {},
-      Script = Math,
-      SizeFeatures =
-        {
-          {
-            Size = \tf at size-
-          } ,
-          {
-            Size = \sf at size-\tf at size ,
-            Font = \l__um_script_font_tl ,
-            \l__um_script_features_tl
-          } ,
-          {
-            Size = -\sf at size ,
-            Font = \l__um_sscript_font_tl ,
-            \l__um_sscript_features_tl
-          }
-        } ,
-      \l__um_unknown_keys_clist
-    }
-
-  \fontspec_set_fontface:NNxn \l__um_font \l__um_family_tl
-    {\l__um_font_keyval_tl} {\l__um_fontname_tl}
-    \group_begin:
-      \fontfamily{\l__um_family_tl}\selectfont
-      \fontspec_if_script:nF {math} {\bool_gset_false:N \l__um_ot_math_bool}
-    \group_end:
+    \__um_set_delcode:nnn {operators} {`\.} {\c_zero}
   }
 \cs_set:Nn \__um_process_symbol_noparse:nnn
   {
@@ -1214,23 +1364,23 @@
   }
 \cs_set:Nn \__um_process_symbol_parse:nnn
   {
-    \__um_if_char_spec:nNNT {#1} {#2} {#3}
+    \__um_if_char_spec:nNT {#1} {#3}
       {
         \__um_process_symbol_noparse:nnn {#1} {#2} {#3}
       }
   }
-\cs_new:Npn \__um_remap_symbols:
+\cs_new:Nn \__um_remap_symbols:
   {
-    \__um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus
-    \__um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk"
+    \__um_remap_symbol:nnn {`\-} {\mathbin} {"2212}
+    \__um_remap_symbol:nnn {`\*} {\mathbin} {"02217}% text asterisk to "centred asterisk"
     \bool_if:NF \g__um_literal_colon_bool
       {
-        \__um_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel)
+        \__um_remap_symbol:nnn {`\:} {\mathrel} {"02236}% colon to ratio (i.e., punct to rel)
       }
   }
 \cs_new:Nn \__um_remap_symbol_parse:nnn
   {
-    \__um_if_char_spec:nNNT {#3} {\@nil} {#2}
+    \__um_if_char_spec:nNT {#3} {#2}
       { \__um_remap_symbol_noparse:nnn {#1} {#2} {#3} }
   }
 \cs_new:Nn \__um_remap_symbol_noparse:nnn
@@ -1240,19 +1390,19 @@
   }
 \cs_new:Npn \__um_setup_mathactives:
   {
-    \__um_make_mathactive:nNN {"2032} \__um_prime_single_mchar \mathord
-    \__um_make_mathactive:nNN {"2033} \__um_prime_double_mchar \mathord
-    \__um_make_mathactive:nNN {"2034} \__um_prime_triple_mchar \mathord
-    \__um_make_mathactive:nNN {"2057} \__um_prime_quad_mchar   \mathord
-    \__um_make_mathactive:nNN {"2035} \__um_backprime_single_mchar \mathord
-    \__um_make_mathactive:nNN {"2036} \__um_backprime_double_mchar \mathord
-    \__um_make_mathactive:nNN {"2037} \__um_backprime_triple_mchar \mathord
+\__um_make_mathactive:nNN {"2032} \__um_prime_single_mchar \mathord
+\__um_make_mathactive:nNN {"2033} \__um_prime_double_mchar \mathord
+\__um_make_mathactive:nNN {"2034} \__um_prime_triple_mchar \mathord
+\__um_make_mathactive:nNN {"2057} \__um_prime_quad_mchar   \mathord
+\__um_make_mathactive:nNN {"2035} \__um_backprime_single_mchar \mathord
+\__um_make_mathactive:nNN {"2036} \__um_backprime_double_mchar \mathord
+\__um_make_mathactive:nNN {"2037} \__um_backprime_triple_mchar \mathord
     \__um_make_mathactive:nNN {`\'} \mathstraightquote \mathord
     \__um_make_mathactive:nNN {`\`} \mathbacktick      \mathord
   }
 \cs_new:Nn \__um_make_mathactive_parse:nNN
   {
-    \__um_if_char_spec:nNNT {#1} #2 #3
+    \__um_if_char_spec:nNT {#1} #3
       { \__um_make_mathactive_noparse:nNN {#1} #2 #3 }
   }
 \cs_new:Nn \__um_make_mathactive_noparse:nNN
@@ -1266,7 +1416,7 @@
   }
 \cs_new:Nn \__um_assign_delcode_parse:nn
   {
-    \__um_if_char_spec:nNNT {#2} {\@nil} {\@nil}
+    \__um_if_char_spec:nNT {#2} \@nil
       {
         \__um_assign_delcode_noparse:nn {#1} {#2}
       }
@@ -1274,10 +1424,6 @@
 \cs_new:Nn \__um_assign_delcode:n { \__um_assign_delcode:nn {#1} {#1} }
 \cs_new:Npn \__um_setup_delcodes:
   {
-    % ensure \left. and \right. work:
-    \__um_set_delcode:nnn \l__um_symfont_label_tl {`\.} {\c_zero}
-    % this is forcefully done to fix a bug -- indicates a larger problem!
-
     \__um_assign_delcode:nn {`\/}   {\g__um_slash_delimiter_usv}
     \__um_assign_delcode:nn {"2044} {\g__um_slash_delimiter_usv} % fracslash
     \__um_assign_delcode:nn {"2215} {\g__um_slash_delimiter_usv} % divslash
@@ -1321,8 +1467,73 @@
     \intcap\intcup\upint\lowint
   }
 \tl_set:Nn \l__um_radicals_tl {\sqrt \longdivision}
+\cs_set:Nn \__um_mathparam_restore:
+  {
+    \check at mathfonts
+    \tl_use:N \g__um_mathparam_store_tl
+  }
+\cs_set:Nn \__um_mathparam_store:
+  {
+    \check at mathfonts
+    \tl_gset:Nx \g__um_mathparam_store_tl
+      {
+        \__um_mathparam_store_aux:N \displaystyle
+        \__um_mathparam_store_aux:N \textstyle
+        \__um_mathparam_store_aux:N \scriptstyle
+        \__um_mathparam_store_aux:N \scriptscriptstyle
+      }
+  }
+\cs_set:Nn \__um_mathparam_store_aux:N
+  {
+    \Umathquad                #1 = \the \Umathquad                #1
+    \Umathaxis                #1 = \the \Umathaxis                #1
+    \Umathoperatorsize        #1 = \the \Umathoperatorsize        #1
+    \Umathoverbarkern         #1 = \the \Umathoverbarkern         #1
+    \Umathoverbarrule         #1 = \the \Umathoverbarrule         #1
+    \Umathoverbarvgap         #1 = \the \Umathoverbarvgap         #1
+    \Umathunderbarkern        #1 = \the \Umathunderbarkern        #1
+    \Umathunderbarrule        #1 = \the \Umathunderbarrule        #1
+    \Umathunderbarvgap        #1 = \the \Umathunderbarvgap        #1
+    \Umathradicalkern         #1 = \the \Umathradicalkern         #1
+    \Umathradicalrule         #1 = \the \Umathradicalrule         #1
+    \Umathradicalvgap         #1 = \the \Umathradicalvgap         #1
+    \Umathradicaldegreebefore #1 = \the \Umathradicaldegreebefore #1
+    \Umathradicaldegreeafter  #1 = \the \Umathradicaldegreeafter  #1
+    \Umathradicaldegreeraise  #1 = \the \Umathradicaldegreeraise  #1
+    \Umathstackvgap           #1 = \the \Umathstackvgap           #1
+    \Umathstacknumup          #1 = \the \Umathstacknumup          #1
+    \Umathstackdenomdown      #1 = \the \Umathstackdenomdown      #1
+    \Umathfractionrule        #1 = \the \Umathfractionrule        #1
+    \Umathfractionnumvgap     #1 = \the \Umathfractionnumvgap     #1
+    \Umathfractionnumup       #1 = \the \Umathfractionnumup       #1
+    \Umathfractiondenomvgap   #1 = \the \Umathfractiondenomvgap   #1
+    \Umathfractiondenomdown   #1 = \the \Umathfractiondenomdown   #1
+    \Umathfractiondelsize     #1 = \the \Umathfractiondelsize     #1
+    \Umathlimitabovevgap      #1 = \the \Umathlimitabovevgap      #1
+    \Umathlimitabovebgap      #1 = \the \Umathlimitabovebgap      #1
+    \Umathlimitabovekern      #1 = \the \Umathlimitabovekern      #1
+    \Umathlimitbelowvgap      #1 = \the \Umathlimitbelowvgap      #1
+    \Umathlimitbelowbgap      #1 = \the \Umathlimitbelowbgap      #1
+    \Umathlimitbelowkern      #1 = \the \Umathlimitbelowkern      #1
+    \Umathoverdelimitervgap   #1 = \the \Umathoverdelimitervgap   #1
+    \Umathoverdelimiterbgap   #1 = \the \Umathoverdelimiterbgap   #1
+    \Umathunderdelimitervgap  #1 = \the \Umathunderdelimitervgap  #1
+    \Umathunderdelimiterbgap  #1 = \the \Umathunderdelimiterbgap  #1
+    \Umathsubshiftdrop        #1 = \the \Umathsubshiftdrop        #1
+    \Umathsubshiftdown        #1 = \the \Umathsubshiftdown        #1
+    \Umathsupshiftdrop        #1 = \the \Umathsupshiftdrop        #1
+    \Umathsupshiftup          #1 = \the \Umathsupshiftup          #1
+    \Umathsubsupshiftdown     #1 = \the \Umathsubsupshiftdown     #1
+    \Umathsubtopmax           #1 = \the \Umathsubtopmax           #1
+    \Umathsupbottommin        #1 = \the \Umathsupbottommin        #1
+    \Umathsupsubbottommax     #1 = \the \Umathsupsubbottommax     #1
+    \Umathsubsupvgap          #1 = \the \Umathsubsupvgap          #1
+    \Umathspaceafterscript    #1 = \the \Umathspaceafterscript    #1
+    \Umathconnectoroverlapmin #1 = \the \Umathconnectoroverlapmin #1
+  }
 
 %%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Keyval for `\setmathfont`
 
 \keys_define:nn {unicode-math}
   {
@@ -1333,100 +1544,124 @@
       }
   }
 \keys_define:nn {unicode-math}
- {
-  script-features  .tl_set:N =  \l__um_script_features_tl ,
-  sscript-features .tl_set:N = \l__um_sscript_features_tl ,
-       script-font .tl_set:N =      \l__um_script_font_tl ,
-      sscript-font .tl_set:N =     \l__um_sscript_font_tl ,
- }
+  {
+    script-features  .tl_set:N =  \l__um_script_features_tl ,
+    sscript-features .tl_set:N = \l__um_sscript_features_tl ,
+         script-font .tl_set:N =      \l__um_script_font_tl ,
+        sscript-font .tl_set:N =     \l__um_sscript_font_tl ,
+  }
 \keys_define:nn {unicode-math}
- {
-  range .code:n =
-   {
-    \bool_set_false:N \l__um_init_bool
+  {
+    range .code:n =
+      {
+        \bool_set_false:N \l__um_init_bool
+        \__um_range_init:
+        \group_begin:
+          \seq_map_inline:Nn \g__um_mathclasses_seq
+            {
+              \cs_set:Npn ##1 { \use_none:n \q_unicode_math \exp_not:N ##1 }
+            }
+          \cs_set:Npn \__um_sym:nnn ##1 ##2 ##3
+            {
+              \cs_set:Npn ##2 { \use_none:n \q_unicode_math ##1 }
+            }
+          \__um_input_math_symbol_table:
+          \__um_range_process:n {#1}
+        \group_end:
+      }
+  }
+\cs_new:Nn \__um_range_init:
+  {
     \int_incr:N \g__um_fam_int
     \tl_set:Nx \l__um_symfont_label_tl {__um_fam\int_use:N\g__um_fam_int}
     \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_parse:nnn
-    \cs_set_eq:NN \__um_set_mathalphabet_char:Nnn \__um_mathmap_parse:Nnn
     \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_parse:nnn
     \cs_set_eq:NN \__um_maybe_init_alphabet:n \use_none:n
-    \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn
     \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_parse:nn
     \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_parse:nNN
-    \seq_clear:N \l__um_char_range_seq
-    \seq_clear:N \l__um_mclass_range_seq
-    \seq_clear:N \l__um_cmd_range_seq
-    \seq_clear:N \l__um_mathalph_seq
-
+    \seq_gclear:N \g__um_char_range_seq
+    \seq_gclear:N \g__um_mclass_range_seq
+    \seq_gclear:N \g__um_mathalph_seq
+  }
+\cs_new:Nn \__um_range_process:n
+  {
     \clist_map_inline:nn {#1}
-     {
-      \__um_if_mathalph_decl:nTF {##1}
-       {
-        \seq_put_right:Nx \l__um_mathalph_seq
-         {
-          { \exp_not:V \l__um_tmpa_tl }
-          { \exp_not:V \l__um_tmpb_tl }
-          { \exp_not:V \l__um_tmpc_tl }
-         }
-       }
-       {
-        \seq_if_in:NnTF \g__um_mathclasses_seq {##1}
-          { \seq_put_right:Nn \l__um_mclass_range_seq {##1} }
-          {
-            \bool_lazy_and:nnTF { \tl_if_single_p:n {##1} } { \token_if_cs_p:N ##1 }
-              { \seq_put_right:Nn \l__um_cmd_range_seq {##1} }
-              { \seq_put_right:Nn \l__um_char_range_seq {##1} }
-          }
-       }
-     }
-   }
- }
-\prg_new_conditional:Nnn \__um_if_mathalph_decl:n {TF}
- {
-  \tl_set:Nn  \l__um_tmpa_tl {#1}
-  \tl_clear:N \l__um_tmpb_tl
-  \tl_clear:N \l__um_tmpc_tl
+      {
+        \__um_mathalph_decl:nF {##1} { \__um_range_decl:n {##1} }
+      }
+}
+\cs_new:Nn \__um_mathalph_decl:nF
+  {
 
-  \tl_if_in:NnT \l__um_tmpa_tl {->}
-   { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil }
+    \tl_set:Nn  \l__um_tmpa_tl {#1}
+    \tl_clear:N \l__um_tmpb_tl
+    \tl_clear:N \l__um_tmpc_tl
 
-  \tl_if_in:NnT \l__um_tmpa_tl {/}
-   { \exp_after:wN \__um_split_slash:w \l__um_tmpa_tl \q_nil }
+    \tl_if_in:NnT \l__um_tmpa_tl {->}
+      { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil }
 
-  \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl }
-  \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math }
-  \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym }
-  \tl_trim_spaces:N \l__um_tmpa_tl
+    \tl_if_in:NnT \l__um_tmpa_tl {/}
+      { \exp_after:wN \__um_split_slash:w \l__um_tmpa_tl \q_nil }
 
-  \tl_if_empty:NT \l__um_tmpc_tl
-   { \tl_set_eq:NN \l__um_tmpc_tl \l__um_tmpa_tl }
+    \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl }
+    \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math }
+    \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym }
+    \tl_trim_spaces:N \l__um_tmpa_tl
 
-  \seq_if_in:NVTF \g__um_named_ranges_seq \l__um_tmpa_tl
-   { \prg_return_true: } { \prg_return_false: }
- }
+    \tl_if_empty:NT \l__um_tmpc_tl
+      { \tl_set_eq:NN \l__um_tmpc_tl \l__um_tmpa_tl }
+
+    \clist_if_in:NVT \g__um_bad_alpha_clist \l__um_tmpa_tl { \__um_error:n {range-not-bf-sf} }
+
+    \prop_if_exist:cTF {g__um_named_range_ \l__um_tmpa_tl _prop}
+      {
+        \seq_gput_right:Nx \g__um_mathalph_seq
+          {
+            { \exp_not:V \l__um_tmpa_tl }
+            { \exp_not:V \l__um_tmpb_tl }
+            { \exp_not:V \l__um_tmpc_tl }
+          }
+      }
+      {#2}
+  }
 \cs_set:Npn \__um_split_arrow:w #1->#2 \q_nil
- {
-  \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
-  \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} }
- }
+  {
+    \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
+    \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} }
+  }
 \cs_set:Npn \__um_split_slash:w #1/#2 \q_nil
- {
-  \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
-  \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} }
- }
-\cs_new:Nn \__um_if_char_spec:nNNT
   {
+    \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
+    \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} }
+  }
+\cs_new_protected:Nn \__um_range_decl:n
+  {
+    \bool_lazy_and:nnTF { \tl_if_single_p:n {#1} } { \token_if_cs_p:N #1 }
+      {
+        \tl_if_in:VnTF #1 { \q_unicode_math }
+          {
+            \seq_if_in:NnTF \g__um_mathclasses_seq {#1}
+              { \seq_gput_right:Nn \g__um_mclass_range_seq {#1} }
+              { \seq_gput_right:Nx \g__um_char_range_seq   {#1} }
+          }
+          { \__um_error:nx {bad-cs-in-range} { \tl_to_str:n {#1} } }
+      }
+      {
+        \seq_gput_right:Nx \g__um_char_range_seq {#1}
+      }
+  }
+\cs_new:Nn \__um_if_char_spec:nNT
+  {
     % math class:
-    \seq_if_in:NnT \l__um_mclass_range_seq {#3}
+    \seq_if_in:NnT \g__um_mclass_range_seq {#2}
       { \use_none_delimit_by_q_nil:w }
 
-    % command name:
-    \seq_if_in:NnT \l__um_cmd_range_seq {#2}
-      { \use_none_delimit_by_q_nil:w }
-
     % character slot:
-    \seq_map_inline:Nn \l__um_char_range_seq
+    \seq_map_inline:Nn \g__um_char_range_seq
       {
+        \__um_int_if_slot_is_last_in_range:nnT {#1} {##1}
+          { \seq_gremove_all:Nn \g__um_char_range_seq {##1} }
+
         \__um_int_if_slot_in_range:nnT {#1} {##1}
           { \seq_map_break:n { \use_none_delimit_by_q_nil:w } }
       }
@@ -1436,12 +1671,17 @@
     \q_nil
     \use:n
       {
-        \clist_put_right:Nx \l__um_char_nrange_clist { \int_eval:n {#1} }
-        #4
+        \cs_if_eq:NNT #2 \mathalpha
+          {
+            \clist_put_right:Nx \l__um_mathmap_charints_clist { \int_eval:n {#1} }
+          }
+        #3
       }
   }
 \cs_new:Nn \__um_int_if_slot_in_range:nnT
-  { \__um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} }
+  {
+    \__um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
+  }
 \cs_set:Npn \__um_numrange_parse:nwT #1 #2 - #3 - #4 \q_stop #5
   {
     \tl_if_empty:nTF {#4} { \int_compare:nT {#1=#2} {#5} }
@@ -1453,8 +1693,22 @@
     \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} }
       } } }
   }
+\cs_new:Nn \__um_int_if_slot_is_last_in_range:nnT
+  {
+    \__um_numrange_last_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
+  }
+\cs_set:Npn \__um_numrange_last_parse:nwT #1 #2 - #3 - #4 \q_stop #5
+  {
+    \tl_if_empty:nTF {#4} { \int_compare:nT {#1==#2} {#5} }
+      {
+    \tl_if_empty:nTF {#2} { \int_compare:nT {#1==#3} {#5} }
+      {
+                            \int_compare:nT {#1==#3} {#5}
+      } }
+  }
 
 %%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Cross-platform interface for font parameters
 
 \cs_new_protected_nopar:Nn \__um_new_cramped_style:N
   {
@@ -1466,32 +1720,32 @@
 \__um_new_cramped_style:N \crampedscriptstyle
 \__um_new_cramped_style:N \crampedscriptscriptstyle
 \cs_new_protected_nopar:Nn \__um_font_param:nnnnn
-{
-  \tl_set:Nn \l__um_tmpa_tl { #1 }
-  \tl_remove_all:Nn \l__um_tmpa_tl { _ }
-  \__um_font_param_aux:ccc { __um_ #1 :N } { __um_set_ #1 :Nn }
-    { Umath \l__um_tmpa_tl }
-}
+  {
+    \tl_set:Nn \l__um_tmpa_tl { #1 }
+    \tl_remove_all:Nn \l__um_tmpa_tl { _ }
+    \__um_font_param_aux:ccc { __um_ #1 :N } { __um_set_ #1 :Nn }
+      { Umath \l__um_tmpa_tl }
+  }
 \cs_new_protected_nopar:Nn \__um_font_param:nnn
- {
-  \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 }
- }
+  {
+    \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 }
+  }
 \cs_new_protected_nopar:Nn \__um_font_param:nn
- {
-  \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 }
- }
+  {
+    \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 }
+  }
 \cs_new_protected_nopar:Nn \__um_font_param:n
   { \__um_font_param:nnnnn { #1 } { 0 } { 0 } { 0 } { 0 } }
 \cs_new_protected_nopar:Nn \__um_font_param_aux:NNN
   {
     \cs_new_nopar:Npn #1 ##1
-     {
-      #3 ##1
-     }
+      {
+        #3 ##1
+      }
     \cs_new_protected_nopar:Npn #2 ##1 ##2
-     {
-      #3 ##1 \dim_eval:n { ##2 }
-     }
+      {
+        #3 ##1 \dim_eval:n { ##2 }
+      }
   }
 \cs_generate_variant:Nn \__um_font_param_aux:NNN { ccc }
 \__um_font_param:nn { axis } { 15 }
@@ -1539,111 +1793,444 @@
 \__um_font_param:nn { underbar_rule } { 57 }
 \__um_font_param:nn { underbar_vgap } { 56 }
 \__um_font_param:n { connector_overlap_min }
-\cs_new:Nn \__um_fontdimen_to_percent:nn
- {
-  \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 }
- }
-\cs_new:Nn \__um_fontdimen_to_scale:nn
- {
-  \fp_eval:n {\__um_fontdimen_to_percent:nn {#1} {#2} * \f at size } pt
- }
-\cs_new:Nn \__um_mathstyle_scale:Nnn
- {
-  \ifx#1\scriptstyle
-    #2 \__um_fontdimen_to_percent:nn {10} \l__um_font #3
-  \else
-    \ifx#1\scriptscriptstyle
-      #2 \__um_fontdimen_to_percent:nn {11} \l__um_font #3
+\cs_new:Nn \__um_fontdimen_to_percent:nN
+  {
+    \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 }
+  }
+\cs_new:Nn \__um_fontdimen_to_scale:nN
+  {
+    \fp_eval:n { \__um_fontdimen_to_percent:nN {#1} #2 * \f at size } pt
+  }
+\cs_new:Nn \__um_mathstyle_scale:NnnN
+  {
+    \ifx#1\scriptstyle
+      #2 \__um_fontdimen_to_percent:nN {10} #4 #3
     \else
-      #2 #3
+      \ifx#1\scriptscriptstyle
+        #2 \__um_fontdimen_to_percent:nN {11} #4 #3
+      \else
+        #2 #3
+      \fi
     \fi
-  \fi
- }
+  }
 
 %%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Setup of symbol alphabets.
 
-\cs_set:Npn \use at mathgroup #1 #2
- {
-  \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not!
-   {
-    \math at bgroup
-      \cs_if_eq:cNF {M@\f at encoding} #1 {#1}
-      \__um_switchto_literal:
-      \mathgroup #2 \relax
-    \math at egroup
-   }
- }
-\cs_set:Npn \operator at font
- {
-  \__um_switchto_literal:
-  \@fontswitch {} { \g__um_operator_mathfont_tl }
- }
-\cs_new:Nn \__um_prepare_mathstyle:n
- {
-  \seq_put_right:Nn \g__um_mathstyles_seq {#1}
-  \__um_init_alphabet:n {#1}
-  \cs_set:cpn {__um_sym_#1_aux:n}
-   { \use:c {__um_switchto_#1:} \math at egroup }
-  \cs_set_protected:cpx {sym#1}
-   {
-    \exp_not:n
-     {
-      \math at bgroup
-      \mode_if_math:F
-        {
-          \egroup\expandafter
-          \non at alpherr\expandafter{\csname sym#1\endcsname\space}
-        }
-      \tl_set:Nn \l__um_mathstyle_tl {#1}
-     }
-    \exp_not:c {__um_sym_#1_aux:n}
-   }
- }
-\cs_set:Nn \__um_init_alphabet:n
- {
-  \__um_log:nx {alph-initialise} {#1}
-  \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing:
- }
-\cs_new:Nn \__um_new_named_range:n
- {
-  \prop_new:c {g__um_named_range_#1_prop}
- }
-\clist_set:Nn \g__um_named_ranges_clist
- {
-  up, it, tt, bfup, bfit, bb , bbit, scr, bfscr, cal, bfcal,
-  frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf
- }
-\clist_map_inline:Nn \g__um_named_ranges_clist
- { \__um_new_named_range:n {#1} }
+\cs_new:Npn \__um_setup_alphabets:
+  {
+
+    \bool_if:NTF \l__um_init_bool
+      {
+        % IMPLICIT
+        \__um_log:n {setup-implicit}
+        \seq_gset_eq:NN \g__um_mathalph_seq \g__um_default_mathalph_seq
+        \bool_set_true:N \l__um_implicit_alph_bool
+        \__um_maybe_init_alphabet:n  {sf}
+        \__um_maybe_init_alphabet:n  {bf}
+        \__um_maybe_init_alphabet:n  {bfsf}
+        \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
+        \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
+        \__um_mathalph_map:
+        \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
+      }
+      {
+        \seq_if_empty:NF \g__um_mathalph_seq
+          {
+            % EXPLICIT
+            \__um_log:n {setup-explicit}
+            \bool_set_false:N \l__um_implicit_alph_bool
+            \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
+            \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
+            \__um_mathalph_map:
+            \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
+          }
+
+        % INHERIT
+        \clist_if_empty:NF \l__um_mathmap_charints_clist
+          {
+            \seq_gclear:N \g__um_mathalph_seq
+            \seq_map_inline:Nn \g__um_default_mathalph_seq
+              {
+                \tl_set:No    \l__um_style_tl       { \use_i:nnn   ##1 }
+                \clist_set:No \l__um_alphabet_clist { \use_ii:nnn  ##1 }
+
+                \clist_map_inline:Nn \l__um_alphabet_clist
+                  {
+                    \clist_map_inline:cn {g__um_named_slots_ \l__um_style_tl _ ####1 _clist}
+                      {
+                        \clist_map_inline:Nn \l__um_mathmap_charints_clist
+                          {
+                            \__um_int_if_slot_in_range:nnT {################1} {########1}
+                              {
+                                \seq_gput_right:Nn \g__um_mathalph_seq {##1}
+                                \clist_map_break:n { \clist_map_break:n { \clist_map_break: } }
+                              }
+                          }
+                      }
+                  }
+              }
+          }
+
+        \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_parse:nnn
+        \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn
+        \__um_mathalph_map:
+      }
+  }
+\cs_set:Nn \__um_mathalph_map:
+  {
+   \seq_map_inline:Nn \g__um_mathalph_seq
+      {
+        \tl_set:No    \l__um_style_tl       { \use_i:nnn   ##1 }
+        \clist_set:No \l__um_alphabet_clist { \use_ii:nnn  ##1 }
+        \tl_set:No    \l__um_remap_style_tl { \use_iii:nnn ##1 }
+
+        % If no set of alphabets is defined:
+        \clist_if_empty:NT \l__um_alphabet_clist
+          {
+            \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
+            \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop }
+              { default-alpha } \l__um_alphabet_clist
+          }
+
+        \__um_check_math_alphabet:
+        \__um_setup_math_alphabet:
+      }
+  }
+\cs_new:Nn \__um_check_math_alphabet:
+  {
+    \clist_map_inline:Nn \l__um_alphabet_clist
+      {
+        \tl_set:Nn \l__um_alphabet_tl {##1}
+        \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl
+          {
+            \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc}
+              {
+                \__um_maybe_init_alphabet:n \l__um_style_tl
+                \clist_map_break:
+              }
+              {
+                \__um_glyph_if_exist:NnT \g__um_curr_font_cmd_tl
+                  { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
+                  {
+                    \__um_maybe_init_alphabet:n \l__um_style_tl
+                    \clist_map_break:
+                  }
+              }
+          }
+          {
+            \msg_warning:nnx {unicode-math} {no-alphabet}
+              { \l__um_style_tl / \l__um_alphabet_tl }
+          }
+      }
+  }
+\cs_new:Nn \__um_setup_math_alphabet:
+  {
+    \clist_map_inline:Nn \l__um_alphabet_clist
+      {
+        \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} }
+
+
+        \__um_if_alphabet_exists:nnT {\l__um_style_tl} {\l__um_alphabet_tl}
+          {
+            \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc}
+              {
+                \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
+                \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
+              }
+              {
+                \__um_glyph_if_exist:NnTF \g__um_curr_font_cmd_tl { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
+                  {
+                    \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
+                    \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
+                  }
+                  {
+                    \bool_if:NTF \l__um_implicit_alph_bool
+                      {
+                        \seq_put_right:Nx \l__um_missing_alph_seq
+                          {
+                            \@backslashchar sym \l__um_style_tl \space
+                            (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl})
+                          }
+                      }
+                      {
+                        \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up}
+                      }
+                  }
+              }
+          }
+      }
+  }
 \cs_new:Nn \__um_new_alphabet_config:nnn
- {
-  \prop_if_exist:cF {g__um_named_range_#1_prop}
-   { \__um_warning:nnn {no-named-range} {#1} {#2} }
+  {
+    \prop_if_exist:cF {g__um_named_range_#1_prop}
+      { \__um_warning:nnn {no-named-range} {#1} {#2} }
 
-  \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl }
-    {
-     \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl }
-     {#2}
-    }
-  % Q: do I need to bother removing duplicates?
+    \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl }
+      {
+        \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl } {#2}
+      }
+    % Q: do I need to bother removing duplicates?
 
-  \cs_new:cn { __um_config_#1_#2:n } {#3}
- }
+    \cs_new:cn { __um_config_#1_#2:n }
+      {
+        \clist_gclear_new:c {g__um_named_slots_#1_#2_clist}
+        \tl_set:Nn \l__um_curr_named_slot { g__um_named_slots_#1_#2_clist }
+        #3
+        \clist_gremove_duplicates:c {g__um_named_slots_#1_#2_clist}
+      }
+
+  }
 \cs_new:Nn \__um_alphabet_config:nnn
- {
-  \use:c {__um_config_#1_#2:n} {#3}
- }
+  {
+    \use:c {__um_config_#1_#2:n} {#3}
+  }
 \prg_new_conditional:Nnn \__um_if_alphabet_exists:nn {T,TF}
- {
-  \cs_if_exist:cTF {__um_config_#1_#2:n}
-   \prg_return_true: \prg_return_false:
- }
+  {
+    \cs_if_exist:cTF {__um_config_#1_#2:n}
+      \prg_return_true: \prg_return_false:
+  }
+\cs_new:Nn \__um_map_char_noparse:nn
+  {
+    \__um_set_mathcode:nnnn {#1} {\mathalpha} {\l__um_symfont_label_tl} {#2}
+  }
+\cs_new:Nn \__um_map_char_parse:nn
+  {
+    \__um_if_char_spec:nNT {#1} {\mathalpha}
+      { \__um_map_char_noparse:nn {#1}{#2} }
+  }
+\cs_new:Nn \__um_map_char_single:nnn
+  {
+    \__um_map_char_single:nn { \__um_to_usv:nn {#1} {#3} }
+                           { \__um_to_usv:nn {#2} {#3} }
+  }
+\cs_set:Nn \__um_map_chars_range:nnn
+  {
+    \int_step_inline:nnnn {0} {1} {#1-1}
+      { \__um_map_char_single:nn {#2+##1} {#3+##1} }
+
+    \clist_gput_right:cx { \l__um_curr_named_slot }
+      { \int_eval:n { #3 } - \int_eval:n { #3 + #1-1 } }
+  }
+\cs_new:Nn \__um_map_chars_range:nnnn
+  {
+    \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
+                                 { \__um_to_usv:nn {#3} {#4} }
+  }
+\cs_set:Nn \__um_set_normal_char:nnn
+  {
+    \__um_usv_if_exist:nnT {#3} {#1}
+      {
+        \clist_map_inline:nn {#2}
+          {
+            \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3}
+            \__um_map_char_single:nnn {##1} {#3} {#1}
+
+            \clist_gput_right:cx {\l__um_curr_named_slot}
+              { \int_eval:n { \__um_to_usv:nn {#3} {#1} } }
+          }
+      }
+  }
+\cs_new:Nn \__um_set_normal_Latin:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin}
+      }
+  }
+\cs_new:Nn \__um_set_normal_latin:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {26} {##1} {#2} {latin}
+      }
+  }
+\cs_new:Nn \__um_set_normal_greek:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {25} {##1} {#2} {greek}
+        \__um_map_char_single:nnn {##1} {#2} {epsilon}
+        \__um_map_char_single:nnn {##1} {#2} {vartheta}
+        \__um_map_char_single:nnn {##1} {#2} {varkappa}
+        \__um_map_char_single:nnn {##1} {#2} {phi}
+        \__um_map_char_single:nnn {##1} {#2} {varrho}
+        \__um_map_char_single:nnn {##1} {#2} {varpi}
+        \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2}
+      }
+  }
+\cs_new:Nn \__um_set_normal_Greek:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek}
+        \__um_map_char_single:nnn {##1} {#2} {varTheta}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2}
+      }
+  }
+\cs_new:Nn \__um_set_normal_numbers:nn
+  {
+    \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2}
+    \__um_map_chars_range:nnnn {10} {#1} {#2} {num}
+  }
+\cs_new:Nn \__um_mathmap_noparse:nnn
+  {
+    \tl_put_right:cx { __um_switchto_#1: }
+      {
+        \__um_set_mathcode:nnnn {#2} {\mathalpha} {\l__um_symfont_label_tl} {#3}
+      }
+  }
+\cs_new:Nn \__um_mathmap_parse:nnn
+  {
+    \exp_args:NNx \clist_if_in:NnT \l__um_mathmap_charints_clist { \int_eval:n {#3} }
+      {
+        \__um_mathmap_noparse:nnn {#1} {#2} {#3}
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_char:nnnn
+  {
+    \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
+                                       { \__um_to_usv:nn {#3} {#4} }
+  }
+\cs_new:Nn \__um_set_mathalph_range:nnnn
+  {
+    \int_step_inline:nnnn {0} {1} {#1-1}
+      { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } }
+  }
+\cs_new:Nn \__um_set_mathalph_range:nnnnn
+  {
+    \clist_gput_right:cx { \l__um_curr_named_slot }
+      { \int_eval:n { \__um_to_usv:nn {#4} {#5} } - \int_eval:n { (#1-1)+\__um_to_usv:nn {#4} {#5} } }
+
+    \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} }
+                                          { \__um_to_usv:nn {#4} {#5} }
+  }
+\cs_new:Nn \__um_set_mathalphabet_pos:nnnn
+  {
+    \__um_usv_if_exist:nnT {#4} {#2}
+      {
+        \clist_map_inline:nn {#3}
+          { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} }
+
+        \clist_gput_right:cx {\l__um_curr_named_slot}
+          { \int_eval:n { \__um_to_usv:nn {#4} {#2} } }
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_numbers:nnn
+  {
+    \clist_map_inline:nn {#2}
+      { \__um_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} }
+  }
+\cs_new:Nn \__um_set_mathalphabet_Latin:nnn
+  {
+    \clist_map_inline:nn {#2}
+      { \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} }
+  }
+\cs_new:Nn \__um_set_mathalphabet_latin:nnn
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {h}
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_Greek:nnn
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varTheta}
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_greek:nnn
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {epsilon}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {vartheta}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varkappa}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {phi}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varrho}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varpi}
+      }
+  }
+
+%%^^A%% um-code-sym-commands.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of "math symbol alphabet" commands such as `\symbf` and co.
+
+\cs_set:Npn \use at mathgroup #1 #2
+  {
+    \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not!
+      {
+        \math at bgroup
+          \cs_if_eq:cNF {M@\f at encoding} #1 {#1}
+          \__um_switchto_literal:
+          \mathgroup #2 \relax
+        \math at egroup
+      }
+  }
+\cs_set:Npn \operator at font
+  {
+    \__um_switchto_literal:
+    \__um_fontswitch:n { \g__um_operator_mathfont_tl }
+  }
+\cs_set:Nn \__um_fontswitch:n
+  {
+    \mode_if_math:T
+      {
+        \cs_set_eq:NN \math at bgroup     \scan_stop:
+        \cs_set_eq:NN \__um_group_begin: \scan_stop:
+        \cs_set:Npn \__um_group_end:
+          {
+            \cs_set_eq:NN \__um_group_begin: \__um_group_begin_frozen:
+            \cs_set_eq:NN \__um_group_end:   \__um_group_end_frozen:
+            \cs_set_eq:NN \math at bgroup \__ummath at bgroup
+            \cs_set_eq:NN \math at egroup \__ummath at egroup
+          }
+        \cs_set_eq:NN \math at egroup \__um_group_end:
+        #1 \scan_stop:
+      }
+  }
+\cs_new:Nn \__um_prepare_mathstyle:n
+  {
+    \seq_gput_right:Nn \g__um_mathstyles_seq {#1}
+    \__um_init_alphabet:n {#1}
+    \cs_set_protected:cpx {sym#1} ##1
+      {
+        \__um_group_begin:
+          \exp_not:n
+            {
+              \mode_if_math:F
+                {
+                  \exp_args:Nc \non at alpherr {sym#1}
+                }
+              \tl_set:Nn \l__um_mathstyle_tl {#1}
+            }
+          \exp_not:c {__um_switchto_#1:} ##1
+        \__um_group_end:
+      }
+  }
+\cs_set:Nn \__um_init_alphabet:n
+  {
+    \__um_log:nx {alph-initialise} {#1}
+    \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing:
+  }
 \cs_new:Nn \__um_default_mathalph:nnn
- {
-  \seq_put_right:Nx \g__um_named_ranges_seq { \tl_to_str:n {#1} }
-  \seq_put_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}}
-  \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2}
- }
+  {
+    \prop_new:c {g__um_named_range_#1_prop}
+    \seq_gput_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}}
+    \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2}
+  }
 \__um_default_mathalph:nnn {up    } {latin,Latin,greek,Greek,num,misc} {up    }
 \__um_default_mathalph:nnn {it    } {latin,Latin,greek,Greek,misc}     {it    }
 \__um_default_mathalph:nnn {bb    } {latin,Latin,num,misc}             {bb    }
@@ -1662,366 +2249,932 @@
 \__um_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup}
 \__um_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc}     {bfsfit}
 \clist_map_inline:nn
- {
-  up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf,
-  tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak,
-  normal, literal, sf, bf,
- }
- { \__um_prepare_mathstyle:n {#1} }
+  {
+    up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf,
+    tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak,
+    normal, literal, sf, bf,
+  }
+  {
+    \__um_prepare_mathstyle:n {#1}
+  }
 \clist_map_inline:nn
- { rm, it, bf, sf, tt }
- { \cs_set_eq:cc { mathtext #1 } { math #1 } }
+  { rm, it, bf, sf, tt }
+  { \cs_set_eq:cc { mathtext #1 } { math #1 } }
 \clist_map_inline:nn
- {
-   normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
-   bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
+  {
+    normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
+    bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
+  }
+  {
+    \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } }
+  }
+\AtBeginDocument
+  {
+    \clist_map_inline:nn
+      { rm, it, bf, sf, tt }
+      {
+        \cs_set_protected:cpx { math #1 }
+        {
+          \exp_not:n { \bool_if:NTF  } \exp_not:c { g__um_ math #1 _text_bool}
+            { \exp_not:c { mathtext #1 } }
+            { \exp_not:c { sym #1 } }
+        }
+      }
+  }
+\cs_set_protected:Npn \mathup { \mathrm }
+\cs_set_protected:Npn \symrm  { \symup  }
+
+%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definitions for setting up the "math symbol alphabets".
+
+\__um_new_alphabet_config:nnn {up} {num}
+  {
+    \__um_set_normal_numbers:nn {up} {#1}
+    \__um_set_mathalphabet_numbers:nnn {up} {up} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {up} {Latin}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} }
+      {
+        \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
+      }
+    \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1}
+    \__um_set_mathalphabet_Latin:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_Latin:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {latin}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} }
+      {
+        \bool_if:NT \g__um_uplatin_bool
+          {
+            \__um_set_normal_latin:nn        {up,it} {#1}
+            \__um_set_normal_char:nnn        {h} {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1}
+    \__um_set_mathalphabet_latin:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_latin:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {Greek}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} }
+      {
+        \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} }
+      }
+    \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1}
+    \__um_set_mathalphabet_Greek:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_Greek:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {greek}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} }
+      {
+        \bool_if:NT \g__um_upgreek_bool
+          {
+            \__um_set_normal_greek:nn {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1}
+    \__um_set_mathalphabet_greek:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_greek:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_normal_char:nnn {Nabla}{up}{up}
+      }
+      {
+        \bool_if:NT \g__um_upNabla_bool
+          {
+            \__um_set_normal_char:nnn {Nabla}{up,it}{up}
+          }
+      }
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_normal_char:nnn {partial}{up}{up}
+      }
+      {
+        \bool_if:NT \g__um_uppartial_bool
+          {
+            \__um_set_normal_char:nnn {partial}{up,it}{up}
+          }
+      }
+    \__um_set_mathalphabet_pos:nnnn {up}  {partial} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {up}    {Nabla} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {it} {Latin}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} }
+      {
+        \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
+      }
+    \__um_set_mathalphabet_Latin:nnn {it} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {latin}
+  {
+    \bool_if:NTF \g__um_literal_bool
+      {
+        \__um_set_normal_latin:nn    {it}{#1}
+        \__um_set_normal_char:nnn {h}{it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_uplatin_bool
+          {
+            \__um_set_normal_latin:nn            {up,it} {#1}
+            \__um_set_normal_char:nnn {h}        {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {it}            {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {it} {dotlessi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {it} {dotlessj} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {Greek}
+  {
+    \bool_if:NTF \g__um_literal_bool
+      {
+        \__um_set_normal_Greek:nn {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it} {#1} }
+      }
+    \__um_set_mathalphabet_Greek:nnn {it} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {greek}
+  {
+    \bool_if:NTF \g__um_literal_bool
+      {
+        \__um_set_normal_greek:nn {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} }
+      }
+    \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_normal_char:nnn {Nabla} {it} {it}
+      }
+      {
+        \bool_if:NF \g__um_upNabla_bool
+          {
+            \__um_set_normal_char:nnn {Nabla} {up,it} {it}
+          }
+      }
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_normal_char:nnn {partial} {it} {it}
+      }
+      {
+        \bool_if:NF \g__um_uppartial_bool
+          {
+            \__um_set_normal_char:nnn {partial} {up,it} {it}
+          }
+      }
+    \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1}
+    \__um_set_mathalphabet_pos:nnnn {it} {Nabla}   {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bb} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {bb} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bb} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bb}    {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bb} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {bb} {up} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bb} {misc}
+  {
+    \__um_set_mathalphabet_pos:nnnn {bb}        {Pi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb}        {pi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb}     {Gamma} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb}     {gamma} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up}    {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bbit} {misc}
+  {
+    \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {scr} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {scr}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {B} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {E} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {F} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {I} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {L} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {M} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {R} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {scr} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {scr}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {e} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {g} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {o} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {cal} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {cal}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {B} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {E} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {F} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {I} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {L} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {M} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {R} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {frak} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {frak}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {C} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {I} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {R} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {Z} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {frak} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {frak} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {sfup} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {sf}   {up} {#1}
+    \__um_set_mathalphabet_numbers:nnn {sfup} {up} {#1}
+  }
+\__um_new_alphabet_config:nnn {sfup} {Latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {sfup} {#1}
+        \__um_set_mathalphabet_Latin:nnn {sf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_Latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_Latin:nnn {sfup} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {sfup} {latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_latin:nn {sfup} {#1}
+        \__um_set_mathalphabet_latin:nnn {sf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {sfup} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {sfit} {Latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {sfit} {#1}
+        \__um_set_mathalphabet_Latin:nnn {sf} {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_upsans_bool
+          {
+            \__um_set_normal_Latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_Latin:nnn {sfit} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {sfit} {latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_latin:nn {sfit} {#1}
+        \__um_set_mathalphabet_latin:nnn {sf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_upsans_bool
+          {
+            \__um_set_normal_latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {tt} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1}
+  }
+\__um_new_alphabet_config:nnn {tt} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {tt} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfit} {Latin}
+  {
+    \bool_if:NF \g__um_bfupLatin_bool
+      {
+        \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {bfit} {#1}
+        \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_bfupLatin_bool
+          {
+            \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {latin}
+  {
+    \bool_if:NF \g__um_bfuplatin_bool
+      {
+        \__um_set_normal_latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_latin:nn {bfit} {#1}
+        \__um_set_mathalphabet_latin:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_bfuplatin_bool
+          {
+            \__um_set_normal_latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {Greek}
+  {
+    \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Greek:nn {bfit}{#1}
+        \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_bfupGreek_bool
+          {
+            \__um_set_normal_Greek:nn {bfup,bfit}{#1}
+            \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {greek}
+  {
+    \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_greek:nn {bfit} {#1}
+        \__um_set_mathalphabet_greek:nnn {bf} {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_bfupgreek_bool
+          {
+            \__um_set_normal_greek:nn {bfit,bfup} {#1}
+            \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      { \__um_set_normal_char:nnn {Nabla} {bfit} {#1} }
+      {
+        \bool_if:NF \g__um_upNabla_bool
+          { \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} }
+      }
+
+    \bool_if:NTF \g__um_literal_partial_bool
+      { \__um_set_normal_char:nnn {partial} {bfit} {#1} }
+      {
+        \bool_if:NF \g__um_uppartial_bool
+          { \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1} }
+      }
+
+    \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla}   {up,it} {#1}
+
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_uppartial_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
+          }
+      }
+
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_upNabla_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
+          }
+      }
+  }
+\__um_new_alphabet_config:nnn {bfup} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {bf}   {up} {#1}
+    \__um_set_mathalphabet_numbers:nnn {bfup} {up} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {Latin}
+  {
+    \bool_if:NT \g__um_bfupLatin_bool
+      {
+        \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_Latin:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {bfup} {#1}
+        \__um_set_mathalphabet_Latin:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfupLatin_bool
+          {
+            \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {bf} {up,it} {#1}
+          }
+      }
  }
+
+\__um_new_alphabet_config:nnn {bfup} {latin}
+  {
+    \bool_if:NT \g__um_bfuplatin_bool
+      {
+        \__um_set_normal_latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_latin:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_latin:nn {bfup} {#1}
+        \__um_set_mathalphabet_latin:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfuplatin_bool
+          {
+            \__um_set_normal_latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {Greek}
+  {
+    \__um_set_mathalphabet_Greek:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Greek:nn {bfup} {#1}
+        \__um_set_mathalphabet_Greek:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfupGreek_bool
+          {
+            \__um_set_normal_Greek:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_Greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {greek}
+  {
+    \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_greek:nn {bfup} {#1}
+        \__um_set_mathalphabet_greek:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfupgreek_bool
+          {
+            \__um_set_normal_greek:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_normal_char:nnn {Nabla} {bfup} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upNabla_bool
+          {
+            \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1}
+          }
+      }
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_normal_char:nnn {partial} {bfup} {#1}
+      }
+      {
+        \bool_if:NT \g__um_uppartial_bool
+          {
+            \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1}
+          }
+      }
+    \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla}   {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bf}   {digamma} {up} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bf}   {Digamma} {up} {#1}
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_uppartial_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it} {#1}
+          }
+      }
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upNabla_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it} {#1}
+          }
+      }
+  }
+\__um_new_alphabet_config:nnn {bffrak} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bffrak} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfscr} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfscr} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfcal} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bfcal}  {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfsfup} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {bfsf}   {up}{#1}
+    \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfsfup} {Latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {bfsfup} {#1}
+        \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_latin:nn {bfsfup} {#1}
+        \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {Greek}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Greek:nn {bfsfup}{#1}
+        \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
+            \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {greek}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_greek:nn {bfsfup} {#1}
+        \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
+            \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {misc}
  {
-  \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } }
- }
-\AtBeginDocument{
-\clist_map_inline:nn
- { rm, it, bf, sf, tt }
- {
-  \cs_set_protected:cpx { math #1 }
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \exp_not:n { \bool_if:NTF  } \exp_not:c { g__um_ math #1 _text_bool}
-     { \exp_not:c { mathtext #1 } }
-     { \exp_not:c { sym #1 } }
+    \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1}
    }
- }}
-\cs_set_protected:Npn \mathup { \mathrm }
-\cs_set_protected:Npn \symrm  { \symup  }
-\cs_new:Npn \__um_setup_alphabets:
- {
-  \seq_if_empty:NTF \l__um_mathalph_seq
    {
-    \__um_log:n {setup-implicit}
-    \seq_set_eq:NN \l__um_mathalph_seq \g__um_default_mathalph_seq
-    \bool_set_true:N \l__um_implicit_alph_bool
-    \__um_maybe_init_alphabet:n  {sf}
-    \__um_maybe_init_alphabet:n  {bf}
-    \__um_maybe_init_alphabet:n  {bfsf}
+    \bool_if:NT \g__um_upNabla_bool
+     {
+      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
+     }
    }
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \__um_log:n {setup-explicit}
-    \bool_set_false:N \l__um_implicit_alph_bool
-    \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
-    \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
+    \__um_set_normal_char:nnn {partial}{bfsfup}{#1}
    }
-
-  % Now perform the mapping:
-  \seq_map_inline:Nn \l__um_mathalph_seq
    {
-    \tl_set:No    \l__um_style_tl       { \use_i:nnn   ##1 }
-    \clist_set:No \l__um_alphabet_clist { \use_ii:nnn  ##1 }
-    \tl_set:No    \l__um_remap_style_tl { \use_iii:nnn ##1 }
-
-    % If no set of alphabets is defined:
-    \clist_if_empty:NT \l__um_alphabet_clist
+    \bool_if:NT \g__um_uppartial_bool
      {
-      \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
-      \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop }
-       { default-alpha } \l__um_alphabet_clist
+      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
      }
-
-    \__um_setup_math_alphabet:
    }
-  \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
- }
-\cs_new:Nn \__um_setup_math_alphabet:
- {
-  \clist_map_inline:Nn \l__um_alphabet_clist
+  \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1}
+  \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla}   {up,it}{#1}
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \tl_set:Nn \l__um_alphabet_tl {##1}
-    \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1}
+   }
+   {
+    \bool_if:NT \g__um_uppartial_bool
      {
-      \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc}
-       {
-        \__um_maybe_init_alphabet:n \l__um_style_tl
-        \clist_map_break:
-       }
-       {
-        \__um_glyph_if_exist:NnT \l__um_font { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
-         {
-          \__um_maybe_init_alphabet:n \l__um_style_tl
-          \clist_map_break:
-         }
-       }
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
      }
-     { \msg_warning:nnx {unicode-math} {no-alphabet} { \l__um_style_tl / \l__um_alphabet_tl } }
    }
-  \clist_map_inline:Nn \l__um_alphabet_clist
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} }
-    \cs_if_exist:cT {__um_config_ \l__um_style_tl _ \l__um_alphabet_tl :n}
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up}{#1}
+   }
+   {
+    \bool_if:NT \g__um_upNabla_bool
      {
-      \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc}
-       {
-        \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
-        \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
-       }
-       {
-        \__um_glyph_if_exist:NnTF \l__um_font { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
-         {
-          \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
-          \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
-         }
-         {
-          \bool_if:NTF \l__um_implicit_alph_bool
-           {
-            \seq_put_right:Nx \l__um_missing_alph_seq
-             {
-              \@backslashchar sym \l__um_style_tl \space
-              (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl})
-             }
-           }
-           {
-            \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up}
-           }
-         }
-       }
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
      }
    }
  }
-\cs_new:Nn \__um_map_char_noparse:nn
- { \__um_set_mathcode:nnnn {#1}{\mathalpha}{\l__um_symfont_label_tl}{#2} }
-\cs_new:Nn \__um_map_char_parse:nn
+\__um_new_alphabet_config:nnn {bfsfit} {Latin}
  {
-  \__um_if_char_spec:nNNT {#1} {\@nil} {\mathalpha}
-   { \__um_map_char_noparse:nn {#1}{#2} }
- }
-\cs_new:Nn \__um_map_char_single:nnn
- {
-  \__um_map_char_single:nn { \__um_to_usv:nn {#1}{#3} }
-                         { \__um_to_usv:nn {#2}{#3} }
- }
-\cs_set:Nn \__um_map_chars_range:nnn
- {
-  \int_step_inline:nnnn {0}{1}{#1-1}
-   { \__um_map_char_single:nn {#2+##1}{#3+##1} }
- }
-\cs_new:Nn \__um_map_chars_range:nnnn
- {
-  \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2}{#4} }
-                               { \__um_to_usv:nn {#3}{#4} }
- }
-\cs_set:Nn \__um_set_normal_char:nnn
- {
-  \__um_usv_if_exist:nnT {#3} {#1}
-  {
-    \clist_map_inline:nn {#2}
+  \bool_if:NTF \g__um_sfliteral_bool
+   {
+    \__um_set_normal_Latin:nn {bfsfit} {#1}
+    \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1}
+   }
+   {
+    \bool_if:NF \g__um_upsans_bool
      {
-      \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3}
-      \__um_map_char_single:nnn {##1} {#3} {#1}
+      \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
+      \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
      }
-  }
- }
-\cs_new:Nn \__um_set_normal_Latin:nn
- {
-  \clist_map_inline:nn {#1}
-   {
-    \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin}
    }
+  \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1}
  }
-\cs_new:Nn \__um_set_normal_latin:nn
+
+\__um_new_alphabet_config:nnn {bfsfit} {latin}
  {
-  \clist_map_inline:nn {#1}
+  \bool_if:NTF \g__um_sfliteral_bool
    {
-    \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {26} {##1} {#2} {latin}
+    \__um_set_normal_latin:nn {bfsfit} {#1}
+    \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1}
    }
- }
-\cs_new:Nn \__um_set_normal_greek:nn
- {
-  \clist_map_inline:nn {#1}
    {
-    \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {25} {##1} {#2} {greek}
-    \__um_map_char_single:nnn {##1} {#2} {epsilon}
-    \__um_map_char_single:nnn {##1} {#2} {vartheta}
-    \__um_map_char_single:nnn {##1} {#2} {varkappa}
-    \__um_map_char_single:nnn {##1} {#2} {phi}
-    \__um_map_char_single:nnn {##1} {#2} {varrho}
-    \__um_map_char_single:nnn {##1} {#2} {varpi}
-    \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2}
+    \bool_if:NF \g__um_upsans_bool
+     {
+      \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
+      \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
+     }
    }
+  \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1}
  }
-\cs_new:Nn \__um_set_normal_Greek:nn
+
+\__um_new_alphabet_config:nnn {bfsfit} {Greek}
  {
-  \clist_map_inline:nn {#1}
+  \bool_if:NTF \g__um_sfliteral_bool
    {
-    \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek}
-    \__um_map_char_single:nnn {##1} {#2} {varTheta}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2}
+    \__um_set_normal_Greek:nn {bfsfit}{#1}
+    \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1}
    }
- }
-\cs_new:Nn \__um_set_normal_numbers:nn
- {
-  \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2}
-  \__um_map_chars_range:nnnn {10} {#1} {#2} {num}
- }
-\cs_new:Nn \__um_mathmap_noparse:nnn
- {
-  \clist_map_inline:nn {#2}
    {
-    \tl_put_right:cx {__um_switchto_#1:}
+    \bool_if:NF \g__um_upsans_bool
      {
-      \__um_set_mathcode:nnnn {##1} {\mathalpha} {\l__um_symfont_label_tl} {#3}
+      \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
+      \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
      }
    }
+  \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1}
  }
-\cs_new:Nn \__um_mathmap_parse:nnn
+
+\__um_new_alphabet_config:nnn {bfsfit} {greek}
  {
-  \clist_if_in:NnT \l__um_char_nrange_clist {#3}
+  \bool_if:NTF \g__um_sfliteral_bool
    {
-    \__um_mathmap_noparse:nnn {#1}{#2}{#3}
+    \__um_set_normal_greek:nn {bfsfit} {#1}
+    \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1}
    }
- }
-\cs_new:Nn \__um_set_mathalphabet_char:nnnn
- {
-  \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
-                                     { \__um_to_usv:nn {#3} {#4} }
- }
-\cs_new:Nn \__um_set_mathalph_range:nnnn
- {
-  \int_step_inline:nnnn {0} {1} {#1-1}
-    { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } }
- }
-\cs_new:Nn \__um_set_mathalph_range:nnnnn
- {
-  \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} }
-                                        { \__um_to_usv:nn {#4} {#5} }
- }
-\cs_new:Nn \__um_set_mathalphabet_pos:nnnn
- {
-  \__um_usv_if_exist:nnT {#4} {#2}
    {
-    \clist_map_inline:nn {#3}
-      { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} }
+    \bool_if:NF \g__um_upsans_bool
+     {
+      \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
+      \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
+     }
    }
+  \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1}
  }
-\cs_new:Nn \__um_set_mathalphabet_numbers:nnn
+
+\__um_new_alphabet_config:nnn {bfsfit} {misc}
  {
-  \clist_map_inline:nn {#2}
-    { \__um_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} }
- }
-\cs_new:Nn \__um_set_mathalphabet_Latin:nnn
- {
-  \clist_map_inline:nn {#2}
-    { \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} }
- }
-\cs_new:Nn \__um_set_mathalphabet_latin:nnn
- {
-  \clist_map_inline:nn {#2}
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {h}
+    \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1}
    }
- }
-\cs_new:Nn \__um_set_mathalphabet_Greek:nnn
- {
-  \clist_map_inline:nn {#2}
    {
-    \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varTheta}
+    \bool_if:NF \g__um_upNabla_bool
+     {
+      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
+     }
    }
- }
-\cs_new:Nn \__um_set_mathalphabet_greek:nnn
- {
-  \clist_map_inline:nn {#2}
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {epsilon}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {vartheta}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varkappa}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {phi}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varrho}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varpi}
+    \__um_set_normal_char:nnn {partial}{bfsfit}{#1}
    }
- }
-
-%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\AtBeginDocument{\__um_resolve_greek:}
-\cs_new:Npn \__um_resolve_greek:
- {
-  \clist_map_inline:nn
    {
-    Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,
-    alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
-    Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,
-    mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,
-    varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi
+    \bool_if:NF \g__um_uppartial_bool
+     {
+      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
+     }
    }
+  \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1}
+  \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla}   {up,it}{#1}
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \tl_set:cx {##1} { \exp_not:c { mit ##1 } }
-    \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } }
-    \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } }
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1}
    }
- }
-\cs_if_exist:NF \Uroot
-  { \cs_new_eq:NN \Uroot \luatexUroot }
-\AtBeginDocument{\__um_redefine_radical:}
-\cs_new:Nn \__um_redefine_radical:
- {
-  \@ifpackageloaded { amsmath } { }
    {
-    \cs_set:Npn \root ##1 \of ##2
+    \bool_if:NF \g__um_uppartial_bool
      {
-       \Uroot \l__um_radical_sqrt_tl { ##1 } { ##2 }
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
      }
    }
- }
-\cs_new:Npn \__um_define_active_frac:Nw #1 #2/#3
- {
-  \char_set_catcode_active:N #1
-  \__um_char_gmake_mathactive:N #1
-  \tl_rescan:nn
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \catcode`\_=11\relax
-    \catcode`\:=11\relax
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {it}{#1}
    }
    {
-    \cs_gset:Npx #1
+    \bool_if:NF \g__um_upNabla_bool
      {
-      \bool_if:NTF \l__um_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac}
-          {#2} {#3}
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
      }
    }
  }
+
+%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Assorted definitions to close up.
+
+\AtBeginDocument { \__um_resolve_greek: }
+\cs_new:Npn \__um_resolve_greek:
+  {
+    \clist_map_inline:nn
+      {
+        Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,
+        alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
+        Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,
+        mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,
+        varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi
+      }
+      {
+        \tl_set:cx {##1} { \exp_not:c { mit ##1 } }
+        \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } }
+        \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } }
+      }
+  }
+\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \__um_redefine_radical: } }
+\cs_new:Nn \__um_redefine_radical:
+  {
+    \cs_set:Npn \root ##1 \of ##2
+      {
+        \Uroot \l__um_radical_sqrt_tl { ##1 } { ##2 }
+      }
+  }
+\cs_new:Nn \__um_which_frac:nn
+  {
+    \bool_if:NTF \l__um_smallfrac_bool {\tfrac} {\frac} {#1} {#2}
+  }
 \cs_new:Npn \__um_setup_active_frac:
- {
-  \group_begin:
-  \__um_define_active_frac:Nw  ^^^^2189  0/3
-  \__um_define_active_frac:Nw  ^^^^2152  1/{10}
-  \__um_define_active_frac:Nw  ^^^^2151  1/9
-  \__um_define_active_frac:Nw  ^^^^215b  1/8
-  \__um_define_active_frac:Nw  ^^^^2150  1/7
-  \__um_define_active_frac:Nw  ^^^^2159  1/6
-  \__um_define_active_frac:Nw  ^^^^2155  1/5
-  \__um_define_active_frac:Nw  ^^^^00bc  1/4
-  \__um_define_active_frac:Nw  ^^^^2153  1/3
-  \__um_define_active_frac:Nw  ^^^^215c  3/8
-  \__um_define_active_frac:Nw  ^^^^2156  2/5
-  \__um_define_active_frac:Nw  ^^^^00bd  1/2
-  \__um_define_active_frac:Nw  ^^^^2157  3/5
-  \__um_define_active_frac:Nw  ^^^^215d  5/8
-  \__um_define_active_frac:Nw  ^^^^2154  2/3
-  \__um_define_active_frac:Nw  ^^^^00be  3/4
-  \__um_define_active_frac:Nw  ^^^^2158  4/5
-  \__um_define_active_frac:Nw  ^^^^215a  5/6
-  \__um_define_active_frac:Nw  ^^^^215e  7/8
-  \group_end:
- }
-\__um_setup_active_frac:
+  {
+    \__um_mathactive_remap:nn {"2189}  { \__um_which_frac:nn {0} {3}  }
+    \__um_mathactive_remap:nn {"2152}  { \__um_which_frac:nn {1} {10} }
+    \__um_mathactive_remap:nn {"2151}  { \__um_which_frac:nn {1} {9}  }
+    \__um_mathactive_remap:nn {"215B}  { \__um_which_frac:nn {1} {8}  }
+    \__um_mathactive_remap:nn {"2150}  { \__um_which_frac:nn {1} {7}  }
+    \__um_mathactive_remap:nn {"2159}  { \__um_which_frac:nn {1} {6}  }
+    \__um_mathactive_remap:nn {"2155}  { \__um_which_frac:nn {1} {5}  }
+    \__um_mathactive_remap:nn {"00BC}  { \__um_which_frac:nn {1} {4}  }
+    \__um_mathactive_remap:nn {"2153}  { \__um_which_frac:nn {1} {3}  }
+    \__um_mathactive_remap:nn {"215C}  { \__um_which_frac:nn {3} {8}  }
+    \__um_mathactive_remap:nn {"2156}  { \__um_which_frac:nn {2} {5}  }
+    \__um_mathactive_remap:nn {"00BD}  { \__um_which_frac:nn {1} {2}  }
+    \__um_mathactive_remap:nn {"2157}  { \__um_which_frac:nn {3} {5}  }
+    \__um_mathactive_remap:nn {"215D}  { \__um_which_frac:nn {5} {8}  }
+    \__um_mathactive_remap:nn {"2154}  { \__um_which_frac:nn {2} {3}  }
+    \__um_mathactive_remap:nn {"00BE}  { \__um_which_frac:nn {3} {4}  }
+    \__um_mathactive_remap:nn {"2158}  { \__um_which_frac:nn {4} {5}  }
+    \__um_mathactive_remap:nn {"215A}  { \__um_which_frac:nn {5} {6}  }
+    \__um_mathactive_remap:nn {"215E}  { \__um_which_frac:nn {7} {8}  }
+  }
+\AtBeginDocument { \__um_setup_active_frac: }
 \protected\def\to{\rightarrow}
 \protected\def\le{\leq}
 \protected\def\ge{\geq}
@@ -2051,19 +3204,19 @@
 \protected\def\smallint{\mathop{\textstyle\int}\limits}
 \cs_set_eq:NN \latexe_underbar:n \underbar
 \renewcommand\underbar
- {
-  \mode_if_math:TF \mathunderbar \latexe_underbar:n
- }
+  {
+    \mode_if_math:TF \mathunderbar \latexe_underbar:n
+  }
 \@ifpackageloaded{amsmath}
- {
-  % define their own colon, perhaps I should just steal it. (It does look much better.)
- }
- {
-  \cs_set_protected:Npn \colon
-   {
-    \bool_if:NTF \g__um_literal_colon_bool {:} { \mathpunct{:} }
-   }
- }
+  {
+    % define their own colon, perhaps I should just steal it. (It does look much better.)
+  }
+  {
+    \cs_set_protected:Npn \colon
+      {
+        \bool_if:NTF \g__um_literal_colon_bool {:} { \mathpunct{:} }
+      }
+  }
 \protected\def\digamma{\updigamma}
 \protected\def\Digamma{\upDigamma}
 \cs_set_protected:Npn \| {\Vert}
@@ -2071,47 +3224,77 @@
 \cs_set_protected:Npn \cdots {\mathinner{\unicodecdots}}
 \cs_set_eq:NN \__um_text_slash: \slash
 \cs_set_protected:Npn \slash
- {
-  \mode_if_math:TF {\mathslash} {\__um_text_slash:}
- }
-\cs_new:Npn \__um_newnot:N #1
- {
-   \tl_set:Nx \l_not_token_name_tl { \token_to_str:N #1 }
-   \exp_args:Nx \tl_if_empty:nF { \tl_tail:V \l_not_token_name_tl }
-    {
-     \tl_set:Nx \l_not_token_name_tl { \tl_tail:V \l_not_token_name_tl }
-    }
-   \cs_if_exist:cTF { n \l_not_token_name_tl }
-    {
-     \use:c { n \l_not_token_name_tl }
-    }
-    {
-     \cs_if_exist:cTF { not \l_not_token_name_tl }
+  {
+    \mode_if_math:TF {\mathslash} {\__um_text_slash:}
+  }
+\DeclareDocumentCommand \not {m}
+  {
+    \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #1 }
+    \tl_if_empty:NT \l__um_not_token_name_tl
       {
-       \use:c { not \l_not_token_name_tl }
+        \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #1 }
       }
+    \cs_if_exist:cTF { not \l__um_not_token_name_tl }
       {
-       \__um_oldnot: #1
+        \use:c { not \l__um_not_token_name_tl }
       }
-    }
- }
-\cs_set_eq:NN \__um_oldnot: \not
-\AtBeginDocument{\cs_set_eq:NN \not \__um_newnot:N}
-\cs_new_protected_nopar:Nn \__um_setup_negations:
- {
-  \cs_gset:cpn { not= }    { \neq }
-  \cs_gset:cpn { not< }    { \nless }
-  \cs_gset:cpn { not> }    { \ngtr }
-  \cs_gset:Npn  \ngets     { \nleftarrow }
-  \cs_gset:Npn  \nsimeq    { \nsime }
-  \cs_gset:Npn  \nequal    { \ne }
-  \cs_gset:Npn  \nle       { \nleq }
-  \cs_gset:Npn  \nge       { \ngeq }
-  \cs_gset:Npn  \ngreater  { \ngtr }
-  \cs_gset:Npn  \nforksnot { \forks }
- }
+      {
+        \cs_if_exist:cTF { n \l__um_not_token_name_tl }
+          {
+            \use:c { n \l__um_not_token_name_tl }
+          }
+          {
+            \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1
+          }
+      }
+  }
+\DeclareDocumentCommand \NewNegationCommand {mm}
+  {
+    \__um_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2}
+  }
+\DeclareDocumentCommand \RenewNegationCommand {mm}
+  {
+    \__um_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2}
+  }
+\cs_set:Nn \__um_set_negation_command:Nnn
+  {
+    \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #2 }
+    \tl_if_empty:NT \l__um_not_token_name_tl
+      {
+        \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #2 }
+      }
+    #1 { not \l__um_not_token_name_tl } { #3 }
+  }
+\NewNegationCommand { = }    { \neq   }
+\NewNegationCommand { < }    { \nless }
+\NewNegationCommand { > }    { \ngtr  }
+\NewNegationCommand { \gets     } { \nleftarrow }
+\NewNegationCommand { \simeq    } { \nsime      }
+\NewNegationCommand { \equal    } { \ne         }
+\NewNegationCommand { \le       } { \nleq       }
+\NewNegationCommand { \ge       } { \ngeq       }
+\NewNegationCommand { \greater  } { \ngtr       }
+\NewNegationCommand { \forksnot } { \forks      }
+\int_step_inline:nnnn {0} {1} {9}
+  {
+    \__um_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}}
+  }
+\int_step_inline:nnnn {0} {1} {26}
+  {
+    \__um_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}}
+    \__um_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}}
+  }
+\cs_new:Nn \__um_undeclare_symbol:N
+  {
+    \cs_set_protected:Npn #1
+      { \__um_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } }
+  }
+\__um_undeclare_symbol:N \arrowvert
+\__um_undeclare_symbol:N \Arrowvert
+\__um_undeclare_symbol:N \bracevert
 
 %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The definitions needed for the input of primes.
 
 \cs_new:Nn \__um_arg_i_before_egroup:n {#1\egroup}
 \cs_new:Nn \__um_superscript:n
@@ -2133,17 +3316,17 @@
    {
     {1} { \__um_superscript:n {#1} }
     {2} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2033}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2033}
         { \__um_superscript:n {\__um_prime_double_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
     {3} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2034}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2034}
         { \__um_superscript:n {\__um_prime_triple_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
     {4} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2057}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2057}
         { \__um_superscript:n {\__um_prime_quad_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
@@ -2158,12 +3341,12 @@
    {
     {1} { \__um_superscript:n {#1} }
     {2} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2036}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2036}
         { \__um_superscript:n {\__um_backprime_double_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
     {3} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2037}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2037}
         { \__um_superscript:n {\__um_backprime_triple_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
@@ -2395,1171 +3578,299 @@
 \group_end:
 
 %%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Setup for active chars needed to process subscript/superscript input chars.
 
-\group_begin:
 \cs_new:Nn \__um_setup_active_superscript:nn
- {
-  \prop_gput:Nnn \g__um_supers_prop   {#1} {#2}
-  \char_set_catcode_active:N #1
-  \__um_char_gmake_mathactive:N #1
-  \scantokens
-   {
-    \cs_gset:Npn #1
-     {
-      \tl_set:Nn \l__um_ss_chain_tl {#2}
-      \cs_set_eq:NN \__um_sub_or_super:n \sp
-      \tl_set:Nn \l__um_tmpa_tl {supers}
-      \__um_scan_sscript:
-     }
-   }
- }
-\__um_setup_active_superscript:nn {^^^^2070} {0}
-\__um_setup_active_superscript:nn {^^^^00b9} {1}
-\__um_setup_active_superscript:nn {^^^^00b2} {2}
-\__um_setup_active_superscript:nn {^^^^00b3} {3}
-\__um_setup_active_superscript:nn {^^^^2074} {4}
-\__um_setup_active_superscript:nn {^^^^2075} {5}
-\__um_setup_active_superscript:nn {^^^^2076} {6}
-\__um_setup_active_superscript:nn {^^^^2077} {7}
-\__um_setup_active_superscript:nn {^^^^2078} {8}
-\__um_setup_active_superscript:nn {^^^^2079} {9}
-\__um_setup_active_superscript:nn {^^^^207a} {+}
-\__um_setup_active_superscript:nn {^^^^207b} {-}
-\__um_setup_active_superscript:nn {^^^^207c} {=}
-\__um_setup_active_superscript:nn {^^^^207d} {(}
-\__um_setup_active_superscript:nn {^^^^207e} {)}
-\__um_setup_active_superscript:nn {^^^^2071} {i}
-\__um_setup_active_superscript:nn {^^^^207f} {n}
-\__um_setup_active_superscript:nn {^^^^02b0} {h}
-\__um_setup_active_superscript:nn {^^^^02b2} {j}
-\__um_setup_active_superscript:nn {^^^^02b3} {r}
-\__um_setup_active_superscript:nn {^^^^02b7} {w}
-\__um_setup_active_superscript:nn {^^^^02b8} {y}
+  {
+    \prop_gput:Nxn \g__um_supers_prop { \int_eval:n {#1} } {#2}
+    \__um_mathactive_remap:nn {#1}
+       {
+        \tl_set:Nn \l__um_ss_chain_tl {#2}
+        \cs_set_eq:NN \__um_sub_or_super:n \sp
+        \tl_set:Nn \l__um_tmpa_tl {supers}
+        \__um_scan_sscript:
+       }
+  }
 \cs_new:Nn \__um_setup_active_subscript:nn
- {
-  \prop_gput:Nnn \g__um_subs_prop   {#1} {#2}
-  \char_set_catcode_active:N #1
-  \__um_char_gmake_mathactive:N #1
-  \scantokens
-   {
-    \cs_gset:Npn #1
-     {
-      \tl_set:Nn \l__um_ss_chain_tl {#2}
-      \cs_set_eq:NN \__um_sub_or_super:n \sb
-      \tl_set:Nn \l__um_tmpa_tl {subs}
-      \__um_scan_sscript:
-     }
-   }
- }
-\__um_setup_active_subscript:nn {^^^^2080} {0}
-\__um_setup_active_subscript:nn {^^^^2081} {1}
-\__um_setup_active_subscript:nn {^^^^2082} {2}
-\__um_setup_active_subscript:nn {^^^^2083} {3}
-\__um_setup_active_subscript:nn {^^^^2084} {4}
-\__um_setup_active_subscript:nn {^^^^2085} {5}
-\__um_setup_active_subscript:nn {^^^^2086} {6}
-\__um_setup_active_subscript:nn {^^^^2087} {7}
-\__um_setup_active_subscript:nn {^^^^2088} {8}
-\__um_setup_active_subscript:nn {^^^^2089} {9}
-\__um_setup_active_subscript:nn {^^^^208a} {+}
-\__um_setup_active_subscript:nn {^^^^208b} {-}
-\__um_setup_active_subscript:nn {^^^^208c} {=}
-\__um_setup_active_subscript:nn {^^^^208d} {(}
-\__um_setup_active_subscript:nn {^^^^208e} {)}
-\__um_setup_active_subscript:nn {^^^^2090} {a}
-\__um_setup_active_subscript:nn {^^^^2091} {e}
-\__um_setup_active_subscript:nn {^^^^2095} {h}
-\__um_setup_active_subscript:nn {^^^^1d62} {i}
-\__um_setup_active_subscript:nn {^^^^2c7c} {j}
-\__um_setup_active_subscript:nn {^^^^2096} {k}
-\__um_setup_active_subscript:nn {^^^^2097} {l}
-\__um_setup_active_subscript:nn {^^^^2098} {m}
-\__um_setup_active_subscript:nn {^^^^2099} {n}
-\__um_setup_active_subscript:nn {^^^^2092} {o}
-\__um_setup_active_subscript:nn {^^^^209a} {p}
-\__um_setup_active_subscript:nn {^^^^1d63} {r}
-\__um_setup_active_subscript:nn {^^^^209b} {s}
-\__um_setup_active_subscript:nn {^^^^209c} {t}
-\__um_setup_active_subscript:nn {^^^^1d64} {u}
-\__um_setup_active_subscript:nn {^^^^1d65} {v}
-\__um_setup_active_subscript:nn {^^^^2093} {x}
-\__um_setup_active_subscript:nn {^^^^1d66} {\beta}
-\__um_setup_active_subscript:nn {^^^^1d67} {\gamma}
-\__um_setup_active_subscript:nn {^^^^1d68} {\rho}
-\__um_setup_active_subscript:nn {^^^^1d69} {\phi}
-\__um_setup_active_subscript:nn {^^^^1d6a} {\chi}
-\group_end:
-\cs_new:Npn \__um_scan_sscript:
- {
-  \__um_scan_sscript:TF
-   {
-    \__um_scan_sscript:
-   }
-   {
-    \__um_sub_or_super:n {\l__um_ss_chain_tl}
-   }
- }
-\cs_new:Npn \__um_scan_sscript:TF #1#2
- {
-  \peek_N_type:TF
-   {
-    \group_align_safe_begin:
-    \__um_scan_sscript_aux:nnN {#1} {#2}
-   }
-   {#2}
- }
-\cs_new:Npn \__um_scan_sscript_aux:nnN #1#2#3
- {
-  \prop_get:cnNTF {g__um_\l__um_tmpa_tl _prop} {#3} \l__um_tmpb_tl
-   {
-    \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl
-    \group_align_safe_end:
-    #1
-   }
-   { \group_align_safe_end: #2 #3 }
- }
+  {
+    \prop_gput:Nxn \g__um_subs_prop { \int_eval:n {#1} } {#2}
+    \__um_mathactive_remap:nn {#1}
+      {
+        \tl_set:Nn \l__um_ss_chain_tl {#2}
+        \cs_set_eq:NN \__um_sub_or_super:n \sb
+        \tl_set:Nn \l__um_tmpa_tl {subs}
+        \__um_scan_sscript:
+      }
+  }
+\cs_new:Nn \__um_scan_sscript:
+  {
+    \__um_scan_sscript:TF
+      { \__um_scan_sscript: }
+      { \__um_sub_or_super:n {\l__um_ss_chain_tl} }
+  }
+\cs_new:Nn \__um_scan_sscript:TF
+  {
+    \peek_N_type:TF
+      {
+        \group_align_safe_begin:
+        \__um_scan_sscript_aux:nnN {#1} {#2}
+      }
+      {#2}
+  }
+\cs_new:Nn \__um_scan_sscript_aux:nnN
+  {
+    \tl_set:Nx \l__um_tmpa_key_tl { \tl_to_str:n {#3} }
+    \prop_get:cxNTF {g__um_\l__um_tmpa_tl _prop}
+      { \int_eval:n { \exp_after:wN ` \l__um_tmpa_key_tl } }
+      \l__um_tmpb_tl
+      {
+        \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl
+        \group_align_safe_end:
+        #1
+      }
+      { \group_align_safe_end: #2 #3 }
+  }
+\__um_setup_active_superscript:nn {"2070} {0}
+\__um_setup_active_superscript:nn {"00B9} {1}
+\__um_setup_active_superscript:nn {"00B2} {2}
+\__um_setup_active_superscript:nn {"00B3} {3}
+\__um_setup_active_superscript:nn {"2074} {4}
+\__um_setup_active_superscript:nn {"2075} {5}
+\__um_setup_active_superscript:nn {"2076} {6}
+\__um_setup_active_superscript:nn {"2077} {7}
+\__um_setup_active_superscript:nn {"2078} {8}
+\__um_setup_active_superscript:nn {"2079} {9}
+\__um_setup_active_superscript:nn {"207A} {+}
+\__um_setup_active_superscript:nn {"207B} {-}
+\__um_setup_active_superscript:nn {"207C} {=}
+\__um_setup_active_superscript:nn {"207D} {(}
+\__um_setup_active_superscript:nn {"207E} {)}
+\__um_setup_active_superscript:nn {"2071} {i}
+\__um_setup_active_superscript:nn {"207F} {n}
+\__um_setup_active_superscript:nn {"02B0} {h}
+\__um_setup_active_superscript:nn {"02B2} {j}
+\__um_setup_active_superscript:nn {"02B3} {r}
+\__um_setup_active_superscript:nn {"02B7} {w}
+\__um_setup_active_superscript:nn {"02B8} {y}
+\__um_setup_active_subscript:nn {"2080} {0}
+\__um_setup_active_subscript:nn {"2081} {1}
+\__um_setup_active_subscript:nn {"2082} {2}
+\__um_setup_active_subscript:nn {"2083} {3}
+\__um_setup_active_subscript:nn {"2084} {4}
+\__um_setup_active_subscript:nn {"2085} {5}
+\__um_setup_active_subscript:nn {"2086} {6}
+\__um_setup_active_subscript:nn {"2087} {7}
+\__um_setup_active_subscript:nn {"2088} {8}
+\__um_setup_active_subscript:nn {"2089} {9}
+\__um_setup_active_subscript:nn {"208A} {+}
+\__um_setup_active_subscript:nn {"208B} {-}
+\__um_setup_active_subscript:nn {"208C} {=}
+\__um_setup_active_subscript:nn {"208D} {(}
+\__um_setup_active_subscript:nn {"208E} {)}
+\__um_setup_active_subscript:nn {"2090} {a}
+\__um_setup_active_subscript:nn {"2091} {e}
+\__um_setup_active_subscript:nn {"2095} {h}
+\__um_setup_active_subscript:nn {"1D62} {i}
+\__um_setup_active_subscript:nn {"2C7C} {j}
+\__um_setup_active_subscript:nn {"2096} {k}
+\__um_setup_active_subscript:nn {"2097} {l}
+\__um_setup_active_subscript:nn {"2098} {m}
+\__um_setup_active_subscript:nn {"2099} {n}
+\__um_setup_active_subscript:nn {"2092} {o}
+\__um_setup_active_subscript:nn {"209A} {p}
+\__um_setup_active_subscript:nn {"1D63} {r}
+\__um_setup_active_subscript:nn {"209B} {s}
+\__um_setup_active_subscript:nn {"209C} {t}
+\__um_setup_active_subscript:nn {"1D64} {u}
+\__um_setup_active_subscript:nn {"1D65} {v}
+\__um_setup_active_subscript:nn {"2093} {x}
+\__um_setup_active_subscript:nn {"1D66} {\beta}
+\__um_setup_active_subscript:nn {"1D67} {\gamma}
+\__um_setup_active_subscript:nn {"1D68} {\rho}
+\__um_setup_active_subscript:nn {"1D69} {\phi}
+\__um_setup_active_subscript:nn {"1D6A} {\chi}
 
 %%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Compatibility with 3rd party packages.
 
-\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnnn
- {
-  \cs_if_exist:NT #1
-   {
-    \token_if_macro:NTF #1
-     {
-      \group_begin:
-      #2 \__um_tmpa:w #3 { #4 }
-      \cs_if_eq:NNTF #1 \__um_tmpa:w
-       {
-        \msg_info:nnx { unicode-math } { patch-macro }
-          { \token_to_str:N #1 }
-        \group_end:
-        #2 #1 #3
-          { #5 }
+\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnn
+  {
+    \cs_if_exist:NT #1
+      {
+        \token_if_macro:NTF #1
+          {
+            \group_begin:
+            #2 \__um_tmpa:w #3 { #4 }
+            \cs_if_eq:NNTF #1 \__um_tmpa:w
+              {
+                \msg_info:nnx { unicode-math } { patch-macro } { \token_to_str:N #1 }
+                \group_end:
+                #2 #1 #3 { #5 }
+              }
+              {
+                \msg_warning:nnxxx { unicode-math } { wrong-meaning }
+                  { \token_to_str:N #1 } { \token_to_meaning:N #1 }
+                  { \token_to_meaning:N \__um_tmpa:w }
+                \group_end:
+              }
+          }
+          {
+            \msg_warning:nnx { unicode-math } { macro-expected }
+              { \token_to_str:N #1 }
+          }
        }
-       {
-        \msg_warning:nnxxx { unicode-math } { wrong-meaning }
-          { \token_to_str:N #1 } { \token_to_meaning:N #1 }
-          { \token_to_meaning:N \__um_tmpa:w }
-        \group_end:
-       }
-     }
-     {
-      \msg_warning:nnx { unicode-math } { macro-expected }
-        { \token_to_str:N #1 }
-     }
-   }
- }
-\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnn
- {
-  \__um_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 }
- }
-\cs_new_protected_nopar:Nn \__um_check_and_fix_luatex:NNnnn
- {
-    \__um_check_and_fix:NNnnn #1 #2 { #3 } { #4 } { #5 }
- }
-\cs_generate_variant:Nn \__um_check_and_fix_luatex:NNnnn { c }
+  }
 \AtEndOfPackageFile * {url}
- {
-  \tl_put_left:Nn \Url at FormatString { \__um_switchto_up: }
-  \tl_put_right:Nn \UrlSpecials
-   {
-    \do\`{\mathchar`\`}
-    \do\'{\mathchar`\'}
-    \do\${\mathchar`\$}
-    \do\&{\mathchar`\&}
-   }
- }
-\AtEndOfPackageFile * {amsmath}
- {
-  \cs_set:Npn \@cdots {\mathinner{\cdots}}
-  \cs_set_eq:NN \dotsb@ \cdots
-  \__um_check_and_fix_luatex:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 }
-   {
-    \setbox \rootbox \hbox
-     {
-      $ \m at th \scriptscriptstyle { #1 } $
-     }
-    \mathchoice
-      { \r@@t \displaystyle      { #2 } }
-      { \r@@t \textstyle         { #2 } }~
-      { \r@@t \scriptstyle       { #2 } }
-      { \r@@t \scriptscriptstyle { #2 } }
-    \egroup
-   }
-   {
-    \bool_if:nTF
-     {
-      \int_compare_p:nNn { \uproot@ } = { \c_zero }
-      && \int_compare_p:nNn { \leftroot@ } = { \c_zero }
-     }
-     {
-        \Uroot \l__um_radical_sqrt_tl { #1 } { #2 }
-     }
-     {
-      \hbox_set:Nn \rootbox
-       {
-        \c_math_toggle_token
-        \m at th
-        \scriptscriptstyle { #1 }
-        \c_math_toggle_token
-       }
-      \mathchoice
-        { \r@@t \displaystyle      { #2 } }
-        { \r@@t \textstyle         { #2 } }
-        { \r@@t \scriptstyle       { #2 } }
-        { \r@@t \scriptscriptstyle { #2 } }
-     }
-    \c_group_end_token
-   }
-  \__um_check_and_fix:NNnnnn \r@@t \cs_set_nopar:Npn { #1 #2 }
-   {
-    \setboxz at h { $ \m at th #1 \sqrtsign { #2 } $ }
-    \dimen@ \ht\z@
-    \advance \dimen@ -\dp\z@
-    \setbox\@ne \hbox { $ \m at th #1 \mskip \uproot@ mu $ }
-    \advance \dimen@ by 1.667 \wd\@ne
-    \mkern -\leftroot@ mu
-    \mkern 5mu
-    \raise .6\dimen@ \copy\rootbox
-    \mkern -10mu
-    \mkern \leftroot@ mu
-    \boxz@
-   }
-   {
-    \hbox_set:Nn \l_tmpa_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \mskip \uproot@ mu
-      \c_math_toggle_token
-     }
-      \Uroot \l__um_radical_sqrt_tl
-     {
-      \box_move_up:nn { \box_wd:N \l_tmpa_box }
-       {
-        \hbox:n
-         {
-          \c_math_toggle_token
-          \m at th
-          \mkern -\leftroot@ mu
-          \box_use:N \rootbox
-          \mkern \leftroot@ mu
-          \c_math_toggle_token
-         }
-       }
-     }
-     { #2 }
-   }
-   {
-    \hbox_set:Nn \l_tmpa_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \sqrtsign { #2 }
-      \c_math_toggle_token
-     }
-    \hbox_set:Nn \l_tmpb_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \mskip \uproot@ mu
-      \c_math_toggle_token
-     }
-    \mkern -\leftroot@ mu
-    \__um_mathstyle_scale:Nnn #1 { \kern }
-     {
-      \fontdimen 63 \l__um_font
-     }
-    \box_move_up:nn
-     {
-      \box_wd:N \l_tmpb_box
-      + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
-      * \number \fontdimen 65 \l__um_font / 100
-     }
-     {
-      \box_use:N \rootbox
-     }
-    \__um_mathstyle_scale:Nnn #1 { \kern }
-     {
-      \fontdimen 64 \l__um_font
-     }
-    \mkern \leftroot@ mu
-    \box_use_clear:N \l_tmpa_box
-   }
- }
+  {
+    \tl_put_left:Nn \Url at FormatString { \__um_switchto_up: }
+    \tl_put_right:Nn \UrlSpecials
+      {
+        \do \` { \mathchar`\` }
+        \do \' { \mathchar`\' }
+        \do \$ { \mathchar`\$ }
+        \do \& { \mathchar`\& }
+      }
+  }
 \AtEndOfPackageFile * { mathtools }
- {
+  {
     \cs_set_eq:NN \MToverbracket  \overbracket
     \cs_set_eq:NN \MTunderbracket \underbracket
 
     \AtBeginDocument
-     {
-      \msg_warning:nn { unicode-math } { mathtools-overbracket }
+      {
+        \msg_warning:nn { unicode-math } { mathtools-overbracket }
 
-\def\downbracketfill#1#2
- {%
-            \edef\l_MT_bracketheight_fdim{.27ex}%
-            \downbracketend{#1}{#2}
+       \cs_set:Npn \downbracketfill #1 #2
+        {
+            \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
+            \downbracketend {#1} {#2}
             \leaders \vrule \@height #1 \@depth \z@ \hfill
-            \downbracketend{#1}{#2}%
-     }
-\def\upbracketfill#1#2
- {%
-            \edef\l_MT_bracketheight_fdim{.27ex}%
-            \upbracketend{#1}{#2}
+            \downbracketend {#1} {#2}
+          }
+
+      \cs_set:Npn \upbracketfill #1 #2
+        {
+            \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
+            \upbracketend {#1} {#2}
             \leaders \vrule \@height \z@ \@depth #1 \hfill
-            \upbracketend{#1}{#2}%
+            \upbracketend {#1} {#2}
+          }
+
+      \cs_set_eq:NN \Uoverbracket  \overbracket
+      \cs_set_eq:NN \Uunderbracket \underbracket
+        \cs_set_eq:NN \overbracket   \MToverbracket
+        \cs_set_eq:NN \underbracket  \MTunderbracket
      }
-\let\Uoverbracket =\overbracket
-\let\Uunderbracket=\underbracket
-        \let\overbracket  =\MToverbracket
-        \let\underbracket =\MTunderbracket
-     }% end of AtBeginDocument
-  \msg_warning:nn { unicode-math } { mathtools-colon }
-  \NewDocumentCommand \dblcolon { } { \Colon }
-  \NewDocumentCommand \coloneqq { } { \coloneq }
-  \NewDocumentCommand \Coloneqq { } { \Coloneq }
-  \NewDocumentCommand \eqqcolon { } { \eqcolon }
- }
+  }
+\AtEndOfPackageFile * { mathtools }
+  {
+    \msg_warning:nn { unicode-math } { mathtools-colon }
+    \NewDocumentCommand \dblcolon { } { \Colon }
+    \NewDocumentCommand \coloneqq { } { \coloneq }
+    \NewDocumentCommand \Coloneqq { } { \Coloneq }
+    \NewDocumentCommand \eqqcolon { } { \eqcolon }
+  }
 \AtEndOfPackageFile * { colonequals }
- {
-  \msg_warning:nn { unicode-math } { colonequals }
-  \RenewDocumentCommand \ratio { } { \mathratio }
-  \RenewDocumentCommand \coloncolon { } { \Colon }
-  \RenewDocumentCommand \minuscolon { } { \dashcolon }
-  \RenewDocumentCommand \colonequals { } { \coloneq }
-  \RenewDocumentCommand \equalscolon { } { \eqcolon }
-  \RenewDocumentCommand \coloncolonequals { } { \Coloneq }
- }
+  {
+    \msg_warning:nn { unicode-math } { colonequals }
+    \RenewDocumentCommand \ratio { } { \mathratio }
+    \RenewDocumentCommand \coloncolon { } { \Colon }
+    \RenewDocumentCommand \minuscolon { } { \dashcolon }
+    \RenewDocumentCommand \colonequals { } { \coloneq }
+    \RenewDocumentCommand \equalscolon { } { \eqcolon }
+    \RenewDocumentCommand \coloncolonequals { } { \Coloneq }
+  }
 
-%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% um-code-amsmath.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Compatibility with amsmath.
 
-\__um_new_alphabet_config:nnn {up} {num}
- {
-  \__um_set_normal_numbers:nn {up} {#1}
-  \__um_set_mathalphabet_numbers:nnn {up} {up} {#1}
- }
+\AtEndOfPackageFile * {amsmath}
+  {
+    \tl_remove_once:Nn \@begindocumenthook
+      {
+        \mathchardef\std at minus\mathcode`\-\relax
+        \mathchardef\std at equal\mathcode`\=\relax
+      }
+    \AtBeginDocument
+      {
+        \Umathcharnumdef\std at minus\Umathcodenum`-
+        \Umathcharnumdef\std at equal\Umathcodenum`=
+      }
+    \cs_set:Npn \@cdots {\mathinner{\unicodecdots}}
+    \cs_set_eq:NN \dotsb@ \cdots
+  \__um_check_and_fix:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 }
+    {
+      \setbox \rootbox \hbox
+        {
+          $ \m at th \scriptscriptstyle { #1 } $
+        }
+      \mathchoice
+        { \r@@t \displaystyle      { #2 } }
+        { \r@@t \textstyle         { #2 } }~
+        { \r@@t \scriptstyle       { #2 } }
+        { \r@@t \scriptscriptstyle { #2 } }
+      \egroup
+    }
+    {
+      \bool_if:nTF
+        {
+          \int_compare_p:nNn { \uproot@ } = { \c_zero }
+          && \int_compare_p:nNn { \leftroot@ } = { \c_zero }
+        }
+        {
+          \Uroot \l__um_radical_sqrt_tl { #1 } { #2 }
+        }
+        {
+          \hbox_set:Nn \rootbox
+            {
+              \c_math_toggle_token \m at th
+              \scriptscriptstyle { #1 }
+              \c_math_toggle_token
+            }
+          \mathchoice
+            { \r@@t \displaystyle      { #2 } }
+            { \r@@t \textstyle         { #2 } }
+            { \r@@t \scriptstyle       { #2 } }
+            { \r@@t \scriptscriptstyle { #2 } }
+        }
+       \c_group_end_token
+    }
+  \__um_check_and_fix:NNnnn \r@@t \cs_set_nopar:Npn { #1 #2 }
+    {
+      \setboxz at h { $ \m at th #1 \sqrtsign { #2 } $ }
+      \dimen@ \ht\z@
+      \advance \dimen@ -\dp\z@
+      \setbox\@ne \hbox { $ \m at th #1 \mskip \uproot@ mu $ }
+      \advance \dimen@ by 1.667 \wd\@ne
+      \mkern -\leftroot@ mu
+      \mkern 5mu
+      \raise .6\dimen@ \copy\rootbox
+      \mkern -10mu
+      \mkern \leftroot@ mu
+      \boxz@
+    }
+    {
+      \hbox_set:Nn \l_tmpa_box
+        {
+          \c_math_toggle_token \m at th
+            #1 \mskip \uproot@ mu
+          \c_math_toggle_token
+        }
+      \Uroot \l__um_radical_sqrt_tl
+        {
+          \box_move_up:nn { \box_wd:N \l_tmpa_box }
+            {
+              \hbox:n
+                {
+                  \c_math_toggle_token \m at th
+                    \mkern -\leftroot@ mu
+                    \box_use:N \rootbox
+                    \mkern \leftroot@ mu
+                  \c_math_toggle_token
+                }
+            }
+        }
+        { #2 }
+    }
+  }
 
-\__um_new_alphabet_config:nnn {up} {Latin}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} }
-   {
-    \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
-   }
-  \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1}
-  \__um_set_mathalphabet_Latin:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_Latin:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {latin}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} }
-   {
-    \bool_if:NT \g__um_uplatin_bool
-     {
-      \__um_set_normal_latin:nn        {up,it} {#1}
-      \__um_set_normal_char:nnn        {h} {up,it} {#1}
-      \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
-      \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1}
-  \__um_set_mathalphabet_latin:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_latin:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {Greek}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} }
-   {
-    \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} }
-   }
-  \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1}
-  \__um_set_mathalphabet_Greek:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_Greek:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {greek}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} }
-   {
-    \bool_if:NT \g__um_upgreek_bool
-     {
-      \__um_set_normal_greek:nn {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1}
-  \__um_set_mathalphabet_greek:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_greek:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{up}{up}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{up,it}{up}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{up}{up}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{up,it}{up}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {up}  {partial} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {up}    {Nabla} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1}
- }
-\__um_new_alphabet_config:nnn {it} {Latin}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} }
-   {
-    \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
-   }
-  \__um_set_mathalphabet_Latin:nnn {it}{up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {latin}
- {
-  \bool_if:NTF \g__um_literal_bool
-   {
-    \__um_set_normal_latin:nn {it} {#1}
-    \__um_set_normal_char:nnn {h}{it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uplatin_bool
-     {
-      \__um_set_normal_latin:nn {up,it} {#1}
-      \__um_set_normal_char:nnn {h}{up,it}{#1}
-      \__um_set_normal_char:nnn {dotlessi}{up,it}{#1}
-      \__um_set_normal_char:nnn {dotlessj}{up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {it}            {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {Greek}
- {
-  \bool_if:NTF \g__um_literal_bool
-   {
-    \__um_set_normal_Greek:nn {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} }
-   }
-  \__um_set_mathalphabet_Greek:nnn {it} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {greek}
- {
-  \bool_if:NTF \g__um_literal_bool
-   {
-    \__um_set_normal_greek:nn {it} {#1}
-   }
-   {
-    \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} }
-   }
-  \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{it}{it}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{up,it}{it}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{it}{it}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{up,it}{it}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {it} {Nabla}   {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bb} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {bb} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bb} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bb} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {bb} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {bb} {up}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bb} {misc}
- {
-  \__um_set_mathalphabet_pos:nnnn {bb}        {Pi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb}        {pi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb}     {Gamma} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb}     {gamma} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1}
- }
-
-\__um_new_alphabet_config:nnn {bbit} {misc}
- {
-  \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1}
- }
-\__um_new_alphabet_config:nnn {scr} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {scr}    {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {B}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {E}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {F}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {H}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {I}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {L}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {M}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {R}{up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {scr} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {scr}    {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {e}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {g}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {o}{up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {cal} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {cal}  {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {B}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {E}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {F}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {H}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {I}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {L}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {M}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {R}{up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {frak} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {frak}    {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {C}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {H}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {I}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {R}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {Z}{up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {frak} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {frak} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfup} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {sf}   {up}{#1}
-  \__um_set_mathalphabet_numbers:nnn {sfup} {up}{#1}
- }
-\__um_new_alphabet_config:nnn {sfup} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {sfup} {#1}
-    \__um_set_mathalphabet_Latin:nnn {sf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {sfup} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfup} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {sfup} {#1}
-    \__um_set_mathalphabet_latin:nnn {sf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {sfup} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfit} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {sfit} {#1}
-    \__um_set_mathalphabet_Latin:nnn {sf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {sfit} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfit} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {sfit} {#1}
-    \__um_set_mathalphabet_latin:nnn {sf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {tt} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1}
- }
-\__um_new_alphabet_config:nnn {tt} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {tt} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfit} {Latin}
- {
-  \bool_if:NF \g__um_bfupLatin_bool
-   {
-    \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfit} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_bfupLatin_bool
-     {
-      \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {latin}
- {
-  \bool_if:NF \g__um_bfuplatin_bool
-   {
-    \__um_set_normal_latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfit} {#1}
-    \__um_set_mathalphabet_latin:nnn {bf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_bfuplatin_bool
-     {
-      \__um_set_normal_latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {Greek}
- {
-  \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfit}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_bfupGreek_bool
-     {
-      \__um_set_normal_Greek:nn {bfup,bfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {greek}
- {
-  \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfit} {#1}
-    \__um_set_mathalphabet_greek:nnn {bf} {it} {#1}
-   }
-   {
-    \bool_if:NF \g__um_bfupgreek_bool
-     {
-      \__um_set_normal_greek:nn {bfit,bfup} {#1}
-      \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   { \__um_set_normal_char:nnn {Nabla}{bfit}{#1} }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     { \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   { \__um_set_normal_char:nnn {partial}{bfit}{#1} }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     { \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1} }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla}   {up,it}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bfup} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {bf}   {up}{#1}
-  \__um_set_mathalphabet_numbers:nnn {bfup} {up}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfup} {Latin}
- {
-  \bool_if:NT \g__um_bfupLatin_bool
-   {
-    \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfup} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_bfupLatin_bool
-     {
-      \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfup} {latin}
- {
-  \bool_if:NT \g__um_bfuplatin_bool
-   {
-    \__um_set_normal_latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_latin:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfup} {#1}
-    \__um_set_mathalphabet_latin:nnn {bf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_bfuplatin_bool
-     {
-      \__um_set_normal_latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bfup} {Greek}
- {
-  \__um_set_mathalphabet_Greek:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfup}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_bfupGreek_bool
-     {
-      \__um_set_normal_Greek:nn {bfup,bfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfup} {greek}
- {
-  \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfup} {#1}
-    \__um_set_mathalphabet_greek:nnn {bf} {up} {#1}
-   }
-   {
-    \bool_if:NT \g__um_bfupgreek_bool
-     {
-      \__um_set_normal_greek:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfup} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{bfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{bfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla}   {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bf}   {digamma} {up}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bf}   {Digamma} {up}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bffrak} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bffrak} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfscr} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfscr} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfcal} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bfcal}  {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfsfup} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {bfsf}   {up}{#1}
-  \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1}
- }
-\__um_new_alphabet_config:nnn {bfsfup} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfsfup} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfup} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfsfup} {#1}
-    \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfup} {Greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfsfup}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfup} {greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfsfup} {#1}
-    \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1}
- }
-\__um_new_alphabet_config:nnn {bfsfup} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{bfsfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla}   {up,it}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bfsfit} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfsfit} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfsfit} {#1}
-    \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {Greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfsfit}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfsfit} {#1}
-    \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{bfsfit}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla}   {up,it}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-

Modified: trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex	2018-01-07 23:46:58 UTC (rev 46240)
@@ -1,4 +1,5 @@
 %%^^A%% unicode-math-table.tex -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Source file of the math symbols.
 
 \UnicodeMathSymbol{"00021}{\mathexclam               }{\mathclose}{exclamation mark}%
 \UnicodeMathSymbol{"00023}{\mathoctothorpe           }{\mathord}{number sign}%
@@ -58,7 +59,7 @@
 \UnicodeMathSymbol{"0031A}{\droang                   }{\mathaccent}{left angle above (non-spacing)}%
 \UnicodeMathSymbol{"00330}{\wideutilde               }{\mathbotaccentwide}{under tilde accent (multiple characters and non-spacing)}%
 \UnicodeMathSymbol{"00332}{\mathunderbar             }{\mathbotaccentwide}{combining low line}%
-\UnicodeMathSymbol{"00338}{\not                      }{\mathaccent}{combining long solidus overlay}%
+\UnicodeMathSymbol{"00338}{\notaccent                }{\mathaccentoverlay}{combining long solidus overlay}%
 \UnicodeMathSymbol{"0034D}{\underleftrightarrow      }{\mathbotaccentwide}{underleftrightarrow accent}%
 \UnicodeMathSymbol{"00391}{\mupAlpha                 }{\mathalpha}{capital alpha, greek}%
 \UnicodeMathSymbol{"00392}{\mupBeta                  }{\mathalpha}{capital beta, greek}%
@@ -119,6 +120,7 @@
 \UnicodeMathSymbol{"003F4}{\mupvarTheta              }{\mathalpha}{greek capital theta symbol}%
 \UnicodeMathSymbol{"003F5}{\mupepsilon               }{\mathalpha}{greek lunate varepsilon symbol}%
 \UnicodeMathSymbol{"003F6}{\upbackepsilon            }{\mathord}{greek reversed lunate epsilon symbol}%
+\UnicodeMathSymbol{"02010}{\mathhyphen               }{\mathalpha}{hyphen}%
 \UnicodeMathSymbol{"02015}{\horizbar                 }{\mathord}{horizontal bar}%
 \UnicodeMathSymbol{"02016}{\Vert                     }{\mathfence}{double vertical bar}%
 \UnicodeMathSymbol{"02017}{\twolowline               }{\mathord}{double low line (spacing)}%
@@ -999,7 +1001,7 @@
 \UnicodeMathSymbol{"0297F}{\downfishtail             }{\mathrel}{down fish tail}%
 \UnicodeMathSymbol{"02980}{\Vvert                    }{\mathfence}{triple vertical bar delimiter}%
 \UnicodeMathSymbol{"02981}{\mdsmblkcircle            }{\mathord}{z notation spot}%
-\UnicodeMathSymbol{"02982}{\typecolon                }{\mathbin}{z notation type colon}%
+\UnicodeMathSymbol{"02982}{\typecolon                }{\mathrel}{z notation type colon}%
 \UnicodeMathSymbol{"02983}{\lBrace                   }{\mathopen}{left white curly bracket}%
 \UnicodeMathSymbol{"02984}{\rBrace                   }{\mathclose}{right white curly bracket}%
 \UnicodeMathSymbol{"02985}{\lParen                   }{\mathopen}{left white parenthesis}%
@@ -2455,7 +2457,7 @@
 % the conditions of the LaTeX Project Public License, version 1.3c or higher
 % (your choice): <http://www.latex-project.org/lppl/>.
 % ------------------------------------------------
-% Copyright 2006-2017  Will Robertson, LPPL "maintainer"
+% Copyright 2006-2018  Will Robertson, LPPL "maintainer"
 % Copyright 2010-2017  Philipp Stephani
 % Copyright 2011-2017  Joseph Wright
 % Copyright 2012-2015  Khaled Hosny

Modified: trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty	2018-01-07 23:46:58 UTC (rev 46240)
@@ -19,11 +19,13 @@
 %% um-code-fontopt.dtx  (with options: `package,XE')
 %% um-code-fontparam.dtx  (with options: `package,XE')
 %% um-code-mathmap.dtx  (with options: `package,XE')
+%% um-code-sym-commands.dtx  (with options: `package,XE')
+%% um-code-alphabets.dtx  (with options: `package,XE')
 %% um-code-epilogue.dtx  (with options: `package,XE')
 %% um-code-primes.dtx  (with options: `package,XE')
 %% um-code-sscript.dtx  (with options: `package,XE')
 %% um-code-compat.dtx  (with options: `package,XE')
-%% um-code-alphabets.dtx  (with options: `package,XE')
+%% um-code-amsmath.dtx  (with options: `package,XE')
 %% ------------------------------------------------
 %% The UNICODE-MATH package  <wspr.io/unicode-math>
 %% ------------------------------------------------
@@ -37,19 +39,27 @@
 %% Copyright 2012-2015  Khaled Hosny
 %% ------------------------------------------------
 %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Metadata for the package code, including files and versioning
 
 \ProvidesPackage{unicode-math-xetex}
-  [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX]
+  [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX]
 
 %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine.
 
 
 %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Assorted initialisation tasks, including some low-level function definitions.
 
 \ExplSyntaxOn
 \cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: }
 \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx}
-\cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx}
+\cs_generate_variant:Nn \prop_get:NnNTF {cx}
+\cs_generate_variant:Nn \tl_if_eq:nnF {o}
+\cs_set_eq:NN \__um_group_begin: \group_begin:
+\cs_set_eq:NN \__um_group_end:   \group_end:
+\cs_set_eq:NN \__um_group_begin_frozen: \__um_group_begin:
+\cs_set_eq:NN \__um_group_end_frozen:   \__um_group_end:
 \prg_new_conditional:Nnn \__um_glyph_if_exist:Nn {p,TF,T,F}
   {
     \etex_iffontchar:D #1 #2 \scan_stop:
@@ -58,6 +68,11 @@
       \prg_return_false:
     \fi:
   }
+\cs_set_protected:Nn \__um_fontface_gset_eq:NN
+  {
+    \tex_global:D \tex_let:D #1 #2
+  }
+\cs_generate_variant:Nn \__um_fontface_gset_eq:NN {NV,cV}
 \cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4
   {
     \Umathcode \int_eval:n {#1} =
@@ -92,23 +107,27 @@
   }
 \cs_new:Nn \__um_char_gmake_mathactive:N
   {
-    \global\mathcode `#1 = "8000 \scan_stop:
+    \tex_global:D \tex_mathcode:D `#1 = "8000 \scan_stop:
   }
 \cs_new:Nn \__um_char_gmake_mathactive:n
   {
-    \global\mathcode #1 = "8000 \scan_stop:
+    \tex_global:D \tex_mathcode:D \int_eval:n {#1} = "8000 \scan_stop:
   }
-\cs_new:Nn \__um_copy_fontparam:nnn
+\cs_new:Nn \__um_mathactive_remap:nn
   {
-    \fontdimen #1 \font = \__um_get_fontparam:nn {#2} {#3}
+    \group_begin:
+      \cs_set_protected:Npn \__um_tmp: {#2}
+      \__um_char_gmake_mathactive:n {#1}
+      \char_gset_active_eq:nN {#1} \__um_tmp:
+    \group_end:
   }
-\cs_new:Nn \__um_zero_fontparam:n
+\cs_new:Nn \__um_copy_fontdimen:nnN
   {
-    \fontdimen #1 \font = 0pt\relax
+    \fontdimen #1 \font = \the \fontdimen #2 #3 \relax
   }
-\cs_new:Nn \__um_get_fontparam:nn
+\cs_new:Nn \__um_zero_fontdimen:n
   {
-    \the\fontdimen#1\l__um_font\relax
+    \fontdimen #1 \font = 0pt\relax
   }
 \cs_new:Nn \usv_set:nnn  { \tl_const:cn { c__um_#1_#2_usv } {#3} }
 \cs_new:Nn \__um_to_usv:nn {       \use:c { c__um_#1_#2_usv } }
@@ -136,13 +155,22 @@
   {
     \tl_remove_once:Nn \@preamblecmds {\do#1}
   }
+\cs_new:Npn \__um_error:n     { \msg_error:nn     {unicode-math} }
+\cs_new:Npn \__um_error:nx    { \msg_error:nnx    {unicode-math} }
+\cs_new:Npn \__um_warning:n   { \msg_warning:nn   {unicode-math} }
+\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} }
+\cs_new:Npn \__um_log:n       { \msg_log:nn       {unicode-math} }
+\cs_new:Npn \__um_log:nx      { \msg_log:nnx      {unicode-math} }
+\cs_generate_variant:Nn \msg_new:nnn  {nnx}
+\cs_generate_variant:Nn \msg_new:nnnn {nnxx}
+\cs_new:Nn \__um_msg_new:nn  { \msg_new:nnx  {unicode-math} {#1} { \tl_trim_spaces:n {#2} } }
 
 %%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Declaration of all code-level variables used in the package.
 
 \bool_new:N \l__um_ot_math_bool
 \bool_new:N \l__um_init_bool
 \bool_new:N \l__um_implicit_alph_bool
-\bool_new:N \g__um_mainfont_already_set_bool
 \bool_new:N \g__um_literal_bool
 \bool_new:N \g__um_upLatin_bool
 \bool_new:N \g__um_uplatin_bool
@@ -167,6 +195,8 @@
 \bool_new:N \g__um_mathsf_text_bool
 \bool_new:N \g__um_mathtt_text_bool
 \int_new:N \g__um_fam_int
+\int_new:N \g__um_fonts_used_int
+\int_new:N \l__um_primecount_int
 \tl_const:Nn \c__um_math_alphabet_name_latin_tl {Latin,~lowercase}
 \tl_const:Nn \c__um_math_alphabet_name_Latin_tl {Latin,~uppercase}
 \tl_const:Nn \c__um_math_alphabet_name_greek_tl {Greek,~lowercase}
@@ -177,17 +207,30 @@
 \tl_new:N \l__um_radicals_tl
 \tl_new:N \l__um_nolimits_tl
 \tl_new:N \g__um_operator_mathfont_tl
-\seq_new:N \l__um_missing_alph_seq
-\seq_new:N \l__um_mathalph_seq
-\seq_new:N \l__um_char_range_seq
-\seq_new:N \l__um_mclass_range_seq
-\seq_new:N \l__um_cmd_range_seq
-\clist_new:N  \g__um_alphabets_seq
-\clist_set:Nn \g__um_alphabets_seq { latin, Latin, greek, Greek, num }
-\clist_new:N \g__um_named_ranges_clist
+\tl_new:N \g__um_slash_delimiter_usv
+\tl_new:N \g__um_mathtable_tl
+\tl_new:N \g__um_fontname_tl
+\tl_new:N \g__um_mversion_tl
+\tl_new:N \g__um_symfont_tl
+\tl_new:N \g__um_font_keyval_tl
+\tl_new:N \g__um_family_tl
+\tl_new:N \g__um_style_tl
+\tl_new:N \g__um_remap_style_tl
+\tl_new:N \l__um_not_token_name_tl
+\tl_new:N \g__um_curr_font_cmd_tl
+\tl_new:N \g__um_sqrt_font_cmd_tl
+\tl_new:N \g__um_prime_font_cmd_tl
 \clist_new:N \g__um_char_nrange_clist
 \clist_new:N \g__um_unknown_keys_clist
 \clist_new:N \g__um_alphabet_clist
+\clist_new:N \g__um_bad_alpha_clist
+\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bf} }
+\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {sf} }
+\clist_put_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bfsf} }
+\seq_new:N \l__um_missing_alph_seq
+\seq_new:N \g__um_mathalph_seq
+\seq_new:N \g__um_char_range_seq
+\seq_new:N \g__um_mclass_range_seq
 \seq_new:N \g__um_mathclasses_seq
 \seq_set_from_clist:Nn \g__um_mathclasses_seq
   {
@@ -195,29 +238,20 @@
      \mathop,
     \mathopen,\mathclose,
     \mathfence,\mathover,\mathunder,
-     \mathaccent,\mathbotaccent,\mathaccentwide,\mathbotaccentwide
+     \mathaccent,\mathaccentoverlay,\mathbotaccent,\mathaccentwide,\mathbotaccentwide
   }
-
 \seq_new:N \g__um_default_mathalph_seq
-\seq_new:N \g__um_named_ranges_seq
 \seq_new:N \g__um_mathstyles_seq
+\prop_new:N \g__um_supers_prop
+\prop_new:N \g__um_subs_prop
 \muskip_new:N \g__um_primekern_muskip
 \muskip_gset:Nn \g__um_primekern_muskip { -\thinmuskip/2 }% arbitrary
-\int_new:N \l__um_primecount_int
-\prop_new:N \g__um_supers_prop
-\prop_new:N \g__um_subs_prop
-\tl_new:N \l_not_token_name_tl
-\tl_new:N \g__um_slash_delimiter_usv
-\tl_new:N \g__um_mathtable_tl
-\tl_new:N \g__um_fontname_tl
-\tl_new:N \g__um_mversion_tl
-\tl_new:N \g__um_symfont_tl
-\tl_new:N \g__um_font_keyval_tl
-\tl_new:N \g__um_family_tl
-\tl_new:N \g__um_style_tl
-\tl_new:N \g__um_remap_style_tl
+\fp_new:N \g__um_size_tfsf_fp
+\fp_new:N \g__um_size_sfssf_fp
+\quark_new:N \q_unicode_math
 
 %%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The (underdeveloped) API to interface with the package internals.
 
 \cs_new:Nn \unimath_get_mathstyle:
  {
@@ -225,6 +259,7 @@
  }
 
 %%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The xparse user interface top-level definitions.
 
 \NewDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} }
 \NewDocumentCommand \setmathfont { O{} m O{} }
@@ -251,19 +286,20 @@
   }
 
 %%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Package options.
 
 \cs_new:Nn \__um_keys_choices:nn
- {
-  \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} }
-  \use:x
-   {
-    \exp_not:N \keys_define:nn {unicode-math}
-     {
-      #1 .choice: ,
-      \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn
-     }
-   }
- }
+  {
+    \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} }
+    \use:x
+      {
+        \exp_not:N \keys_define:nn {unicode-math}
+          {
+            #1 .choice: ,
+            \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn
+          }
+      }
+  }
 \cs_new:Nn \__um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , }
 \cs_new:Nn \__um_tl_map_dbl:nN
   {
@@ -277,37 +313,37 @@
     \__um_tl_map_dbl:Nnn #1
  }
 \__um_keys_choices:nn {mathup}
- {
-  {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
+  }
 \__um_keys_choices:nn {mathrm}
- {
-  {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathrm_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathrm_text_bool }
+  }
 \__um_keys_choices:nn {mathit}
- {
-  {sym}  { \bool_set_false:N \g__um_mathit_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathit_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathit_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathit_text_bool }
+  }
 \__um_keys_choices:nn {mathbf}
- {
-  {sym}  { \bool_set_false:N \g__um_mathbf_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathbf_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathbf_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathbf_text_bool }
+  }
 \__um_keys_choices:nn {mathsf}
- {
-  {sym}  { \bool_set_false:N \g__um_mathsf_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathsf_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathsf_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathsf_text_bool }
+  }
 \__um_keys_choices:nn {mathtt}
- {
-  {sym}  { \bool_set_false:N \g__um_mathtt_text_bool }
-  {text} { \bool_set_true:N  \g__um_mathtt_text_bool }
- }
+  {
+    {sym}  { \bool_set_false:N \g__um_mathtt_text_bool }
+    {text} { \bool_set_true:N  \g__um_mathtt_text_bool }
+  }
 \__um_keys_choices:nn {normal-style}
- {
+  {
        {ISO} {
               \bool_set_false:N \g__um_literal_bool
               \bool_set_false:N \g__um_upGreek_bool
@@ -339,9 +375,9 @@
    {literal} {
               \bool_set_true:N  \g__um_literal_bool
              }
- }
+  }
 \__um_keys_choices:nn {math-style}
- {
+  {
       {ISO} {
              \unimathsetup { nabla=upright, partial=italic,
               normal-style=ISO, bold-style=ISO, sans-style=italic }
@@ -362,9 +398,9 @@
              \unimathsetup { colon=literal, nabla=literal, partial=literal,
                normal-style=literal, bold-style=literal, sans-style=literal }
             }
- }
+  }
 \__um_keys_choices:nn {bold-style}
- {
+  {
       {ISO} {
              \bool_set_false:N \g__um_bfliteral_bool
              \bool_set_false:N \g__um_bfupGreek_bool
@@ -389,67 +425,71 @@
   {literal} {
              \bool_set_true:N  \g__um_bfliteral_bool
             }
- }
+  }
 \__um_keys_choices:nn {sans-style}
- {
-  {italic}  { \bool_set_false:N \g__um_upsans_bool    }
-  {upright} { \bool_set_true:N  \g__um_upsans_bool    }
-  {literal} { \bool_set_true:N  \g__um_sfliteral_bool }
- }
+  {
+    {italic}  { \bool_set_false:N \g__um_upsans_bool    }
+    {upright} { \bool_set_true:N  \g__um_upsans_bool    }
+    {literal} { \bool_set_true:N  \g__um_sfliteral_bool }
+  }
 \__um_keys_choices:nn {nabla}
- {
-  {upright} {
-              \bool_set_false:N \g__um_literal_Nabla_bool
-              \bool_set_true:N  \g__um_upNabla_bool
-            }
-  {italic}  {
-              \bool_set_false:N \g__um_literal_Nabla_bool
-              \bool_set_false:N \g__um_upNabla_bool
-            }
-  {literal} { \bool_set_true:N  \g__um_literal_Nabla_bool }
- }
+  {
+    {upright} {
+                \bool_set_false:N \g__um_literal_Nabla_bool
+                \bool_set_true:N  \g__um_upNabla_bool
+              }
+    {italic}  {
+                \bool_set_false:N \g__um_literal_Nabla_bool
+                \bool_set_false:N \g__um_upNabla_bool
+              }
+    {literal} {
+                \bool_set_true:N  \g__um_literal_Nabla_bool
+              }
+  }
 \__um_keys_choices:nn {partial}
- {
-  {upright} {
-              \bool_set_false:N \g__um_literal_partial_bool
-              \bool_set_true:N  \g__um_uppartial_bool
-            }
-  {italic}  {
-              \bool_set_false:N \g__um_literal_partial_bool
-              \bool_set_false:N \g__um_uppartial_bool
-            }
-  {literal} { \bool_set_true:N  \g__um_literal_partial_bool }
- }
+  {
+   {upright} {
+               \bool_set_false:N \g__um_literal_partial_bool
+               \bool_set_true:N  \g__um_uppartial_bool
+             }
+   {italic}  {
+               \bool_set_false:N \g__um_literal_partial_bool
+               \bool_set_false:N \g__um_uppartial_bool
+             }
+   {literal} {
+               \bool_set_true:N  \g__um_literal_partial_bool
+             }
+  }
 \__um_keys_choices:nn {colon}
- {
-  {literal} { \bool_set_true:N  \g__um_literal_colon_bool }
-  {TeX}     { \bool_set_false:N \g__um_literal_colon_bool }
- }
+  {
+    {literal} { \bool_set_true:N  \g__um_literal_colon_bool }
+    {TeX}     { \bool_set_false:N \g__um_literal_colon_bool }
+  }
 \__um_keys_choices:nn {slash-delimiter}
- {
-  {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} }
-  {frac}  { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} }
-  {div}   { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} }
- }
+  {
+    {ascii} { \tl_set:Nn \g__um_slash_delimiter_usv {"002F} }
+    {frac}  { \tl_set:Nn \g__um_slash_delimiter_usv {"2044} }
+    {div}   { \tl_set:Nn \g__um_slash_delimiter_usv {"2215} }
+  }
 \__um_keys_choices:nn {active-frac}
- {
-   {small}
-   {
-    \cs_if_exist:NTF \tfrac
-     { \bool_set_true:N \l__um_smallfrac_bool }
-     {
-      \__um_warning:n {no-tfrac}
+  {
+    {small}
+    {
+      \cs_if_exist:NTF \tfrac
+        { \bool_set_true:N \l__um_smallfrac_bool }
+        {
+          \__um_warning:n {no-tfrac}
+          \bool_set_false:N \l__um_smallfrac_bool
+        }
+      \use:c {__um_setup_active_frac:}
+    }
+
+    {normalsize}
+    {
       \bool_set_false:N \l__um_smallfrac_bool
-     }
-    \use:c {__um_setup_active_frac:}
-   }
-
-   {normalsize}
-   {
-    \bool_set_false:N \l__um_smallfrac_bool
-    \use:c {__um_setup_active_frac:}
-   }
- }
+      \use:c {__um_setup_active_frac:}
+    }
+  }
 \keys_define:nn {unicode-math}
   {
     warnings-off .code:n =
@@ -459,11 +499,11 @@
       }
   }
 \__um_keys_choices:nn {trace}
- {
-  {on}    {} % default
-  {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
-  {off}   { \msg_redirect_module:nnn { unicode-math } { log } { none } }
- }
+  {
+    {on}    {} % default
+    {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
+    {off}   { \msg_redirect_module:nnn { unicode-math } { log } { none } }
+  }
 \unimathsetup {math-style=TeX}
 \unimathsetup {slash-delimiter=ascii}
 \unimathsetup {trace=off}
@@ -472,348 +512,362 @@
 \ProcessKeysOptions {unicode-math}
 
 %%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definitions of error, warning, and log messages.
 
-\cs_new:Npn \__um_error:n   { \msg_error:nn   {unicode-math} }
-\cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} }
-\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} }
-\cs_new:Npn \__um_log:n     { \msg_log:nn     {unicode-math} }
-\cs_new:Npn \__um_log:nx    { \msg_log:nnx    {unicode-math} }
-\msg_new:nnn {unicode-math} {no-tfrac}
+\char_set_catcode_space:n {32}
+\__um_msg_new:nn {no-tfrac}
 {
-  Small~ fraction~ command~ \protect\tfrac\ not~ defined.\\
-  Load~ amsmath~ or~ define~ it~ manually~ before~ loading~ unicode-math.
+  Small fraction command \protect\tfrac\ not defined.\\
+  Load amsmath or define it manually before loading unicode-math.
 }
-\msg_new:nnn {unicode-math} {default-math-font}
+\__um_msg_new:nn {default-math-font}
 {
-  Defining~ the~ default~ maths~ font~ as~ '\l__um_fontname_tl'.
+  Defining the default maths font as '\l__um_fontname_tl'.
 }
-\msg_new:nnn {unicode-math} {setup-implicit}
+\__um_msg_new:nn {setup-implicit}
 {
-  Setup~ alphabets:~ implicit~ mode.
+  Setup alphabets: implicit mode.
 }
-\msg_new:nnn {unicode-math} {setup-explicit}
+\__um_msg_new:nn {setup-explicit}
 {
-  Setup~ alphabets:~ explicit~ mode.
+  Setup alphabets: explicit mode.
 }
-\msg_new:nnn {unicode-math} {alph-initialise}
+\__um_msg_new:nn {alph-initialise}
 {
-  Initialising~ \@backslashchar math#1.
+  Initialising \@backslashchar math#1.
 }
-\msg_new:nnn {unicode-math} {setup-alph}
+\__um_msg_new:nn {setup-alph}
 {
-  Setup~ alphabet:~ #1.
+  Setup alphabet: #1.
 }
-\msg_new:nnn {unicode-math} {no-alphabet}
+\__um_msg_new:nn {no-alphabet}
 {
-  I~ am~ trying~ to~ set~ up~ alphabet~"#1"~ but~ there~ are~ no~ configuration~ settings~ for~ it.~
-  (See~ source~ file~ "unicode-math-alphabets.dtx"~ to~ debug.)
+  I am trying to set up alphabet"#1" but there are no configuration settings for it.
+  (See source file "unicode-math-alphabets.dtx" to debug.)
 }
-\msg_new:nnn { unicode-math } { no-named-range }
+\__um_msg_new:nn {no-named-range}
  {
-  I~ am~ trying~ to~ define~ new~ alphabet~ "#2"~ in~ range~ "#1",~ but~ range~ "#1"~ hasn't~ been~ defined~ yet.
+  I am trying to define new alphabet "#2" in range "#1", but range "#1" hasn't been defined yet.
  }
-\msg_new:nnn { unicode-math } { missing-alphabets }
+\__um_msg_new:nn {missing-alphabets}
  {
-  Missing~math~alphabets~in~font~ "\fontname\l__um_font" \\ \\
+  Missingmathalphabetsinfont "\fontname\g__um_curr_font_cmd_tl" \\ \\
   \seq_map_function:NN \l__um_missing_alph_seq \__um_print_indent:n
  }
 \cs_new:Nn \__um_print_indent:n { \space\space\space\space #1 \\ }
-\msg_new:nnn {unicode-math} {macro-expected}
+\__um_msg_new:nn {macro-expected}
 {
-  I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't.
+  I've expected that #1 is a macro, but it isn't.
 }
-\msg_new:nnn {unicode-math} {wrong-meaning}
+\__um_msg_new:nn {wrong-meaning}
 {
-  I've~ expected~ #1~ to~ have~ the~ meaning~ #3,~ but~ it~ has~ the~ meaning~ #2.
+  I've expected #1 to have the meaning #3, but it has the meaning #2.
 }
-\msg_new:nnn {unicode-math} {patch-macro}
+\__um_msg_new:nn {patch-macro}
 {
-  I'm~ going~ to~ patch~ macro~ #1.
+  I'm going to patch macro #1.
 }
-\msg_new:nnn { unicode-math } { mathtools-overbracket } {
-  Using~ \token_to_str:N \overbracket\ and~
-         \token_to_str:N \underbracket\ from~
- `mathtools'~ package.\\
+\__um_msg_new:nn {mathtools-overbracket} {
+  Using \token_to_str:N \overbracket\ and
+         \token_to_str:N \underbracket\ from
+ `mathtools' package.\\
   \\
-  Use~ \token_to_str:N \Uoverbracket\ and~
-       \token_to_str:N \Uunderbracket\ for~
-       original~ `unicode-math'~ definition.
+  Use \token_to_str:N \Uoverbracket\ and
+       \token_to_str:N \Uunderbracket\ for
+       original `unicode-math' definition.
 }
-\msg_new:nnn { unicode-math } { mathtools-colon } {
-  I'm~ going~ to~ overwrite~ the~ following~ commands~ from~
-  the~ `mathtools'~ package: \\ \\
-  \ \ \ \ \token_to_str:N \dblcolon,~
-  \token_to_str:N \coloneqq,~
-  \token_to_str:N \Coloneqq,~
+\__um_msg_new:nn {mathtools-colon} {
+  I'm going to overwrite the following commands from
+  the `mathtools' package: \\ \\
+  \ \ \ \ \token_to_str:N \dblcolon,
+  \token_to_str:N \coloneqq,
+  \token_to_str:N \Coloneqq,
   \token_to_str:N \eqqcolon. \\ \\
-  Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like~
-  commands,~ using~ them~ will~ lead~ to~ inconsistencies.
+  Note that since I won't overwrite the other colon-like
+  commands, using them will lead to inconsistencies.
 }
-\msg_new:nnn { unicode-math } { colonequals } {
-  I'm~ going~ to~ overwrite~ the~ following~ commands~ from~
-  the~ `colonequals'~ package: \\ \\
-  \ \ \ \ \token_to_str:N \ratio,~
-          \token_to_str:N \coloncolon,~
+\__um_msg_new:nn {colonequals} {
+  I'm going to overwrite the following commands from
+  the `colonequals' package: \\ \\
+  \ \ \ \ \token_to_str:N \ratio,
+          \token_to_str:N \coloncolon,
           \token_to_str:N \minuscolon, \\
-  \ \ \ \ \token_to_str:N \colonequals,~
-          \token_to_str:N \equalscolon,~
+  \ \ \ \ \token_to_str:N \colonequals,
+          \token_to_str:N \equalscolon,
           \token_to_str:N \coloncolonequals. \\ \\
-  Note~ that~ since~ I~ won't~ overwrite~ the~ other~ colon-like~
-  commands,~ using~ them~ will~ lead~ to~ inconsistencies.~
-  Furthermore,~ changing~ \token_to_str:N \colonsep \c_space_tl
-  or~ \token_to_str:N \doublecolonsep \c_space_tl won't~ have~
-  any~ effect~ on~ the~ re-defined~ commands.
+  Note that since I won't overwrite the other colon-like
+  commands, using them will lead to inconsistencies.
+  Furthermore, changing \token_to_str:N \colonsep \c_space_tl
+  or \token_to_str:N \doublecolonsep \c_space_tl won't have
+  any effect on the re-defined commands.
 }
+\__um_msg_new:nn {bad-cs-in-range}
+  {
+    Command `#1` in math range is not recognised as a maths symbol.
+    Check file "unicode-math-table.tex" for allowable commands.
+  }
+\__um_msg_new:nn {legacy-char-not-supported}
+  {
+    Command `#1` is a legacy maths symbol that is not supported by unicode-math.
+  }
+\__um_msg_new:nn {range-not-bf-sf}
+  {
+    Range alphabets cannot include alphabets referring to `bf`, `sf`, or `bfsf`
+    since they relate to input commands not output glyphs.
+    Use `bfit` or `bfup` (etc.) to specify which.
+  }
+\char_set_catcode_ignore:n {32}
 
 %%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Mapping of mathematical unicode slots for alphabets.
 
-\usv_set:nnn {normal}  {num}  {48}
-\usv_set:nnn {normal}  {Latin}{"1D434}
-\usv_set:nnn {normal}  {latin}{"1D44E}
-\usv_set:nnn {normal}  {Greek}{"1D6E2}
-\usv_set:nnn {normal}  {greek}{"1D6FC}
-\usv_set:nnn {normal}{varTheta}  {"1D6F3}
-\usv_set:nnn {normal}{epsilon}{"1D716}
-\usv_set:nnn {normal}{vartheta}  {"1D717}
-\usv_set:nnn {normal}{varkappa}  {"1D718}
-\usv_set:nnn {normal}{phi}    {"1D719}
-\usv_set:nnn {normal}{varrho}    {"1D71A}
-\usv_set:nnn {normal}{varpi}     {"1D71B}
-\usv_set:nnn {normal}    {Nabla}{"1D6FB}
-\usv_set:nnn {normal}    {partial}{"1D715}
+\usv_set:nnn {normal} {num}      {48}
+\usv_set:nnn {normal} {Latin}    {"1D434}
+\usv_set:nnn {normal} {latin}    {"1D44E}
+\usv_set:nnn {normal} {Greek}    {"1D6E2}
+\usv_set:nnn {normal} {greek}    {"1D6FC}
+\usv_set:nnn {normal} {varTheta} {"1D6F3}
+\usv_set:nnn {normal} {epsilon}  {"1D716}
+\usv_set:nnn {normal} {vartheta} {"1D717}
+\usv_set:nnn {normal} {varkappa} {"1D718}
+\usv_set:nnn {normal} {phi}      {"1D719}
+\usv_set:nnn {normal} {varrho}   {"1D71A}
+\usv_set:nnn {normal} {varpi}    {"1D71B}
+\usv_set:nnn {normal} {Nabla}    {"1D6FB}
+\usv_set:nnn {normal} {partial}  {"1D715}
+\usv_set:nnn {up}   {num}   {48}
+\usv_set:nnn {up}   {Latin} {65}
+\usv_set:nnn {up}   {latin} {97}
+\usv_set:nnn {up}   {Greek} {"391}
+\usv_set:nnn {up}   {greek} {"3B1}
+\usv_set:nnn {it}   {Latin} {"1D434}
+\usv_set:nnn {it}   {latin} {"1D44E}
+\usv_set:nnn {it}   {Greek} {"1D6E2}
+\usv_set:nnn {it}   {greek} {"1D6FC}
+\usv_set:nnn {bb}   {num}   {"1D7D8}
+\usv_set:nnn {bb}   {Latin} {"1D538}
+\usv_set:nnn {bb}   {latin} {"1D552}
+\usv_set:nnn {scr}  {Latin} {"1D49C}
+\usv_set:nnn {cal}  {Latin} {"1D49C}
+\usv_set:nnn {scr}  {latin} {"1D4B6}
+\usv_set:nnn {frak} {Latin} {"1D504}
+\usv_set:nnn {frak} {latin} {"1D51E}
+\usv_set:nnn {sf}   {num}   {"1D7E2}
+\usv_set:nnn {sfup} {num}   {"1D7E2}
+\usv_set:nnn {sfit} {num}   {"1D7E2}
+\usv_set:nnn {sfup} {Latin} {"1D5A0}
+\usv_set:nnn {sf}   {Latin} {"1D5A0}
+\usv_set:nnn {sfup} {latin} {"1D5BA}
+\usv_set:nnn {sf}   {latin} {"1D5BA}
+\usv_set:nnn {sfit} {Latin} {"1D608}
+\usv_set:nnn {sfit} {latin} {"1D622}
+\usv_set:nnn {tt}   {num}   {"1D7F6}
+\usv_set:nnn {tt}   {Latin} {"1D670}
+\usv_set:nnn {tt}   {latin} {"1D68A}
+\usv_set:nnn {bf}     {num}   {"1D7CE}
+\usv_set:nnn {bfup}   {num}   {"1D7CE}
+\usv_set:nnn {bfit}   {num}   {"1D7CE}
+\usv_set:nnn {bfup}   {Latin} {"1D400}
+\usv_set:nnn {bfup}   {latin} {"1D41A}
+\usv_set:nnn {bfup}   {Greek} {"1D6A8}
+\usv_set:nnn {bfup}   {greek} {"1D6C2}
+\usv_set:nnn {bfit}   {Latin} {"1D468}
+\usv_set:nnn {bfit}   {latin} {"1D482}
+\usv_set:nnn {bfit}   {Greek} {"1D71C}
+\usv_set:nnn {bfit}   {greek} {"1D736}
+\usv_set:nnn {bffrak} {Latin} {"1D56C}
+\usv_set:nnn {bffrak} {latin} {"1D586}
+\usv_set:nnn {bfscr}  {Latin} {"1D4D0}
+\usv_set:nnn {bfcal}  {Latin} {"1D4D0}
+\usv_set:nnn {bfscr}  {latin} {"1D4EA}
+\usv_set:nnn {bfsf}   {num}   {"1D7EC}
+\usv_set:nnn {bfsfup} {num}   {"1D7EC}
+\usv_set:nnn {bfsfit} {num}   {"1D7EC}
+\usv_set:nnn {bfsfup} {Latin} {"1D5D4}
+\usv_set:nnn {bfsfup} {latin} {"1D5EE}
+\usv_set:nnn {bfsfup} {Greek} {"1D756}
+\usv_set:nnn {bfsfup} {greek} {"1D770}
+\usv_set:nnn {bfsfit} {Latin} {"1D63C}
+\usv_set:nnn {bfsfit} {latin} {"1D656}
+\usv_set:nnn {bfsfit} {Greek} {"1D790}
+\usv_set:nnn {bfsfit} {greek} {"1D7AA}
+\usv_set:nnn {bfsf} {Latin} { \bool_if:NTF \g__um_upLatin_bool   \g__um_bfsfup_Latin_usv \g__um_bfsfit_Latin_usv }
+\usv_set:nnn {bfsf} {latin} { \bool_if:NTF \g__um_uplatin_bool   \g__um_bfsfup_latin_usv \g__um_bfsfit_latin_usv }
+\usv_set:nnn {bfsf} {Greek} { \bool_if:NTF \g__um_upGreek_bool   \g__um_bfsfup_Greek_usv \g__um_bfsfit_Greek_usv }
+\usv_set:nnn {bfsf} {greek} { \bool_if:NTF \g__um_upgreek_bool   \g__um_bfsfup_greek_usv \g__um_bfsfit_greek_usv }
+\usv_set:nnn {bf}   {Latin} { \bool_if:NTF \g__um_bfupLatin_bool \g__um_bfup_Latin_usv   \g__um_bfit_Latin_usv   }
+\usv_set:nnn {bf}   {latin} { \bool_if:NTF \g__um_bfuplatin_bool \g__um_bfup_latin_usv   \g__um_bfit_latin_usv   }
+\usv_set:nnn {bf}   {Greek} { \bool_if:NTF \g__um_bfupGreek_bool \g__um_bfup_Greek_usv   \g__um_bfit_Greek_usv   }
+\usv_set:nnn {bf}   {greek} { \bool_if:NTF \g__um_bfupgreek_bool \g__um_bfup_greek_usv   \g__um_bfit_greek_usv   }
+\usv_set:nnn {up} {varTheta} {"3F4}
+\usv_set:nnn {up} {Digamma}  {"3DC}
+\usv_set:nnn {up} {epsilon}  {"3F5}
+\usv_set:nnn {up} {vartheta} {"3D1}
+\usv_set:nnn {up} {varkappa} {"3F0}
+\usv_set:nnn {up} {phi}      {"3D5}
+\usv_set:nnn {up} {varrho}   {"3F1}
+\usv_set:nnn {up} {varpi}    {"3D6}
+\usv_set:nnn {up} {digamma}  {"3DD}
+\usv_set:nnn {bfup} {varTheta} {"1D6B9}
+\usv_set:nnn {bfup} {Digamma}  {"1D7CA}
+\usv_set:nnn {bfup} {epsilon}  {"1D6DC}
+\usv_set:nnn {bfup} {vartheta} {"1D6DD}
+\usv_set:nnn {bfup} {varkappa} {"1D6DE}
+\usv_set:nnn {bfup} {phi}      {"1D6DF}
+\usv_set:nnn {bfup} {varrho}   {"1D6E0}
+\usv_set:nnn {bfup} {varpi}    {"1D6E1}
+\usv_set:nnn {bfup} {digamma}  {"1D7CB}
+\usv_set:nnn {it} {varTheta} {"1D6F3}
+\usv_set:nnn {it} {epsilon}  {"1D716}
+\usv_set:nnn {it} {vartheta} {"1D717}
+\usv_set:nnn {it} {varkappa} {"1D718}
+\usv_set:nnn {it} {phi}      {"1D719}
+\usv_set:nnn {it} {varrho}   {"1D71A}
+\usv_set:nnn {it} {varpi}    {"1D71B}
+\usv_set:nnn {bfit} {varTheta} {"1D72D}
+\usv_set:nnn {bfit} {epsilon}  {"1D750}
+\usv_set:nnn {bfit} {vartheta} {"1D751}
+\usv_set:nnn {bfit} {varkappa} {"1D752}
+\usv_set:nnn {bfit} {phi}      {"1D753}
+\usv_set:nnn {bfit} {varrho}   {"1D754}
+\usv_set:nnn {bfit} {varpi}    {"1D755}
+\usv_set:nnn {bfsfup} {varTheta} {"1D767}
+\usv_set:nnn {bfsfup} {epsilon}  {"1D78A}
+\usv_set:nnn {bfsfup} {vartheta} {"1D78B}
+\usv_set:nnn {bfsfup} {varkappa} {"1D78C}
+\usv_set:nnn {bfsfup} {phi}      {"1D78D}
+\usv_set:nnn {bfsfup} {varrho}   {"1D78E}
+\usv_set:nnn {bfsfup} {varpi}    {"1D78F}
+\usv_set:nnn {bfsfit} {varTheta} {"1D7A1}
+\usv_set:nnn {bfsfit} {epsilon}  {"1D7C4}
+\usv_set:nnn {bfsfit} {vartheta} {"1D7C5}
+\usv_set:nnn {bfsfit} {varkappa} {"1D7C6}
+\usv_set:nnn {bfsfit} {phi}      {"1D7C7}
+\usv_set:nnn {bfsfit} {varrho}   {"1D7C8}
+\usv_set:nnn {bfsfit} {varpi}    {"1D7C9}
+\usv_set:nnn {up}     {Nabla} {"02207}
+\usv_set:nnn {it}     {Nabla} {"1D6FB}
+\usv_set:nnn {bfup}   {Nabla} {"1D6C1}
+\usv_set:nnn {bfit}   {Nabla} {"1D735}
+\usv_set:nnn {bfsfup} {Nabla} {"1D76F}
+\usv_set:nnn {bfsfit} {Nabla} {"1D7A9}
+\usv_set:nnn {up}     {partial} {"02202}
+\usv_set:nnn {it}     {partial} {"1D715}
+\usv_set:nnn {bfup}   {partial} {"1D6DB}
+\usv_set:nnn {bfit}   {partial} {"1D74F}
+\usv_set:nnn {bfsfup} {partial} {"1D789}
+\usv_set:nnn {bfsfit} {partial} {"1D7C3}
+\usv_set:nnn {up} {B} {`\B}
+\usv_set:nnn {up} {C} {`\C}
+\usv_set:nnn {up} {D} {`\D}
+\usv_set:nnn {up} {E} {`\E}
+\usv_set:nnn {up} {F} {`\F}
+\usv_set:nnn {up} {H} {`\H}
+\usv_set:nnn {up} {I} {`\I}
+\usv_set:nnn {up} {L} {`\L}
+\usv_set:nnn {up} {M} {`\M}
+\usv_set:nnn {up} {N} {`\N}
+\usv_set:nnn {up} {P} {`\P}
+\usv_set:nnn {up} {Q} {`\Q}
+\usv_set:nnn {up} {R} {`\R}
+\usv_set:nnn {up} {Z} {`\Z}
+\usv_set:nnn {it} {B} {"1D435}
+\usv_set:nnn {it} {C} {"1D436}
+\usv_set:nnn {it} {D} {"1D437}
+\usv_set:nnn {it} {E} {"1D438}
+\usv_set:nnn {it} {F} {"1D439}
+\usv_set:nnn {it} {H} {"1D43B}
+\usv_set:nnn {it} {I} {"1D43C}
+\usv_set:nnn {it} {L} {"1D43F}
+\usv_set:nnn {it} {M} {"1D440}
+\usv_set:nnn {it} {N} {"1D441}
+\usv_set:nnn {it} {P} {"1D443}
+\usv_set:nnn {it} {Q} {"1D444}
+\usv_set:nnn {it} {R} {"1D445}
+\usv_set:nnn {it} {Z} {"1D44D}
+\usv_set:nnn {up} {d} {`\d}
+\usv_set:nnn {up} {e} {`\e}
+\usv_set:nnn {up} {g} {`\g}
+\usv_set:nnn {up} {h} {`\h}
+\usv_set:nnn {up} {i} {`\i}
+\usv_set:nnn {up} {j} {`\j}
+\usv_set:nnn {up} {o} {`\o}
+\usv_set:nnn {it} {d} {"1D451}
+\usv_set:nnn {it} {e} {"1D452}
+\usv_set:nnn {it} {g} {"1D454}
+\usv_set:nnn {it} {h} {"0210E}
+\usv_set:nnn {it} {i} {"1D456}
+\usv_set:nnn {it} {j} {"1D457}
+\usv_set:nnn {it} {o} {"1D45C}
+\usv_set:nnn {bb}     {h} {"1D559}
+\usv_set:nnn {tt}     {h} {"1D691}
+\usv_set:nnn {scr}    {h} {"1D4BD}
+\usv_set:nnn {frak}   {h} {"1D525}
+\usv_set:nnn {bfup}   {h} {"1D421}
+\usv_set:nnn {bfit}   {h} {"1D489}
+\usv_set:nnn {sfup}   {h} {"1D5C1}
+\usv_set:nnn {sfit}   {h} {"1D629}
+\usv_set:nnn {bffrak} {h} {"1D58D}
+\usv_set:nnn {bfscr}  {h} {"1D4F1}
+\usv_set:nnn {bfsfup} {h} {"1D5F5}
+\usv_set:nnn {bfsfit} {h} {"1D65D}
+\usv_set:nnn {up} {dotlessi} {"00131}
+\usv_set:nnn {up} {dotlessj} {"00237}
+\usv_set:nnn {it} {dotlessi} {"1D6A4}
+\usv_set:nnn {it} {dotlessj} {"1D6A5}
+\usv_set:nnn {bb} {C}         {"2102}
+\usv_set:nnn {bb} {H}         {"210D}
+\usv_set:nnn {bb} {N}         {"2115}
+\usv_set:nnn {bb} {P}         {"2119}
+\usv_set:nnn {bb} {Q}         {"211A}
+\usv_set:nnn {bb} {R}         {"211D}
+\usv_set:nnn {bb} {Z}         {"2124}
+\usv_set:nnn {up} {Pi}        {"003A0}
+\usv_set:nnn {up} {pi}        {"003C0}
+\usv_set:nnn {up} {Gamma}     {"00393}
+\usv_set:nnn {up} {gamma}     {"003B3}
+\usv_set:nnn {up} {summation} {"02211}
+\usv_set:nnn {it} {Pi}        {"1D6F1}
+\usv_set:nnn {it} {pi}        {"1D70B}
+\usv_set:nnn {it} {Gamma}     {"1D6E4}
+\usv_set:nnn {it} {gamma}     {"1D6FE}
+\usv_set:nnn {bb} {Pi}        {"0213F}
+\usv_set:nnn {bb} {pi}        {"0213C}
+\usv_set:nnn {bb} {Gamma}     {"0213E}
+\usv_set:nnn {bb} {gamma}     {"0213D}
+\usv_set:nnn {bb} {summation} {"02140}
+\usv_set:nnn {bbit} {D} {"2145}
+\usv_set:nnn {bbit} {d} {"2146}
+\usv_set:nnn {bbit} {e} {"2147}
+\usv_set:nnn {bbit} {i} {"2148}
+\usv_set:nnn {bbit} {j} {"2149}
+\usv_set:nnn {scr} {B} {"212C}
+\usv_set:nnn {scr} {E} {"2130}
+\usv_set:nnn {scr} {F} {"2131}
+\usv_set:nnn {scr} {H} {"210B}
+\usv_set:nnn {scr} {I} {"2110}
+\usv_set:nnn {scr} {L} {"2112}
+\usv_set:nnn {scr} {M} {"2133}
+\usv_set:nnn {scr} {R} {"211B}
+\usv_set:nnn {scr} {e} {"212F}
+\usv_set:nnn {scr} {g} {"210A}
+\usv_set:nnn {scr} {o} {"2134}
+\usv_set:nnn {cal} {B} {"212C}
+\usv_set:nnn {cal} {E} {"2130}
+\usv_set:nnn {cal} {F} {"2131}
+\usv_set:nnn {cal} {H} {"210B}
+\usv_set:nnn {cal} {I} {"2110}
+\usv_set:nnn {cal} {L} {"2112}
+\usv_set:nnn {cal} {M} {"2133}
+\usv_set:nnn {cal} {R} {"211B}
+\usv_set:nnn {frak} {C} {"212D}
+\usv_set:nnn {frak} {H} {"210C}
+\usv_set:nnn {frak} {I} {"2111}
+\usv_set:nnn {frak} {R} {"211C}
+\usv_set:nnn {frak} {Z} {"2128}
 
-\usv_set:nnn {up}  {num}  {48}
-\usv_set:nnn {up}  {Latin}{65}
-\usv_set:nnn {up}  {latin}{97}
-\usv_set:nnn {up}  {Greek}{"391}
-\usv_set:nnn {up}  {greek}{"3B1}
-\usv_set:nnn {it}  {Latin}{"1D434}
-\usv_set:nnn {it}  {latin}{"1D44E}
-\usv_set:nnn {it}  {Greek}{"1D6E2}
-\usv_set:nnn {it}  {greek}{"1D6FC}
-\usv_set:nnn {bb}  {num}  {"1D7D8}
-\usv_set:nnn {bb}  {Latin}{"1D538}
-\usv_set:nnn {bb}  {latin}{"1D552}
-\usv_set:nnn {scr} {Latin}{"1D49C}
-\usv_set:nnn {cal} {Latin}{"1D49C}
-\usv_set:nnn {scr} {latin}{"1D4B6}
-\usv_set:nnn {frak}{Latin}{"1D504}
-\usv_set:nnn {frak}{latin}{"1D51E}
-\usv_set:nnn {sf}  {num}  {"1D7E2}
-\usv_set:nnn {sfup}{num}  {"1D7E2}
-\usv_set:nnn {sfit}{num}  {"1D7E2}
-\usv_set:nnn {sfup}{Latin}{"1D5A0}
-\usv_set:nnn {sf}  {Latin}{"1D5A0}
-\usv_set:nnn {sfup}{latin}{"1D5BA}
-\usv_set:nnn {sf}  {latin}{"1D5BA}
-\usv_set:nnn {sfit}{Latin}{"1D608}
-\usv_set:nnn {sfit}{latin}{"1D622}
-\usv_set:nnn {tt}  {num}  {"1D7F6}
-\usv_set:nnn {tt}  {Latin}{"1D670}
-\usv_set:nnn {tt}  {latin}{"1D68A}
-\usv_set:nnn {bf}    {num}  {"1D7CE}
-\usv_set:nnn {bfup}  {num}  {"1D7CE}
-\usv_set:nnn {bfit}  {num}  {"1D7CE}
-\usv_set:nnn {bfup}  {Latin}{"1D400}
-\usv_set:nnn {bfup}  {latin}{"1D41A}
-\usv_set:nnn {bfup}  {Greek}{"1D6A8}
-\usv_set:nnn {bfup}  {greek}{"1D6C2}
-\usv_set:nnn {bfit}  {Latin}{"1D468}
-\usv_set:nnn {bfit}  {latin}{"1D482}
-\usv_set:nnn {bfit}  {Greek}{"1D71C}
-\usv_set:nnn {bfit}  {greek}{"1D736}
-\usv_set:nnn {bffrak}{Latin}{"1D56C}
-\usv_set:nnn {bffrak}{latin}{"1D586}
-\usv_set:nnn {bfscr} {Latin}{"1D4D0}
-\usv_set:nnn {bfcal} {Latin}{"1D4D0}
-\usv_set:nnn {bfscr} {latin}{"1D4EA}
-\usv_set:nnn {bfsf}  {num}  {"1D7EC}
-\usv_set:nnn {bfsfup}{num}  {"1D7EC}
-\usv_set:nnn {bfsfit}{num}  {"1D7EC}
-\usv_set:nnn {bfsfup}{Latin}{"1D5D4}
-\usv_set:nnn {bfsfup}{latin}{"1D5EE}
-\usv_set:nnn {bfsfup}{Greek}{"1D756}
-\usv_set:nnn {bfsfup}{greek}{"1D770}
-\usv_set:nnn {bfsfit}{Latin}{"1D63C}
-\usv_set:nnn {bfsfit}{latin}{"1D656}
-\usv_set:nnn {bfsfit}{Greek}{"1D790}
-\usv_set:nnn {bfsfit}{greek}{"1D7AA}
-\usv_set:nnn {bfsf}{Latin}{ \bool_if:NTF \g__um_upLatin_bool   \g__um_bfsfup_Latin_usv \g__um_bfsfit_Latin_usv }
-\usv_set:nnn {bfsf}{latin}{ \bool_if:NTF \g__um_uplatin_bool   \g__um_bfsfup_latin_usv \g__um_bfsfit_latin_usv }
-\usv_set:nnn {bfsf}{Greek}{ \bool_if:NTF \g__um_upGreek_bool   \g__um_bfsfup_Greek_usv \g__um_bfsfit_Greek_usv }
-\usv_set:nnn {bfsf}{greek}{ \bool_if:NTF \g__um_upgreek_bool   \g__um_bfsfup_greek_usv \g__um_bfsfit_greek_usv }
-\usv_set:nnn {bf}  {Latin}{ \bool_if:NTF \g__um_bfupLatin_bool \g__um_bfup_Latin_usv   \g__um_bfit_Latin_usv   }
-\usv_set:nnn {bf}  {latin}{ \bool_if:NTF \g__um_bfuplatin_bool \g__um_bfup_latin_usv   \g__um_bfit_latin_usv   }
-\usv_set:nnn {bf}  {Greek}{ \bool_if:NTF \g__um_bfupGreek_bool \g__um_bfup_Greek_usv   \g__um_bfit_Greek_usv   }
-\usv_set:nnn {bf}  {greek}{ \bool_if:NTF \g__um_bfupgreek_bool \g__um_bfup_greek_usv   \g__um_bfit_greek_usv   }
-\usv_set:nnn {up}{varTheta}  {"3F4}
-\usv_set:nnn {up}{Digamma}   {"3DC}
-\usv_set:nnn {up}{epsilon}{"3F5}
-\usv_set:nnn {up}{vartheta}  {"3D1}
-\usv_set:nnn {up}{varkappa}  {"3F0}
-\usv_set:nnn {up}{phi}    {"3D5}
-\usv_set:nnn {up}{varrho}    {"3F1}
-\usv_set:nnn {up}{varpi}     {"3D6}
-\usv_set:nnn {up}{digamma}   {"3DD}
-\usv_set:nnn {bfup}{varTheta}  {"1D6B9}
-\usv_set:nnn {bfup}{Digamma}   {"1D7CA}
-\usv_set:nnn {bfup}{epsilon}{"1D6DC}
-\usv_set:nnn {bfup}{vartheta}  {"1D6DD}
-\usv_set:nnn {bfup}{varkappa}  {"1D6DE}
-\usv_set:nnn {bfup}{phi}    {"1D6DF}
-\usv_set:nnn {bfup}{varrho}    {"1D6E0}
-\usv_set:nnn {bfup}{varpi}     {"1D6E1}
-\usv_set:nnn {bfup}{digamma}   {"1D7CB}
-\usv_set:nnn {it}{varTheta}  {"1D6F3}
-\usv_set:nnn {it}{epsilon}{"1D716}
-\usv_set:nnn {it}{vartheta}  {"1D717}
-\usv_set:nnn {it}{varkappa}  {"1D718}
-\usv_set:nnn {it}{phi}    {"1D719}
-\usv_set:nnn {it}{varrho}    {"1D71A}
-\usv_set:nnn {it}{varpi}     {"1D71B}
-\usv_set:nnn {bfit}{varTheta}  {"1D72D}
-\usv_set:nnn {bfit}{epsilon}{"1D750}
-\usv_set:nnn {bfit}{vartheta}  {"1D751}
-\usv_set:nnn {bfit}{varkappa}  {"1D752}
-\usv_set:nnn {bfit}{phi}    {"1D753}
-\usv_set:nnn {bfit}{varrho}    {"1D754}
-\usv_set:nnn {bfit}{varpi}     {"1D755}
-\usv_set:nnn {bfsfup}{varTheta}  {"1D767}
-\usv_set:nnn {bfsfup}{epsilon}{"1D78A}
-\usv_set:nnn {bfsfup}{vartheta}  {"1D78B}
-\usv_set:nnn {bfsfup}{varkappa}  {"1D78C}
-\usv_set:nnn {bfsfup}{phi}    {"1D78D}
-\usv_set:nnn {bfsfup}{varrho}    {"1D78E}
-\usv_set:nnn {bfsfup}{varpi}     {"1D78F}
-\usv_set:nnn {bfsfit}{varTheta}  {"1D7A1}
-\usv_set:nnn {bfsfit}{epsilon}{"1D7C4}
-\usv_set:nnn {bfsfit}{vartheta}  {"1D7C5}
-\usv_set:nnn {bfsfit}{varkappa}  {"1D7C6}
-\usv_set:nnn {bfsfit}{phi}    {"1D7C7}
-\usv_set:nnn {bfsfit}{varrho}    {"1D7C8}
-\usv_set:nnn {bfsfit}{varpi}     {"1D7C9}
-\usv_set:nnn {up}    {Nabla}{"02207}
-\usv_set:nnn {it}    {Nabla}{"1D6FB}
-\usv_set:nnn {bfup}  {Nabla}{"1D6C1}
-\usv_set:nnn {bfit}  {Nabla}{"1D735}
-\usv_set:nnn {bfsfup}{Nabla}{"1D76F}
-\usv_set:nnn {bfsfit}{Nabla}{"1D7A9}
-\usv_set:nnn {up}    {partial}{"02202}
-\usv_set:nnn {it}    {partial}{"1D715}
-\usv_set:nnn {bfup}  {partial}{"1D6DB}
-\usv_set:nnn {bfit}  {partial}{"1D74F}
-\usv_set:nnn {bfsfup}{partial}{"1D789}
-\usv_set:nnn {bfsfit}{partial}{"1D7C3}
-\usv_set:nnn {up}{B}{`\B}
-\usv_set:nnn {up}{C}{`\C}
-\usv_set:nnn {up}{D}{`\D}
-\usv_set:nnn {up}{E}{`\E}
-\usv_set:nnn {up}{F}{`\F}
-\usv_set:nnn {up}{H}{`\H}
-\usv_set:nnn {up}{I}{`\I}
-\usv_set:nnn {up}{L}{`\L}
-\usv_set:nnn {up}{M}{`\M}
-\usv_set:nnn {up}{N}{`\N}
-\usv_set:nnn {up}{P}{`\P}
-\usv_set:nnn {up}{Q}{`\Q}
-\usv_set:nnn {up}{R}{`\R}
-\usv_set:nnn {up}{Z}{`\Z}
-\usv_set:nnn {it}{B}{"1D435}
-\usv_set:nnn {it}{C}{"1D436}
-\usv_set:nnn {it}{D}{"1D437}
-\usv_set:nnn {it}{E}{"1D438}
-\usv_set:nnn {it}{F}{"1D439}
-\usv_set:nnn {it}{H}{"1D43B}
-\usv_set:nnn {it}{I}{"1D43C}
-\usv_set:nnn {it}{L}{"1D43F}
-\usv_set:nnn {it}{M}{"1D440}
-\usv_set:nnn {it}{N}{"1D441}
-\usv_set:nnn {it}{P}{"1D443}
-\usv_set:nnn {it}{Q}{"1D444}
-\usv_set:nnn {it}{R}{"1D445}
-\usv_set:nnn {it}{Z}{"1D44D}
-\usv_set:nnn {up}{d}{`\d}
-\usv_set:nnn {up}{e}{`\e}
-\usv_set:nnn {up}{g}{`\g}
-\usv_set:nnn {up}{h}{`\h}
-\usv_set:nnn {up}{i}{`\i}
-\usv_set:nnn {up}{j}{`\j}
-\usv_set:nnn {up}{o}{`\o}
-\usv_set:nnn {it}{d}{"1D451}
-\usv_set:nnn {it}{e}{"1D452}
-\usv_set:nnn {it}{g}{"1D454}
-\usv_set:nnn {it}{h}{"0210E}
-\usv_set:nnn {it}{i}{"1D456}
-\usv_set:nnn {it}{j}{"1D457}
-\usv_set:nnn {it}{o}{"1D45C}
-\usv_set:nnn {bb}    {h}{"1D559}
-\usv_set:nnn {tt}    {h}{"1D691}
-\usv_set:nnn {scr}   {h}{"1D4BD}
-\usv_set:nnn {frak}  {h}{"1D525}
-\usv_set:nnn {bfup}  {h}{"1D421}
-\usv_set:nnn {bfit}  {h}{"1D489}
-\usv_set:nnn {sfup}  {h}{"1D5C1}
-\usv_set:nnn {sfit}  {h}{"1D629}
-\usv_set:nnn {bffrak}{h}{"1D58D}
-\usv_set:nnn {bfscr} {h}{"1D4F1}
-\usv_set:nnn {bfsfup}{h}{"1D5F5}
-\usv_set:nnn {bfsfit}{h}{"1D65D}
-\usv_set:nnn {up}{dotlessi}{"00131}
-\usv_set:nnn {up}{dotlessj}{"00237}
-\usv_set:nnn {it}{dotlessi}{"1D6A4}
-\usv_set:nnn {it}{dotlessj}{"1D6A5}
-\usv_set:nnn {bb}{C}{"2102}
-\usv_set:nnn {bb}{H}{"210D}
-\usv_set:nnn {bb}{N}{"2115}
-\usv_set:nnn {bb}{P}{"2119}
-\usv_set:nnn {bb}{Q}{"211A}
-\usv_set:nnn {bb}{R}{"211D}
-\usv_set:nnn {bb}{Z}{"2124}
-\usv_set:nnn {up}{Pi}       {"003A0}
-\usv_set:nnn {up}{pi}       {"003C0}
-\usv_set:nnn {up}{Gamma}    {"00393}
-\usv_set:nnn {up}{gamma}    {"003B3}
-\usv_set:nnn {up}{summation}{"02211}
-\usv_set:nnn {it}{Pi}       {"1D6F1}
-\usv_set:nnn {it}{pi}       {"1D70B}
-\usv_set:nnn {it}{Gamma}    {"1D6E4}
-\usv_set:nnn {it}{gamma}    {"1D6FE}
-\usv_set:nnn {bb}{Pi}       {"0213F}
-\usv_set:nnn {bb}{pi}       {"0213C}
-\usv_set:nnn {bb}{Gamma}    {"0213E}
-\usv_set:nnn {bb}{gamma}    {"0213D}
-\usv_set:nnn {bb}{summation}{"02140}
-\usv_set:nnn {bbit}{D}{"2145}
-\usv_set:nnn {bbit}{d}{"2146}
-\usv_set:nnn {bbit}{e}{"2147}
-\usv_set:nnn {bbit}{i}{"2148}
-\usv_set:nnn {bbit}{j}{"2149}
-\usv_set:nnn {scr}{B}{"212C}
-\usv_set:nnn {scr}{E}{"2130}
-\usv_set:nnn {scr}{F}{"2131}
-\usv_set:nnn {scr}{H}{"210B}
-\usv_set:nnn {scr}{I}{"2110}
-\usv_set:nnn {scr}{L}{"2112}
-\usv_set:nnn {scr}{M}{"2133}
-\usv_set:nnn {scr}{R}{"211B}
-\usv_set:nnn {scr}{e}{"212F}
-\usv_set:nnn {scr}{g}{"210A}
-\usv_set:nnn {scr}{o}{"2134}
-\usv_set:nnn {cal}{B}{"212C}
-\usv_set:nnn {cal}{E}{"2130}
-\usv_set:nnn {cal}{F}{"2131}
-\usv_set:nnn {cal}{H}{"210B}
-\usv_set:nnn {cal}{I}{"2110}
-\usv_set:nnn {cal}{L}{"2112}
-\usv_set:nnn {cal}{M}{"2133}
-\usv_set:nnn {cal}{R}{"211B}
-\usv_set:nnn {frak}{C}{"212D}
-\usv_set:nnn {frak}{H}{"210C}
-\usv_set:nnn {frak}{I}{"2111}
-\usv_set:nnn {frak}{R}{"211C}
-\usv_set:nnn {frak}{Z}{"2128}
-
 %%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% General assignment of maths symbols.
 
 \cs_new:Npn \__um_symbol_setup:
  {
@@ -834,7 +888,7 @@
        { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence }
        {##3}
       {
-        \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ }
+        \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} }
       }
      }
     \__um_input_math_symbol_table:
@@ -874,6 +928,8 @@
      { \__um_set_math_overunder:Nnnn #2 {} {#1} {#4} }
     \mathunder
      { \__um_set_math_overunder:Nnnn #2 {bottom} {#1} {#4} }
+    \mathaccentoverlay
+     { \__um_set_math_accent:Nnnn #2 {} {#1} {#4} }
    }
  }
 \edef\mathfence{\string\mathfence}
@@ -881,6 +937,7 @@
 \edef\mathunder{\string\mathunder}
 \edef\mathbotaccent{\string\mathbotaccent}
 \edef\mathaccentwide{\string\mathaccentwide}
+\edef\mathaccentoverlay{\string\mathaccentoverlay}
 \edef\mathbotaccentwide{\string\mathbotaccentwide}
 \cs_new:Nn \__um_set_big_operator:nnn
  {
@@ -937,43 +994,44 @@
   \cs_gset_protected_nopar:Npx #1 ##1
    {
     \mathop
-     { \__um_accent:nnn {#2} {#3} {#4} {##1} }
+     { \__um_accent:nnn {#2} {#3} {#4} {{}##1} }
+     %      TODO: remove braces above ^^ which work around a LuaTeX bug
     \limits
    }
  }
 
 %%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The "math text" commands such as `\mathbf` and co.
 
 \keys_define:nn {__um_mathface}
- {
-  version .code:n =
-   { \tl_set:Nn \l__um_mversion_tl {#1} }
- }
+  {
+    version .tl_set:N = \l__um_mversion_tl
+  }
 \cs_set:Nn \__um_setmathfontface:Nnn
- {
-  \tl_clear:N \l__um_mversion_tl
+  {
+    \tl_clear:N \l__um_mversion_tl
 
-  \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist
+    \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist
 
-  \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl
-   { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3}
+    \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl
+      { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3}
 
-  \tl_if_empty:NT \l__um_mversion_tl
-   {
-    \tl_set:Nn \l__um_mversion_tl {normal}
-    \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
-   }
+    \tl_if_empty:NT \l__um_mversion_tl
+      {
+        \tl_set:Nn \l__um_mversion_tl {normal}
+        \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
+      }
 
-  \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
+    \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
 
-  % integrate with fontspec's \setmathrm etc:
-  \tl_case:Nn #1
-   {
-    \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl }
-    \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl }
-    \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl }
-   }
- }
+    % integrate with fontspec's \setmathrm etc:
+    \tl_case:Nn #1
+      {
+        \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl }
+        \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl }
+        \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl }
+      }
+  }
 \cs_generate_variant:Nn \tl_if_eq:nnT {o}
 \cs_set:Nn \__fontspec_setmainfont_hook:nn
   {
@@ -980,29 +1038,23 @@
     \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault}
       {
    \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2}
-        \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault
-        \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault
-        \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault
+        \__fontspec_setmathrm_hook:nn {#1} {#2}
       }
   }
-
 \cs_set:Nn \__fontspec_setsansfont_hook:nn
   {
     \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault}
       {
    \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2}
-        \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault
-        \SetMathAlphabet\mathsf{bold}  \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault
+        \__fontspec_setmathsf_hook:nn {#1} {#2}
       }
   }
-
 \cs_set:Nn \__fontspec_setmonofont_hook:nn
   {
     \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault}
       {
    \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2}
-        \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
-        \SetMathAlphabet\mathtt{bold}  \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
+        \__fontspec_setmathtt_hook:nn {#1} {#2}
       }
   }
 \cs_set:Nn \__fontspec_setmathrm_hook:nn
@@ -1027,48 +1079,58 @@
     \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
     \SetMathAlphabet\mathtt{bold}  \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
   }
+\tl_if_eq:onF {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
+\tl_if_eq:onF {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
+\tl_if_eq:onF {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
+\AtBeginDocument
+  {
+    \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
+    \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
+    \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
+  }
 
 %%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of `\setmainfont`.
 
 \cs_set:Nn \__um_setmathfont:nn
   {
-    \tl_set:Nn \l__um_fontname_tl {#2}
+
+    \__um_init:n {#2}
     \cs_set_eq:NN \glb at currsize \scan_stop:
-    \__um_init:
     \cs_if_exist:cF { S@ \f at size } { \calculate at math@sizes }
-    \csname S@\f at size\endcsname
+    \use:c { S@ \f at size }
+
     \keys_set_known:nnN {unicode-math} {#1} \l__um_unknown_keys_clist
-    \bool_if:NT \l__um_init_bool { \__um_log:n {default-math-font} }
-    \__um_fontspec_select_font:
-    \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
+
+    \bool_if:NT \l__um_init_bool
       {
+        \__um_fontspec_trial_font:
         \__um_declare_math_sizes:
-        \__um_fontspec_select_font:
       }
-    \cs_if_exist:cF { sym \l__um_symfont_label_tl }
+    \__um_fontspec_select_font:
+    \__um_setup_math_fam:
+    \bool_if:NT \l__um_init_bool
       {
-        \DeclareSymbolFont{\l__um_symfont_label_tl}
-          {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
-      }
-    \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl}
-      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
-    \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
-      {
-        \SetSymbolFont{\l__um_symfont_label_tl}{bold}
-          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
-      }
-    \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
-      {
-        \bool_set_true:N \g__um_mainfont_already_set_bool
         \__um_setup_legacy_fam_two:
         \__um_setup_legacy_fam_three:
       }
+
     \__um_input_math_symbol_table:
+
+    \bool_if:NT \l__um_init_bool \__um_onceoff_setup:
     \__um_remap_symbols:
     \__um_setup_mathactives:
     \__um_setup_delcodes:
     \__um_setup_alphabets:
-    \__um_setup_negations:
+
+    %% TODO: what of the above should only be run for the "default"/"main" font?
+
+    \bool_if:NTF \l__um_init_bool
+      {
+        \__um_log:n {default-math-font}
+      }
+      {
+      }
   }
 \AtBeginDocument { \__um_load_lm_if_necessary: }
 \cs_new:Nn \__um_load_lm_if_necessary:
@@ -1075,132 +1137,193 @@
   {
     \cs_if_exist:NF \l__um_fontname_tl
       {
-        % TODO: update this when lmmath-bold.otf is released
-        \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}]
-        \bool_set_false:N \g__um_mainfont_already_set_bool
+        \setmathfont{latinmodern-math.otf}
+          [BoldFont={latinmodern-math.otf}]
       }
   }
-\cs_new:Nn \__um_init:
+\cs_new:Nn \__um_init:n
   {
+    \tl_set:Nn \l__um_fontname_tl {#1}
     \bool_set_true:N  \l__um_ot_math_bool
-    \tl_set:Nn \l__um_mversion_tl {normal}
+    \tl_set:Nn \l__um_mversion_tl      {normal}
     \tl_set:Nn \l__um_symfont_label_tl {operators}
+
     \tl_set:Nn    \l__um_script_features_tl  {Style=MathScript}
     \tl_set:Nn    \l__um_sscript_features_tl {Style=MathScriptScript}
     \tl_set_eq:NN \l__um_script_font_tl      \l__um_fontname_tl
     \tl_set_eq:NN \l__um_sscript_font_tl     \l__um_fontname_tl
+
     \bool_set_true:N \l__um_init_bool
-    \seq_clear:N     \l__um_char_range_seq
-    \clist_clear:N   \l__um_char_nrange_clist
-    \seq_clear:N     \l__um_mathalph_seq
+    \seq_gclear:N    \g__um_char_range_seq
+    \clist_clear:N   \l__um_mathmap_charints_clist
+    \seq_gclear:N    \g__um_mathalph_seq
     \seq_clear:N     \l__um_missing_alph_seq
-    \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_noparse:nnn
-    \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
-    \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_noparse:nnn
-    \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
-    \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
-    \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_noparse:nn
-    \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_noparse:nNN
+
+    \cs_set_eq:NN \__um_sym:nnn                  \__um_process_symbol_noparse:nnn
+    \cs_set_eq:NN \__um_remap_symbol:nnn          \__um_remap_symbol_noparse:nnn
+    \cs_set_eq:NN \__um_maybe_init_alphabet:n     \__um_init_alphabet:n
+    \cs_set_eq:NN \__um_assign_delcode:nn         \__um_assign_delcode_noparse:nn
+    \cs_set_eq:NN \__um_make_mathactive:nNN       \__um_make_mathactive_noparse:nNN
   }
+\tl_new:N \g__um_main_font_cmd_tl
 \cs_new:Nn \__um_declare_math_sizes:
   {
-    \dim_compare:nF { \fontdimen 10 \l__um_font == 0pt }
+    \dim_compare:nF { \fontdimen 10 \g__um_trial_font == 0pt }
       {
         \DeclareMathSizes { \f at size } { \f at size }
-          { \__um_fontdimen_to_scale:nn {10} {\l__um_font} }
-          { \__um_fontdimen_to_scale:nn {11} {\l__um_font} }
+          { \__um_fontdimen_to_scale:nN {10} \g__um_trial_font }
+          { \__um_fontdimen_to_scale:nN {11} \g__um_trial_font }
       }
   }
+\cs_new:Nn \__um_fontspec_trial_font:
+  {
+    \tl_set:Nx \l__um_font_keyval_tl
+      {
+        BoldItalicFont = {}, ItalicFont = {},
+        Script = Math,
+        \l__um_unknown_keys_clist
+      }
+
+    \fontspec_set_family:Nxn \l__um_trial_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl}
+
+    \group_begin:
+      \fontfamily { \l__um_trial_family_tl } \selectfont
+      \__um_fontface_gset_eq:NV \g__um_trial_font \font at name
+      \fontspec_if_script:nF {math}
+        {
+          \bool_gset_false:N \l__um_ot_math_bool
+          \bool_gset_false:N \l__um_init_bool
+        }
+    \group_end:
+
+  }
+\cs_new:Nn \__um_fontspec_select_font:
+  {
+    \fp_gset:Nn \g__um_size_tfsf_fp   { (\f at size +\sf at size )/2 }
+    \fp_gset:Nn \g__um_size_sfssf_fp  { (\sf at size+\ssf at size)/2 }
+
+    \tl_set:Nx \l__um_font_keyval_tl
+      {
+        BoldItalicFont = {}, ItalicFont = {},
+        Script = Math,
+        SizeFeatures =
+          {
+            {
+              Size = \fp_use:N \g__um_size_tfsf_fp -
+            } ,
+            {
+              Size = \fp_use:N \g__um_size_sfssf_fp - \fp_use:N \g__um_size_tfsf_fp ,
+              Font = \l__um_script_font_tl ,
+              \l__um_script_features_tl
+            } ,
+            {
+              Size = - \fp_use:N \g__um_size_sfssf_fp ,
+              Font = \l__um_sscript_font_tl ,
+              \l__um_sscript_features_tl
+            }
+          } ,
+        \l__um_unknown_keys_clist
+      }
+
+    \fontspec_set_family:Nxn \l__um_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl}
+
+    \int_gincr:N \g__um_fonts_used_int
+    \group_begin:
+      \fontfamily { \l__um_family_tl } \selectfont
+      \__um_fontface_gset_eq:cV {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} \font at name
+      \tl_gset:Nx \g__um_curr_font_cmd_tl { \exp_not:c {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} }
+      \bool_if:NT \l__um_init_bool
+{
+\__um_fontface_gset_eq:NV \l__um_font \font at name
+}
+      \fontspec_if_script:nF {math}
+        {
+          \bool_gset_false:N \l__um_ot_math_bool
+          \bool_gset_false:N \l__um_init_bool
+        }
+    \group_end:
+  }
+\tl_set:Nn \g__um_main_font_cmd_tl  { \l__um_font }
+\tl_set:Nn \g__um_sqrt_font_cmd_tl  { \l__um_font }
+\tl_set:Nn \g__um_prime_font_cmd_tl { \l__um_font }
+\cs_new:Nn \__um_setup_math_fam:
+  {
+    \cs_if_exist:cF { sym \l__um_symfont_label_tl }
+      {
+        \DeclareSymbolFont{\l__um_symfont_label_tl}
+          {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+      }
+    \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl}
+      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+    \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
+      {
+        \SetSymbolFont{\l__um_symfont_label_tl}{bold}
+          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+      }
+  }
 \cs_new:Nn \__um_setup_legacy_fam_two:
   {
-    \fontspec_set_family:Nxn \l__um_family_tl
+    \fontspec_set_family:Nxn \l__um_fam_two_tl
       {
         \l__um_font_keyval_tl,
         Scale=1.00001,
         FontAdjustment =
           {
-            \__um_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax
-            \__um_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax
-            \__um_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax
-            \__um_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax
-            \__um_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax
-            \__um_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax
-            \__um_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax
-            \__um_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax
-            \__um_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax
-            \__um_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax
-            \__um_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax
-            \__um_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax
-            \__um_zero_fontparam:n   {20} % delim1 = FractionDelimiterDisplaySize
-            \__um_zero_fontparam:n   {21} % delim2 = FractionDelimiterSize
-            \__um_copy_fontparam:nnn {22} {15} {AxisHeight}\relax
+            \__um_copy_fontdimen:nnN { 8} {43} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN { 9} {42} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {10} {32} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {11} {45} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {12} {44} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {13} {21} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {14} {21} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {15} {22} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {16} {18} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {17} {18} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {18} {24} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {19} {20} \g__um_main_font_cmd_tl
+            \__um_copy_fontdimen:nnN {22} {15} \g__um_main_font_cmd_tl
+            \__um_zero_fontdimen:n   {20} % delim1 = FractionDelimiterDisplaySize
+            \__um_zero_fontdimen:n   {21} % delim2 = FractionDelimiterSize
          }
       } {\l__um_fontname_tl}
 
     \SetSymbolFont{symbols}{\l__um_mversion_tl}
-      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+      {\encodingdefault}{\l__um_fam_two_tl}{\mddefault}{\updefault}
 
     \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
       {
         \SetSymbolFont{symbols}{bold}
-          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+          {\encodingdefault}{\l__um_fam_two_tl}{\bfdefault}{\updefault}
       }
   }
 \cs_new:Nn \__um_setup_legacy_fam_three:
   {
-    \fontspec_set_family:Nxn \l__um_family_tl
+    \fontspec_set_family:Nxn \l__um_fam_three_tl
       {
         \l__um_font_keyval_tl,
         Scale=0.99999,
         FontAdjustment = {
-          \__um_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax
-          \__um_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax
-          \__um_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax
-          \__um_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax
-          \__um_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax
-          \__um_zero_fontparam:n   {13}
+          \__um_copy_fontdimen:nnN { 8} {48} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN { 9} {28} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN {10} {30} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN {11} {29} \g__um_main_font_cmd_tl
+          \__um_copy_fontdimen:nnN {12} {31} \g__um_main_font_cmd_tl
+          \__um_zero_fontdimen:n   {13}
        }
       } {\l__um_fontname_tl}
 
     \SetSymbolFont{largesymbols}{\l__um_mversion_tl}
-      {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+      {\encodingdefault}{\l__um_fam_three_tl}{\mddefault}{\updefault}
 
     \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
       {
         \SetSymbolFont{largesymbols}{bold}
-          {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+          {\encodingdefault}{\l__um_fam_three_tl}{\bfdefault}{\updefault}
       }
   }
-\cs_new:Nn \__um_fontspec_select_font:
+\cs_new:Nn \__um_onceoff_setup:
   {
-    \tl_set:Nx \l__um_font_keyval_tl {
-      BoldItalicFont = {}, ItalicFont = {},
-      Script = Math,
-      SizeFeatures =
-        {
-          {
-            Size = \tf at size-
-          } ,
-          {
-            Size = \sf at size-\tf at size ,
-            Font = \l__um_script_font_tl ,
-            \l__um_script_features_tl
-          } ,
-          {
-            Size = -\sf at size ,
-            Font = \l__um_sscript_font_tl ,
-            \l__um_sscript_features_tl
-          }
-        } ,
-      \l__um_unknown_keys_clist
-    }
-
-  \fontspec_set_fontface:NNxn \l__um_font \l__um_family_tl
-    {\l__um_font_keyval_tl} {\l__um_fontname_tl}
-    \group_begin:
-      \fontfamily{\l__um_family_tl}\selectfont
-      \fontspec_if_script:nF {math} {\bool_gset_false:N \l__um_ot_math_bool}
-    \group_end:
+    \__um_set_delcode:nnn {operators} {`\.} {\c_zero}
   }
 \cs_set:Nn \__um_process_symbol_noparse:nnn
   {
@@ -1208,23 +1331,23 @@
   }
 \cs_set:Nn \__um_process_symbol_parse:nnn
   {
-    \__um_if_char_spec:nNNT {#1} {#2} {#3}
+    \__um_if_char_spec:nNT {#1} {#3}
       {
         \__um_process_symbol_noparse:nnn {#1} {#2} {#3}
       }
   }
-\cs_new:Npn \__um_remap_symbols:
+\cs_new:Nn \__um_remap_symbols:
   {
-    \__um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus
-    \__um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk"
+    \__um_remap_symbol:nnn {`\-} {\mathbin} {"2212}
+    \__um_remap_symbol:nnn {`\*} {\mathbin} {"02217}% text asterisk to "centred asterisk"
     \bool_if:NF \g__um_literal_colon_bool
       {
-        \__um_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel)
+        \__um_remap_symbol:nnn {`\:} {\mathrel} {"02236}% colon to ratio (i.e., punct to rel)
       }
   }
 \cs_new:Nn \__um_remap_symbol_parse:nnn
   {
-    \__um_if_char_spec:nNNT {#3} {\@nil} {#2}
+    \__um_if_char_spec:nNT {#3} {#2}
       { \__um_remap_symbol_noparse:nnn {#1} {#2} {#3} }
   }
 \cs_new:Nn \__um_remap_symbol_noparse:nnn
@@ -1234,19 +1357,19 @@
   }
 \cs_new:Npn \__um_setup_mathactives:
   {
-    \__um_make_mathactive:nNN {"2032} \__um_prime_single_mchar \mathord
-    \__um_make_mathactive:nNN {"2033} \__um_prime_double_mchar \mathord
-    \__um_make_mathactive:nNN {"2034} \__um_prime_triple_mchar \mathord
-    \__um_make_mathactive:nNN {"2057} \__um_prime_quad_mchar   \mathord
-    \__um_make_mathactive:nNN {"2035} \__um_backprime_single_mchar \mathord
-    \__um_make_mathactive:nNN {"2036} \__um_backprime_double_mchar \mathord
-    \__um_make_mathactive:nNN {"2037} \__um_backprime_triple_mchar \mathord
+\__um_make_mathactive:nNN {"2032} \__um_prime_single_mchar \mathord
+\__um_make_mathactive:nNN {"2033} \__um_prime_double_mchar \mathord
+\__um_make_mathactive:nNN {"2034} \__um_prime_triple_mchar \mathord
+\__um_make_mathactive:nNN {"2057} \__um_prime_quad_mchar   \mathord
+\__um_make_mathactive:nNN {"2035} \__um_backprime_single_mchar \mathord
+\__um_make_mathactive:nNN {"2036} \__um_backprime_double_mchar \mathord
+\__um_make_mathactive:nNN {"2037} \__um_backprime_triple_mchar \mathord
     \__um_make_mathactive:nNN {`\'} \mathstraightquote \mathord
     \__um_make_mathactive:nNN {`\`} \mathbacktick      \mathord
   }
 \cs_new:Nn \__um_make_mathactive_parse:nNN
   {
-    \__um_if_char_spec:nNNT {#1} #2 #3
+    \__um_if_char_spec:nNT {#1} #3
       { \__um_make_mathactive_noparse:nNN {#1} #2 #3 }
   }
 \cs_new:Nn \__um_make_mathactive_noparse:nNN
@@ -1260,7 +1383,7 @@
   }
 \cs_new:Nn \__um_assign_delcode_parse:nn
   {
-    \__um_if_char_spec:nNNT {#2} {\@nil} {\@nil}
+    \__um_if_char_spec:nNT {#2} \@nil
       {
         \__um_assign_delcode_noparse:nn {#1} {#2}
       }
@@ -1268,10 +1391,6 @@
 \cs_new:Nn \__um_assign_delcode:n { \__um_assign_delcode:nn {#1} {#1} }
 \cs_new:Npn \__um_setup_delcodes:
   {
-    % ensure \left. and \right. work:
-    \__um_set_delcode:nnn \l__um_symfont_label_tl {`\.} {\c_zero}
-    % this is forcefully done to fix a bug -- indicates a larger problem!
-
     \__um_assign_delcode:nn {`\/}   {\g__um_slash_delimiter_usv}
     \__um_assign_delcode:nn {"2044} {\g__um_slash_delimiter_usv} % fracslash
     \__um_assign_delcode:nn {"2215} {\g__um_slash_delimiter_usv} % divslash
@@ -1317,6 +1436,7 @@
 \tl_set:Nn \l__um_radicals_tl {\sqrt \longdivision}
 
 %%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Keyval for `\setmathfont`
 
 \keys_define:nn {unicode-math}
   {
@@ -1327,100 +1447,124 @@
       }
   }
 \keys_define:nn {unicode-math}
- {
-  script-features  .tl_set:N =  \l__um_script_features_tl ,
-  sscript-features .tl_set:N = \l__um_sscript_features_tl ,
-       script-font .tl_set:N =      \l__um_script_font_tl ,
-      sscript-font .tl_set:N =     \l__um_sscript_font_tl ,
- }
+  {
+    script-features  .tl_set:N =  \l__um_script_features_tl ,
+    sscript-features .tl_set:N = \l__um_sscript_features_tl ,
+         script-font .tl_set:N =      \l__um_script_font_tl ,
+        sscript-font .tl_set:N =     \l__um_sscript_font_tl ,
+  }
 \keys_define:nn {unicode-math}
- {
-  range .code:n =
-   {
-    \bool_set_false:N \l__um_init_bool
+  {
+    range .code:n =
+      {
+        \bool_set_false:N \l__um_init_bool
+        \__um_range_init:
+        \group_begin:
+          \seq_map_inline:Nn \g__um_mathclasses_seq
+            {
+              \cs_set:Npn ##1 { \use_none:n \q_unicode_math \exp_not:N ##1 }
+            }
+          \cs_set:Npn \__um_sym:nnn ##1 ##2 ##3
+            {
+              \cs_set:Npn ##2 { \use_none:n \q_unicode_math ##1 }
+            }
+          \__um_input_math_symbol_table:
+          \__um_range_process:n {#1}
+        \group_end:
+      }
+  }
+\cs_new:Nn \__um_range_init:
+  {
     \int_incr:N \g__um_fam_int
     \tl_set:Nx \l__um_symfont_label_tl {__um_fam\int_use:N\g__um_fam_int}
     \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_parse:nnn
-    \cs_set_eq:NN \__um_set_mathalphabet_char:Nnn \__um_mathmap_parse:Nnn
     \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_parse:nnn
     \cs_set_eq:NN \__um_maybe_init_alphabet:n \use_none:n
-    \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn
     \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_parse:nn
     \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_parse:nNN
-    \seq_clear:N \l__um_char_range_seq
-    \seq_clear:N \l__um_mclass_range_seq
-    \seq_clear:N \l__um_cmd_range_seq
-    \seq_clear:N \l__um_mathalph_seq
-
+    \seq_gclear:N \g__um_char_range_seq
+    \seq_gclear:N \g__um_mclass_range_seq
+    \seq_gclear:N \g__um_mathalph_seq
+  }
+\cs_new:Nn \__um_range_process:n
+  {
     \clist_map_inline:nn {#1}
-     {
-      \__um_if_mathalph_decl:nTF {##1}
-       {
-        \seq_put_right:Nx \l__um_mathalph_seq
-         {
-          { \exp_not:V \l__um_tmpa_tl }
-          { \exp_not:V \l__um_tmpb_tl }
-          { \exp_not:V \l__um_tmpc_tl }
-         }
-       }
-       {
-        \seq_if_in:NnTF \g__um_mathclasses_seq {##1}
-          { \seq_put_right:Nn \l__um_mclass_range_seq {##1} }
-          {
-            \bool_lazy_and:nnTF { \tl_if_single_p:n {##1} } { \token_if_cs_p:N ##1 }
-              { \seq_put_right:Nn \l__um_cmd_range_seq {##1} }
-              { \seq_put_right:Nn \l__um_char_range_seq {##1} }
-          }
-       }
-     }
-   }
- }
-\prg_new_conditional:Nnn \__um_if_mathalph_decl:n {TF}
- {
-  \tl_set:Nn  \l__um_tmpa_tl {#1}
-  \tl_clear:N \l__um_tmpb_tl
-  \tl_clear:N \l__um_tmpc_tl
+      {
+        \__um_mathalph_decl:nF {##1} { \__um_range_decl:n {##1} }
+      }
+}
+\cs_new:Nn \__um_mathalph_decl:nF
+  {
 
-  \tl_if_in:NnT \l__um_tmpa_tl {->}
-   { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil }
+    \tl_set:Nn  \l__um_tmpa_tl {#1}
+    \tl_clear:N \l__um_tmpb_tl
+    \tl_clear:N \l__um_tmpc_tl
 
-  \tl_if_in:NnT \l__um_tmpa_tl {/}
-   { \exp_after:wN \__um_split_slash:w \l__um_tmpa_tl \q_nil }
+    \tl_if_in:NnT \l__um_tmpa_tl {->}
+      { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil }
 
-  \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl }
-  \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math }
-  \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym }
-  \tl_trim_spaces:N \l__um_tmpa_tl
+    \tl_if_in:NnT \l__um_tmpa_tl {/}
+      { \exp_after:wN \__um_split_slash:w \l__um_tmpa_tl \q_nil }
 
-  \tl_if_empty:NT \l__um_tmpc_tl
-   { \tl_set_eq:NN \l__um_tmpc_tl \l__um_tmpa_tl }
+    \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl }
+    \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math }
+    \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym }
+    \tl_trim_spaces:N \l__um_tmpa_tl
 
-  \seq_if_in:NVTF \g__um_named_ranges_seq \l__um_tmpa_tl
-   { \prg_return_true: } { \prg_return_false: }
- }
+    \tl_if_empty:NT \l__um_tmpc_tl
+      { \tl_set_eq:NN \l__um_tmpc_tl \l__um_tmpa_tl }
+
+    \clist_if_in:NVT \g__um_bad_alpha_clist \l__um_tmpa_tl { \__um_error:n {range-not-bf-sf} }
+
+    \prop_if_exist:cTF {g__um_named_range_ \l__um_tmpa_tl _prop}
+      {
+        \seq_gput_right:Nx \g__um_mathalph_seq
+          {
+            { \exp_not:V \l__um_tmpa_tl }
+            { \exp_not:V \l__um_tmpb_tl }
+            { \exp_not:V \l__um_tmpc_tl }
+          }
+      }
+      {#2}
+  }
 \cs_set:Npn \__um_split_arrow:w #1->#2 \q_nil
- {
-  \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
-  \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} }
- }
+  {
+    \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
+    \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} }
+  }
 \cs_set:Npn \__um_split_slash:w #1/#2 \q_nil
- {
-  \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
-  \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} }
- }
-\cs_new:Nn \__um_if_char_spec:nNNT
   {
+    \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
+    \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} }
+  }
+\cs_new_protected:Nn \__um_range_decl:n
+  {
+    \bool_lazy_and:nnTF { \tl_if_single_p:n {#1} } { \token_if_cs_p:N #1 }
+      {
+        \tl_if_in:VnTF #1 { \q_unicode_math }
+          {
+            \seq_if_in:NnTF \g__um_mathclasses_seq {#1}
+              { \seq_gput_right:Nn \g__um_mclass_range_seq {#1} }
+              { \seq_gput_right:Nx \g__um_char_range_seq   {#1} }
+          }
+          { \__um_error:nx {bad-cs-in-range} { \tl_to_str:n {#1} } }
+      }
+      {
+        \seq_gput_right:Nx \g__um_char_range_seq {#1}
+      }
+  }
+\cs_new:Nn \__um_if_char_spec:nNT
+  {
     % math class:
-    \seq_if_in:NnT \l__um_mclass_range_seq {#3}
+    \seq_if_in:NnT \g__um_mclass_range_seq {#2}
       { \use_none_delimit_by_q_nil:w }
 
-    % command name:
-    \seq_if_in:NnT \l__um_cmd_range_seq {#2}
-      { \use_none_delimit_by_q_nil:w }
-
     % character slot:
-    \seq_map_inline:Nn \l__um_char_range_seq
+    \seq_map_inline:Nn \g__um_char_range_seq
       {
+        \__um_int_if_slot_is_last_in_range:nnT {#1} {##1}
+          { \seq_gremove_all:Nn \g__um_char_range_seq {##1} }
+
         \__um_int_if_slot_in_range:nnT {#1} {##1}
           { \seq_map_break:n { \use_none_delimit_by_q_nil:w } }
       }
@@ -1430,12 +1574,17 @@
     \q_nil
     \use:n
       {
-        \clist_put_right:Nx \l__um_char_nrange_clist { \int_eval:n {#1} }
-        #4
+        \cs_if_eq:NNT #2 \mathalpha
+          {
+            \clist_put_right:Nx \l__um_mathmap_charints_clist { \int_eval:n {#1} }
+          }
+        #3
       }
   }
 \cs_new:Nn \__um_int_if_slot_in_range:nnT
-  { \__um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3} }
+  {
+    \__um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
+  }
 \cs_set:Npn \__um_numrange_parse:nwT #1 #2 - #3 - #4 \q_stop #5
   {
     \tl_if_empty:nTF {#4} { \int_compare:nT {#1=#2} {#5} }
@@ -1447,8 +1596,22 @@
     \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} }
       } } }
   }
+\cs_new:Nn \__um_int_if_slot_is_last_in_range:nnT
+  {
+    \__um_numrange_last_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
+  }
+\cs_set:Npn \__um_numrange_last_parse:nwT #1 #2 - #3 - #4 \q_stop #5
+  {
+    \tl_if_empty:nTF {#4} { \int_compare:nT {#1==#2} {#5} }
+      {
+    \tl_if_empty:nTF {#2} { \int_compare:nT {#1==#3} {#5} }
+      {
+                            \int_compare:nT {#1==#3} {#5}
+      } }
+  }
 
 %%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Cross-platform interface for font parameters
 
 \cs_new_protected_nopar:Nn \__um_new_cramped_style:N
   { \quark_new:N #1 }
@@ -1490,30 +1653,30 @@
     \c_two
   }
 \cs_new_protected_nopar:Nn \__um_font_param:nnnnn
-{
-  \__um_font_param_aux:ccnnnn { __um_ #1 :N } { __um_set_ #1 :Nn }
-    { #2 } { #3 } { #4 } { #5 }
-}
+  {
+    \__um_font_param_aux:ccnnnn { __um_ #1 :N } { __um_set_ #1 :Nn }
+      { #2 } { #3 } { #4 } { #5 }
+  }
 \cs_new_protected_nopar:Nn \__um_font_param:nnn
- {
-  \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 }
- }
+  {
+    \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 }
+  }
 \cs_new_protected_nopar:Nn \__um_font_param:nn
- {
-  \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 }
- }
+  {
+    \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 }
+  }
 \cs_new_protected_nopar:Nn \__um_font_param:n
   { }
 \cs_new_protected_nopar:Nn \__um_font_param_aux:NNnnnn
   {
     \cs_new_nopar:Npn #1 ##1
-     {
-      \__um_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 }
-     }
+      {
+        \__um_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 }
+      }
     \cs_new_protected_nopar:Npn #2 ##1 ##2
-     {
-      #1 ##1 \dim_eval:n { ##2 }
-     }
+      {
+        #1 ##1 \dim_eval:n { ##2 }
+      }
   }
 \cs_generate_variant:Nn \__um_font_param_aux:NNnnnn { cc }
 \__um_font_param:nn { axis } { 15 }
@@ -1561,111 +1724,444 @@
 \__um_font_param:nn { underbar_rule } { 57 }
 \__um_font_param:nn { underbar_vgap } { 56 }
 \__um_font_param:n { connector_overlap_min }
-\cs_new:Nn \__um_fontdimen_to_percent:nn
- {
-  \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 }
- }
-\cs_new:Nn \__um_fontdimen_to_scale:nn
- {
-  \fp_eval:n {\__um_fontdimen_to_percent:nn {#1} {#2} * \f at size } pt
- }
-\cs_new:Nn \__um_mathstyle_scale:Nnn
- {
-  \ifx#1\scriptstyle
-    #2 \__um_fontdimen_to_percent:nn {10} \l__um_font #3
-  \else
-    \ifx#1\scriptscriptstyle
-      #2 \__um_fontdimen_to_percent:nn {11} \l__um_font #3
+\cs_new:Nn \__um_fontdimen_to_percent:nN
+  {
+    \fp_eval:n { \dim_to_decimal:n { \fontdimen #1 #2 } * 65536 / 100 }
+  }
+\cs_new:Nn \__um_fontdimen_to_scale:nN
+  {
+    \fp_eval:n { \__um_fontdimen_to_percent:nN {#1} #2 * \f at size } pt
+  }
+\cs_new:Nn \__um_mathstyle_scale:NnnN
+  {
+    \ifx#1\scriptstyle
+      #2 \__um_fontdimen_to_percent:nN {10} #4 #3
     \else
-      #2 #3
+      \ifx#1\scriptscriptstyle
+        #2 \__um_fontdimen_to_percent:nN {11} #4 #3
+      \else
+        #2 #3
+      \fi
     \fi
-  \fi
- }
+  }
 
 %%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Setup of symbol alphabets.
 
-\cs_set:Npn \use at mathgroup #1 #2
- {
-  \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not!
-   {
-    \math at bgroup
-      \cs_if_eq:cNF {M@\f at encoding} #1 {#1}
-      \__um_switchto_literal:
-      \mathgroup #2 \relax
-    \math at egroup
-   }
- }
-\cs_set:Npn \operator at font
- {
-  \__um_switchto_literal:
-  \@fontswitch {} { \g__um_operator_mathfont_tl }
- }
-\cs_new:Nn \__um_prepare_mathstyle:n
- {
-  \seq_put_right:Nn \g__um_mathstyles_seq {#1}
-  \__um_init_alphabet:n {#1}
-  \cs_set:cpn {__um_sym_#1_aux:n}
-   { \use:c {__um_switchto_#1:} \math at egroup }
-  \cs_set_protected:cpx {sym#1}
-   {
-    \exp_not:n
-     {
-      \math at bgroup
-      \mode_if_math:F
-        {
-          \egroup\expandafter
-          \non at alpherr\expandafter{\csname sym#1\endcsname\space}
-        }
-      \tl_set:Nn \l__um_mathstyle_tl {#1}
-     }
-    \exp_not:c {__um_sym_#1_aux:n}
-   }
- }
-\cs_set:Nn \__um_init_alphabet:n
- {
-  \__um_log:nx {alph-initialise} {#1}
-  \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing:
- }
-\cs_new:Nn \__um_new_named_range:n
- {
-  \prop_new:c {g__um_named_range_#1_prop}
- }
-\clist_set:Nn \g__um_named_ranges_clist
- {
-  up, it, tt, bfup, bfit, bb , bbit, scr, bfscr, cal, bfcal,
-  frak, bffrak, sfup, sfit, bfsfup, bfsfit, bfsf
- }
-\clist_map_inline:Nn \g__um_named_ranges_clist
- { \__um_new_named_range:n {#1} }
+\cs_new:Npn \__um_setup_alphabets:
+  {
+
+    \bool_if:NTF \l__um_init_bool
+      {
+        % IMPLICIT
+        \__um_log:n {setup-implicit}
+        \seq_gset_eq:NN \g__um_mathalph_seq \g__um_default_mathalph_seq
+        \bool_set_true:N \l__um_implicit_alph_bool
+        \__um_maybe_init_alphabet:n  {sf}
+        \__um_maybe_init_alphabet:n  {bf}
+        \__um_maybe_init_alphabet:n  {bfsf}
+        \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
+        \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
+        \__um_mathalph_map:
+        \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
+      }
+      {
+        \seq_if_empty:NF \g__um_mathalph_seq
+          {
+            % EXPLICIT
+            \__um_log:n {setup-explicit}
+            \bool_set_false:N \l__um_implicit_alph_bool
+            \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
+            \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
+            \__um_mathalph_map:
+            \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
+          }
+
+        % INHERIT
+        \clist_if_empty:NF \l__um_mathmap_charints_clist
+          {
+            \seq_gclear:N \g__um_mathalph_seq
+            \seq_map_inline:Nn \g__um_default_mathalph_seq
+              {
+                \tl_set:No    \l__um_style_tl       { \use_i:nnn   ##1 }
+                \clist_set:No \l__um_alphabet_clist { \use_ii:nnn  ##1 }
+
+                \clist_map_inline:Nn \l__um_alphabet_clist
+                  {
+                    \clist_map_inline:cn {g__um_named_slots_ \l__um_style_tl _ ####1 _clist}
+                      {
+                        \clist_map_inline:Nn \l__um_mathmap_charints_clist
+                          {
+                            \__um_int_if_slot_in_range:nnT {################1} {########1}
+                              {
+                                \seq_gput_right:Nn \g__um_mathalph_seq {##1}
+                                \clist_map_break:n { \clist_map_break:n { \clist_map_break: } }
+                              }
+                          }
+                      }
+                  }
+              }
+          }
+
+        \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_parse:nnn
+        \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn
+        \__um_mathalph_map:
+      }
+  }
+\cs_set:Nn \__um_mathalph_map:
+  {
+   \seq_map_inline:Nn \g__um_mathalph_seq
+      {
+        \tl_set:No    \l__um_style_tl       { \use_i:nnn   ##1 }
+        \clist_set:No \l__um_alphabet_clist { \use_ii:nnn  ##1 }
+        \tl_set:No    \l__um_remap_style_tl { \use_iii:nnn ##1 }
+
+        % If no set of alphabets is defined:
+        \clist_if_empty:NT \l__um_alphabet_clist
+          {
+            \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
+            \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop }
+              { default-alpha } \l__um_alphabet_clist
+          }
+
+        \__um_check_math_alphabet:
+        \__um_setup_math_alphabet:
+      }
+  }
+\cs_new:Nn \__um_check_math_alphabet:
+  {
+    \clist_map_inline:Nn \l__um_alphabet_clist
+      {
+        \tl_set:Nn \l__um_alphabet_tl {##1}
+        \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl
+          {
+            \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc}
+              {
+                \__um_maybe_init_alphabet:n \l__um_style_tl
+                \clist_map_break:
+              }
+              {
+                \__um_glyph_if_exist:NnT \g__um_curr_font_cmd_tl
+                  { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
+                  {
+                    \__um_maybe_init_alphabet:n \l__um_style_tl
+                    \clist_map_break:
+                  }
+              }
+          }
+          {
+            \msg_warning:nnx {unicode-math} {no-alphabet}
+              { \l__um_style_tl / \l__um_alphabet_tl }
+          }
+      }
+  }
+\cs_new:Nn \__um_setup_math_alphabet:
+  {
+    \clist_map_inline:Nn \l__um_alphabet_clist
+      {
+        \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} }
+
+
+        \__um_if_alphabet_exists:nnT {\l__um_style_tl} {\l__um_alphabet_tl}
+          {
+            \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc}
+              {
+                \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
+                \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
+              }
+              {
+                \__um_glyph_if_exist:NnTF \g__um_curr_font_cmd_tl { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
+                  {
+                    \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
+                    \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
+                  }
+                  {
+                    \bool_if:NTF \l__um_implicit_alph_bool
+                      {
+                        \seq_put_right:Nx \l__um_missing_alph_seq
+                          {
+                            \@backslashchar sym \l__um_style_tl \space
+                            (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl})
+                          }
+                      }
+                      {
+                        \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up}
+                      }
+                  }
+              }
+          }
+      }
+  }
 \cs_new:Nn \__um_new_alphabet_config:nnn
- {
-  \prop_if_exist:cF {g__um_named_range_#1_prop}
-   { \__um_warning:nnn {no-named-range} {#1} {#2} }
+  {
+    \prop_if_exist:cF {g__um_named_range_#1_prop}
+      { \__um_warning:nnn {no-named-range} {#1} {#2} }
 
-  \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl }
-    {
-     \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl }
-     {#2}
-    }
-  % Q: do I need to bother removing duplicates?
+    \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl }
+      {
+        \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl } {#2}
+      }
+    % Q: do I need to bother removing duplicates?
 
-  \cs_new:cn { __um_config_#1_#2:n } {#3}
- }
+    \cs_new:cn { __um_config_#1_#2:n }
+      {
+        \clist_gclear_new:c {g__um_named_slots_#1_#2_clist}
+        \tl_set:Nn \l__um_curr_named_slot { g__um_named_slots_#1_#2_clist }
+        #3
+        \clist_gremove_duplicates:c {g__um_named_slots_#1_#2_clist}
+      }
+
+  }
 \cs_new:Nn \__um_alphabet_config:nnn
- {
-  \use:c {__um_config_#1_#2:n} {#3}
- }
+  {
+    \use:c {__um_config_#1_#2:n} {#3}
+  }
 \prg_new_conditional:Nnn \__um_if_alphabet_exists:nn {T,TF}
- {
-  \cs_if_exist:cTF {__um_config_#1_#2:n}
-   \prg_return_true: \prg_return_false:
- }
+  {
+    \cs_if_exist:cTF {__um_config_#1_#2:n}
+      \prg_return_true: \prg_return_false:
+  }
+\cs_new:Nn \__um_map_char_noparse:nn
+  {
+    \__um_set_mathcode:nnnn {#1} {\mathalpha} {\l__um_symfont_label_tl} {#2}
+  }
+\cs_new:Nn \__um_map_char_parse:nn
+  {
+    \__um_if_char_spec:nNT {#1} {\mathalpha}
+      { \__um_map_char_noparse:nn {#1}{#2} }
+  }
+\cs_new:Nn \__um_map_char_single:nnn
+  {
+    \__um_map_char_single:nn { \__um_to_usv:nn {#1} {#3} }
+                           { \__um_to_usv:nn {#2} {#3} }
+  }
+\cs_set:Nn \__um_map_chars_range:nnn
+  {
+    \int_step_inline:nnnn {0} {1} {#1-1}
+      { \__um_map_char_single:nn {#2+##1} {#3+##1} }
+
+    \clist_gput_right:cx { \l__um_curr_named_slot }
+      { \int_eval:n { #3 } - \int_eval:n { #3 + #1-1 } }
+  }
+\cs_new:Nn \__um_map_chars_range:nnnn
+  {
+    \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
+                                 { \__um_to_usv:nn {#3} {#4} }
+  }
+\cs_set:Nn \__um_set_normal_char:nnn
+  {
+    \__um_usv_if_exist:nnT {#3} {#1}
+      {
+        \clist_map_inline:nn {#2}
+          {
+            \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3}
+            \__um_map_char_single:nnn {##1} {#3} {#1}
+
+            \clist_gput_right:cx {\l__um_curr_named_slot}
+              { \int_eval:n { \__um_to_usv:nn {#3} {#1} } }
+          }
+      }
+  }
+\cs_new:Nn \__um_set_normal_Latin:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin}
+      }
+  }
+\cs_new:Nn \__um_set_normal_latin:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {26} {##1} {#2} {latin}
+      }
+  }
+\cs_new:Nn \__um_set_normal_greek:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {25} {##1} {#2} {greek}
+        \__um_map_char_single:nnn {##1} {#2} {epsilon}
+        \__um_map_char_single:nnn {##1} {#2} {vartheta}
+        \__um_map_char_single:nnn {##1} {#2} {varkappa}
+        \__um_map_char_single:nnn {##1} {#2} {phi}
+        \__um_map_char_single:nnn {##1} {#2} {varrho}
+        \__um_map_char_single:nnn {##1} {#2} {varpi}
+        \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2}
+      }
+  }
+\cs_new:Nn \__um_set_normal_Greek:nn
+  {
+    \clist_map_inline:nn {#1}
+      {
+        \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2}
+        \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek}
+        \__um_map_char_single:nnn {##1} {#2} {varTheta}
+        \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2}
+      }
+  }
+\cs_new:Nn \__um_set_normal_numbers:nn
+  {
+    \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2}
+    \__um_map_chars_range:nnnn {10} {#1} {#2} {num}
+  }
+\cs_new:Nn \__um_mathmap_noparse:nnn
+  {
+    \tl_put_right:cx { __um_switchto_#1: }
+      {
+        \__um_set_mathcode:nnnn {#2} {\mathalpha} {\l__um_symfont_label_tl} {#3}
+      }
+  }
+\cs_new:Nn \__um_mathmap_parse:nnn
+  {
+    \exp_args:NNx \clist_if_in:NnT \l__um_mathmap_charints_clist { \int_eval:n {#3} }
+      {
+        \__um_mathmap_noparse:nnn {#1} {#2} {#3}
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_char:nnnn
+  {
+    \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
+                                       { \__um_to_usv:nn {#3} {#4} }
+  }
+\cs_new:Nn \__um_set_mathalph_range:nnnn
+  {
+    \int_step_inline:nnnn {0} {1} {#1-1}
+      { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } }
+  }
+\cs_new:Nn \__um_set_mathalph_range:nnnnn
+  {
+    \clist_gput_right:cx { \l__um_curr_named_slot }
+      { \int_eval:n { \__um_to_usv:nn {#4} {#5} } - \int_eval:n { (#1-1)+\__um_to_usv:nn {#4} {#5} } }
+
+    \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} }
+                                          { \__um_to_usv:nn {#4} {#5} }
+  }
+\cs_new:Nn \__um_set_mathalphabet_pos:nnnn
+  {
+    \__um_usv_if_exist:nnT {#4} {#2}
+      {
+        \clist_map_inline:nn {#3}
+          { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} }
+
+        \clist_gput_right:cx {\l__um_curr_named_slot}
+          { \int_eval:n { \__um_to_usv:nn {#4} {#2} } }
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_numbers:nnn
+  {
+    \clist_map_inline:nn {#2}
+      { \__um_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} }
+  }
+\cs_new:Nn \__um_set_mathalphabet_Latin:nnn
+  {
+    \clist_map_inline:nn {#2}
+      { \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} }
+  }
+\cs_new:Nn \__um_set_mathalphabet_latin:nnn
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {h}
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_Greek:nnn
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varTheta}
+      }
+  }
+\cs_new:Nn \__um_set_mathalphabet_greek:nnn
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {epsilon}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {vartheta}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varkappa}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {phi}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varrho}
+        \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varpi}
+      }
+  }
+
+%%^^A%% um-code-sym-commands.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of "math symbol alphabet" commands such as `\symbf` and co.
+
+\cs_set:Npn \use at mathgroup #1 #2
+  {
+    \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not!
+      {
+        \math at bgroup
+          \cs_if_eq:cNF {M@\f at encoding} #1 {#1}
+          \__um_switchto_literal:
+          \mathgroup #2 \relax
+        \math at egroup
+      }
+  }
+\cs_set:Npn \operator at font
+  {
+    \__um_switchto_literal:
+    \__um_fontswitch:n { \g__um_operator_mathfont_tl }
+  }
+\cs_set:Nn \__um_fontswitch:n
+  {
+    \mode_if_math:T
+      {
+        \cs_set_eq:NN \math at bgroup     \scan_stop:
+        \cs_set_eq:NN \__um_group_begin: \scan_stop:
+        \cs_set:Npn \__um_group_end:
+          {
+            \cs_set_eq:NN \__um_group_begin: \__um_group_begin_frozen:
+            \cs_set_eq:NN \__um_group_end:   \__um_group_end_frozen:
+            \cs_set_eq:NN \math at bgroup \__ummath at bgroup
+            \cs_set_eq:NN \math at egroup \__ummath at egroup
+          }
+        \cs_set_eq:NN \math at egroup \__um_group_end:
+        #1 \scan_stop:
+      }
+  }
+\cs_new:Nn \__um_prepare_mathstyle:n
+  {
+    \seq_gput_right:Nn \g__um_mathstyles_seq {#1}
+    \__um_init_alphabet:n {#1}
+    \cs_set_protected:cpx {sym#1} ##1
+      {
+        \__um_group_begin:
+          \exp_not:n
+            {
+              \mode_if_math:F
+                {
+                  \exp_args:Nc \non at alpherr {sym#1}
+                }
+              \tl_set:Nn \l__um_mathstyle_tl {#1}
+            }
+          \exp_not:c {__um_switchto_#1:} ##1
+        \__um_group_end:
+      }
+  }
+\cs_set:Nn \__um_init_alphabet:n
+  {
+    \__um_log:nx {alph-initialise} {#1}
+    \cs_set_eq:cN {__um_switchto_#1:} \prg_do_nothing:
+  }
 \cs_new:Nn \__um_default_mathalph:nnn
- {
-  \seq_put_right:Nx \g__um_named_ranges_seq { \tl_to_str:n {#1} }
-  \seq_put_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}}
-  \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2}
- }
+  {
+    \prop_new:c {g__um_named_range_#1_prop}
+    \seq_gput_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}}
+    \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2}
+  }
 \__um_default_mathalph:nnn {up    } {latin,Latin,greek,Greek,num,misc} {up    }
 \__um_default_mathalph:nnn {it    } {latin,Latin,greek,Greek,misc}     {it    }
 \__um_default_mathalph:nnn {bb    } {latin,Latin,num,misc}             {bb    }
@@ -1684,382 +2180,945 @@
 \__um_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup}
 \__um_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc}     {bfsfit}
 \clist_map_inline:nn
- {
-  up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf,
-  tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak,
-  normal, literal, sf, bf,
- }
- { \__um_prepare_mathstyle:n {#1} }
+  {
+    up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf,
+    tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak,
+    normal, literal, sf, bf,
+  }
+  {
+    \__um_prepare_mathstyle:n {#1}
+  }
 \clist_map_inline:nn
- { rm, it, bf, sf, tt }
- { \cs_set_eq:cc { mathtext #1 } { math #1 } }
+  { rm, it, bf, sf, tt }
+  { \cs_set_eq:cc { mathtext #1 } { math #1 } }
 \clist_map_inline:nn
- {
-   normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
-   bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
+  {
+    normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
+    bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
+  }
+  {
+    \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } }
+  }
+\AtBeginDocument
+  {
+    \clist_map_inline:nn
+      { rm, it, bf, sf, tt }
+      {
+        \cs_set_protected:cpx { math #1 }
+        {
+          \exp_not:n { \bool_if:NTF  } \exp_not:c { g__um_ math #1 _text_bool}
+            { \exp_not:c { mathtext #1 } }
+            { \exp_not:c { sym #1 } }
+        }
+      }
+  }
+\cs_set_protected:Npn \mathup { \mathrm }
+\cs_set_protected:Npn \symrm  { \symup  }
+
+%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definitions for setting up the "math symbol alphabets".
+
+\__um_new_alphabet_config:nnn {up} {num}
+  {
+    \__um_set_normal_numbers:nn {up} {#1}
+    \__um_set_mathalphabet_numbers:nnn {up} {up} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {up} {Latin}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} }
+      {
+        \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
+      }
+    \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1}
+    \__um_set_mathalphabet_Latin:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_Latin:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {latin}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} }
+      {
+        \bool_if:NT \g__um_uplatin_bool
+          {
+            \__um_set_normal_latin:nn        {up,it} {#1}
+            \__um_set_normal_char:nnn        {h} {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1}
+    \__um_set_mathalphabet_latin:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_latin:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {Greek}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} }
+      {
+        \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} }
+      }
+    \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1}
+    \__um_set_mathalphabet_Greek:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_Greek:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {greek}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} }
+      {
+        \bool_if:NT \g__um_upgreek_bool
+          {
+            \__um_set_normal_greek:nn {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1}
+    \__um_set_mathalphabet_greek:nnn {literal} {up} {up}
+    \__um_set_mathalphabet_greek:nnn {literal} {it} {it}
+  }
+
+\__um_new_alphabet_config:nnn {up} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_normal_char:nnn {Nabla}{up}{up}
+      }
+      {
+        \bool_if:NT \g__um_upNabla_bool
+          {
+            \__um_set_normal_char:nnn {Nabla}{up,it}{up}
+          }
+      }
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_normal_char:nnn {partial}{up}{up}
+      }
+      {
+        \bool_if:NT \g__um_uppartial_bool
+          {
+            \__um_set_normal_char:nnn {partial}{up,it}{up}
+          }
+      }
+    \__um_set_mathalphabet_pos:nnnn {up}  {partial} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {up}    {Nabla} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {it} {Latin}
+  {
+    \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} }
+      {
+        \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
+      }
+    \__um_set_mathalphabet_Latin:nnn {it} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {latin}
+  {
+    \bool_if:NTF \g__um_literal_bool
+      {
+        \__um_set_normal_latin:nn    {it}{#1}
+        \__um_set_normal_char:nnn {h}{it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_uplatin_bool
+          {
+            \__um_set_normal_latin:nn            {up,it} {#1}
+            \__um_set_normal_char:nnn {h}        {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
+            \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {it}            {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {it} {dotlessi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {it} {dotlessj} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {Greek}
+  {
+    \bool_if:NTF \g__um_literal_bool
+      {
+        \__um_set_normal_Greek:nn {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it} {#1} }
+      }
+    \__um_set_mathalphabet_Greek:nnn {it} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {greek}
+  {
+    \bool_if:NTF \g__um_literal_bool
+      {
+        \__um_set_normal_greek:nn {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} }
+      }
+    \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {it} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_normal_char:nnn {Nabla} {it} {it}
+      }
+      {
+        \bool_if:NF \g__um_upNabla_bool
+          {
+            \__um_set_normal_char:nnn {Nabla} {up,it} {it}
+          }
+      }
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_normal_char:nnn {partial} {it} {it}
+      }
+      {
+        \bool_if:NF \g__um_uppartial_bool
+          {
+            \__um_set_normal_char:nnn {partial} {up,it} {it}
+          }
+      }
+    \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1}
+    \__um_set_mathalphabet_pos:nnnn {it} {Nabla}   {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bb} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {bb} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bb} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bb}    {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bb} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {bb} {up} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bb} {misc}
+  {
+    \__um_set_mathalphabet_pos:nnnn {bb}        {Pi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb}        {pi} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb}     {Gamma} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb}     {gamma} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up}    {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bbit} {misc}
+  {
+    \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {scr} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {scr}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {B} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {E} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {F} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {I} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {L} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {M} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {R} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {scr} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {scr}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {e} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {g} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {scr} {o} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {cal} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {cal}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {B} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {E} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {F} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {I} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {L} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {M} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {cal} {R} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {frak} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {frak}     {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {C} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {H} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {I} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {R} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn  {frak} {Z} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {frak} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {frak} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {sfup} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {sf}   {up} {#1}
+    \__um_set_mathalphabet_numbers:nnn {sfup} {up} {#1}
+  }
+\__um_new_alphabet_config:nnn {sfup} {Latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {sfup} {#1}
+        \__um_set_mathalphabet_Latin:nnn {sf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_Latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_Latin:nnn {sfup} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {sfup} {latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_latin:nn {sfup} {#1}
+        \__um_set_mathalphabet_latin:nnn {sf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {sfup} {up,it} {#1}
+  }
+\__um_new_alphabet_config:nnn {sfit} {Latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {sfit} {#1}
+        \__um_set_mathalphabet_Latin:nnn {sf} {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_upsans_bool
+          {
+            \__um_set_normal_Latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_Latin:nnn {sfit} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {sfit} {latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_latin:nn {sfit} {#1}
+        \__um_set_mathalphabet_latin:nnn {sf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_upsans_bool
+          {
+            \__um_set_normal_latin:nn {sfup,sfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {tt} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1}
+  }
+\__um_new_alphabet_config:nnn {tt} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {tt} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfit} {Latin}
+  {
+    \bool_if:NF \g__um_bfupLatin_bool
+      {
+        \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {bfit} {#1}
+        \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_bfupLatin_bool
+          {
+            \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {latin}
+  {
+    \bool_if:NF \g__um_bfuplatin_bool
+      {
+        \__um_set_normal_latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_latin:nn {bfit} {#1}
+        \__um_set_mathalphabet_latin:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_bfuplatin_bool
+          {
+            \__um_set_normal_latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {Greek}
+  {
+    \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Greek:nn {bfit}{#1}
+        \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_bfupGreek_bool
+          {
+            \__um_set_normal_Greek:nn {bfup,bfit}{#1}
+            \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {greek}
+  {
+    \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_greek:nn {bfit} {#1}
+        \__um_set_mathalphabet_greek:nnn {bf} {it} {#1}
+      }
+      {
+        \bool_if:NF \g__um_bfupgreek_bool
+          {
+            \__um_set_normal_greek:nn {bfit,bfup} {#1}
+            \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfit} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      { \__um_set_normal_char:nnn {Nabla} {bfit} {#1} }
+      {
+        \bool_if:NF \g__um_upNabla_bool
+          { \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} }
+      }
+
+    \bool_if:NTF \g__um_literal_partial_bool
+      { \__um_set_normal_char:nnn {partial} {bfit} {#1} }
+      {
+        \bool_if:NF \g__um_uppartial_bool
+          { \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1} }
+      }
+
+    \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla}   {up,it} {#1}
+
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_uppartial_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
+          }
+      }
+
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {it}{#1}
+      }
+      {
+        \bool_if:NF \g__um_upNabla_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
+          }
+      }
+  }
+\__um_new_alphabet_config:nnn {bfup} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {bf}   {up} {#1}
+    \__um_set_mathalphabet_numbers:nnn {bfup} {up} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {Latin}
+  {
+    \bool_if:NT \g__um_bfupLatin_bool
+      {
+        \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_Latin:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {bfup} {#1}
+        \__um_set_mathalphabet_Latin:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfupLatin_bool
+          {
+            \__um_set_normal_Latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {bf} {up,it} {#1}
+          }
+      }
  }
+
+\__um_new_alphabet_config:nnn {bfup} {latin}
+  {
+    \bool_if:NT \g__um_bfuplatin_bool
+      {
+        \__um_set_normal_latin:nn {bfup,bfit} {#1}
+      }
+    \__um_set_mathalphabet_latin:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_latin:nn {bfup} {#1}
+        \__um_set_mathalphabet_latin:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfuplatin_bool
+          {
+            \__um_set_normal_latin:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {Greek}
+  {
+    \__um_set_mathalphabet_Greek:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_Greek:nn {bfup} {#1}
+        \__um_set_mathalphabet_Greek:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfupGreek_bool
+          {
+            \__um_set_normal_Greek:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_Greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {greek}
+  {
+    \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1}
+    \bool_if:NTF \g__um_bfliteral_bool
+      {
+        \__um_set_normal_greek:nn {bfup} {#1}
+        \__um_set_mathalphabet_greek:nnn {bf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_bfupgreek_bool
+          {
+            \__um_set_normal_greek:nn {bfup,bfit} {#1}
+            \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
+          }
+      }
+  }
+
+\__um_new_alphabet_config:nnn {bfup} {misc}
+  {
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_normal_char:nnn {Nabla} {bfup} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upNabla_bool
+          {
+            \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1}
+          }
+      }
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_normal_char:nnn {partial} {bfup} {#1}
+      }
+      {
+        \bool_if:NT \g__um_uppartial_bool
+          {
+            \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1}
+          }
+      }
+    \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla}   {up,it} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bf}   {digamma} {up} {#1}
+    \__um_set_mathalphabet_pos:nnnn {bf}   {Digamma} {up} {#1}
+    \bool_if:NTF \g__um_literal_partial_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_uppartial_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it} {#1}
+          }
+      }
+    \bool_if:NTF \g__um_literal_Nabla_bool
+      {
+        \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upNabla_bool
+          {
+            \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it} {#1}
+          }
+      }
+  }
+\__um_new_alphabet_config:nnn {bffrak} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bffrak} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfscr} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfscr} {latin}
+  {
+    \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfcal} {Latin}
+  {
+    \__um_set_mathalphabet_Latin:nnn {bfcal}  {up,it}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfsfup} {num}
+  {
+    \__um_set_mathalphabet_numbers:nnn {bfsf}   {up}{#1}
+    \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1}
+  }
+\__um_new_alphabet_config:nnn {bfsfup} {Latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Latin:nn {bfsfup} {#1}
+        \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
+            \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {latin}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_latin:nn {bfsfup} {#1}
+        \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
+            \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {Greek}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_Greek:nn {bfsfup}{#1}
+        \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
+            \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
+          }
+      }
+    \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {greek}
+  {
+    \bool_if:NTF \g__um_sfliteral_bool
+      {
+        \__um_set_normal_greek:nn {bfsfup} {#1}
+        \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1}
+      }
+      {
+        \bool_if:NT \g__um_upsans_bool
+          {
+            \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
+            \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
+          }
+      }
+    \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1}
+  }
+
+\__um_new_alphabet_config:nnn {bfsfup} {misc}
  {
-  \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } }
- }
-\AtBeginDocument{
-\clist_map_inline:nn
- { rm, it, bf, sf, tt }
- {
-  \cs_set_protected:cpx { math #1 }
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \exp_not:n { \bool_if:NTF  } \exp_not:c { g__um_ math #1 _text_bool}
-     { \exp_not:c { mathtext #1 } }
-     { \exp_not:c { sym #1 } }
+    \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1}
    }
- }}
-\cs_set_protected:Npn \mathup { \mathrm }
-\cs_set_protected:Npn \symrm  { \symup  }
-\cs_new:Npn \__um_setup_alphabets:
- {
-  \seq_if_empty:NTF \l__um_mathalph_seq
    {
-    \__um_log:n {setup-implicit}
-    \seq_set_eq:NN \l__um_mathalph_seq \g__um_default_mathalph_seq
-    \bool_set_true:N \l__um_implicit_alph_bool
-    \__um_maybe_init_alphabet:n  {sf}
-    \__um_maybe_init_alphabet:n  {bf}
-    \__um_maybe_init_alphabet:n  {bfsf}
+    \bool_if:NT \g__um_upNabla_bool
+     {
+      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
+     }
    }
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \__um_log:n {setup-explicit}
-    \bool_set_false:N \l__um_implicit_alph_bool
-    \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
-    \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
+    \__um_set_normal_char:nnn {partial}{bfsfup}{#1}
    }
-
-  % Now perform the mapping:
-  \seq_map_inline:Nn \l__um_mathalph_seq
    {
-    \tl_set:No    \l__um_style_tl       { \use_i:nnn   ##1 }
-    \clist_set:No \l__um_alphabet_clist { \use_ii:nnn  ##1 }
-    \tl_set:No    \l__um_remap_style_tl { \use_iii:nnn ##1 }
-
-    % If no set of alphabets is defined:
-    \clist_if_empty:NT \l__um_alphabet_clist
+    \bool_if:NT \g__um_uppartial_bool
      {
-      \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
-      \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop }
-       { default-alpha } \l__um_alphabet_clist
+      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
      }
-
-    \__um_setup_math_alphabet:
    }
-  \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
- }
-\cs_new:Nn \__um_setup_math_alphabet:
- {
-  \clist_map_inline:Nn \l__um_alphabet_clist
+  \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1}
+  \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla}   {up,it}{#1}
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \tl_set:Nn \l__um_alphabet_tl {##1}
-    \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1}
+   }
+   {
+    \bool_if:NT \g__um_uppartial_bool
      {
-      \str_if_eq_x:nnTF {\l__um_alphabet_tl} {misc}
-       {
-        \__um_maybe_init_alphabet:n \l__um_style_tl
-        \clist_map_break:
-       }
-       {
-        \__um_glyph_if_exist:NnT \l__um_font { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
-         {
-          \__um_maybe_init_alphabet:n \l__um_style_tl
-          \clist_map_break:
-         }
-       }
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
      }
-     { \msg_warning:nnx {unicode-math} {no-alphabet} { \l__um_style_tl / \l__um_alphabet_tl } }
    }
-  \clist_map_inline:Nn \l__um_alphabet_clist
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} }
-    \cs_if_exist:cT {__um_config_ \l__um_style_tl _ \l__um_alphabet_tl :n}
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up}{#1}
+   }
+   {
+    \bool_if:NT \g__um_upNabla_bool
      {
-      \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc}
-       {
-        \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
-        \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
-       }
-       {
-        \__um_glyph_if_exist:NnTF \l__um_font { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
-         {
-          \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
-          \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
-         }
-         {
-          \bool_if:NTF \l__um_implicit_alph_bool
-           {
-            \seq_put_right:Nx \l__um_missing_alph_seq
-             {
-              \@backslashchar sym \l__um_style_tl \space
-              (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl})
-             }
-           }
-           {
-            \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up}
-           }
-         }
-       }
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
      }
    }
  }
-\cs_new:Nn \__um_map_char_noparse:nn
- { \__um_set_mathcode:nnnn {#1}{\mathalpha}{\l__um_symfont_label_tl}{#2} }
-\cs_new:Nn \__um_map_char_parse:nn
+\__um_new_alphabet_config:nnn {bfsfit} {Latin}
  {
-  \__um_if_char_spec:nNNT {#1} {\@nil} {\mathalpha}
-   { \__um_map_char_noparse:nn {#1}{#2} }
- }
-\cs_new:Nn \__um_map_char_single:nnn
- {
-  \__um_map_char_single:nn { \__um_to_usv:nn {#1}{#3} }
-                         { \__um_to_usv:nn {#2}{#3} }
- }
-\cs_set:Nn \__um_map_chars_range:nnn
- {
-  \int_step_inline:nnnn {0}{1}{#1-1}
-   { \__um_map_char_single:nn {#2+##1}{#3+##1} }
- }
-\cs_new:Nn \__um_map_chars_range:nnnn
- {
-  \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2}{#4} }
-                               { \__um_to_usv:nn {#3}{#4} }
- }
-\cs_set:Nn \__um_set_normal_char:nnn
- {
-  \__um_usv_if_exist:nnT {#3} {#1}
-  {
-    \clist_map_inline:nn {#2}
+  \bool_if:NTF \g__um_sfliteral_bool
+   {
+    \__um_set_normal_Latin:nn {bfsfit} {#1}
+    \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1}
+   }
+   {
+    \bool_if:NF \g__um_upsans_bool
      {
-      \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3}
-      \__um_map_char_single:nnn {##1} {#3} {#1}
+      \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
+      \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
      }
-  }
- }
-\cs_new:Nn \__um_set_normal_Latin:nn
- {
-  \clist_map_inline:nn {#1}
-   {
-    \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin}
    }
+  \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1}
  }
-\cs_new:Nn \__um_set_normal_latin:nn
+
+\__um_new_alphabet_config:nnn {bfsfit} {latin}
  {
-  \clist_map_inline:nn {#1}
+  \bool_if:NTF \g__um_sfliteral_bool
    {
-    \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {26} {##1} {#2} {latin}
+    \__um_set_normal_latin:nn {bfsfit} {#1}
+    \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1}
    }
- }
-\cs_new:Nn \__um_set_normal_greek:nn
- {
-  \clist_map_inline:nn {#1}
    {
-    \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {25} {##1} {#2} {greek}
-    \__um_map_char_single:nnn {##1} {#2} {epsilon}
-    \__um_map_char_single:nnn {##1} {#2} {vartheta}
-    \__um_map_char_single:nnn {##1} {#2} {varkappa}
-    \__um_map_char_single:nnn {##1} {#2} {phi}
-    \__um_map_char_single:nnn {##1} {#2} {varrho}
-    \__um_map_char_single:nnn {##1} {#2} {varpi}
-    \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2}
+    \bool_if:NF \g__um_upsans_bool
+     {
+      \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
+      \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
+     }
    }
+  \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1}
  }
-\cs_new:Nn \__um_set_normal_Greek:nn
+
+\__um_new_alphabet_config:nnn {bfsfit} {Greek}
  {
-  \clist_map_inline:nn {#1}
+  \bool_if:NTF \g__um_sfliteral_bool
    {
-    \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2}
-    \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek}
-    \__um_map_char_single:nnn {##1} {#2} {varTheta}
-    \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2}
+    \__um_set_normal_Greek:nn {bfsfit}{#1}
+    \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1}
    }
- }
-\cs_new:Nn \__um_set_normal_numbers:nn
- {
-  \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2}
-  \__um_map_chars_range:nnnn {10} {#1} {#2} {num}
- }
-\cs_new:Nn \__um_mathmap_noparse:nnn
- {
-  \clist_map_inline:nn {#2}
    {
-    \tl_put_right:cx {__um_switchto_#1:}
+    \bool_if:NF \g__um_upsans_bool
      {
-      \__um_set_mathcode:nnnn {##1} {\mathalpha} {\l__um_symfont_label_tl} {#3}
+      \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
+      \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
      }
    }
+  \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1}
  }
-\cs_new:Nn \__um_mathmap_parse:nnn
+
+\__um_new_alphabet_config:nnn {bfsfit} {greek}
  {
-  \clist_if_in:NnT \l__um_char_nrange_clist {#3}
+  \bool_if:NTF \g__um_sfliteral_bool
    {
-    \__um_mathmap_noparse:nnn {#1}{#2}{#3}
+    \__um_set_normal_greek:nn {bfsfit} {#1}
+    \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1}
    }
- }
-\cs_new:Nn \__um_set_mathalphabet_char:nnnn
- {
-  \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
-                                     { \__um_to_usv:nn {#3} {#4} }
- }
-\cs_new:Nn \__um_set_mathalph_range:nnnn
- {
-  \int_step_inline:nnnn {0} {1} {#1-1}
-    { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } }
- }
-\cs_new:Nn \__um_set_mathalph_range:nnnnn
- {
-  \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} }
-                                        { \__um_to_usv:nn {#4} {#5} }
- }
-\cs_new:Nn \__um_set_mathalphabet_pos:nnnn
- {
-  \__um_usv_if_exist:nnT {#4} {#2}
    {
-    \clist_map_inline:nn {#3}
-      { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} }
+    \bool_if:NF \g__um_upsans_bool
+     {
+      \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
+      \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
+     }
    }
+  \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1}
  }
-\cs_new:Nn \__um_set_mathalphabet_numbers:nnn
+
+\__um_new_alphabet_config:nnn {bfsfit} {misc}
  {
-  \clist_map_inline:nn {#2}
-    { \__um_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} }
- }
-\cs_new:Nn \__um_set_mathalphabet_Latin:nnn
- {
-  \clist_map_inline:nn {#2}
-    { \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} }
- }
-\cs_new:Nn \__um_set_mathalphabet_latin:nnn
- {
-  \clist_map_inline:nn {#2}
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {h}
+    \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1}
    }
- }
-\cs_new:Nn \__um_set_mathalphabet_Greek:nnn
- {
-  \clist_map_inline:nn {#2}
    {
-    \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varTheta}
+    \bool_if:NF \g__um_upNabla_bool
+     {
+      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
+     }
    }
- }
-\cs_new:Nn \__um_set_mathalphabet_greek:nnn
- {
-  \clist_map_inline:nn {#2}
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {epsilon}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {vartheta}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varkappa}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {phi}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varrho}
-    \__um_set_mathalphabet_char:nnnn    {#1} {##1} {#3} {varpi}
+    \__um_set_normal_char:nnn {partial}{bfsfit}{#1}
    }
- }
-
-%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
-
-\AtBeginDocument{\__um_resolve_greek:}
-\cs_new:Npn \__um_resolve_greek:
- {
-  \clist_map_inline:nn
    {
-    Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,
-    alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
-    Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,
-    mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,
-    varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi
+    \bool_if:NF \g__um_uppartial_bool
+     {
+      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
+     }
    }
+  \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1}
+  \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla}   {up,it}{#1}
+  \bool_if:NTF \g__um_literal_partial_bool
    {
-    \tl_set:cx {##1} { \exp_not:c { mit ##1 } }
-    \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } }
-    \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } }
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1}
    }
- }
-\AtBeginDocument{\__um_redefine_radical:}
-\cs_new:Nn \__um_redefine_radical:
- {
-  \@ifpackageloaded { amsmath } { }
    {
-    \cs_set_nopar:Npn \r@@t ##1 ##2
+    \bool_if:NF \g__um_uppartial_bool
      {
-      \hbox_set:Nn \l_tmpa_box
-       {
-        \c_math_toggle_token
-        \m at th
-        ##1
-        \sqrtsign { ##2 }
-        \c_math_toggle_token
-       }
-      \__um_mathstyle_scale:Nnn ##1 { \kern }
-       { \fontdimen 63 \l__um_font }
-      \box_move_up:nn
-       {
-        (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
-        * \number \fontdimen 65 \l__um_font / 100
-       }
-       { \box_use:N \rootbox }
-      \__um_mathstyle_scale:Nnn ##1 { \kern }
-       { \fontdimen 64 \l__um_font }
-      \box_use_clear:N \l_tmpa_box
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
      }
    }
- }
-\cs_new:Npn \__um_define_active_frac:Nw #1 #2/#3
- {
-  \char_set_catcode_active:N #1
-  \__um_char_gmake_mathactive:N #1
-  \tl_rescan:nn
+  \bool_if:NTF \g__um_literal_Nabla_bool
    {
-    \catcode`\_=11\relax
-    \catcode`\:=11\relax
+    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {it}{#1}
    }
    {
-    \cs_gset:Npx #1
+    \bool_if:NF \g__um_upNabla_bool
      {
-      \bool_if:NTF \l__um_smallfrac_bool {\exp_not:N\tfrac} {\exp_not:N\frac}
-          {#2} {#3}
+      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
      }
    }
  }
+
+%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Assorted definitions to close up.
+
+\AtBeginDocument { \__um_resolve_greek: }
+\cs_new:Npn \__um_resolve_greek:
+  {
+    \clist_map_inline:nn
+      {
+        Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,
+        alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
+        Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,
+        mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,
+        varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi
+      }
+      {
+        \tl_set:cx {##1} { \exp_not:c { mit ##1 } }
+        \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } }
+        \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } }
+      }
+  }
+\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \__um_redefine_radical: } }
+\cs_new:Nn \__um_redefine_radical:
+  {
+    \cs_set_nopar:Npn \r@@t ##1 ##2
+      {
+        \hbox_set:Nn \l_tmpa_box
+          {
+            \c_math_toggle_token \m at th
+            ##1 \sqrtsign { ##2 }
+            \c_math_toggle_token
+          }
+        \__um_mathstyle_scale:NnnN ##1 { \kern } { \fontdimen 63 \g__um_sqrt_font_cmd_tl } \g__um_sqrt_font_cmd_tl
+        \box_move_up:nn
+          {
+            (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box) * \number \fontdimen 65 \g__um_sqrt_font_cmd_tl / 100
+          }
+          { \box_use:N \rootbox }
+        \__um_mathstyle_scale:NnnN ##1 { \kern } { \fontdimen 64 \g__um_sqrt_font_cmd_tl } \g__um_sqrt_font_cmd_tl
+        \box_use_clear:N \l_tmpa_box
+      }
+  }
+\cs_new:Nn \__um_which_frac:nn
+  {
+    \bool_if:NTF \l__um_smallfrac_bool {\tfrac} {\frac} {#1} {#2}
+  }
 \cs_new:Npn \__um_setup_active_frac:
- {
-  \group_begin:
-  \__um_define_active_frac:Nw  ^^^^2189  0/3
-  \__um_define_active_frac:Nw  ^^^^2152  1/{10}
-  \__um_define_active_frac:Nw  ^^^^2151  1/9
-  \__um_define_active_frac:Nw  ^^^^215b  1/8
-  \__um_define_active_frac:Nw  ^^^^2150  1/7
-  \__um_define_active_frac:Nw  ^^^^2159  1/6
-  \__um_define_active_frac:Nw  ^^^^2155  1/5
-  \__um_define_active_frac:Nw  ^^^^00bc  1/4
-  \__um_define_active_frac:Nw  ^^^^2153  1/3
-  \__um_define_active_frac:Nw  ^^^^215c  3/8
-  \__um_define_active_frac:Nw  ^^^^2156  2/5
-  \__um_define_active_frac:Nw  ^^^^00bd  1/2
-  \__um_define_active_frac:Nw  ^^^^2157  3/5
-  \__um_define_active_frac:Nw  ^^^^215d  5/8
-  \__um_define_active_frac:Nw  ^^^^2154  2/3
-  \__um_define_active_frac:Nw  ^^^^00be  3/4
-  \__um_define_active_frac:Nw  ^^^^2158  4/5
-  \__um_define_active_frac:Nw  ^^^^215a  5/6
-  \__um_define_active_frac:Nw  ^^^^215e  7/8
-  \group_end:
- }
-\__um_setup_active_frac:
+  {
+    \__um_mathactive_remap:nn {"2189}  { \__um_which_frac:nn {0} {3}  }
+    \__um_mathactive_remap:nn {"2152}  { \__um_which_frac:nn {1} {10} }
+    \__um_mathactive_remap:nn {"2151}  { \__um_which_frac:nn {1} {9}  }
+    \__um_mathactive_remap:nn {"215B}  { \__um_which_frac:nn {1} {8}  }
+    \__um_mathactive_remap:nn {"2150}  { \__um_which_frac:nn {1} {7}  }
+    \__um_mathactive_remap:nn {"2159}  { \__um_which_frac:nn {1} {6}  }
+    \__um_mathactive_remap:nn {"2155}  { \__um_which_frac:nn {1} {5}  }
+    \__um_mathactive_remap:nn {"00BC}  { \__um_which_frac:nn {1} {4}  }
+    \__um_mathactive_remap:nn {"2153}  { \__um_which_frac:nn {1} {3}  }
+    \__um_mathactive_remap:nn {"215C}  { \__um_which_frac:nn {3} {8}  }
+    \__um_mathactive_remap:nn {"2156}  { \__um_which_frac:nn {2} {5}  }
+    \__um_mathactive_remap:nn {"00BD}  { \__um_which_frac:nn {1} {2}  }
+    \__um_mathactive_remap:nn {"2157}  { \__um_which_frac:nn {3} {5}  }
+    \__um_mathactive_remap:nn {"215D}  { \__um_which_frac:nn {5} {8}  }
+    \__um_mathactive_remap:nn {"2154}  { \__um_which_frac:nn {2} {3}  }
+    \__um_mathactive_remap:nn {"00BE}  { \__um_which_frac:nn {3} {4}  }
+    \__um_mathactive_remap:nn {"2158}  { \__um_which_frac:nn {4} {5}  }
+    \__um_mathactive_remap:nn {"215A}  { \__um_which_frac:nn {5} {6}  }
+    \__um_mathactive_remap:nn {"215E}  { \__um_which_frac:nn {7} {8}  }
+  }
+\AtBeginDocument { \__um_setup_active_frac: }
 \protected\def\to{\rightarrow}
 \protected\def\le{\leq}
 \protected\def\ge{\geq}
@@ -2089,19 +3148,19 @@
 \protected\def\smallint{\mathop{\textstyle\int}\limits}
 \cs_set_eq:NN \latexe_underbar:n \underbar
 \renewcommand\underbar
- {
-  \mode_if_math:TF \mathunderbar \latexe_underbar:n
- }
+  {
+    \mode_if_math:TF \mathunderbar \latexe_underbar:n
+  }
 \@ifpackageloaded{amsmath}
- {
-  % define their own colon, perhaps I should just steal it. (It does look much better.)
- }
- {
-  \cs_set_protected:Npn \colon
-   {
-    \bool_if:NTF \g__um_literal_colon_bool {:} { \mathpunct{:} }
-   }
- }
+  {
+    % define their own colon, perhaps I should just steal it. (It does look much better.)
+  }
+  {
+    \cs_set_protected:Npn \colon
+      {
+        \bool_if:NTF \g__um_literal_colon_bool {:} { \mathpunct{:} }
+      }
+  }
 \protected\def\digamma{\updigamma}
 \protected\def\Digamma{\upDigamma}
 \cs_set_protected:Npn \| {\Vert}
@@ -2109,47 +3168,77 @@
 \cs_set_protected:Npn \cdots {\mathinner{\unicodecdots}}
 \cs_set_eq:NN \__um_text_slash: \slash
 \cs_set_protected:Npn \slash
- {
-  \mode_if_math:TF {\mathslash} {\__um_text_slash:}
- }
-\cs_new:Npn \__um_newnot:N #1
- {
-   \tl_set:Nx \l_not_token_name_tl { \token_to_str:N #1 }
-   \exp_args:Nx \tl_if_empty:nF { \tl_tail:V \l_not_token_name_tl }
-    {
-     \tl_set:Nx \l_not_token_name_tl { \tl_tail:V \l_not_token_name_tl }
-    }
-   \cs_if_exist:cTF { n \l_not_token_name_tl }
-    {
-     \use:c { n \l_not_token_name_tl }
-    }
-    {
-     \cs_if_exist:cTF { not \l_not_token_name_tl }
+  {
+    \mode_if_math:TF {\mathslash} {\__um_text_slash:}
+  }
+\DeclareDocumentCommand \not {m}
+  {
+    \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #1 }
+    \tl_if_empty:NT \l__um_not_token_name_tl
       {
-       \use:c { not \l_not_token_name_tl }
+        \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #1 }
       }
+    \cs_if_exist:cTF { not \l__um_not_token_name_tl }
       {
-       \__um_oldnot: #1
+        \use:c { not \l__um_not_token_name_tl }
       }
-    }
- }
-\cs_set_eq:NN \__um_oldnot: \not
-\AtBeginDocument{\cs_set_eq:NN \not \__um_newnot:N}
-\cs_new_protected_nopar:Nn \__um_setup_negations:
- {
-  \cs_gset:cpn { not= }    { \neq }
-  \cs_gset:cpn { not< }    { \nless }
-  \cs_gset:cpn { not> }    { \ngtr }
-  \cs_gset:Npn  \ngets     { \nleftarrow }
-  \cs_gset:Npn  \nsimeq    { \nsime }
-  \cs_gset:Npn  \nequal    { \ne }
-  \cs_gset:Npn  \nle       { \nleq }
-  \cs_gset:Npn  \nge       { \ngeq }
-  \cs_gset:Npn  \ngreater  { \ngtr }
-  \cs_gset:Npn  \nforksnot { \forks }
- }
+      {
+        \cs_if_exist:cTF { n \l__um_not_token_name_tl }
+          {
+            \use:c { n \l__um_not_token_name_tl }
+          }
+          {
+            \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1
+          }
+      }
+  }
+\DeclareDocumentCommand \NewNegationCommand {mm}
+  {
+    \__um_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2}
+  }
+\DeclareDocumentCommand \RenewNegationCommand {mm}
+  {
+    \__um_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2}
+  }
+\cs_set:Nn \__um_set_negation_command:Nnn
+  {
+    \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #2 }
+    \tl_if_empty:NT \l__um_not_token_name_tl
+      {
+        \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #2 }
+      }
+    #1 { not \l__um_not_token_name_tl } { #3 }
+  }
+\NewNegationCommand { = }    { \neq   }
+\NewNegationCommand { < }    { \nless }
+\NewNegationCommand { > }    { \ngtr  }
+\NewNegationCommand { \gets     } { \nleftarrow }
+\NewNegationCommand { \simeq    } { \nsime      }
+\NewNegationCommand { \equal    } { \ne         }
+\NewNegationCommand { \le       } { \nleq       }
+\NewNegationCommand { \ge       } { \ngeq       }
+\NewNegationCommand { \greater  } { \ngtr       }
+\NewNegationCommand { \forksnot } { \forks      }
+\int_step_inline:nnnn {0} {1} {9}
+  {
+    \__um_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}}
+  }
+\int_step_inline:nnnn {0} {1} {26}
+  {
+    \__um_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}}
+    \__um_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}}
+  }
+\cs_new:Nn \__um_undeclare_symbol:N
+  {
+    \cs_set_protected:Npn #1
+      { \__um_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } }
+  }
+\__um_undeclare_symbol:N \arrowvert
+\__um_undeclare_symbol:N \Arrowvert
+\__um_undeclare_symbol:N \bracevert
 
 %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% The definitions needed for the input of primes.
 
 \cs_new:Nn \__um_arg_i_before_egroup:n {#1\egroup}
 \cs_new:Nn \__um_superscript:n
@@ -2171,17 +3260,17 @@
    {
     {1} { \__um_superscript:n {#1} }
     {2} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2033}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2033}
         { \__um_superscript:n {\__um_prime_double_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
     {3} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2034}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2034}
         { \__um_superscript:n {\__um_prime_triple_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
     {4} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2057}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2057}
         { \__um_superscript:n {\__um_prime_quad_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
@@ -2196,12 +3285,12 @@
    {
     {1} { \__um_superscript:n {#1} }
     {2} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2036}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2036}
         { \__um_superscript:n {\__um_backprime_double_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
     {3} {
-      \__um_glyph_if_exist:NnTF \l__um_font {"2037}
+      \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2037}
         { \__um_superscript:n {\__um_backprime_triple_mchar} }
         { \__um_nprimes:Nn #1 {#2} }
     }
@@ -2433,1293 +3522,352 @@
 \group_end:
 
 %%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Setup for active chars needed to process subscript/superscript input chars.
 
-\group_begin:
 \cs_new:Nn \__um_setup_active_superscript:nn
- {
-  \prop_gput:Nnn \g__um_supers_prop   {#1} {#2}
-  \char_set_catcode_active:N #1
-  \__um_char_gmake_mathactive:N #1
-  \scantokens
-   {
-    \cs_gset:Npn #1
-     {
-      \tl_set:Nn \l__um_ss_chain_tl {#2}
-      \cs_set_eq:NN \__um_sub_or_super:n \sp
-      \tl_set:Nn \l__um_tmpa_tl {supers}
-      \__um_scan_sscript:
-     }
-   }
- }
-\__um_setup_active_superscript:nn {^^^^2070} {0}
-\__um_setup_active_superscript:nn {^^^^00b9} {1}
-\__um_setup_active_superscript:nn {^^^^00b2} {2}
-\__um_setup_active_superscript:nn {^^^^00b3} {3}
-\__um_setup_active_superscript:nn {^^^^2074} {4}
-\__um_setup_active_superscript:nn {^^^^2075} {5}
-\__um_setup_active_superscript:nn {^^^^2076} {6}
-\__um_setup_active_superscript:nn {^^^^2077} {7}
-\__um_setup_active_superscript:nn {^^^^2078} {8}
-\__um_setup_active_superscript:nn {^^^^2079} {9}
-\__um_setup_active_superscript:nn {^^^^207a} {+}
-\__um_setup_active_superscript:nn {^^^^207b} {-}
-\__um_setup_active_superscript:nn {^^^^207c} {=}
-\__um_setup_active_superscript:nn {^^^^207d} {(}
-\__um_setup_active_superscript:nn {^^^^207e} {)}
-\__um_setup_active_superscript:nn {^^^^2071} {i}
-\__um_setup_active_superscript:nn {^^^^207f} {n}
-\__um_setup_active_superscript:nn {^^^^02b0} {h}
-\__um_setup_active_superscript:nn {^^^^02b2} {j}
-\__um_setup_active_superscript:nn {^^^^02b3} {r}
-\__um_setup_active_superscript:nn {^^^^02b7} {w}
-\__um_setup_active_superscript:nn {^^^^02b8} {y}
+  {
+    \prop_gput:Nxn \g__um_supers_prop { \int_eval:n {#1} } {#2}
+    \__um_mathactive_remap:nn {#1}
+       {
+        \tl_set:Nn \l__um_ss_chain_tl {#2}
+        \cs_set_eq:NN \__um_sub_or_super:n \sp
+        \tl_set:Nn \l__um_tmpa_tl {supers}
+        \__um_scan_sscript:
+       }
+  }
 \cs_new:Nn \__um_setup_active_subscript:nn
- {
-  \prop_gput:Nnn \g__um_subs_prop   {#1} {#2}
-  \char_set_catcode_active:N #1
-  \__um_char_gmake_mathactive:N #1
-  \scantokens
-   {
-    \cs_gset:Npn #1
-     {
-      \tl_set:Nn \l__um_ss_chain_tl {#2}
-      \cs_set_eq:NN \__um_sub_or_super:n \sb
-      \tl_set:Nn \l__um_tmpa_tl {subs}
-      \__um_scan_sscript:
-     }
-   }
- }
-\__um_setup_active_subscript:nn {^^^^2080} {0}
-\__um_setup_active_subscript:nn {^^^^2081} {1}
-\__um_setup_active_subscript:nn {^^^^2082} {2}
-\__um_setup_active_subscript:nn {^^^^2083} {3}
-\__um_setup_active_subscript:nn {^^^^2084} {4}
-\__um_setup_active_subscript:nn {^^^^2085} {5}
-\__um_setup_active_subscript:nn {^^^^2086} {6}
-\__um_setup_active_subscript:nn {^^^^2087} {7}
-\__um_setup_active_subscript:nn {^^^^2088} {8}
-\__um_setup_active_subscript:nn {^^^^2089} {9}
-\__um_setup_active_subscript:nn {^^^^208a} {+}
-\__um_setup_active_subscript:nn {^^^^208b} {-}
-\__um_setup_active_subscript:nn {^^^^208c} {=}
-\__um_setup_active_subscript:nn {^^^^208d} {(}
-\__um_setup_active_subscript:nn {^^^^208e} {)}
-\__um_setup_active_subscript:nn {^^^^2090} {a}
-\__um_setup_active_subscript:nn {^^^^2091} {e}
-\__um_setup_active_subscript:nn {^^^^2095} {h}
-\__um_setup_active_subscript:nn {^^^^1d62} {i}
-\__um_setup_active_subscript:nn {^^^^2c7c} {j}
-\__um_setup_active_subscript:nn {^^^^2096} {k}
-\__um_setup_active_subscript:nn {^^^^2097} {l}
-\__um_setup_active_subscript:nn {^^^^2098} {m}
-\__um_setup_active_subscript:nn {^^^^2099} {n}
-\__um_setup_active_subscript:nn {^^^^2092} {o}
-\__um_setup_active_subscript:nn {^^^^209a} {p}
-\__um_setup_active_subscript:nn {^^^^1d63} {r}
-\__um_setup_active_subscript:nn {^^^^209b} {s}
-\__um_setup_active_subscript:nn {^^^^209c} {t}
-\__um_setup_active_subscript:nn {^^^^1d64} {u}
-\__um_setup_active_subscript:nn {^^^^1d65} {v}
-\__um_setup_active_subscript:nn {^^^^2093} {x}
-\__um_setup_active_subscript:nn {^^^^1d66} {\beta}
-\__um_setup_active_subscript:nn {^^^^1d67} {\gamma}
-\__um_setup_active_subscript:nn {^^^^1d68} {\rho}
-\__um_setup_active_subscript:nn {^^^^1d69} {\phi}
-\__um_setup_active_subscript:nn {^^^^1d6a} {\chi}
-\group_end:
-\cs_new:Npn \__um_scan_sscript:
- {
-  \__um_scan_sscript:TF
-   {
-    \__um_scan_sscript:
-   }
-   {
-    \__um_sub_or_super:n {\l__um_ss_chain_tl}
-   }
- }
-\cs_new:Npn \__um_scan_sscript:TF #1#2
- {
-  \peek_N_type:TF
-   {
-    \group_align_safe_begin:
-    \__um_scan_sscript_aux:nnN {#1} {#2}
-   }
-   {#2}
- }
-\cs_new:Npn \__um_scan_sscript_aux:nnN #1#2#3
- {
-  \prop_get:cnNTF {g__um_\l__um_tmpa_tl _prop} {#3} \l__um_tmpb_tl
-   {
-    \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl
-    \group_align_safe_end:
-    #1
-   }
-   { \group_align_safe_end: #2 #3 }
- }
+  {
+    \prop_gput:Nxn \g__um_subs_prop { \int_eval:n {#1} } {#2}
+    \__um_mathactive_remap:nn {#1}
+      {
+        \tl_set:Nn \l__um_ss_chain_tl {#2}
+        \cs_set_eq:NN \__um_sub_or_super:n \sb
+        \tl_set:Nn \l__um_tmpa_tl {subs}
+        \__um_scan_sscript:
+      }
+  }
+\cs_new:Nn \__um_scan_sscript:
+  {
+    \__um_scan_sscript:TF
+      { \__um_scan_sscript: }
+      { \__um_sub_or_super:n {\l__um_ss_chain_tl} }
+  }
+\cs_new:Nn \__um_scan_sscript:TF
+  {
+    \peek_N_type:TF
+      {
+        \group_align_safe_begin:
+        \__um_scan_sscript_aux:nnN {#1} {#2}
+      }
+      {#2}
+  }
+\cs_new:Nn \__um_scan_sscript_aux:nnN
+  {
+    \tl_set:Nx \l__um_tmpa_key_tl { \tl_to_str:n {#3} }
+    \prop_get:cxNTF {g__um_\l__um_tmpa_tl _prop}
+      { \int_eval:n { \exp_after:wN ` \l__um_tmpa_key_tl } }
+      \l__um_tmpb_tl
+      {
+        \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl
+        \group_align_safe_end:
+        #1
+      }
+      { \group_align_safe_end: #2 #3 }
+  }
+\__um_setup_active_superscript:nn {"2070} {0}
+\__um_setup_active_superscript:nn {"00B9} {1}
+\__um_setup_active_superscript:nn {"00B2} {2}
+\__um_setup_active_superscript:nn {"00B3} {3}
+\__um_setup_active_superscript:nn {"2074} {4}
+\__um_setup_active_superscript:nn {"2075} {5}
+\__um_setup_active_superscript:nn {"2076} {6}
+\__um_setup_active_superscript:nn {"2077} {7}
+\__um_setup_active_superscript:nn {"2078} {8}
+\__um_setup_active_superscript:nn {"2079} {9}
+\__um_setup_active_superscript:nn {"207A} {+}
+\__um_setup_active_superscript:nn {"207B} {-}
+\__um_setup_active_superscript:nn {"207C} {=}
+\__um_setup_active_superscript:nn {"207D} {(}
+\__um_setup_active_superscript:nn {"207E} {)}
+\__um_setup_active_superscript:nn {"2071} {i}
+\__um_setup_active_superscript:nn {"207F} {n}
+\__um_setup_active_superscript:nn {"02B0} {h}
+\__um_setup_active_superscript:nn {"02B2} {j}
+\__um_setup_active_superscript:nn {"02B3} {r}
+\__um_setup_active_superscript:nn {"02B7} {w}
+\__um_setup_active_superscript:nn {"02B8} {y}
+\__um_setup_active_subscript:nn {"2080} {0}
+\__um_setup_active_subscript:nn {"2081} {1}
+\__um_setup_active_subscript:nn {"2082} {2}
+\__um_setup_active_subscript:nn {"2083} {3}
+\__um_setup_active_subscript:nn {"2084} {4}
+\__um_setup_active_subscript:nn {"2085} {5}
+\__um_setup_active_subscript:nn {"2086} {6}
+\__um_setup_active_subscript:nn {"2087} {7}
+\__um_setup_active_subscript:nn {"2088} {8}
+\__um_setup_active_subscript:nn {"2089} {9}
+\__um_setup_active_subscript:nn {"208A} {+}
+\__um_setup_active_subscript:nn {"208B} {-}
+\__um_setup_active_subscript:nn {"208C} {=}
+\__um_setup_active_subscript:nn {"208D} {(}
+\__um_setup_active_subscript:nn {"208E} {)}
+\__um_setup_active_subscript:nn {"2090} {a}
+\__um_setup_active_subscript:nn {"2091} {e}
+\__um_setup_active_subscript:nn {"2095} {h}
+\__um_setup_active_subscript:nn {"1D62} {i}
+\__um_setup_active_subscript:nn {"2C7C} {j}
+\__um_setup_active_subscript:nn {"2096} {k}
+\__um_setup_active_subscript:nn {"2097} {l}
+\__um_setup_active_subscript:nn {"2098} {m}
+\__um_setup_active_subscript:nn {"2099} {n}
+\__um_setup_active_subscript:nn {"2092} {o}
+\__um_setup_active_subscript:nn {"209A} {p}
+\__um_setup_active_subscript:nn {"1D63} {r}
+\__um_setup_active_subscript:nn {"209B} {s}
+\__um_setup_active_subscript:nn {"209C} {t}
+\__um_setup_active_subscript:nn {"1D64} {u}
+\__um_setup_active_subscript:nn {"1D65} {v}
+\__um_setup_active_subscript:nn {"2093} {x}
+\__um_setup_active_subscript:nn {"1D66} {\beta}
+\__um_setup_active_subscript:nn {"1D67} {\gamma}
+\__um_setup_active_subscript:nn {"1D68} {\rho}
+\__um_setup_active_subscript:nn {"1D69} {\phi}
+\__um_setup_active_subscript:nn {"1D6A} {\chi}
 
 %%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Compatibility with 3rd party packages.
 
-\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnnn
- {
-  \cs_if_exist:NT #1
-   {
-    \token_if_macro:NTF #1
-     {
-      \group_begin:
-      #2 \__um_tmpa:w #3 { #4 }
-      \cs_if_eq:NNTF #1 \__um_tmpa:w
-       {
-        \msg_info:nnx { unicode-math } { patch-macro }
-          { \token_to_str:N #1 }
-        \group_end:
-        #2 #1 #3
-          { #6 }
+\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnn
+  {
+    \cs_if_exist:NT #1
+      {
+        \token_if_macro:NTF #1
+          {
+            \group_begin:
+            #2 \__um_tmpa:w #3 { #4 }
+            \cs_if_eq:NNTF #1 \__um_tmpa:w
+              {
+                \msg_info:nnx { unicode-math } { patch-macro } { \token_to_str:N #1 }
+                \group_end:
+                #2 #1 #3 { #5 }
+              }
+              {
+                \msg_warning:nnxxx { unicode-math } { wrong-meaning }
+                  { \token_to_str:N #1 } { \token_to_meaning:N #1 }
+                  { \token_to_meaning:N \__um_tmpa:w }
+                \group_end:
+              }
+          }
+          {
+            \msg_warning:nnx { unicode-math } { macro-expected }
+              { \token_to_str:N #1 }
+          }
        }
-       {
-        \msg_warning:nnxxx { unicode-math } { wrong-meaning }
-          { \token_to_str:N #1 } { \token_to_meaning:N #1 }
-          { \token_to_meaning:N \__um_tmpa:w }
-        \group_end:
-       }
-     }
-     {
-      \msg_warning:nnx { unicode-math } { macro-expected }
-        { \token_to_str:N #1 }
-     }
-   }
- }
-\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnn
- {
-  \__um_check_and_fix:NNnnnn #1 #2 { #3 } { #4 } { #5 } { #5 }
- }
-\cs_new_protected_nopar:Nn \__um_check_and_fix_luatex:NNnnn
- {
- }
-\cs_generate_variant:Nn \__um_check_and_fix_luatex:NNnnn { c }
+  }
 \AtEndOfPackageFile * {url}
- {
-  \tl_put_left:Nn \Url at FormatString { \__um_switchto_up: }
-  \tl_put_right:Nn \UrlSpecials
-   {
-    \do\`{\mathchar`\`}
-    \do\'{\mathchar`\'}
-    \do\${\mathchar`\$}
-    \do\&{\mathchar`\&}
-   }
- }
-\AtEndOfPackageFile * {amsmath}
- {
-    \tl_remove_once:Nn \@begindocumenthook
+  {
+    \tl_put_left:Nn \Url at FormatString { \__um_switchto_up: }
+    \tl_put_right:Nn \UrlSpecials
+      {
+        \do \` { \mathchar`\` }
+        \do \' { \mathchar`\' }
+        \do \$ { \mathchar`\$ }
+        \do \& { \mathchar`\& }
+      }
+  }
+\AtEndOfPackageFile * { mathtools }
+  {
+    \__um_check_and_fix:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 }
      {
-      \mathchardef\std at minus\mathcode`\-\relax
-      \mathchardef\std at equal\mathcode`\=\relax
+       \sbox \z@ { $ \m at th #1 \nulldelimiterspace = \z@ \radical \z@ { #2 } $ }
+       \ifx #1 \displaystyle
+         \dimen@ = \fontdimen 8 \textfont 3
+         \advance \dimen@ .25 \fontdimen 5 \textfont 2
+       \else
+         \dimen@ = 1.25 \fontdimen 8
+         \ifx #1 \textstyle
+           \textfont
+         \else
+           \ifx #1 \scriptstyle
+             \scriptfont
+           \else
+             \scriptscriptfont
+           \fi
+         \fi
+         3
+       \fi
+       \advance \dimen@ -\ht\z@
+       \ht\z@ = -\dimen@
+       \box\z@
      }
-    \def\std at minus{\Umathcharnum\Umathcodenum`\-\relax}
-    \def\std at equal{\Umathcharnum\Umathcodenum`\=\relax}
-  \cs_set:Npn \@cdots {\mathinner{\cdots}}
-  \cs_set_eq:NN \dotsb@ \cdots
-    \def \resetMathstrut@
-     {%
-      \setbox\z@\hbox{$($}%)
-      \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
-     }
-    \__um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 }
      {
-      \vcenter
-      \bgroup
-      \Let@
-      \restore at math@cr
-      \default at tag
-      \baselineskip \fontdimen 10~ \scriptfont \tw@
-      \advance \baselineskip \fontdimen 12~ \scriptfont \tw@
-      \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@
-      \lineskiplimit \lineskip
-      \ialign
-      \bgroup
-      \ifx c #1 \hfil \fi
-      $ \m at th \scriptstyle ## $
-      \hfil
-      \crcr
-     }
-     {
-      \vcenter
-      \c_group_begin_token
-      \Let@
-      \restore at math@cr
-      \default at tag
-      \skip_set:Nn \baselineskip
-       {
-        \__um_stack_num_up:N \scriptstyle
-        + \__um_stack_denom_down:N \scriptstyle
-       }
-      \lineskip \__um_stack_vgap:N \scriptstyle
-      \lineskiplimit \lineskip
-      \ialign
-      \c_group_begin_token
-      \token_if_eq_meaning:NNT c #1 { \hfil }
-      \c_math_toggle_token
-      \m at th
-      \scriptstyle
-      \c_parameter_token \c_parameter_token
-      \c_math_toggle_token
-      \hfil
-      \crcr
-     }
-  \__um_check_and_fix_luatex:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 }
-   {
-    \setbox \rootbox \hbox
-     {
-      $ \m at th \scriptscriptstyle { #1 } $
-     }
-    \mathchoice
-      { \r@@t \displaystyle      { #2 } }
-      { \r@@t \textstyle         { #2 } }~
-      { \r@@t \scriptstyle       { #2 } }
-      { \r@@t \scriptscriptstyle { #2 } }
-    \egroup
-   }
-   {
-    \bool_if:nTF
-     {
-      \int_compare_p:nNn { \uproot@ } = { \c_zero }
-      && \int_compare_p:nNn { \leftroot@ } = { \c_zero }
-     }
-     {
-        \Uroot \l__um_radical_sqrt_tl { #1 } { #2 }
-     }
-     {
-      \hbox_set:Nn \rootbox
-       {
-        \c_math_toggle_token
-        \m at th
-        \scriptscriptstyle { #1 }
-        \c_math_toggle_token
-       }
-      \mathchoice
-        { \r@@t \displaystyle      { #2 } }
-        { \r@@t \textstyle         { #2 } }
-        { \r@@t \scriptstyle       { #2 } }
-        { \r@@t \scriptscriptstyle { #2 } }
-     }
-    \c_group_end_token
-   }
-  \__um_check_and_fix:NNnnnn \r@@t \cs_set_nopar:Npn { #1 #2 }
-   {
-    \setboxz at h { $ \m at th #1 \sqrtsign { #2 } $ }
-    \dimen@ \ht\z@
-    \advance \dimen@ -\dp\z@
-    \setbox\@ne \hbox { $ \m at th #1 \mskip \uproot@ mu $ }
-    \advance \dimen@ by 1.667 \wd\@ne
-    \mkern -\leftroot@ mu
-    \mkern 5mu
-    \raise .6\dimen@ \copy\rootbox
-    \mkern -10mu
-    \mkern \leftroot@ mu
-    \boxz@
-   }
-   {
-    \hbox_set:Nn \l_tmpa_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \mskip \uproot@ mu
-      \c_math_toggle_token
-     }
-      \Uroot \l__um_radical_sqrt_tl
-     {
-      \box_move_up:nn { \box_wd:N \l_tmpa_box }
-       {
-        \hbox:n
+       \hbox_set:Nn \l_tmpa_box
          {
-          \c_math_toggle_token
-          \m at th
-          \mkern -\leftroot@ mu
-          \box_use:N \rootbox
-          \mkern \leftroot@ mu
-          \c_math_toggle_token
+           \color at setgroup \c_math_toggle_token \m at th
+             #1
+             \dim_zero:N \nulldelimiterspace
+             \XeTeXradical \c_two_hundred_fifty_five \c_zero { #2 }
+           \c_math_toggle_token \color at endgroup
          }
-       }
+       \box_set_ht:Nn \l_tmpa_box
+         {
+           \box_ht:N \l_tmpa_box - \__um_radical_vgap:N #1
+         }
+       \box_use_clear:N \l_tmpa_box
      }
-     { #2 }
-   }
-   {
-    \hbox_set:Nn \l_tmpa_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \sqrtsign { #2 }
-      \c_math_toggle_token
-     }
-    \hbox_set:Nn \l_tmpb_box
-     {
-      \c_math_toggle_token
-      \m at th
-      #1
-      \mskip \uproot@ mu
-      \c_math_toggle_token
-     }
-    \mkern -\leftroot@ mu
-    \__um_mathstyle_scale:Nnn #1 { \kern }
-     {
-      \fontdimen 63 \l__um_font
-     }
-    \box_move_up:nn
-     {
-      \box_wd:N \l_tmpb_box
-      + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
-      * \number \fontdimen 65 \l__um_font / 100
-     }
-     {
-      \box_use:N \rootbox
-     }
-    \__um_mathstyle_scale:Nnn #1 { \kern }
-     {
-      \fontdimen 64 \l__um_font
-     }
-    \mkern \leftroot@ mu
-    \box_use_clear:N \l_tmpa_box
-   }
- }
-\AtEndOfPackageFile * {amsopn}
- {
-  \cs_set:Npn \newmcodes@
-   {
-    \mathcode`\'39\scan_stop:
-    \mathcode`\*42\scan_stop:
-    \mathcode`\."613A\scan_stop:
-%%  \ifnum\mathcode`\-=45 \else
-%%    \mathchardef\std at minus\mathcode`\-\relax
-%%  \fi
-    \mathcode`\-45\scan_stop:
-    \mathcode`\/47\scan_stop:
-    \mathcode`\:"603A\scan_stop:
-   }
- }
+  }
 \AtEndOfPackageFile * { mathtools }
- {
-    \__um_check_and_fix:NNnnn
-        \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 }
-     {
-      \sbox \z@
-       {
-        $
-        \m at th
-        #1
-        \nulldelimiterspace = \z@
-        \radical \z@ { #2 }
-        $
-       }
-      \ifx #1 \displaystyle
-        \dimen@ = \fontdimen 8 \textfont 3
-        \advance \dimen@ .25 \fontdimen 5 \textfont 2
-      \else
-        \dimen@ = 1.25 \fontdimen 8
-        \ifx #1 \textstyle
-          \textfont
-        \else
-          \ifx #1 \scriptstyle
-            \scriptfont
-          \else
-            \scriptscriptfont
-          \fi
-        \fi
-        3
-      \fi
-      \advance \dimen@ -\ht\z@
-      \ht\z@ = -\dimen@
-      \box\z@
-     }
-     {
-      \hbox_set:Nn \l_tmpa_box
-       {
-        \color at setgroup
-        \c_math_toggle_token
-        \m at th
-        #1
-        \dim_zero:N \nulldelimiterspace
-        \XeTeXradical \c_two_hundred_fifty_five \c_zero { #2 }
-        \c_math_toggle_token
-        \color at endgroup
-       }
-      \box_set_ht:Nn \l_tmpa_box
-       {
-        \box_ht:N \l_tmpa_box
-        - \__um_radical_vgap:N #1
-       }
-      \box_use_clear:N \l_tmpa_box
-     }
- }
-\AtEndOfPackageFile * { mathtools }
- {
+  {
     \cs_set_eq:NN \MToverbracket  \overbracket
     \cs_set_eq:NN \MTunderbracket \underbracket
 
     \AtBeginDocument
-     {
-      \msg_warning:nn { unicode-math } { mathtools-overbracket }
+      {
+        \msg_warning:nn { unicode-math } { mathtools-overbracket }
 
-\def\downbracketfill#1#2
- {%
-            \edef\l_MT_bracketheight_fdim{.27ex}%
-            \downbracketend{#1}{#2}
+       \cs_set:Npn \downbracketfill #1 #2
+        {
+            \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
+            \downbracketend {#1} {#2}
             \leaders \vrule \@height #1 \@depth \z@ \hfill
-            \downbracketend{#1}{#2}%
-     }
-\def\upbracketfill#1#2
- {%
-            \edef\l_MT_bracketheight_fdim{.27ex}%
-            \upbracketend{#1}{#2}
+            \downbracketend {#1} {#2}
+          }
+
+      \cs_set:Npn \upbracketfill #1 #2
+        {
+            \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
+            \upbracketend {#1} {#2}
             \leaders \vrule \@height \z@ \@depth #1 \hfill
-            \upbracketend{#1}{#2}%
+            \upbracketend {#1} {#2}
+          }
+
+      \cs_set_eq:NN \Uoverbracket  \overbracket
+      \cs_set_eq:NN \Uunderbracket \underbracket
+        \cs_set_eq:NN \overbracket   \MToverbracket
+        \cs_set_eq:NN \underbracket  \MTunderbracket
      }
-\let\Uoverbracket =\overbracket
-\let\Uunderbracket=\underbracket
-        \let\overbracket  =\MToverbracket
-        \let\underbracket =\MTunderbracket
-     }% end of AtBeginDocument
-  \msg_warning:nn { unicode-math } { mathtools-colon }
-  \NewDocumentCommand \dblcolon { } { \Colon }
-  \NewDocumentCommand \coloneqq { } { \coloneq }
-  \NewDocumentCommand \Coloneqq { } { \Coloneq }
-  \NewDocumentCommand \eqqcolon { } { \eqcolon }
- }
+  }
+\AtEndOfPackageFile * { mathtools }
+  {
+    \msg_warning:nn { unicode-math } { mathtools-colon }
+    \NewDocumentCommand \dblcolon { } { \Colon }
+    \NewDocumentCommand \coloneqq { } { \coloneq }
+    \NewDocumentCommand \Coloneqq { } { \Coloneq }
+    \NewDocumentCommand \eqqcolon { } { \eqcolon }
+  }
 \AtEndOfPackageFile * { colonequals }
- {
-  \msg_warning:nn { unicode-math } { colonequals }
-  \RenewDocumentCommand \ratio { } { \mathratio }
-  \RenewDocumentCommand \coloncolon { } { \Colon }
-  \RenewDocumentCommand \minuscolon { } { \dashcolon }
-  \RenewDocumentCommand \colonequals { } { \coloneq }
-  \RenewDocumentCommand \equalscolon { } { \eqcolon }
-  \RenewDocumentCommand \coloncolonequals { } { \Coloneq }
- }
+  {
+    \msg_warning:nn { unicode-math } { colonequals }
+    \RenewDocumentCommand \ratio { } { \mathratio }
+    \RenewDocumentCommand \coloncolon { } { \Colon }
+    \RenewDocumentCommand \minuscolon { } { \dashcolon }
+    \RenewDocumentCommand \colonequals { } { \coloneq }
+    \RenewDocumentCommand \equalscolon { } { \eqcolon }
+    \RenewDocumentCommand \coloncolonequals { } { \Coloneq }
+  }
 
-%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% um-code-amsmath.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Compatibility with amsmath.
 
-\__um_new_alphabet_config:nnn {up} {num}
- {
-  \__um_set_normal_numbers:nn {up} {#1}
-  \__um_set_mathalphabet_numbers:nnn {up} {up} {#1}
- }
+\AtEndOfPackageFile * {amsmath}
+  {
+    \tl_remove_once:Nn \@begindocumenthook
+      {
+        \mathchardef\std at minus\mathcode`\-\relax
+        \mathchardef\std at equal\mathcode`\=\relax
+      }
+    \AtBeginDocument
+      {
+        \Umathcharnumdef\std at minus\Umathcodenum`-
+        \Umathcharnumdef\std at equal\Umathcodenum`=
+      }
+    \cs_set:Npn \@cdots {\mathinner{\unicodecdots}}
+    \cs_set_eq:NN \dotsb@ \cdots
+    \def \resetMathstrut@
+      {%
+        \setbox\z@\hbox{$($}%)
+        \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
+      }
+    \__um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 }
+      {
+        \vcenter
+        \bgroup
+        \Let@
+        \restore at math@cr
+        \default at tag
+        \baselineskip \fontdimen 10~ \scriptfont \tw@
+        \advance \baselineskip \fontdimen 12~ \scriptfont \tw@
+        \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@
+        \lineskiplimit \lineskip
+        \ialign
+        \bgroup
+        \ifx c #1 \hfil \fi
+        $ \m at th \scriptstyle ## $
+        \hfil
+        \crcr
+      }
+      {
+        \vcenter
+        \c_group_begin_token
+        \Let@
+        \restore at math@cr
+        \default at tag
+        \skip_set:Nn \baselineskip
+          {
+            \__um_stack_num_up:N \scriptstyle
+            + \__um_stack_denom_down:N \scriptstyle
+          }
+        \lineskip \__um_stack_vgap:N \scriptstyle
+        \lineskiplimit \lineskip
+        \ialign
+        \c_group_begin_token
+        \token_if_eq_meaning:NNT c #1 { \hfil }
+        \c_math_toggle_token
+        \m at th
+        \scriptstyle
+        \c_parameter_token \c_parameter_token
+        \c_math_toggle_token
+        \hfil
+        \crcr
+      }
+  \__um_check_and_fix:NNnnn \r@@t \cs_set_nopar:Npn { #1 #2 }
+    {
+      \setboxz at h { $ \m at th #1 \sqrtsign { #2 } $ }
+      \dimen@ \ht\z@
+      \advance \dimen@ -\dp\z@
+      \setbox\@ne \hbox { $ \m at th #1 \mskip \uproot@ mu $ }
+      \advance \dimen@ by 1.667 \wd\@ne
+      \mkern -\leftroot@ mu
+      \mkern 5mu
+      \raise .6\dimen@ \copy\rootbox
+      \mkern -10mu
+      \mkern \leftroot@ mu
+      \boxz@
+    }
+    {
+      \hbox_set:Nn \l_tmpa_box
+        {
+          \c_math_toggle_token \m at th
+            #1 \sqrtsign { #2 }
+          \c_math_toggle_token
+        }
+      \hbox_set:Nn \l_tmpb_box
+        {
+          \c_math_toggle_token \m at th
+            #1 \mskip \uproot@ mu
+          \c_math_toggle_token
+        }
+      \mkern -\leftroot@ mu
+      \__um_mathstyle_scale:Nnn #1 { \kern } { \fontdimen 63 \g__um_sqrt_font_cmd_tl }
+      \box_move_up:nn
+        {
+          \box_wd:N \l_tmpb_box + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
+            * \number \fontdimen 65 \g__um_sqrt_font_cmd_tl / 100
+        }
+        { \box_use:N \rootbox }
+      \__um_mathstyle_scale:Nnn #1 { \kern } { \fontdimen 64 \g__um_sqrt_font_cmd_tl }
+      \mkern \leftroot@ mu
+      \box_use_clear:N \l_tmpa_box
+    }
+  }
 
-\__um_new_alphabet_config:nnn {up} {Latin}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} }
-   {
-    \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
-   }
-  \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1}
-  \__um_set_mathalphabet_Latin:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_Latin:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {latin}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} }
-   {
-    \bool_if:NT \g__um_uplatin_bool
-     {
-      \__um_set_normal_latin:nn        {up,it} {#1}
-      \__um_set_normal_char:nnn        {h} {up,it} {#1}
-      \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
-      \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1}
-  \__um_set_mathalphabet_latin:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_latin:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {Greek}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} }
-   {
-    \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} }
-   }
-  \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1}
-  \__um_set_mathalphabet_Greek:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_Greek:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {greek}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} }
-   {
-    \bool_if:NT \g__um_upgreek_bool
-     {
-      \__um_set_normal_greek:nn {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1}
-  \__um_set_mathalphabet_greek:nnn {literal} {up} {up}
-  \__um_set_mathalphabet_greek:nnn {literal} {it} {it}
- }
-
-\__um_new_alphabet_config:nnn {up} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{up}{up}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{up,it}{up}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{up}{up}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{up,it}{up}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {up}  {partial} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {up}    {Nabla} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1}
- }
-\__um_new_alphabet_config:nnn {it} {Latin}
- {
-  \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} }
-   {
-    \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
-   }
-  \__um_set_mathalphabet_Latin:nnn {it}{up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {latin}
- {
-  \bool_if:NTF \g__um_literal_bool
-   {
-    \__um_set_normal_latin:nn {it} {#1}
-    \__um_set_normal_char:nnn {h}{it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uplatin_bool
-     {
-      \__um_set_normal_latin:nn {up,it} {#1}
-      \__um_set_normal_char:nnn {h}{up,it}{#1}
-      \__um_set_normal_char:nnn {dotlessi}{up,it}{#1}
-      \__um_set_normal_char:nnn {dotlessj}{up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {it}            {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {Greek}
- {
-  \bool_if:NTF \g__um_literal_bool
-   {
-    \__um_set_normal_Greek:nn {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} }
-   }
-  \__um_set_mathalphabet_Greek:nnn {it} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {greek}
- {
-  \bool_if:NTF \g__um_literal_bool
-   {
-    \__um_set_normal_greek:nn {it} {#1}
-   }
-   {
-    \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} }
-   }
-  \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {it} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{it}{it}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{up,it}{it}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{it}{it}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{up,it}{it}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {it} {Nabla}   {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bb} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {bb} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bb} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bb} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {bb} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {bb} {up}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bb} {misc}
- {
-  \__um_set_mathalphabet_pos:nnnn {bb}        {Pi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb}        {pi} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb}     {Gamma} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb}     {gamma} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1}
- }
-
-\__um_new_alphabet_config:nnn {bbit} {misc}
- {
-  \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1}
-  \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1}
- }
-\__um_new_alphabet_config:nnn {scr} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {scr}    {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {B}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {E}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {F}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {H}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {I}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {L}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {M}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {R}{up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {scr} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {scr}    {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {e}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {g}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {scr} {o}{up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {cal} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {cal}  {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {B}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {E}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {F}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {H}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {I}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {L}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {M}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {cal} {R}{up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {frak} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {frak}    {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {C}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {H}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {I}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {R}{up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {frak} {Z}{up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {frak} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {frak} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfup} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {sf}   {up}{#1}
-  \__um_set_mathalphabet_numbers:nnn {sfup} {up}{#1}
- }
-\__um_new_alphabet_config:nnn {sfup} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {sfup} {#1}
-    \__um_set_mathalphabet_Latin:nnn {sf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {sfup} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfup} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {sfup} {#1}
-    \__um_set_mathalphabet_latin:nnn {sf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {sfup} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfit} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {sfit} {#1}
-    \__um_set_mathalphabet_Latin:nnn {sf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {sfit} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {sfit} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {sfit} {#1}
-    \__um_set_mathalphabet_latin:nnn {sf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {sfup,sfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {tt} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1}
- }
-\__um_new_alphabet_config:nnn {tt} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {tt} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfit} {Latin}
- {
-  \bool_if:NF \g__um_bfupLatin_bool
-   {
-    \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfit} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_bfupLatin_bool
-     {
-      \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {latin}
- {
-  \bool_if:NF \g__um_bfuplatin_bool
-   {
-    \__um_set_normal_latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfit} {#1}
-    \__um_set_mathalphabet_latin:nnn {bf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_bfuplatin_bool
-     {
-      \__um_set_normal_latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {Greek}
- {
-  \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfit}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_bfupGreek_bool
-     {
-      \__um_set_normal_Greek:nn {bfup,bfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {greek}
- {
-  \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfit} {#1}
-    \__um_set_mathalphabet_greek:nnn {bf} {it} {#1}
-   }
-   {
-    \bool_if:NF \g__um_bfupgreek_bool
-     {
-      \__um_set_normal_greek:nn {bfit,bfup} {#1}
-      \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfit} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   { \__um_set_normal_char:nnn {Nabla}{bfit}{#1} }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     { \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1} }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   { \__um_set_normal_char:nnn {partial}{bfit}{#1} }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     { \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1} }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla}   {up,it}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bfup} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {bf}   {up}{#1}
-  \__um_set_mathalphabet_numbers:nnn {bfup} {up}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfup} {Latin}
- {
-  \bool_if:NT \g__um_bfupLatin_bool
-   {
-    \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfup} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_bfupLatin_bool
-     {
-      \__um_set_normal_Latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfup} {latin}
- {
-  \bool_if:NT \g__um_bfuplatin_bool
-   {
-    \__um_set_normal_latin:nn {bfup,bfit} {#1}
-   }
-  \__um_set_mathalphabet_latin:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfup} {#1}
-    \__um_set_mathalphabet_latin:nnn {bf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_bfuplatin_bool
-     {
-      \__um_set_normal_latin:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bfup} {Greek}
- {
-  \__um_set_mathalphabet_Greek:nnn {bfup} {up,it}{#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfup}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_bfupGreek_bool
-     {
-      \__um_set_normal_Greek:nn {bfup,bfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfup} {greek}
- {
-  \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1}
-  \bool_if:NTF \g__um_bfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfup} {#1}
-    \__um_set_mathalphabet_greek:nnn {bf} {up} {#1}
-   }
-   {
-    \bool_if:NT \g__um_bfupgreek_bool
-     {
-      \__um_set_normal_greek:nn {bfup,bfit} {#1}
-      \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
-     }
-   }
- }
-
-\__um_new_alphabet_config:nnn {bfup} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{bfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{bfup,bfit}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{bfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{bfup,bfit}{#1}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla}   {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bf}   {digamma} {up}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bf}   {Digamma} {up}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bffrak} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bffrak} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfscr} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfscr} {latin}
- {
-  \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfcal} {Latin}
- {
-  \__um_set_mathalphabet_Latin:nnn {bfcal}  {up,it}{#1}
- }
-\__um_new_alphabet_config:nnn {bfsfup} {num}
- {
-  \__um_set_mathalphabet_numbers:nnn {bfsf}   {up}{#1}
-  \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1}
- }
-\__um_new_alphabet_config:nnn {bfsfup} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfsfup} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfup} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfsfup} {#1}
-    \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfup} {Greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfsfup}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfup} {greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfsfup} {#1}
-    \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1}
-   }
-   {
-    \bool_if:NT \g__um_upsans_bool
-     {
-      \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1}
- }
-\__um_new_alphabet_config:nnn {bfsfup} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{bfsfup}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla}   {up,it}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up}{#1}
-   }
-   {
-    \bool_if:NT \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-\__um_new_alphabet_config:nnn {bfsfit} {Latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Latin:nn {bfsfit} {#1}
-    \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {latin}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_latin:nn {bfsfit} {#1}
-    \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {Greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_Greek:nn {bfsfit}{#1}
-    \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
-      \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
-     }
-   }
-  \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {greek}
- {
-  \bool_if:NTF \g__um_sfliteral_bool
-   {
-    \__um_set_normal_greek:nn {bfsfit} {#1}
-    \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1}
-   }
-   {
-    \bool_if:NF \g__um_upsans_bool
-     {
-      \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
-      \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
-     }
-   }
-  \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1}
- }
-
-\__um_new_alphabet_config:nnn {bfsfit} {misc}
- {
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_normal_char:nnn {partial}{bfsfit}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
-     }
-   }
-  \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1}
-  \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla}   {up,it}{#1}
-  \bool_if:NTF \g__um_literal_partial_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_uppartial_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
-     }
-   }
-  \bool_if:NTF \g__um_literal_Nabla_bool
-   {
-    \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {it}{#1}
-   }
-   {
-    \bool_if:NF \g__um_upNabla_bool
-     {
-      \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla}   {up,it}{#1}
-     }
-   }
- }
-

Modified: trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty	2018-01-07 01:23:38 UTC (rev 46239)
+++ trunk/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty	2018-01-07 23:46:58 UTC (rev 46240)
@@ -19,11 +19,13 @@
 %% Copyright 2012-2015  Khaled Hosny
 %% ------------------------------------------------
 %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Metadata for the package code, including files and versioning
 
 \ProvidesPackage{unicode-math}
-  [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX]
+  [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX]
 
 %%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine.
 
 \ifdefined\XeTeXversion
   \ifdim\number\XeTeXversion\XeTeXrevision in<0.9998in%
@@ -47,9 +49,8 @@
 \fi\fi
 \RequirePackage{expl3,xparse,l3keys2e}
 \RequirePackage{fontspec}
-\RequirePackage{ucharcat}
-\RequirePackage{fix-cm} % avoid some warnings (still necessary? check...)
 \RequirePackage{filehook}
+\RequirePackage{fix-cm}
 \ExplSyntaxOn
 \sys_if_engine_luatex:T { \RequirePackageWithOptions{unicode-math-luatex} }
 \sys_if_engine_xetex:T  { \RequirePackageWithOptions{unicode-math-xetex}  }



More information about the tex-live-commits mailing list