texlive[65193] Master/texmf-dist: mathfont (4dec22)

commits+karl at tug.org commits+karl at tug.org
Sun Dec 4 22:08:17 CET 2022


Revision: 65193
          http://tug.org/svn/texlive?view=revision&revision=65193
Author:   karl
Date:     2022-12-04 22:08:16 +0100 (Sun, 04 Dec 2022)
Log Message:
-----------
mathfont (4dec22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/mathfont/README.txt
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_code.pdf
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.pdf
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.pdf
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.pdf
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.pdf
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.pdf
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.tex
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.pdf
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex
    trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx
    trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/README.txt	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/README.txt	2022-12-04 21:08:16 UTC (rev 65193)
@@ -1,6 +1,7 @@
-LaTeX package mathfont version 2.0 installation information.
+LaTeX package mathfont version 2.2 installation information,
+released December 2022.
 
-This file is README.txt from version 2.0 of the free and
+This file is README.txt from version 2.2 of the free and
 open-source LaTeX package "mathfont," to be used with the
 XeTeX or LuaTeX engines. The package is designed to adapt
 text fonts for use in math mode, and if you typeset your
@@ -7,41 +8,64 @@
 document with LuaLaTeX, mathfont adds resizable delimiters,
 big operators, and a MathConstants table to your font.
 
-Besides this file, the installation contains the following
+*********************************************************
+
+To install mathfont automatically, update your TeXLive or
+MacTeX distribution or use a package manager such as tlmgr.
+
+To install mathfont manually, you need to generate the
+package file mathfont.sty from mathfont.dtx. You can do
+this in two ways:
+
+  (1) Running Plain TeX on mathfont_code.dtx will create
+      mathfont.sty as well as several other tex files
+      that can be used for typesetting documentation.
+
+  (2) Running LaTeX on mathfont_code.dtx will produce the
+      files listed in point (1) including mathfont.sty as 
+      well as mathfont_code.pdf.
+
+Once you have created mathfont.sty, you should move it 
+into a directory searchable by TeX to complete the
+installation.
+
+*********************************************************
+
+Besides this README, the installation contains the following
 items:
 
-  (1) mathfont_code.dtx: the primary file. Run this file 
-      through LaTeX to generate mathfont.sty and complete 
-      the installation.
+  (1) mathfont_code.dtx: the primary file. See above for
+      instructions to generate mathfont.sty from this file
+      and complete the installation.
 
   (2) mathfont_code.pdf: documentation of the package code.
 
-  (3) mathfont_symbol_list.pdf: a list of symbols that 
+  (3) mathfont_symbol_list.pdf: a list of symbols that
       mathfont provides access to.
 
   (4) mathfont_user_guide.pdf: a user guide.
 
   (5) four files called mathfont_example_<fontname>.pdf:
-      example files showing mathfont in action.
+      examples of mathfont in action.
 
-To install mathfont automatically, update your TeXLive or
-MacTeX distribution or use a package manager such as tlmgr.
-To install mathfont manually, run mathfont_code.dtx through
-LaTeX and move the derived file mathfont.sty to a directory
-searchable by TeX.
+Typesetting mathfont_code.dtx will generate the tex files
+used to create the pdf documentation listed in points (3)
+through (5) above.
 
-Copyright 2018-2021 by Conrad Kosowsky
+*********************************************************
 
-This file may be distributed and modified under the terms 
-of the LaTeX Public Project License, version 1.3c or any 
-later version. The most recent version of this license is 
-available online at
+Copyright 2018-2022 by Conrad Kosowsky
 
+This Work may be used, distributed, and modified under the
+terms of the LaTeX Public Project License, version 1.3c or
+any later version. The most recent version of this license
+is available online at
+
           https://www.latex-project.org/lppl/.
 
 This Work has the LPPL status "maintained," and the current
-maintainer is the package author, Conrad Kosowsky. He can 
-be reached at kosowsky.latex at gmail.com. The Work consists 
+maintainer is the package author, Conrad Kosowsky. He can
+be reached at kosowsky.latex at gmail.com. The Work consists
 of the following items:
 
   (1) the base file:
@@ -73,30 +97,10 @@
   (5) all other files created through the configuration
       process
 
-  (6) the associated README.txt file
+    and
 
-THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS 
-OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES 
-OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
-IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE 
-COST FOR ANY REPAIR OR CORRECTION.
+  (6) this README.txt file
 
-BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE 
-TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR 
-DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS 
-BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-See also the "No Warranty" section of the LaTeX Project 
-Public License. In releasing the package author from 
-liability, you also release from liability any third 
-parties who distribute the software under the terms 
-of the LaTeX Project Public License. Derivative works 
-based on this package may come with their own license or
-terms of use, and the package author is not responsible 
-for any third-party software.
-
 The Work does not include any fonts, and the installation
 does not contain any font files. The fonts Bona Nova, 
 Cormorant, Crimson, Kelvinch, Overpass, STIXGeneral, and 
@@ -105,7 +109,39 @@
 Roboto has been released under the Apache License and is 
 used pursuant to that license.
 
-For more information, see mathfont_code.dtx.
+PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 
-Happy TeXing!
+THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+`AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+CORRECTION.
 
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+For more information, see the LaTeX Project Public License.
+Derivative works based on this package may come with their
+own license or terms of use, and the package author is not
+responsible for any third-party software.
+
+*********************************************************
+
+For more information, see mathfont_code.dtx. Happy TeXing!

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `doc')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 
 \let\?\SpecialUsageIndex

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `equations')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \begin{multicols}{2}
 \let\medskip\relax

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `cormorant')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \documentclass[12pt]{article}
 \makeatletter
@@ -59,9 +68,9 @@
 \usepackage{mathfont}
 \DeclareFontFamily{TU}{Cormorant}{}
 \DeclareFontShape{TU}{Cormorant}{m}{n}
-  {<->"Cormorant Medium:\M at default@otf at features;-liga"}{}
+  {<->"Cormorant Medium:\M at otf@features;-liga"}{}
 \DeclareFontShape{TU}{Cormorant}{m}{it}
-  {<->"Cormorant Medium Italic:\M at default@otf at features"}{}
+  {<->"Cormorant Medium Italic:\M at otf@features"}{}
 \mathfont[greeklower=upright,greekupper]{Crimson}
 \mathfont[diacritics]{Bona Nova}
 \setfont{Cormorant}
@@ -79,7 +88,7 @@
 
 \input mathfont_heading.tex
 
-This is Cormorant with Crimson for Greek characters and Bona Nova for diacritics. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Cormorant with Crimson for Greek characters and Bona Nova for diacritics. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 \input{mathfont_equations.tex}
 

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `kelvinch')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \documentclass[12pt]{article}
 \makeatletter
@@ -72,7 +81,7 @@
 
 \input mathfont_heading.tex
 
-This is Kelvinch with Crimson for the radical signs. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Kelvinch with Crimson for the radical signs. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 \input{mathfont_equations.tex}
 

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `roboto')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \documentclass[12pt]{article}
 \makeatletter
@@ -76,7 +85,7 @@
 
 \input mathfont_heading.tex
 
-This is Roboto with Overpass for the radical signs and STIXGeneral for the tensor product. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Roboto with Overpass for the radical signs and STIXGeneral for the tensor product. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 \input{mathfont_equations.tex}
 

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `typey')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \documentclass[12pt]{article}
 \makeatletter
@@ -58,15 +67,32 @@
 \DeclareMathOperator{\Res}{Res}
 \usepackage{mathfont}
 \mathfont[radical]{Crimson}
+
+%% We have to declare Typey McTypeface manually because
+%% it has no bold fontface---we use embolden from luaotflaod
+%% to make a fake bold
+
 \DeclareFontFamily{TU}{Typey}{}
 \DeclareFontShape{TU}{Typey}{m}{n}
-  {<->"Typey McTypeface:\M at default@otf at features"}{}
+  {<->"Typey McTypeface:\M at otf@features"}{}
 \DeclareFontShape{TU}{Typey}{m}{it}
-  {<->"Typey McTypeface/I:\M at default@otf at features"}{}
+  {<->"Typey McTypeface/I:\M at otf@features"}{}
 \DeclareFontShape{TU}{Typey}{b}{n}
-  {<->"Typey McTypeface:\M at default@otf at features;embolden=6"}{}
+  {<->"Typey McTypeface:\M at otf@features;embolden=6"}{}
 \DeclareFontShape{TU}{Typey}{b}{it}
-  {<->"Typey McTypeface/I:\M at default@otf at features;embolden=6"}{}
+  {<->"Typey McTypeface/I:\M at otf@features;embolden=6"}{}
+
+%% We also need to declare Typey-base family for math mode
+
+\DeclareFontFamily{TU}{Typey-base}{}
+\DeclareFontShape{TU}{Typey-base}{\mddefault}{\shapedefault}
+  {<->"Typey McTypeface:\M at otf@features;mode=base"}{}
+\DeclareFontShape{TU}{Typey-base}{\mddefault}{\itdefault}
+  {<->"Typey McTypeface/I:\M at otf@features;mode=base"}{}
+\DeclareFontShape{TU}{Typey-base}{\bfdefault}{\shapedefault}
+  {<->"Typey McTypeface:\M at otf@features;embolden=6;mode=base"}{}
+\DeclareFontShape{TU}{Typey-base}{\bfdefault}{\itdefault}
+  {<->"Typey McTypeface/I:\M at otf@features;embolden=6;mode=base"}{}
 \setfont{Typey}
 \mathfont[]{STIXGeneral}
 \DeclareSymbolFont{Mroman2}{TU}{STIXGeneral}{m}{n}
@@ -84,7 +110,7 @@
 
 \input mathfont_heading.tex
 
-This is Typey McTypeface with Crimson for the radical signs and STIXGeneral for the tensor product. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Typey McTypeface with Crimson for the radical signs and STIXGeneral for the tensor product. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 \let\bullet\cdot
 \input{mathfont_equations.tex}

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `heading')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,35 +23,44 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 
-\def\packagedate{December 2021}
-\def\packageversion{2.0}
+\def\packagedate{December 2022}
+\def\packageversion{2.2}
 
 
 \let\@@section\section
@@ -101,6 +110,7 @@
 \egroup
 \def\topfraction{1}
 \def\bottomfraction{1}
+\let\code\@undefined
 \newenvironment{code}
   {\strut\vadjust\bgroup\medskip\parindent\z@\leftskip2em\relax
     \noindent\strut\ignorespaces}

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `chars')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \documentclass[12pt,twoside]{article}
 \makeatletter
@@ -59,7 +68,7 @@
 \usepackage{mathfont}
 \mathfont[agreeklower=upright,agreekupper]{Crimson}
 \mathfont[hebrew]{Coelacanth}
-\mathfont[\M at normalkeys,\M at letterlikekeys]{STIXGeneral}
+\mathfont[\M at keys]{STIXGeneral}
 \usepackage{shortvrb,doc}
 \MakeShortVerb{|}
 \raggedcolumns

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `user')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,31 +23,40 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \documentclass[12pt,twoside]{article}
 \makeatletter
@@ -134,7 +143,7 @@
 \begin{code}
 |\mathfont[lower=upright, upper=upright]{Times New Roman}|
 \end{code}
-changes all Latin letters to upright Times New Roman. Know that once \textsf{mathfont} has set the default font for a keyword in Table~1, it will ignore any future instructions to do so and prints a warning to the terminal instead.
+changes all Latin letters to upright Times New Roman. Once \textsf{mathfont} has set the default font for a keyword in Table~1, it will ignore any future instructions to do so and prints a warning to the terminal instead.
 
 \begin{figure}[t]
 \labelfig{SetFont}
@@ -153,13 +162,13 @@
 \end{tabularx}
 \end{figure}
 
-If you want to change the font for your entire document at once, you should use |\setfont| instead of |\mathfont|. This command accepts a single mandatory argument:
+If you want to change the font for both text and math, you should use |\setfont| instead of |\mathfont|. This command accepts a single mandatory argument:
 \begin{code}
 |\setfont{|\meta{font name}|}|.
 \end{code}
 It calls |\mathfont| without an optional argument---i.e.\ for the default keywords---on your \meta{font name} and sets your document's default text font to be the \meta{font name}. The command also defines the eight commands in Table~\ref{SetFont} using the \meta{font name} and the |\new| macros in the next section. Both |\mathfont| and |\setfont| should appear in the preamble only.
 
-To select OpenType features, you should put a colon after the font name and follow it with appropriate OpenType tags. For example adding ``|onum=true|'' tells \TeX\ to load your font with oldstyle numbering, assuming that feature is present in the font.\footnote{By default, \textsf{mathfont} enables standard ligatures, traditional \TeX\ ligatures, and lining numbers. The package sets |smcp| to |true| or |false| depending on whether it is attempting to load a small-caps font. For the full list of OpenType features, see \link{https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist}.} Whenever you declare any font setting, such as calling |\mathfont|, the package uses its own fontloader unless you have loaded \textsf{fontspec}. In that case, \textsf{mathfont} feeds your argument directly to \textsf{fontspec}, and if you previously set any font with \textsf{fontspec}, you can say |\mathfont{fontspec}| to call |\mathfont| with the most recent font used by \textsf{fontspec}. I don't recommend using \textsf{fontspec} indirectly like this unless you know what you're doing because Lua\TeX's default font-loading settings are optimized for text fonts, and you may not see any OpenType font features in math mode as a result.\footnote{The default \textsf{luaotfload} (and \textsf{fontspec}) setting is |mode=node|, but \textsf{mathfont} uses |mode=base|. The |node| setting allows users to enable more OpenType font features in text but prevents any OpenType features from showing up in math mode. On the other hand, |base| supports fewer OpenType features but enables them in math mode. This point may seem technical, but it can be very relevant. For example, Cormorant, used in one of the \textsf{mathfont} example pdf files, uses oldstyle numbers by default but includes lining numbers as a separate OpenType feature. (Oldstyle numbers can work well in text, but lining numbers are a much better default for math.) Loading Cormorant with |mode=node| means that the numbers in math mode will be oldstyle, even if you!
  say |lnum=true|, so |base| mode is necessary here. Like I said, fonts are complicated.}
+To select OpenType features, you should put a colon after the font name and follow it with appropriate OpenType tags. For example adding ``|onum=true|'' tells \TeX\ to load your font with oldstyle numbering, assuming that feature is present in the font.\footnote{By default, \textsf{mathfont} enables standard ligatures, traditional \TeX\ ligatures, and lining numbers. The package sets |smcp| to |true| or |false| depending on whether it is attempting to load a small-caps font. For the full list of OpenType features, see \link{https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist}.} Whenever you select a font, \textsf{mathfont} first checks whether you previously loaded \textsf{fontspec}, and if so, the package feeds your entire \meta{font name} argument to \textsf{fontspec}. (You can also say ``|fontspec|'' as the \meta{font name} to select the most recent font used by \textsf{fontspec}.) If you have not loaded \textsf{fontspec}, the package uses its own fontloader. I recommend letting \textsf{mathfont} handle font-loading because when using Lua\TeX, \textsf{mathfont} takes care to load fonts in such a way that full OpenType features are accessible in text and limited OpenType features are accessible in math. While it is also possible to do this in \textsf{fontspec}, it takes some doing.\footnote{The \textsf{luaotfload} package supports two main modes for loading fonts: |node| mode is the default setting, and it supports full OpenType features in text but no OpenType features in math. The |base| mode supports limited OpenType features, but the features will work for both text and math. When \textsf{mathfont} loads a font, it does so twice, once in |node| mode, which is primarily for setting the text font with \vrb\setfont, and once in |base| mode, which is for the package's other font declarations. This way you will be able to use OpenType features throughout your document.}
 
 The last five keywords in Table~\ref{Keywords} are a bit different. If you call |\mathfont| on a \meta{keyword} from the last five rows in Table~\ref{Keywords}, the package defines the macro
 \begin{code}
@@ -169,7 +178,7 @@
 \begin{code}
 |\mathfont[bb]{STIXGeneral}|
 \end{code}
-sets STIXGeneral as the font for bold calligraphic characters and defines |\mathbb| to access them. The argument of |\mathbb| should contain only digits and Latin letters, and for the other four keywords, the argument of |\math|\meta{keyword} should contain only Latin letters. \TeX\ will ignore and issue a warning in response to any other characters in the argument of these macros.
+sets STIXGeneral as the font for bold calligraphic characters and defines |\mathbb| to access them. These are not for use with any double-struck, caligraphic, or fraktur font. Rather, they access Unicode's math alphanumeric symbols block. If you want to use a font where the regular letters appear double-struck, caligraphic, or fraktur, consider the font-changing control sequences in the next section.
 
 \section{Local Font Changes}
 
@@ -208,11 +217,19 @@
 \begin{code}
 |\newmathfontcommand{|\meta{control sequence}|}{|\meta{font name}|}{|\meta{series}|}{|\meta{shape}|}|,
 \end{code}
-where the \meta{control sequence} in the first argument again becomes the macro that changes characters to the \meta{font name}. You are welcome to use a system font name with |\newmathfontcommand|, but the intention behind this command is that you can use an \textsc{nfss} family name for the \meta{font name}. The series and shape values will then correspond to more obscure font faces from the \textsc{nfss} family that you would be otherwise unable to access. The commands from Table~\ref{MathAlpha} as well as |\newmathfontcommand| should appear in the preamble only.
+where the \meta{control sequence} in the first argument again becomes the macro that changes characters to the \meta{font name}. You are welcome to use a system font name with |\newmathfontcommand|, but the intention behind this command is that you can use an \textsc{nfss} family name for the \meta{font name}. Then the series and shape values can correspond to more obscure font faces from the \textsc{nfss} family that you would be otherwise unable to access. The commands from Table~\ref{MathAlpha} as well as |\newmathfontcommand| should appear in the preamble only.
 
+\section{Default Math Parameters}
+
+Lua\TeX\ uses the MathConstants table from the most recent font assigned for use in math mode, and this means that in a document with multiple math fonts, the choice of MathConstants table can depend on the order of font declaration and be unpredictable. To avoid potential problems from using the wrong MathConstants table, \textsf{mathfont} provides the command
+\begin{code}
+|\mathconstantsfont[|\meta{shape}|]{|\meta{prev arg}|}|,
+\end{code}
+where \meta{shape} is an optional argument that can be ``|upright|'' (default) or ``|italic|,'' and \meta{prev arg} should be any argument that you have previously fed to |\mathfont|. When you call |\mathconstantsfont|, \textsf{mathfont} forces Lua\TeX\ to always use the MathConstants table from the font that corresponded to that instance of |\mathfont| in the specified \meta{shape}. You don't need to set the MathConstants table when you use |\setfont| because the package calls |\mathconstantsfont| automatically when you use |\setfont|. This command will not work in \XeTeX\ and should appear only in the preamble.
+
 \section{Lua Font Adjustments}
 
-\begin{figure}[b]
+\begin{figure}[t]
 \labelfig{Charm}
 \centerline{\bfseries Table \the\fig: Number of Integers Required in \vrb\CharmLine\strut}
 \global\advance\fig by 1\relax
@@ -232,13 +249,7 @@
 \end{itemize}
 Writing an asterisk tells \textsf{mathfont} to use whatever value it has saved in memory, either the default value or the value from the most recent call to |\CharmLine| or |\CharmFile|. If you specify too few charm values, \textsf{mathfont} will raise an error, but if you provide too many, \textsf{mathfont} will silently ignore the extras.
 
-For most applications, you can probably ignore charm information altogether, but if you find bounding boxes or accent placement to be off slightly or if you want to change the scaling for a delimiter or big operator, you should try calling |\CharmLine| with different values to see what works. As is typical with decimal inputs in \TeX, \textsf{mathfont} divides your inputs by 1000 before computing with them. Positive integers mean ``increase,'' and negative integers mean ``decrease.'' For a given character, the scale is usually the glyph width. For example,
-\begin{code}
-|\CharmLine{97, 200, -200, *, 50}|
-\end{code}
-tells \textsf{mathfont} to take the lower-case ``a'' (unicode encoding value of 97), increase the bounding box on the left side by 20\% of the glyph width, decrease the bounding box on the right side by 20\% of the glyph width, do nothing to the top accent, and shift the bottom accent right by 5\% of the glyph width. There is no general formula for what charm values to use for a given font! Rather, you will need to make a design choice based on what looks best, and if you regularly use a particular font, consider making a custom set of charm values uploading it to \textsc{ctan}. Additionally, if you store your charm information in a file, you can read it in with |\CharmFile|. The argument of this command should be a file name, and \textsf{mathfont} reads the file and feeds each line individually to |\CharmLine|.
-
-\begin{figure}[tb]
+\begin{figure}[b]
 \labelfig{Factors}
 \centerline{\bfseries Table \the\fig: Commands to Adjust Individual Characters\strut}
 \global\advance\fig by 1\relax
@@ -251,6 +262,12 @@
 \end{tabularx}
 \end{figure}
 
+For most applications, you can probably ignore charm information altogether, but if you find bounding boxes or accent placement to be off slightly or if you want to change the scaling for a delimiter or big operator, you should try calling |\CharmLine| with different values to see what works. As is typical with decimal inputs in \TeX, \textsf{mathfont} divides your inputs by 1000 before computing with them. Positive integers mean ``increase,'' and negative integers mean ``decrease.'' For a given character, the scale is usually the glyph width. For example,
+\begin{code}
+|\CharmLine{97, 200, -200, *, 50}|
+\end{code}
+tells \textsf{mathfont} to take the lower-case ``a'' (unicode encoding value of 97), increase the bounding box on the left side by 20\% of the glyph width, decrease the bounding box on the right side by 20\% of the glyph width, do nothing to the top accent, and shift the bottom accent right by 5\% of the glyph width. There is no general formula for what charm values to use for a given font! Rather, you will need to make a design choice based on what looks best, and if you regularly use a particular font, consider making a custom set of charm values uploading it to \textsc{ctan}. Additionally, if you store your charm information in a file, you can read it in with |\CharmFile|. The argument of this command should be a file name, and \textsf{mathfont} reads the file and feeds each line individually to |\CharmLine|.
+
 The commands in Table~\ref{Factors} adjust other aspects of the font as indicated. Each command accepts a single integer as an argument, and \textsf{mathfont} once again divides the input by 1000. With each of these macros, \textsf{mathfont} multiplies the quotient by some default length, so values greater than or less than 1000 mean ``scale up'' or ``scale down'' respectively. For example,
 \begin{code}
 |\RuleThicknessFactor{2000}|
@@ -274,14 +291,6 @@
 
 Finally, advanced users who want to interact with the font adjustment process directly should use the six callbacks in Table~\ref{Callbacks}. When Lua\TeX\ loads a font, \textsf{mathfont} (1) always calls |mathfont.inspect_font| and (2) calls the other five callbacks in the order that they appear in Table~\ref{Callbacks} if the font object contains |nomath=true|. Functions added to these callbacks should accept a font object as a single argument and return nothing. Further, please be careful when loading functions in the |disable_nomath|, |add_math_constants|, and |fix_character_metrics| callbacks. If you add a function there, Lua\TeX\ will not carry out the default behvaior associated with the callback, so do not mess with these three callbacks unless you are duplicating the default behavior of the callback or you really know what you're doing. Otherwise, you risk breaking the package. See |mathfont_code.pdf| for more information.
 
-\section{Default Math Parameters}
-
-Lua\TeX\ uses the MathConstants table from the most recent font assigned for use in math mode, and this means that in a document with multiple math fonts, the choice of MathConstants table can depend on the order of font declaration and be unpredictable. To avoid potential problems from using the wrong MathConstants table, \textsf{mathfont} provides the command
-\begin{code}
-|\mathconstantsfont{|\meta{prev arg}|}|,
-\end{code}
-where \meta{prev arg} should be any argument that you have previously fed to |\mathfont|. When you call |\mathconstantsfont|, \textsf{mathfont} forces Lua\TeX\ to always use the MathConstants table from the font that corresponded to that instance of |\mathfont|. You don't need to worry about MathConstants when you use |\setfont| because the package calls |\mathconstantsfont| automatically when you use |\setfont|. This command should appear in the preamble only.
-
 \end{document}
 \endinput
 %%

Modified: trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx	2022-12-04 21:08:16 UTC (rev 65193)
@@ -1,30 +1,40 @@
 % \iffalse     ---!!! FIRST META-COMMENT !!!---
 % 
 % 
-% This file is mathfont_code.dtx from version 2.0 of the
+% This file is mathfont_code.dtx from version 2.2 of the
 % free and open-source LaTeX package "mathfont," to be 
-% used with the XeTeX or LuaTeX engines. Running LaTeX on 
-% mathfont_code.dtx will produce the following files:
+% used with the XeTeX or LuaTeX engines. Running Plain
+% TeX mathfont_code.dtx will produce the following files:
 % 
 %   (1) the package file mathfont.sty;
 % 
-%   (2) the pdf documentation file mathfont_code.pdf;
-% 
-%   (3) the derived files mathfont_symbol_list.tex,
+%   (2) the derived files mathfont_symbol_list.tex,
 %       mathfont_user_guide.tex, and four files called
 %       mathfont_example_<fontname>.tex, which can be
 %       used to typeset further documentation for
 %       mathfont;
 % 
-%   (4) the stand-alone derived files mathfont_doc_patch.tex,
+%   (3) the stand-alone derived files mathfont_doc_patch.tex,
 %       mathfont_equations.tex, and mathfont_heading.tex,
-%       which are used to produce documentation; and
+%       which are used to produce documentation;
 % 
-%   (5) a number of other derived files.
+%     and
 % 
+%   (4) a number of other derived files.
+% 
+% Running LaTeX on mathfont_code.dtx will produce the files
+% listed above as well as the following:
+% 
+%   (5) the pdf documentation file mathfont_code.pdf;
+% 
+%     and
+% 
+%   (6) a number of other derived files.
+% 
 % To install mathfont on your computer, run this file through
-% LaTeX and move mathfont.sty into a directory searchable by
-% TeX.
+% Plain TeX or LaTeX and move mathfont.sty into a directory 
+% searchable by TeX. See the associated README.txt file for
+% installation information.
 % 
 % 
 % \fi
@@ -31,22 +41,22 @@
 % \iffalse     ---!!! SECOND META-COMMENT !!!---
 % 
 % 
-% This file is from version 2.0 of the free and open-source
+% This file is from version 2.2 of the free and open-source
 % LaTeX package "mathfont," to be used with the XeTeX or
 % LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 % 
-% Copyright 2018-2021 by Conrad Kosowsky
+% Copyright 2018-2022 by Conrad Kosowsky
 % 
-% This file may be distributed and modified under the terms 
-% of the LaTeX Public Project License, version 1.3c or any 
-% later version. The most recent version of this license is 
-% available online at
+% This Work may be used, distributed, and modified under the
+% terms of the LaTeX Public Project License, version 1.3c or
+% any later version. The most recent version of this license
+% is available online at
 % 
 %           https://www.latex-project.org/lppl/.
 % 
 % This Work has the LPPL status "maintained," and the current
-% maintainer is the package author, Conrad Kosowsky. He can 
-% be reached at kosowsky.latex at gmail.com. The Work consists 
+% maintainer is the package author, Conrad Kosowsky. He can
+% be reached at kosowsky.latex at gmail.com. The Work consists
 % of the following items:
 % 
 %   (1) the base file:
@@ -78,38 +88,51 @@
 %   (5) all other files created through the configuration
 %       process
 % 
+%     and
+% 
 %   (6) the associated README.txt file
 % 
-% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS 
-% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES 
-% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
-% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE 
-% COST FOR ANY REPAIR OR CORRECTION.
+% The Work does not include any fonts, and the installation
+% does not contain any font files. The fonts Bona Nova,
+% Cormorant, Crimson, Kelvinch, Overpass, STIXGeneral, and
+% Typey McTypeface have been released under the SIL Open
+% Font License and are used pursuant to that license. The
+% font Roboto has been released under the Apache License
+% and is used pursuant to that license.
 % 
-% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE 
-% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR 
-% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS 
-% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 % 
-% See also the "No Warranty" section of the LaTeX Project 
-% Public License. In releasing the package author from 
-% liability, you also release from liability any third 
-% parties who distribute the software under the terms 
-% of the LaTeX Project Public License. Derivative works 
-% based on this package may come with their own license or
-% terms of use, and the package author is not responsible 
-% for any third-party software.
+% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+% CORRECTION.
 % 
-% The Work does not include any fonts, and the installation
-% does not contain any font files. The fonts Bona Nova, 
-% Cormorant, Crimson, Kelvinch, Overpass, STIXGeneral, and 
-% Typey McTypeface have released under the SIL Open Font 
-% License and are used pursuant to that license. The font 
-% Roboto has been released under the Apache License and is 
-% used pursuant to that license.
+% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+% POSSIBILITY OF SUCH DAMAGES.
 % 
+% For more information, see the Latex Project Public License.
+% Derivative works based on this package may come with their
+% own license or terms of use, and the package author is not
+% responsible for any third-party software.
+% 
 % Happy TeXing!
 % 
 % 
@@ -117,7 +140,7 @@
 % \iffalse
 % 
 % The installation and driver files are incorporated into
-% mathfont_code.dtx, so we do not need to generate them 
+% mathfont_code.dtx, so we do not need to generate them
 % separately. The <batchfile> and <driver> tags are for 
 % reference.
 % 
@@ -128,16 +151,16 @@
 \askforoverwritefalse
 \preamble
 
-This file is from version 2.0 of the free and open-source
+This file is from version 2.2 of the free and open-source
 LaTeX package "mathfont," to be used with the XeTeX or
 LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 
-Copyright 2018-2021 by Conrad Kosowsky
+Copyright 2018-2022 by Conrad Kosowsky
 
-This file may be distributed and modified under the terms 
-of the LaTeX Public Project License, version 1.3c or any 
-later version. The most recent version of this license is 
-available online at
+This Work may be used, distributed, and modified under the
+terms of the LaTeX Public Project License, version 1.3c or
+any later version. The most recent version of this license
+is available online at
 
           https://www.latex-project.org/lppl/.
 
@@ -145,31 +168,40 @@
 maintainer is the package author, Conrad Kosowsky. He can
 be reached at kosowsky.latex at gmail.com.
 
-THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS 
-OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES 
-OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
-IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE 
-COST FOR ANY REPAIR OR CORRECTION.
+PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 
-BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE 
-TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR 
-DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS 
-BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+`AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+CORRECTION.
 
-See also the "No Warranty" section of the LaTeX Project 
-Public License. In releasing the package author from 
-liability, you also release from liability any third 
-parties who distribute the software under the terms 
-of the LaTeX Project Public License. Derivative works 
-based on this package may come with their own license or
-terms of use, and the package author is not responsible 
-for any third-party software.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
 
-For more information, see the mathfont_code.dtx.
+For more information, see the LaTeX Project Public License.
+Derivative works based on this package may come with their
+own license or terms of use, and the package author is not
+responsible for any third-party software.
 
-Happy TeXing!
+For more information, see mathfont_code.dtx. Happy TeXing!
 
 \endpreamble
 \generate{
@@ -184,23 +216,28 @@
   \file{mathfont_example_roboto.tex}{\from{mathfont_code.dtx}{roboto}}
   \file{mathfont_example_typey.tex}{\from{mathfont_code.dtx}{typey}}}
 \catcode`\ =12\relax
-\message{^^J^^J
-******************************************^^J
-*                                        *^^J
-* To finish the installation, move the   *^^J
-* following file into a directory        *^^J
-* searchable by TeX once                 *^^J
-* mathfont_code.dtx finishes compiling:  *^^J
-*                                        *^^J
-*              mathfont.sty              *^^J
-*                                        *^^J
-******************************************^^J^^J^^J^^J^^J^^J}
+\message{^^J
+****************************************************^^J
+*                                                  *^^J
+* To finish the installation, move the following   *^^J
+* file into a directory searchable by TeX once     *^^J
+* mathfont_code.dtx finishes compiling:            *^^J
+*                                                  *^^J
+*                   mathfont.sty                   *^^J
+*                                                  *^^J
+****************************************************^^J^^J^^J^^J}
 \endgroup
+\ifx\LaTeX\undefined
+  \message{Plain TeX format used; quitting now.}
+  \message{To create mathfont_code.pdf, run^^J%
+  mathfont_code.dtx through LaTeX.^^J}
+  \expandafter\end
+\fi
 %</batchfile>
 %<*driver>
-\documentclass[12pt,twoside]{ltxdoc}
+\documentclass[12pt,doc2,letterpaper]{ltxdoc}
 \makeatletter
-\usepackage[margin=72.27pt]{geometry}
+\usepackage[margin=1in]{geometry}
 \usepackage[factor=700,stretch=14,shrink=14,step=1]{microtype}
 \usepackage{graphicx}
 \usepackage{tabularx}
@@ -210,6 +247,8 @@
 \c at topnumber\@ne
 \columnsep=20pt
 \MacroIndent=1.32em
+\AtBeginDocument{%
+  \baselineskip=\the\baselineskip plus 0.3pt minus 0.3pt\relax}
 \let\index at prologue\relax
 \EnableCrossrefs\CodelineIndex
 \begin{document}
@@ -232,7 +271,7 @@
   entries indicate pages in the document. Bold means a
   definition.
   
-  \medskip
+  %\medskip
   \input mathfont_code.ind
   
 \end{document}
@@ -242,12 +281,12 @@
 % \fi
 % 
 % 
-% \CheckSum{6965}
+% \CheckSum{6615}
 % \init at checksum
 % 
 % 
 % \makeatother\CharacterTable
-%   {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%   {Upper-case   \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
 %   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
 %   Digits        \0\1\2\3\4\5\6\7\8\9
 %   Exclamation     \!      Double quote   \"      Hash (number)   \#
@@ -282,7 +321,7 @@
 %   \ifM at agreeklower,\ifM at cyrillicupper,\ifM at cyrilliclower,%
 %   \ifM at hebrew,\ifM at digits,\ifM at operator,\ifM at symbols,%
 %   \ifM at extsymbols,\ifM at delimiters,\ifM at arrows,\ifM at bigops,%
-%   \ifM at extbigops,\ifM at bb,\ifM at cal,\ifM at frak,\ifM at bcal,\M at font@loadedtrue%
+%   \ifM at extbigops,\ifM at bb,\ifM at cal,\ifM at frak,\ifM at bcal,\M at font@loadedtrue,%
 %   \ifM at bfrak,\if at optionpresent,\if at suboptionpresent,%
 %   \mathgroup,\nolimits,\on at line,\PackageWarningNoLine,\RequirePackage,%
 %   \thr@@,\M at toks,\inputlineno,\mathchar at type,\DeclareMathAccent,%
@@ -293,13 +332,20 @@
 %   \M at Decl@reF at milytrue,\M at Decl@reF at milyfalse,\itdefault,\shapedefault,%
 %   \mddefault,\bfdefault,\E at sterEggDecl@redtrue,\detokenize,\@ifnextchar,%
 %   \@next,\@suboptionpresenttrue,\@suboptionpresentfalse,\@break at tfor,%
-%   \M at adjust@fonttrue,\M at adjust@fontfalse,\M at fromCharmFiletrue,\M at fromCharmFilefalse,%
-%   \M at arg@goodtrue,\M at arg@goodfalse,\M at Noluaotfloadtrue,\M at Noluaotfloadfalse,%
-%   \M at XeTeXLuaTeXtrue,\ifcsname,\ifdefined,\TU,\",\@@DeclareSymbolFont,%
-%   \@@set at mathaccent,\@@set at mathchar,\@@set at mathsymbol,\@expandedtwoargs,%
-%   \@spaces,\@tempswatrue,\@tempswafalse,\@iftempswa,\@tempbase,\@tempfeatures,
-%   \copy,\e at mathgroup@top,\endlinechar,\everyeof,\globaldefs,\m at th,\newbox,\newread,%
-%   \newmuskip,\number,\setmainfont,\zap at space,\setbox,\clap,\hss,\ht,\wd,\dp,\raise}
+%   \M at adjust@fonttrue,\M at adjust@fontfalse,\M at fromCharmFiletrue,%
+%   \M at fromCharmFilefalse,\M at arg@goodtrue,\M at arg@goodfalse,\M at Noluaotfloadtrue,%
+%   \M at Noluaotfloadfalse,\M at XeTeXLuaTeXtrue,\ifcsname,\ifdefined,\TU,\",%
+%   \@@DeclareSymbolFont,\@@set at mathaccent,\@@set at mathchar,\@@set at mathsymbol,%
+%   \@expandedtwoargs,\@spaces,\@tempswatrue,\@tempswafalse,\@iftempswa,%
+%   \@tempbase,\@tempfeatures,\copy,\e at mathgroup@top,\endlinechar,\everyeof,%
+%   \globaldefs,\m at th,\newbox,\newread,\newmuskip,\number,\setmainfont,%
+%   \zap at space,\setbox,\clap,\hss,\ht,\wd,\dp,\raise,\M at arrows@font,%
+%   \M at delimiters@font,\M at extbigops@font,\M at extsymbols@font,\M at symbols@font,%
+%   \M at greekupper@font,\M at greeklower@font,\M at agreekupper@font,%
+%   \M at agreeklower@font,\M at bigops@font,\M at upper@font,\M at lower@font,%
+%   \M at radical@font,\M at diacritics@font,\M at cyrillicupper@font,%
+%   \M at cyrilliclower@font,\M at hebrew@font,\Umathcode,\EasterEggUpdate,%
+%   \@firstofone,\if at arg@good,\M at f@ntn at me,\M at f@ntn at meb@se,\dimen@}
 % \DoNotIndex{\cyrA,\cyrBe,\cyrVe,\cyrGhe,\cyrDe,%
 %   \cyrIe,\cyrZhe,\cyrZe,\cyrI,\cyrKa,\cyrEl,%
 %   \cyrEm,\cyrEn,\cyrO,\cyrPe,\cyrEr,\cyrEs,%
@@ -312,56 +358,9 @@
 %   \cyrha,\cyrtse,\cyrche,\cyrsha,\cyrshcha,%
 %   \cyrhard,\cyryeru,\cyrsoft,\cyre,\cyryu,%
 %   \cyrya,\cyrvari}
-% \DoNotIndex{\M at bb@A,\M at bb@B,\M at bb@C,\M at bb@D,\M at bb@E,%
-%   \M at bb@F,\M at bb@G,\M at bb@H,\M at bb@I,\M at bb@J,\M at bb@K,%
-%   \M at bb@L,\M at bb@M,\M at bb@N,\M at bb@O,\M at bb@P,\M at bb@Q,%
-%   \M at bb@R,\M at bb@S,\M at bb@T,\M at bb@U,\M at bb@V,\M at bb@W,%
-%   \M at bb@X,\M at bb@Y,\M at bb@Z,\M at bb@a,\M at bb@b,\M at bb@c,%
-%   \M at bb@d,\M at bb@e,\M at bb@f,\M at bb@g,\M at bb@h,\M at bb@i,%
-%   \M at bb@j,\M at bb@k,\M at bb@l,\M at bb@m,\M at bb@n,\M at bb@o,%
-%   \M at bb@p,\M at bb@q,\M at bb@r,\M at bb@s,\M at bb@t,\M at bb@u,%
-%   \M at bb@v,\M at bb@w,\M at bb@x,\M at bb@y,\M at bb@z}
-% \DoNotIndex{\M at cal@A,\M at cal@B,\M at cal@C,\M at cal@D,\M at cal@E,%
-%   \M at cal@F,\M at cal@G,\M at cal@H,\M at cal@I,\M at cal@J,\M at cal@K,%
-%   \M at cal@L,\M at cal@M,\M at cal@N,\M at cal@O,\M at cal@P,\M at cal@Q,%
-%   \M at cal@R,\M at cal@S,\M at cal@T,\M at cal@U,\M at cal@V,\M at cal@W,%
-%   \M at cal@X,\M at cal@Y,\M at cal@Z,\M at cal@a,\M at cal@b,\M at cal@c,%
-%   \M at cal@d,\M at cal@e,\M at cal@f,\M at cal@g,\M at cal@h,\M at cal@i,%
-%   \M at cal@j,\M at cal@k,\M at cal@l,\M at cal@m,\M at cal@n,\M at cal@o,%
-%   \M at cal@p,\M at cal@q,\M at cal@r,\M at cal@s,\M at cal@t,\M at cal@u,%
-%   \M at cal@v,\M at cal@w,\M at cal@x,\M at cal@y,\M at cal@z}
-% \DoNotIndex{\M at frak@A,\M at frak@B,\M at frak@C,\M at frak@D,\M at frak@E,%
-%   \M at frak@F,\M at frak@G,\M at frak@H,\M at frak@I,\M at frak@J,\M at frak@K,%
-%   \M at frak@L,\M at frak@M,\M at frak@N,\M at frak@O,\M at frak@P,\M at frak@Q,%
-%   \M at frak@R,\M at frak@S,\M at frak@T,\M at frak@U,\M at frak@V,\M at frak@W,%
-%   \M at frak@X,\M at frak@Y,\M at frak@Z,\M at frak@a,\M at frak@b,\M at frak@c,%
-%   \M at frak@d,\M at frak@e,\M at frak@f,\M at frak@g,\M at frak@h,\M at frak@i,%
-%   \M at frak@j,\M at frak@k,\M at frak@l,\M at frak@m,\M at frak@n,\M at frak@o,%
-%   \M at frak@p,\M at frak@q,\M at frak@r,\M at frak@s,\M at frak@t,\M at frak@u,%
-%   \M at frak@v,\M at frak@w,\M at frak@x,\M at frak@y,\M at frak@z}
-% \DoNotIndex{\M at bcal@A,\M at bcal@B,\M at bcal@C,\M at bcal@D,\M at bcal@E,%
-%   \M at bcal@F\M at bcal@G,\M at bcal@H,\M at bcal@I,\M at bcal@J,\M at bcal@K,%
-%   \M at bcal@L\M at bcal@M,\M at bcal@N,\M at bcal@O,\M at bcal@P,\M at bcal@Q,%
-%   \M at bcal@R,\M at bcal@S,\M at bcal@T,\M at bcal@U,\M at bcal@V,\M at bcal@W,%
-%   \M at bcal@X,\M at bcal@Y,\M at bcal@Z,\M at bcal@a,\M at bcal@b,\M at bcal@c,%
-%   \M at bcal@d,\M at bcal@e,\M at bcal@f,\M at bcal@g,\M at bcal@h,\M at bcal@i,%
-%   \M at bcal@j,\M at bcal@k,\M at bcal@l,\M at bcal@m,\M at bcal@n,\M at bcal@o,%
-%   \M at bcal@p,\M at bcal@q,\M at bcal@r,\M at bcal@s,\M at bcal@t,\M at bcal@u,%
-%   \M at bcal@v,\M at bcal@w,\M at bcal@x,\M at bcal@y,\M at bcal@z}
-% \DoNotIndex{\M at bfrak@A,\M at bfrak@B,\M at bfrak@C,\M at bfrak@D,%
-%   \M at bfrak@E,\M at bfrak@F,\M at bfrak@G,\M at bfrak@H,\M at bfrak@I,%
-%   \M at bfrak@J,\M at bfrak@K,\M at bfrak@L,\M at bfrak@M,\M at bfrak@N,%
-%   \M at bfrak@O,\M at bfrak@P,\M at bfrak@Q,\M at bfrak@R,\M at bfrak@S,%
-%   \M at bfrak@T,\M at bfrak@U,\M at bfrak@V,\M at bfrak@W,\M at bfrak@X,%
-%   \M at bfrak@Y,\M at bfrak@Z,\M at bfrak@a,\M at bfrak@b,\M at bfrak@c,%
-%   \M at bfrak@d,\M at bfrak@e,\M at bfrak@f,\M at bfrak@g,\M at bfrak@h,%
-%   \M at bfrak@i,\M at bfrak@j,\M at bfrak@k,\M at bfrak@l,\M at bfrak@m,%
-%   \M at bfrak@n,\M at bfrak@o,\M at bfrak@p,\M at bfrak@q,\M at bfrak@r,%
-%   \M at bfrak@s,\M at bfrak@t,\M at bfrak@u,\M at bfrak@v,\M at bfrak@w,%
-%   \M at bfrak@x,\M at bfrak@y,\M at bfrak@z}
 % 
 %  
-% \DoNotIndexMain{\@@set at mathchar,\@@set at mathsymbol,%
+% \DoNotIndex{\@@set at mathchar,\@@set at mathsymbol,%
 %   \@@set at mathaccent,\set at mathchar,\set at mathsymbol,%
 %   \set at mathaccent,\Umathcode,\Umathchardef,%
 %   \colon,\mathellipsis,\angle,\sqsubset,\sqsupset,\bowtie,%
@@ -384,7 +383,7 @@
 %   \@frakshape,\@bcalshape,\@bfrakshape}
 % 
 % 
-% \noindent This file documents the code for the \textsf{mathfont} package. It is not a user guide! If you are looking for instructions on how to use \textsf{mathfont} in your document, see |mathfont_user_guide.pdf|, which is included with the \textsf{mathfont} installation and is available on \textsc{ctan}. See also the other |pdf| documentation files for \textsf{mathfont}. Section~1 of this document begins with the implementation basics, including package declaration and package options. Section~2 deals with errors and messaging, and section~3 provides package default settings. Section~4 contains the optional-argument parser for |\mathfont|, and section~5 contains the fontloader. Section 6 documents the code for the |\mathfont| command itself. In section~7, the package initializes the commands for letterlike symbols, and section~8 contains the code for local font changes. Section~9 contains miscellaneous material. Sections~10--12 contain the Lua code to modify font objects at loading, and section~13 lists the unicode hex values used in symbol declaration. Version history and code index appear at the end of the document.
+% \noindent This file documents the code for the \textsf{mathfont} package. It is not a user guide! If you are looking for instructions on how to use \textsf{mathfont} in your document, see |mathfont_user_guide.pdf|, which is included with the \textsf{mathfont} installation and is available on \textsc{ctan}. See also the other |pdf| documentation files for \textsf{mathfont}. Section~1 of this document begins with the implementation basics, including package declaration and package options. Section~2 deals with errors and messaging, and section~3 provides package default settings. Section~4 contains fontloader, and section~5 contains the optional-argument parser for |\mathfont|. Section 6 documents the code for the |\mathfont| command itself. Section~7 contains the code for local font changes. Section~8 contains miscellaneous material. Sections~9--11 contain the Lua code to modify font objects at loading, and section~12 lists the unicode hex values used in symbol declaration. Version history and code index appear at the end of the document.
 % 
 % \section{Implementation Basics}
 % 
@@ -391,7 +390,7 @@
 % First and foremost, the package needs to declare itself.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mathfont}[2021/12/28 v. 2.0 Package mathfont]
+\ProvidesPackage{mathfont}[2022/12/04 v. 2.2 Package mathfont]
 %    \end{macrocode}
 % We specify conditionals that we will use later in handling options and setup.
 %    \begin{macrocode}
@@ -401,7 +400,7 @@
 \newif\ifM at font@loaded     % load mathfont with font specified?
 \newif\ifE at sterEggDecl@red % already did easter egg?
 %    \end{macrocode}
-% We disable the eighteen user-level commands. If \textsf{mathfont} runs normally, it will overwrite these ``bad'' definitions later, but if it throws one of its two fatal errors, it will |\endinput| while the user-level commands are error messages. That way the commands don't do anything in the user's document, and the user gets information on why not. The bad definitions gobble their original arguments to avoid a ``missing |\begin{document}|'' error.\indexpage{invalid command error}
+% We disable the twenty user-level commands. If \textsf{mathfont} runs normally, it will overwrite these ``bad'' definitions later, but if it throws one of its two fatal errors, it will |\endinput| while the user-level commands are error messages. That way the commands don't do anything in the user's document, and the user gets information on why not. The bad definitions gobble their original arguments to avoid a ``missing |\begin{document}|'' error.\indexpage{invalid command}
 %    \begin{macrocode}
 \long\def\@gobbletwo at brackets[#1]#2{}
 \def\M at NoMathfontError#1{\PackageError{mathfont}
@@ -410,25 +409,33 @@
   {Your command was ignored. I couldn't\MessageBreak
   load mathfont, so I never defined this\MessageBreak
   control sequence.}}
-\def\mathfont{\M at NoMathfontError\mathfont
+\protected\def\mathfont{\M at NoMathfontError\mathfont
   \@ifnextchar[\@gobbletwo at brackets\@gobble}
-\def\mathconstantsfont{\M at NoMathfontError\mathconstantsfont\@gobble}
-\def\setfont{\M at NoMathfontError\setfont\@gobble}
-\def\newmathrm{\M at NoMathfontError\newmathrm\@gobbletwo}
-\def\newmathit{\M at NoMathfontError\newmathit\@gobbletwo}
-\def\newmathbf{\M at NoMathfontError\newmathbf\@gobbletwo}
-\def\newmathbfit{\M at NoMathfontError\newmathbf\@gobbletwo}
-\def\newmathsc{\M at NoMathfontError\newmathsc\@gobbletwo}
-\def\newmathscit{\M at NoMathfontError\newmathscit\@gobbletwo}
-\def\newmathbfsc{\M at NoMathfontError\newmathbfsc\@gobbletwo}
-\def\newmathbfscit{\M at NoMathfontError\newmathbfscit\@gobbletwo}
-\def\newmathfontcommand{\M at NoMathfontError\newmathfontcommand\@gobblefour}
-\def\RuleThicknessFactor{\M at NoMathfontError\RuleThicknessFactor\@gobble}
-\def\IntegralItalicFactor{\M at NoMathfontError\IntegralItalicFactor\@gobble}
-\def\SurdVerticalFactor{\M at NoMathfontError\SurdVerticalFactor\@gobble}
-\def\SurdHorizontalFactor{\M at NoMathfontError\SurdHorizontalFactor\@gobble}
-\def\CharmLine{\M at NoMathfontError\CharmLine\@gobble}
-\def\CharmFile{\M at NoMathfontError\CharmFile\@gobble}
+\protected\def\setfont{\M at NoMathfontError\setfont\@gobble}
+\protected\def\mathconstantsfont{\M at NoMathfontError\mathconstantsfont
+  \@ifnextchar[\@gobbletwo at brackets\@gobble}
+\protected\def\newmathrm{\M at NoMathfontError\newmathrm\@gobbletwo}
+\protected\def\newmathit{\M at NoMathfontError\newmathit\@gobbletwo}
+\protected\def\newmathbf{\M at NoMathfontError\newmathbf\@gobbletwo}
+\protected\def\newmathbfit{\M at NoMathfontError\newmathbf\@gobbletwo}
+\protected\def\newmathbold{\M at NoMathfontError\newmathbold\@gobbletwo}
+\protected\def\newmathboldit{\M at NoMathfontError\newmathbold\@gobbletwo}
+\protected\def\newmathsc{\M at NoMathfontError\newmathsc\@gobbletwo}
+\protected\def\newmathscit{\M at NoMathfontError\newmathscit\@gobbletwo}
+\protected\def\newmathbfsc{\M at NoMathfontError\newmathbfsc\@gobbletwo}
+\protected\def\newmathbfscit{\M at NoMathfontError\newmathbfscit\@gobbletwo}
+\protected\def\newmathfontcommand{%
+  \M at NoMathfontError\newmathfontcommand\@gobblefour}
+\protected\def\RuleThicknessFactor{%
+  \M at NoMathfontError\RuleThicknessFactor\@gobble}
+\protected\def\IntegralItalicFactor{%
+  \M at NoMathfontError\IntegralItalicFactor\@gobble}
+\protected\def\SurdVerticalFactor{%
+  \M at NoMathfontError\SurdVerticalFactor\@gobble}
+\protected\def\SurdHorizontalFactor{%
+  \M at NoMathfontError\SurdHorizontalFactor\@gobble}
+\protected\def\CharmLine{\M at NoMathfontError\CharmLine\@gobble}
+\protected\def\CharmFile{\M at NoMathfontError\CharmFile\@gobble}
 %    \end{macrocode}
 % Check that the engine is \XeTeX\ or Lua\TeX. If yes, set |\ifM at XeTeXLuaTeX| to true. (Otherwise the conditional will be false by default.)
 %    \begin{macrocode}
@@ -439,7 +446,7 @@
   \M at XeTeXLuaTeXtrue
 \fi
 %    \end{macrocode}
-% The package can raise two fatal errors: one if the engine is not \XeTeX\ or Lua\TeX (and cannot load OpenType fonts) and one if \TeX\ cannot find the \textsf{luaotfload} package. In this case, the package will stop loading, so we want a particularly conspicuous error message.
+% The package can raise two fatal errors: one if the engine is not \XeTeX\ or Lua\TeX\ (and cannot load OpenType fonts) and one if \TeX\ cannot find the \textsf{luaotfload} package. In this case, the package will stop loading, so we want a particularly conspicuous error message.
 % 
 % The error message itself is organized as follows. For each message, we check the appropriate conditional to determine if we need to raise the error. If yes, we change |+| to active and define it to be equal to a space character. We use |+| to print multiple spaces inside the error message, and we put the catcode change inside a group to keep it local.\indexpage{catcode changes} We define a |\GenericError| inside a macro and then call the macro for a cleaner error message. The |\@gobbletwo| eats the extra period and return that \LaTeX\ adds to the error message. Notice that we |\endgroup| immediately after issuing the error\textemdash this is because we need |\M at NoFontspecError| to both tokenize its definition and then evaluate while |+| has catcode 13. Otherwise, \TeX\ will issue an |\inaccessible| error. However, we want |\AtBeginDocument| and |\endinput| outside the group. The |\expandafter| means that we expand the final |\fi| before |\endinput|, which balances the original conditional.\indexpage{unable to load}\indexpage{missing xetex or luatex=missing \XeTeX\ or Lua\TeX}
 %    \begin{macrocode}
@@ -471,7 +478,7 @@
       with one of those two engines.^^J}}
     \M at XeTeXLuaTeXError
   \endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line.}}
+  \AtEndOfPackage{\typeout{:: mathfont :: Failed to load\on at line.}}
   \expandafter\endinput % we should \endinput with a balanced conditional
 \fi
 %    \end{macrocode}
@@ -489,7 +496,7 @@
     work with XeTeX}
 \fi
 %    \end{macrocode}
-% If the engine is Lua\TeX, we absolutely must have \textsf{luaotfload} because Lua\TeX\ needs this package to load OpenType fonts. Before anything else, \TeX\ should check whether it can find |luaotfload.sty| and stop reading in \textsf{mathfont} if it cannot. Same command structure as before. Newer \LaTeX\ installations try to load \textsf{luaotfload} as part of the format, but it never hurts to double check.\indexpage{could not load}\indexpage{cannot not find the file luaotfloadsty=cannot find the file \texttt{luaotfload}}
+% If the engine is Lua\TeX, we absolutely must have \textsf{luaotfload} because Lua\TeX\ needs this package to load OpenType fonts. Before anything else, \TeX\ should check whether it can find |luaotfload.sty| and stop reading in \textsf{mathfont} if it cannot. Same command structure as before. Newer \LaTeX\ installations try to load \textsf{luaotfload} as part of the format, but it never hurts to double check.\indexpage{unable to load}\indexpage{cannot not find the file luaotfloadsty=cannot find the file \texttt{luaotfload}}
 %    \begin{macrocode}
 \ifM at Noluaotfload % false by default; true if LuaTeX AND no luaotfload.sty
   \begingroup
@@ -523,11 +530,11 @@
       XeLaTeX.^^J}}
     \M at NoluaotfloadError
   \endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line.}}
+  \AtEndOfPackage{\typeout{:: mathfont :: Failed to load\on at line.}}
   \expandafter\endinput % we should \endinput with a balanced conditional
 \fi
 %    \end{macrocode}
-% Some package options are now deprecated, specifically |packages|, |operators|, and |no-operators|. In the case of these options, the command |\M at Optiondeprecated| issues an error and tells the user the appropriate alternative.\indexpage{deprecated} We check for \textsf{atveryend} to use with the easter egg.
+% Some package options are now deprecated, specifically |packages|, |operators|, and |no-|\penalty0|operators|. In the case of these options, the command |\M at Optiondeprecated| issues an error and tells the user the appropriate alternative.\indexpage{deprecated} We check for \textsf{atveryend} to use with the easter egg.
 %    \begin{macrocode}
 \def\M at Optiondeprecated#1#2{\PackageError{mathfont}
   {Option "#1" deprecated}
@@ -535,9 +542,6 @@
   use #2\MessageBreak
   instead. For more information,\MessageBreak
   see the mathfont documentation.}}
-\IfFileExists{atveryend.sty}
-  {\RequirePackage{atveryend}\let\E at sterEggHook\AtVeryVeryEnd}
-  {\let\E at sterEggHook\AtEndDocument}
 %    \end{macrocode}
 % Now we code the package options. The deprecated options now cause an error.
 %    \begin{macrocode}
@@ -557,25 +561,36 @@
   \ifE at sterEggDecl@red\else
     \E at sterEggDecl@redtrue
     \def\EasterEggUpdate{\show\E at sterEggUpd@te}
-    \def\E at sterEggUpd@te{Okay, opening your Easter egg}
+    \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Okay, opening your Easter egg.^^J^^J}
       \EasterEggUpdate
-    \def\E at sterEggUpd@te{..}
+    \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Uh oh. It looks like^^J%
+        your Easter egg flew^^J%
+        out the window. I don't^^J%
+        suppose you know the^^J%
+        best kind of bait to^^J%
+        lure an egg?^^J^^J}
       \EasterEggUpdate
+    \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Still wrangling. Try back later.^^J^^J}
+    \AtBeginDocument{\bgroup
+      \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J:%
+        If we have zero eggs^^J%
+        and zero bunnies, how^^J%
+        many gnats does it take^^J%
+        to change a lightbulb??^^J^^J}
       \EasterEggUpdate
-    \typeout{^^JHm, I think it flew out the^^J%
-      window. Check back here when^^J%
-      everything's done compiling^^J}
-    \def\E at sterEggUpd@te{Uh oh}
-      \EasterEggUpdate
-    \def\E at sterEggUpd@te{Still wrangling. Try back later}
-    \AtBeginDocument\EasterEggUpdate
-    \E at sterEggHook{%
-      \typeout{^^JHappy, happy day! Happy,^^J%
-      happy day! Clap your hands,^^J%
-      and be glad your hovercraft^^J%
-      isn't full of eels!^^J}
-      \def\E at sterEggUpd@te{Got it :) }
-        \EasterEggUpdate}
+      \egroup}
+    \AtEndDocument{%
+      \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Happy, happy day! Happy,^^J%
+        happy day! Clap your hands,^^J%
+        and be glad your hovercraft^^J%
+        isn't full of eels!^^J^^J}
+        \EasterEggUpdate
+      \let\E at sterEggUpd@te\relax
+      \let\EasterEggUpdate\relax}
   \fi}% my easter egg :)
 %    \end{macrocode}
 % The three real package options. The options |adjust| and |no-adjust| overwrite \textsf{mathfont}'s default decision about whether to apply Lua-based font adjustments to all future fonts loaded.
@@ -583,7 +598,7 @@
 \DeclareOption{adjust}{\M at adjust@fonttrue}
 \DeclareOption{no-adjust}{\M at adjust@fontfalse}
 %    \end{macrocode}
-% Interpret an unknown option as a font name and save it for loading. In this case, the package sets |\ifM at font@loaded| to true and stores the font name in |\M at font@load|.\?\ifM at font@loaded
+% Interpret an unknown option as a font name and save it for loading. In this case, the package sets |\ifM at font@loaded| to true and stores the font name in |\M at font@load|.
 %    \begin{macrocode}
 \DeclareOption*{\M at font@loadedtrue\edef\M at font@load{\CurrentOption}}
 \ProcessOptions*
@@ -620,31 +635,30 @@
 % 
 % \section{Errors and Messaging}
 % 
-% Some error and informational messages. Table~1 lists all macros defined in this section along with a brief description of their use. We begin with general informational messages.\indexpage{log file=\texttt{log} file}\indexpage{Package mathfont Info}\indexpage{I already set the font}
+% Some error and informational messages. Table~1 lists all macros defined in this section along with a brief description of their use. We begin with general informational messages.\indexpage{Package mathfont Info}
 % 
 % \begin{figure}[b]
 % \def\vrb#1{\texttt{\string#1}}
-% \centerline{\bfseries Table 1: Different Warnings and Errors and Their Uses\strut}
+% \centerline{\bfseries Table 1: Various Messages and Errors and Their Uses\strut}
 % \begin{tabularx}\textwidth{lX}
 % \toprule
 % Command & Use\\\midrule
-% \vrb\M at CommandInitializeInfo & Initialize alphanumeric font-change commands\\
-% \vrb\M at FontChangeInfo & NFSS font information\\
-% \vrb\M at NewFontCommandInfo & Initialize local font-change commands\\\midrule
-% \vrb\M at CharacterArgWarning & Bad characters for alphanumeric font changes\\
+% \vrb\M at FontChangeInfo & Use a symbol font for some characters\\
+% \vrb\M at NewFontCommandInfo & Declare new alphanumeric font-change command\\
+% \vrb\M at SymbolFontInfo & Declare new symbol font\\\midrule
 % \vrb\M at CharsSetWarning & Warning when calling \vrb\mathfont\ multiple times for same keyword\\
-% \vrb\M at CSArgWarning & Bad characters for alphanumeric font changes\\
-% \vrb\M at DeprecatedWarning & Warning for certain deprecated macros\\
-% \vrb\M at DoubleArgWarning & Bad characters for alphanumeric font changes\\
-% \vrb\M at NesgedArgWarning & Bad characters for alphanumeric font changes\\\midrule
-% \vrb\M at DoubleArgError & Bad argument provided to be font-change macro\\
-% \vrb\M at HModeError & Alphanumeric font-change command used outside math mode\\
-% \vrb\M at InternalsRestoredError & Called by \vrb\mathfont\ after restoring kernel\\
+% \vrb\M at InternalsRestoredError & User called \vrb\mathfont\ after restoring kernel\\
 % \vrb\M at InvalidOptionError & Bad option for \vrb\mathfont\\
 % \vrb\M at InvalidSupoptionError & Bad suboption for \vrb\mathfont\\
+% \vrb\M at MissingOptionError & Missing an option for \vrb\mathfont\\
+% \vrb\M at MissingSuboptionError & Missing suboption for \vrb\mathfont\\\midrule
+% \vrb\M at BadMathConstantsFontError & Argument not previously fed to \vrb\mathfont\\
+% \vrb\M at BadMathConstantsFontTypeError & Argument not ``upright'' or ``italic''\\
+% \vrb\M at LuaTeXOnlyWarning & User called \vrb\mathcontsantsfont\ in \XeTeX\\\midrule
+% \vrb\M at DeprecatedWarning & Warning for certain deprecated macros\\
+% \vrb\M at DoubleArgError & Gave multiple tokens to be the font-change macro\\
+% \vrb\M at HModeError & Font-change command used outside math mode\\
 % \vrb\M at MissingControlSequenceError & No macro provided to be font-change command\\
-% \vrb\M at MissingOptionError & Missing an option for \vrb\mathfont\\
-% \vrb\M at MissingSuboptionError & Missing suboption for \vrb\mathfont\\
 % \vrb\M at NoFontspecFamilyError & Improper option \texttt{fontspec} for \vrb\mathfont\\
 % \vrb\M at NoFontspecError & Option \texttt{fontspec} for \vrb\mathfont\ declared without having loaded \textsf{fontspec}\\\midrule
 % \vrb\M at BadIntegerError & Font metric adjustment value was not an integer\\
@@ -656,17 +670,16 @@
 % \end{figure}
 % 
 %    \begin{macrocode}
-\def\M at FontChangeInfo#1#2#3#4#5{\wlog{Package mathfont Info:
-  Setting #1 chars to #2!^^J%
-  NFSS Family Name:  #3^^J%
-  Series/Shape Info: #4^^J%
-  Symbol Font Name:  #5^^J}}
-\def\M at CommandInitializeInfo#1{\wlog{Package mathfont Info: Initializing
-  \noexpand#1 font-change command on line \the\inputlineno.}}
-\def\M at NewFontCommandInfo#1#2#3#4#5{\wlog{Package mathfont Info: Creating
-  math-alphabet command^^J%
-  \string#1 using #2 on line \the\inputlineno!^^J%
-  NFSS Family Name: #3^^J%
+\def\M at SymbolFontInfo#1#2#3#4{\wlog{^^JPackage mathfont Info:
+  Declaring new symbol font from #1!^^J%
+  NFSS Family Name: \space#2^^J%
+  Series/Shape Info: #3^^J%
+  Symbol Font Name:  \space#4^^J}}
+\def\M at FontChangeInfo#1#2{\wlog{Package mathfont Info:
+  Setting #1 chars to #2!}}
+\def\M at NewFontCommandInfo#1#2#3#4#5{\wlog{^^JPackage mathfont Info:
+  Creating \string#1 using #2!^^J%
+  NFSS Family Name: \space#3^^J%
   Series/Shape Info: #4/#5^^J}}
 \def\M at CharsSetWarning#1{\PackageWarning{mathfont}
   {I already set the font for\MessageBreak
@@ -674,30 +687,9 @@
   this option for \string\mathfont\space
   on line \the\inputlineno\@gobble}}
 %    \end{macrocode}
+% \indexpage{I already set the font}
 % Warnings for the |\mathbb|, etc.\ commands.
-% \indexpage{Im ignoring the multiple characters=I'm ignoring the multiple characters}
-% \indexpage{Im ingoring the nested argument=I'm ignoring the nested argument}
-% \indexpage{Im ignoring the unexpandable=I'm ignoring the unexpandable}
-%    \begin{macrocode} 
-\def\M at DoubleArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the multiple characters\MessageBreak
-  "#2" that are grouped together in\MessageBreak
-  the argument of your \string#1\space command\MessageBreak}}
-\def\M at NestedArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the nested argument\MessageBreak
-  "#2" from your \string#1\MessageBreak
-  command}}
-\def\M at CSArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the unexpandable control\MessageBreak
-  sequence \string#2\space that appears in the\MessageBreak
-  argument of your \string#1\space command\MessageBreak}}
-\def\M at CharacterArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the "#2" in the\MessageBreak
-  argument of your \string#1\MessageBreak
-  command because it isn't a\MessageBreak
-  letter or digit}}
-%    \end{macrocode}
-% Warning for deprecated commands.\indexpage{Your command is deprecated}
+% Warning for deprecated commands.\indexpage{deprecated}
 %    \begin{macrocode}
 \def\M at DeprecatedWarning#1#2{\PackageWarning{mathfont}
   {Your \string#1\space command on\MessageBreak
@@ -705,11 +697,12 @@
   replaced it with \string#2\@gobble}}
 %    \end{macrocode}
 % Error messages associated with |\mathfont|.
-% \indexpage{Invalid option for mathfont=Invalid Option for \texttt{\char`\\mathfont}}
-% \indexpage{Invalid suboption for mathfont=Invalid Suboption for \texttt{\char`\\mathfont}}
-% \indexpage{Missing option for mathfont=Missing Option for \texttt{\char`\\mathfont}}
-% \indexpage{Missing suboption for mathfont=Missing Suboption for \texttt{\char`\\mathfont}}
-% \indexpage{No previous font}\indexpage{Missing package fontspec=Missing package \texttt{fontspec}}
+% \indexpage{invalid option for mathfont=Invalid Option for \texttt{\char`\\mathfont}}
+% \indexpage{invalid suboption for mathfont=Invalid Suboption for \texttt{\char`\\mathfont}}
+% \indexpage{missing option for mathfont=Missing Option for \texttt{\char`\\mathfont}}
+% \indexpage{missing suboption for mathfont=Missing Suboption for \texttt{\char`\\mathfont}}
+% \indexpage{Internal commands restored}
+% \indexpage{no previous font}\indexpage{missing package fontspec=Missing package \texttt{fontspec}}
 %    \begin{macrocode}
 \def\M at InvalidOptionError#1{\PackageError{mathfont}
   {Invalid^^Joption "#1" for \string\mathfont\on at line}
@@ -774,6 +767,28 @@
   to get messed up. To resolve this error, load\MessageBreak
   fontspec before calling \string\mathfont.^^J}}
 %    \end{macrocode}
+% Error messages for |\mathconstantsfont|.
+% \indexpage{Invalid font specifier}
+% \indexpage{your mathconstants on line=Your \texttt{\char`\\mathconstants} on line}
+%    \begin{macrocode}
+\def\M at BadMathConstantsFontError#1{\PackageError{mathfont}
+  {Invalid\MessageBreak font specifier for
+  \string\mathconstantsfont:\MessageBreak"#1"}
+  {Your command was ignored--I can't parse your argument.\MessageBreak
+  Please make sure to use text that you have previously\MessageBreak
+  fed to \string\mathfont\space for the argument of 
+  \string\mathconstantsfont.^^J}}
+\def\M at BadMathConstantsFontTypeError#1{\PackageError{mathfont}
+  {Invalid\MessageBreak font specifier for
+  \string\mathconstantsfont:\MessageBreak"#1"}
+  {The optional argument of \string\mathconstantsfont\MessageBreak
+  should be "upright" or "italic." Right now,\MessageBreak
+  it's "#1."^^J}}
+\def\M at LuaTeXOnlyWarning{\PackageWarning{mathfont}
+    {Your \string\mathconstantsfont\space
+    on line \the\inputlineno\space is\MessageBreak
+    for LuaTeX only, and I'm ignoring it\@gobble}}
+%    \end{macrocode}
 % Error messages for the |\newmathrm|, etc.\ commands.
 % \indexpage{Missing control sequence}
 % \indexpage{Multiple characters in argument}
@@ -795,13 +810,12 @@
   a single character instead.^^J}}
 \def\M at HModeError#1{\PackageError{mathfont}
   {Missing \string$ inserted\MessageBreak
-  inserted\on at line. Command\MessageBreak
-  \string#1\space is for math mode only\MessageBreak}
+  on input line line \the\inputlineno}
   {I generated an error because 
   you used \string#1\space outside of\MessageBreak
-  math mode. I've inserted a \string$
-  just before your \string#1, so\MessageBreak
-  we should be all good now.^^J}}
+  math mode. I inserted a \string$
+  before your \string#1, so we\MessageBreak
+  should be all good now.^^J}}
 %    \end{macrocode}
 % We need error messages related to Lua-based font adjustments.
 % \indexpage{Forbidden charm info}
@@ -847,11 +861,17 @@
 % We do not want \textsf{fontspec} making changes to mathematics. If the user has loaded the package, we set |\g__fontspec_math_bool| to false. Otherwise, we pass the |no-math| option to the package in case the user loads it later.
 %    \begin{macrocode}
 \@ifpackageloaded{fontspec}
-  {\csname bool_set_false:N\expandafter\endcsname
+  {\wlog{Package mathfont Info: Package fontspec detected.}
+    \wlog{Package mathfont Info: Setting \string\g__fontspec_math_bool
+      to false.}
+    \csname bool_set_false:N\expandafter\endcsname
     \csname g__fontspec_math_bool\endcsname}
-  {\PassOptionsToPackage{no-math}{fontspec}}
+  {\wlog{Package mathfont Info: Package fontspec not detected.}
+    \wlog{Package mathfont Info: Will pass no-math option to fontspec
+      if it gets loaded.}
+    \PassOptionsToPackage{no-math}{fontspec}}
 %    \end{macrocode}
-% We save four macros from the \LaTeX\ kernel so we can change their definitions. To adapt the symbol declaration macros for use with unicode fonts, we reverse the conversion to hexadecimal in |\count0| and change the |\math|\dots\ primitive to |\Umath|. Unlike the traditional primitives, the |\Umath| primitives accept decimal input with a |+| sign.\indexpage{LaTeX kernel=\LaTeX\ kernel}
+% We save four macros from the \LaTeX\ kernel so we can change their definitions. To adapt the symbol declaration macros for use with unicode fonts, we reverse the conversion to hexadecimal in |\count0| and change the |\math| primitive to |\Umath|. Whereas the traditional primitives accept hexadecimal input, |\Umath| primitives accept decimal input with a |+| sign.\indexpage{LaTeX kernel=\LaTeX\ kernel}
 %    \begin{macrocode}
 \let\@@set at mathchar\set at mathchar
 \let\@@set at mathsymbol\set at mathsymbol
@@ -889,19 +909,26 @@
   \protected\xdef#2{%
     \Umathaccent\mathchar at type#3+\number#1+\the\count\z@\relax}}
 %    \end{macrocode}
-% We increase the upper bound on the number of symbol fonts to be 256. Lua\TeX\ and \XeTeX\ allow up to 256 math families, but the \LaTeX\ kernel keeps the old upper bound of 16 symbol fonts under these two engines. We patch |\DeclareSymbolFont| to change the |\count18<15| to |\count18<\e at mathgroup@top|, where |\e at mathgroup@top| is the number of math families and is 256 in \XeTeX\ and Lua\TeX. Because macro patching is complicated, the next few lines may seem esoteric. Our approach is to get a sanitized definition with |\meaning| and |\strip at prefix|, implement the patch by expanding |\M at p@tch at decl@re|, and retokenize the whole thing. A simpler approach, such as calling |\M at p@tch at decl@re| directly on the expansion of |\DeclareSymbolFont|, won't work because of the way \TeX\ stores and expands parameter symbols inside macros.
+% We increase the upper bound on the number of symbol fonts to be 256. Lua\TeX\ and \XeTeX\ allow up to 256 math families, but the \LaTeX\ kernel keeps the old upper bound of 16 symbol fonts under these two engines. We patch |\DeclareSymbolFont| to change the |\count18<15| to |\count18<\e at mathgroup@top|, where |\e at mathgroup@top| is the number of math families and is 256 in \XeTeX\ and Lua\TeX. Because macro patching is complicated, the next few lines may seem somewhat esoteric. Our approach is to get a sanitized definition with |\meaning| and |\strip at prefix|, implement the patch by expanding |\M at p@tch at decl@re|, and retokenize the whole thing. A simpler approach, such as calling |\M at p@tch at decl@re| directly on the expansion of |\DeclareSymbolFont|, won't work because of the way \TeX\ stores and expands parameter symbols inside macros.
+% 
+% As of November 2022, the \LaTeX\ kernel has redefined |\DeclareSymbolFont at m@dropped| to have the same definition as the old |\DeclareSymbolFont|, and now |\DeclareSymbolFont| is a wrapper around this macro. This was done for error checking purposes to remove extra |m|'s from certain \textsc{nfss} family names. This means that if |\DeclareSymbolFont at m@dropped| is defined, we should patch that macro, and otherwise, we should patch |\DeclareSymbolFont|.
 %    \begin{macrocode}
+\ifx\DeclareSymbolFont at m@dropped\@undefined
+  \edef\@tempa{\expandafter\strip at prefix\meaning\DeclareSymbolFont}
+  \def\@tempb{\def\DeclareSymbolFont##1##2##3##4##5}
+\else
+  \edef\@tempa{\expandafter\strip at prefix\meaning\DeclareSymbolFont at m@dropped}
+  \def\@tempb{\def\DeclareSymbolFont at m@dropped##1##2##3##4##5}
+\fi
 \def\M at p@tch at decl@re#1<15#2\@nil{#1<\e at mathgroup@top#2}
-\edef\M at DecSymDef{\expandafter\expandafter\expandafter
-  \M at p@tch at decl@re\expandafter\strip at prefix\meaning\DeclareSymbolFont\@nil}
+\edef\M at DecSymDef{\expandafter\M at p@tch at decl@re\@tempa\@nil}
 %    \end{macrocode}
 % Now |\M at DecSymDef| contains the patched text of our new |\DeclareSymbolFont|, all with catcode 12. In order to make it useable, we have to retokenize it. We use |\scantextokens| in Lua\TeX\ and a safe version of |\scantokens| in \XeTeX. We store the |\def\DeclareSymbolFont| and parameter declaration in a separate macro |\@tempa| to make it easy to expand around them when we redefine |\DeclareSymbolFont|.
 %    \begin{macrocode}
-\def\@tempa{\def\DeclareSymbolFont##1##2##3##4##5}
 \ifdefined\directlua
-  \expandafter\@tempa\expandafter{\scantextokens\expandafter{\M at DecSymDef}}
+  \expandafter\@tempb\expandafter{\scantextokens\expandafter{\M at DecSymDef}}
 %    \end{macrocode}
-% Unfortunately, while |\scantextokens| is straightforward, |\scantokens| is a menace. The problem is that when it expands, the primitive inserts an end-of-file token (because |\scantokens| mimics writing to a file and |\input|ing what it just wrote) after the retokenized code, and this is why |\scantokens| often produces an error about prematurely ending a file. The easiest way to make the command useable is to put a |\noexpand| before the end-of-file token with |\everyeof|, and at the same time, this needs to happen inside an |\edef| so that \TeX\ handles the |\noexpand| as it is first seeing the end-of-file token. In order to prevent the |\edef| from also expanding our retokenized definition of |\DeclareSymbolFont|, we put the definition inside an |\unexpanded|.
+% Unfortunately, while |\scantextokens| is straightforward, |\scantokens| is a menace. The problem is that when it expands, the primitive inserts an end-of-file token (because |\scantokens| mimics writing to a file and |\input|ing what it just wrote) after the retokenized code, and this is why |\scantokens| can produce an end-of-file error. The easiest way to make the command useable is to put a |\noexpand| before the end-of-file token with |\everyeof|, and at the same time, this needs to happen inside an |\edef| so that \TeX\ handles the |\noexpand| as it is first seeing the end-of-file token. In order to prevent the |\edef| from also expanding our retokenized definition of |\DeclareSymbolFont|, we put the definition inside an |\unexpanded|.
 %    \begin{macrocode}
 \else
   \begingroup
@@ -913,15 +940,13 @@
   \edef\M at retokenize{\noexpand\scantokens{\noexpand\unexpanded{\M at DecSymDef}}}
   \edef\M at retokenize{\M at retokenize}
   \expandafter\endgroup
-    \expandafter\@tempa\expandafter{\M at retokenize}
+    \expandafter\@tempb\expandafter{\M at retokenize}
 \fi
-\@onlypreamble\@@DeclareSymbolFont
 %    \end{macrocode}
-% We need to keep track of the number of times we have loaded fonts, and the count |\M at count| fulfills this role. We use |\M at errcode| in the alphanumeric commands, and the other counts come up in Lua-based font adjustments. The |\M at toks| object will record a message that displays in the |log| file when the user calls |\mathfont|. The |\newread| is for Lua-based font adjustments.
+% We need to keep track of the number of times we have loaded fonts, and |\M at count| fulfills this role. The |\M at toks| object will record a message that displays in the |log| file when the user calls |\mathfont|. The |\newread| is for Lua-based font adjustments.
 %    \begin{macrocode}
 \newbox\surdbox
 \newcount\M at count
-\newcount\M at errcode
 \newcount\M at rule@thickness at factor
 \newcount\M at integral@italic at factor
 \newcount\M at surd@vertical at factor
@@ -936,7 +961,7 @@
 \M at surd@vertical at factor\@m
 \radicandoffset=3mu\relax
 %    \end{macrocode}
-% We create necessary booleans and the default math font shapes.
+% Necessary booleans and default math font shapes.
 %    \begin{macrocode}
 \newif\ifM at upper
 \newif\ifM at lower
@@ -966,6 +991,7 @@
 \newif\if at suboptionpresent
 \newif\ifM at arg@good
 \newif\ifM at Decl@reF at mily
+\newif\ifM at Decl@reF at milyB@se
 \newif\ifM at fromCharmFile
 %    \end{macrocode}
 % Default shapes.
@@ -996,9 +1022,14 @@
 \def\M at bcalshape{upright} % bold caligraphic
 \def\M at bfrakshape{upright} % bold fraktur
 %    \end{macrocode}
-% We use |\M at normalkeys| and |\M at letterlikekeys| for error checking, and |\M at defaultkeys| stores the character classes that |\mathfont| acts on by default.
+% The |\M at keys| list stores all the possible keyword options, and |\M at defaultkeys| stores the character classes that |\mathfont| acts on by default.
 % \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
 %    \begin{macrocode}
+\def\M at keys{upper,lower,diacritics,greekupper,%
+  greeklower,agreekupper,agreeklower,cyrillicupper,%
+  cyrilliclower,hebrew,digits,operator,delimiters,%
+  radical,bigops,extbigops,symbols,extsymbols,arrows,%
+  bb,cal,frak,bcal,bfrak}
 \def\M at defaultkeys{upper,lower,diacritics,greekupper,%
   greeklower,digits,operator,symbols}
 %    \end{macrocode}
@@ -1007,27 +1038,184 @@
 \ifM at adjust@font
   \edef\M at defaultkeys{\M at defaultkeys,delimiters,radical,bigops}
 \fi
-\def\M at normalkeys{upper,lower,diacritics,greekupper,%
-  greeklower,agreekupper,agreeklower,cyrillicupper,%
-  cyrilliclower,hebrew,digits,operator,delimiters,%
-  radical,bigops,extbigops,symbols,extsymbols,arrows}
-\def\M at letterlikekeys{bb,cal,frak,bcal,bfrak}
 %    \end{macrocode}
-% Default OpenType features to use for loading fonts. If using Lua\TeX, we need to add |mode=base| to the list of default features; otherwise \textsf{luaotfload} will load fonts with |node| mode, which prevents OpenType features for math mode.
+% Default OpenType features for loading fonts.
 %    \begin{macrocode}
-\def\M at default@otf at features{script=latin;language=DFLT;%
+\def\M at otf@features{script=latin;language=DFLT;%
   tlig=true;liga=true;smcp=false;lnum=true}
-\def\M at default@otf at features@sc{script=latin;language=DFLT;%
+\def\M at otf@features at sc{script=latin;language=DFLT;%
   tlig=true;liga=true;smcp=true;lnum=true}
-\ifdefined\directlua
-  \edef\M at default@otf at features{mode=base;\M at default@otf at features}
-  \edef\M at default@otf at features@sc{mode=base;\M at default@otf at features@sc}
-\fi
 %    \end{macrocode}
-% Using |base| mode limits access to certain OpenType features for the font as a whole, but it allows us to use OpenType features in math mode, which I think is a worthwhile trade. In future versions of \textsf{mathfont}, I may implement a dual fontloader that loads the same font twice in both |base| and |node| modes. Then we could use the |base| mode for math and the |node| mode for text.
 % 
+% \section{Fontloader}
 % 
+% We come to the fontloader. The main font-loading macro is |\M at newfont|, and it is basically a wrapper around code we would expect to see in a typical |fd| file. Advanced users: please do not call |\M at newfont| directly because it may change without warning. Instead call |\mathfont| with the |empty| keyword and extract the \textsc{nfss} family name from |\M at f@ntn at me| or |\M at f@ntn at meb@se|. Our general approach is to feed the mandatory argument of |\mathfont| to |\M at newfont|, check if we have reason to believe that the font corresponds to a entry already in the \textsc{nfss}, and declare the font family and font shapes as necessary. If \textsf{fontspec} is loaded, we pass the entire argument to \textsf{fontspec}. If not, \textsf{mathfont} handles the font declaration internally. When \textsf{mathfont} declares a font family in the \textsc{nfss}, it does so twice, once using the information provided (which typically results in a font in node mode) and once using the information provided with |mode=base| (which results in a font in base mode). The first declaration uses the entire mandatory argument of |\mathfont| with spaces removed as the family name, and the second declaration uses this name with |-base| tacked onto the end. However the font gets loaded, we store the \textsc{nfss} family names in |\M at f@ntn at me| and |\M at f@nt at n@me at base|.
 % 
+% 
+% We use |\M at split@colon| and |\M at strip@colon| for parsing the argument of |\mathfont|. If the user calls |\mathfont{|\meta{name}|:|\meta{features}|}|, we store the name in |\@tempbase| and the features in |\@tempfeatures|. If the user specifies a name only, then |\@tempfeatures| will be empty. Syntactically, we use |\M at strip@colon| to remove a final |:| the same way we removed a final |=| when we parsed the optional argument in the previous section.
+% \?\@tempfeatures\?\@tempbase
+%    \begin{macrocode}
+\def\M at split@colon#1:#2\@nil{%
+  \def\@tempbase{#1}
+  \def\@tempfeatures{#2}}
+\def\M at strip@colon#1:{#1}
+%    \end{macrocode}
+% The macro |\M at fill@nfss at shapes| accepts two arguments and does the actual work of ensuring that the \textsc{nfss} contains the appropriate series and shapes. The first argument should the name of a font family in the \textsc{nfss}, and the second should be a list of OpenType features. We check whether combinations of bold series and italic shape exist for that font in the \textsc{nfss}, and if not, we add them with |\DeclareFontShape|.
+%    \begin{macrocode}
+\def\M at fill@nfss at shapes#1#2{%
+%    \end{macrocode}
+% Upright shape.
+%    \begin{macrocode}
+  \ifcsname TU/#1/\mddefault/\shapedefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\shapedefault}
+      {<->"\@tempbase:\M at otf@features;#2"}{}
+  \fi
+%    \end{macrocode}
+% Italic shape.
+%    \begin{macrocode}
+  \ifcsname TU/#1/\mddefault/\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\itdefault}
+      {<->"\@tempbase/I:\M at otf@features;#2"}{}
+  \fi
+%    \end{macrocode}
+% Bold series with upright shape.
+%    \begin{macrocode}
+  \ifcsname TU/#1/\bfdefault/\shapedefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\shapedefault}
+      {<->"\@tempbase/B:\M at otf@features;#2"}{}
+  \fi
+%    \end{macrocode}
+% Bold series with italic shape.
+%    \begin{macrocode}
+  \ifcsname TU/#1/\bfdefault/\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\itdefault}
+      {<->"\@tempbase/BI:\M at otf@features;#2"}{}
+  \fi
+%    \end{macrocode}
+% Now do the same thing for the small caps variants. I make no promises that this will work. If a small caps font faces is separate from the main font file, \TeX\ won't be able to find it automatically. In that case, you will have to write your own |fd| file or |\DeclareFontShape| commands.
+%    \begin{macrocode}
+  \ifcsname TU/#1/\mddefault/\scdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault}
+      {<->"\@tempbase:\M at otf@features at sc;#2"}{}
+  \fi
+  \ifcsname TU/#1/\mddefault/\scdefault\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault\itdefault}
+      {<->"\@tempbase/I:\M at otf@features at sc;#2"}{}
+  \fi
+  \ifcsname TU/#1/\bfdefault/\scdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault}
+      {<->"\@tempbase/B:\M at otf@features at sc;#2"}{}
+  \fi
+  \ifcsname TU/#1/\bfdefault/\scdefault\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault\itdefault}
+      {<->"\@tempbase/BI:\M at otf@features at sc;#2"}{}
+  \fi}
+%    \end{macrocode}
+% The main font-loading macro. This macro takes a single argument, which should have the form \meta{font name}|:|\meta{optional features}, and \textsf{mathfont} handles the information in one of three ways if all goes well: interface with \textsf{fontspec}, possibly declare a few extra shapes for a font already in the \textsc{nfss}, or declare and load the whole font. At a minimum, \textsf{mathfont} ensures that we have access to medium upright, medium italic, bold upright, and bold italic fonts after calling |\M at newfont|. If \textsf{mathfont} decides to declare a font itself, it will also try to load small caps versions. We begin by splitting the argument into |\@tempbase| and |\@tempfeatures|.
+%    \begin{macrocode}
+\def\M at newfont#1{%
+  \edef\@tempa{#1}
+  \expandafter\M at split@colon\@tempa:\@nil
+  \def\@tempb{fontspec}
+%    \end{macrocode}
+% If the argument is ``|fontspec|,'' we want to use the last font loaded by \textsf{fontspec}, which is stored in |\l_fontspec_family_tl|. If this macro is not empty, we store its contents in |\M at f@ntn at me| and skip loading entirely because \textsf{fontspec} already took care of it. We issue an error if |\l_fontspec_family_tl| is empty or if the user has not loaded \textsf{fontspec}. If we use \textsf{fontspec} to laod the font, we don't get a separate font in base mode.
+%    \begin{macrocode}
+  \ifx\@tempa\@tempb
+    \@ifpackageloaded{fontspec}{%
+      \expandafter\ifx\csname l_fontspec_family_tl\endcsname\@empty
+        \M at NoFontspecFamilyError
+      \else
+        \expandafter
+          \let\expandafter\M at f@ntn at me\csname l_fontspec_family_tl\encsname
+        \def\@tempbase{\M at f@ntn at me\space(from fontspec)}
+        \let\M at f@ntn at meb@se\M at f@ntn at me % no separate font in base mode
+      \fi}{\M at NoFontspecError}
+%    \end{macrocode}
+% If the argument is something other than ``|fontspec|,'' we need to parse it. If the user loaded \textsf{fontspec}, we pass the entire argument to |\fontspec_set_family:Nnn| for loading and store the \textsc{nfss} family name in |\M at f@ntn at me|. For Lua\TeX, this is not recommended\textemdash\textsf{fontspec} is designed to work with text, not math, fonts and typically loads fonts in |node| mode, which makes their OpenType features unusable in math mode.
+%    \begin{macrocode}
+  \else
+    \@ifpackageloaded{fontspec}
+    {\csname fontspec_set_family:Nnn\endcsname\M at f@ntn at me{}{\@tempa}
+      % no separate font in base mode
+      \let\M at f@ntn at meb@se\M at f@ntn at me}
+%    \end{macrocode}
+% If the user has not loaded \textsf{fontspec}, we split the argument into a name and features using |\M at split@colon|. The name goes in |\@tempbase|, and the features go in |\@tempfeatures|. We store the OpenType features for loading in base mode inside |\@basefeatures|. If we are typesetting in Lua\TeX, |\@basefeatures| will be the same as |\@tempfeatures| except with |mode=base| at the end, and if we are using \XeTeX, it will be exactly the same.
+%    \begin{macrocode}
+    {\M at Decl@reF at milytrue
+      \M at Decl@reF at milyB@setrue
+      \ifx\@tempfeatures\@empty
+        \ifdefined\directlua
+          \edef\@basefeatures{mode=base}
+        \else
+          \let\@basefeatures\@tempfeatures
+        \fi
+      \else
+        \edef\@tempfeatures{\expandafter\M at strip@colon\@tempfeatures}
+        \ifdefined\directlua
+          \edef\@basefeatures{\@tempfeatures;mode=base}
+        \else
+          \let\@basefeatures\@tempfeatures
+        \fi
+      \fi
+%    \end{macrocode}
+% We remove the spaces from |#1| and store it in |\@tempa| and from the human-readable font name contained in |#1| and store it in |\@tempb|. We check whether either already exists as a family name in the \textsc{nfss}, and if we do, we call |\M at fill@nfss at shapes| to ensure that we have declared all the shapes. In this case, we set |\ifM at Decl@reF at mily| to false and break out of the |\@tfor| loop.
+%    \begin{macrocode}
+      \edef at nospace\@tempa{\@tempa}
+      \edef at nospace\@tempb{\@tempbase}
+      \M at Decl@reF at milytrue
+      \@tfor\@i:=\@tempa\@tempb\@tempbase\do{%
+        \ifcsname TU+\@i\endcsname
+          \expandafter\let\expandafter\M at f@ntn at me\@i
+          \M at Decl@reF at milyfalse
+          \M at fill@nfss at shapes\M at f@ntn at me\@tempfeatures
+          \@break at tfor
+        \fi}
+%    \end{macrocode}
+% If |\M at newfont| didn't find anything in the \textsc{nfss}, we need to load the font. The name for the font family will be |#1| with spaces removed, which we previously stored in |\@tempa|.
+% \indexpage{log file=\texttt{log} file}
+%    \begin{macrocode}
+      \ifM at Decl@reF at mily
+        \let\M at f@ntn at me\@tempa
+        \wlog{Package mathfont Info: Adding \M at f@ntn at me\space to the nfss!}
+        \DeclareFontFamily{TU}{\M at f@ntn at me}{}
+%    \end{macrocode}
+% Now load the four most common font faces with |\M at fill@nfss at shapes|.
+%    \begin{macrocode}
+        \M at fill@nfss at shapes\M at f@ntn at me\@tempfeatures
+      \fi
+%    \end{macrocode}
+% At this point, there is an entry for the font in the \textsc{nfss}, and we stored the family name in |\M at f@ntn at me|. Now we check if the \textsc{nfss} contains a base-mode version with the family name ending in |-base|.
+%    \begin{macrocode}
+      \ifdefined\directlua
+        \edef\M at f@ntn at meb@se{\M at f@ntn at me-base}
+      \else
+        \let\M at f@ntn at meb@se\M at f@ntn at me
+      \fi
+      \ifcsname TU+\M at f@ntn at meb@se\endcsname\else
+        \wlog{Package mathfont Info: Adding \M at f@ntn at meb@se\space
+          to the nfss!}
+        \DeclareFontFamily{TU}{\M at f@ntn at meb@se}{}
+      \fi
+      \M at fill@nfss at shapes\M at f@ntn at meb@se\@basefeatures}
+  \fi}
+%    \end{macrocode}
+% Finally, the font-loading commands should appear only in the preamble.
+%    \begin{macrocode}
+\@onlypreamble\M at fill@nfss at shapes
+\@onlypreamble\M at newfont
+%    \end{macrocode}
+% At this point, the font information is stored in the \textsc{nfss}, but nothing has been loaded. For text fonts, that happens during a call to |\selectfont|, and for math fonts, that happens the first time entering math mode. I've played with the idea of forcing some fonts to load now, but I'm hesitant to change \LaTeX's standard font-loading behavior. I may address this issue further in future versions of \textsf{mathfont}.
+% 
+% 
+% 
 % \section{Parse Input}
 % 
 % This section provides the macros to parse the optional argument of |\mathfont|. We have two parts to this section: error checking and parsing. For parsing, we extract option and suboption information, and for error checking, we make sure that both are valid. The command |\M at check@option at valid| accepts a macro containing (what is hopefully) the text of a keyword-option. The macro defines |\@temperror| to be an invalid option error and loops through all possible options. If the argument matches one of the correct possibilities, \textsf{mathfont} changes |\@temperror| to |\relax|. The macro ends by calling |\@temperror| and issuing an error if and only if the argument is invalid. If |\M at check@option at valid| finds a valid keyword-option, it changes |\if at optionpresent| to true.\indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
@@ -1034,23 +1222,18 @@
 %    \begin{macrocode}
 \def\M at check@option at valid#1{%
   \let\@temperror\M at InvalidOptionError % error by default
-  \@for\@j:=\M at normalkeys\do{%
+  \@for\@j:=\M at keys\do{%
     \ifx\@j#1
       \let\@temperror\@gobble % eliminate error
       \@optionpresenttrue % set switch to true
     \fi}
+  \def\@j{empty} % if option is "empty," we do nothing
+  \ifx\@j#1
+    \let\@temperror\@gobble
+    \@optionpresentfalse
+  \fi
+  \@temperror{#1}}
 %    \end{macrocode}
-% We have to initialize the blackboard, calligraphic, and fraktur commands separately because these characters don't use the same encoding slots as the regular letters and digits and are produced differently from regular characters.\indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
-%   \begin{macrocode}
-  \@for\@j:=\M at letterlikekeys\do{%
-    \ifx\@j#1
-      \expandafter\M at CommandInitializeInfo\csname math#1\endcsname
-      \csname define@#1\endcsname % initialize command
-      \let\@temperror\@gobble % eliminate error
-      \@optionpresenttrue % set switch to true
-    \fi}
-    \@temperror{#1}}
-%    \end{macrocode}
 % Do the same thing for the suboption.
 % \indexpage{suboption roman=suboption \texttt{roman}}%
 % \indexpage{suboption upright=suboption \texttt{upright}}%
@@ -1119,191 +1302,35 @@
 %    \end{macrocode}
 % Perhaps something that sets spaces to |\catcode9| and then retokenizes |#2| would be better, but I don't think it matters very much.
 % 
-% \section{Fontloader}
 % 
-% We come to the fontloader. The main font-loading macro is |\M at newfont|, and it is basically a wrapper around code we would expect to see in a typical |fd| file. Advanced users: please do not call |\M at newfont| directly because I may change it without warning! Instead, please use |\mathfont[]| and extract the \textsc{nfss} family name from |\M at f@ntn at me|. Our general approach is to feed the mandatory argument of |\mathfont| to |\M at newfont|, check if we have reason to believe that the font corresponds to a entry already in the \textsc{nfss}, and declare the font family and font shapes as necessary. First, |\M at newfont| checks if \textsf{fontspec} is loaded, and if yes, we pass the entire mandatory argument of |\mathfont| to \textsf{fontspec}. If not, \textsf{mathfont} handles the font declaration internally. When \textsf{mathfont} declares a font family in the \textsc{nfss}, it uses the entire mandatory argument of |\mathfont| with spaces removed as the family name, and regardless of whether \textsf{mathfont} |\M at newfont| feeds the font name to \textsf{fontspec}, finds it already in the \textsc{nfss}, or performs the entire font declaration, we store the \textsc{nfss} family name in |\M at f@ntn at me|. This allows for easy access later and is how you should access the \textsc{nfss} information if you call |\mathfont[]|.
-% 
-% 
-% We use |\M at split@colon| and |\M at strip@colon| for parsing the argument of |\mathfont|. If the user calls |\mathfont{|\meta{name}|:|\meta{features}|}|, we store the name in |\@tempbase| and the features in |\@tempfeatures|. If the user specifies a name only, then |\@tempfeatures| will be empty. Syntactically, we use |\M at strip@colon| to remove a final |:| the same way we removed a final |=| when we parsed the optional argument in the previous section.
-% \?\@tempfeatures\?\@tempbase
-%    \begin{macrocode}
-\def\M at split@colon#1:#2\@nil{%
-  \def\@tempbase{#1}
-  \def\@tempfeatures{#2}}
-\def\M at strip@colon#1:{#1}
-%    \end{macrocode}
-% The macro |\M at check@in at nfss| accepts a single argument and checks whether that argument is the name of a font family in the \textsc{nfss}, i.e.\ whether |\TU+|\meta{argument} is defined. If yes, we set |\M at f@ntn at me| to |#1| and for the four basic shapes, check that the \textsc{nfss} contains those shapes. If not, call |\DeclareFontShape|. We assume that |\@tempbase| is the human-readable name of the font and feed that directly to \textsf{luaotfload} or \XeTeX. By default, we enable the OpenType features |tlig| and |liga|, but the user can override these settings by manually declaring them to be false.
-%    \begin{macrocode}
-\def\M at check@in at nfss#1{%
-  \ifcsname TU+#1\endcsname
-    \let\M at f@ntn at me#1
-%    \end{macrocode}
-% Upright shape.
-%    \begin{macrocode}
-    \ifcsname TU/#1/\mddefault/\shapedefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\shapedefault}
-        {<->"\@tempbase:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-%    \end{macrocode}
-% Italic shape.
-%    \begin{macrocode}
-    \ifcsname TU/#1/\mddefault/\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\itdefault}
-        {<->"\@tempbase/I:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-%    \end{macrocode}
-% Bold series with upright shape.
-%    \begin{macrocode}
-    \ifcsname TU/#1/\bfdefault/\shapedefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\shapedefault}
-        {<->"\@tempbase/B:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-%    \end{macrocode}
-% Bold series with italic shape.
-%    \begin{macrocode}
-    \ifcsname TU/#1/\bfdefault/\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\itdefault}
-        {<->"\@tempbase/BI:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-%    \end{macrocode}
-% Now do the same thing for the small caps variants. I make no promises that this will work. If a small caps font faces is separate from the main font file, \TeX\ won't be able to find it automatically. In that case, you will have to write your own |fd| file or font-loading commands.
-%    \begin{macrocode}
-    \ifcsname TU/#1/\mddefault/\scdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault}
-        {<->"\@tempbase:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\mddefault/\scdefault\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault\itdefault}
-        {<->"\@tempbase/I:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\bfdefault/\scdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault}
-        {<->"\@tempbase/B:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\bfdefault/\scdefault\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault\itdefault}
-        {<->"\@tempbase/BI:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-%    \end{macrocode}
-% Finally, set the boolean to false and break out of the |\@tfor| loop from |\M at newfont|.
-%    \begin{macrocode}
-    \M at Decl@reF at milyfalse
-    \@break at tfor
-  \fi}
-%    \end{macrocode}
-% The main font-loading macro. This macro takes a single argument, which should have the form \meta{font name}|:|\meta{optional features}, and \textsf{mathfont} handles the information in one of three ways if all goes well: interface with \textsf{fontspec}, possibly declare a few extra shapes for a font already in the \textsc{nfss}, or declare and load the whole font. At a minimum, \textsf{mathfont} ensures that we have access to medium upright, medium italic, bold upright, and bold italic fonts after calling |\M at newfont|. If \textsf{mathfont} decides to declare a font itself, it will also try to load small caps versions. We begin by splitting the argument into |\@tempbase| and |\@tempfeatures|.
-%    \begin{macrocode}
-\def\M at newfont#1{%
-  \edef\@tempa{#1}
-  \expandafter\M at split@colon\@tempa:\@nil
-  \def\@tempb{fontspec}
-%    \end{macrocode}
-% If the argument is ``|fontspec|,'' we want to use the last font loaded by \textsf{fontspec}, which is stored in |\l_fontspec_family_tl|. If this macro is not empty, we store its contents in |\M at f@ntn at me| and skip loading entirely because \textsf{fontspec} already took care of it. We issue an error if |\l_fontspec_family_tl| is empty or if the user has not loaded \textsf{fontspec}.
-%    \begin{macrocode}
-  \ifx\@tempa\@tempb
-    \@ifpackageloaded{fontspec}{%
-      \expandafter\ifx\csname l_fontspec_family_tl\endcsname\@empty
-        \M at NoFontspecFamilyError
-      \else
-        \expandafter
-          \let\expandafter\M at f@ntn at me\csname l_fontspec_family_tl\encsname
-        \def\@tempbase{\M at f@ntn at me\space(from fontspec)}
-      \fi}{\M at NoFontspecError}
-%    \end{macrocode}
-% If the argument is something other than ``|fontspec|,'' we need to parse it. If the user loaded \textsf{fontspec}, we pass the entire argument to |\fontspec_set_family:Nnn| for loading and store the \textsc{nfss} family name in |\M at f@ntn at me|. For Lua\TeX, this is not recommended\textemdash\textsf{fontspec} is designed to work with text, not math, fonts and typically loads fonts in |node| mode, which makes their OpenType features unusable in math mode.
-%    \begin{macrocode}
-  \else
-    \@ifpackageloaded{fontspec}
-    {\csname fontspec_set_family:Nnn\endcsname\M at f@ntn at me{}{\@tempa}}
-%    \end{macrocode}
-% If the user has not loaded \textsf{fontspec}, we split the argument into a name and features using |\M at split@colon|. The name goes in |\@tempbase|, and the features go in |\@tempfeatures|. The boolean |\ifM at Decl@reF at mily| keeps track of whether we need to manually declare a font family and shapes in the \textsc{nfss}. By default, we set it to true, and if \textsf{mathfont} finds a match to |#1| in the \textsc{nfss} already, |\M at check@in at nfss| will set it to false.
-%    \begin{macrocode}
-    {\M at Decl@reF at milytrue
-      \ifx\@tempfeatures\@empty\else
-        \edef\@tempfeatures{\expandafter\M at strip@colon\@tempfeatures}
-      \fi
-%    \end{macrocode}
-% We remove the spaces from |#1| and from the human-readable font name contained in |#1| and check whether either already exists as a family name in the \textsc{nfss}.
-%    \begin{macrocode}
-      \edef at nospace\@tempa{\@tempa}
-      \edef at nospace\@tempb{\@tempbase}
-      \@tfor\@i:=\@tempa\@tempb\@tempbase\do{\expandafter\M at check@in at nfss\@i}
-%    \end{macrocode}
-% If |\M at newfont| didn't find anything in the \textsc{nfss}, we need to load the font. We declare the font family in the \textsc{nfss} to have the name given by |#1| with spaces removed.
-% \indexpage{log file=\texttt{log} file}
-%    \begin{macrocode}
-      \ifM at Decl@reF at mily
-        \wlog{^^JPackage mathfont Info:
-          Adding the font family \@tempa\space to the nfss.}
-        \DeclareFontFamily{TU}{\@tempa}{}
-        \let\M at f@ntn at me\@tempa
-%    \end{macrocode}
-% Now load the four most common font faces. We are relying on the ``|/I|,'' etc.\ feature of \XeTeX\ and \textsf{luaotfolad} to correctly find the bold, italic, and bold italic fonts corresponding to the family named |\@tempbase|.
-%    \begin{macrocode}
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\shapedefault}
-          {<->"\@tempbase:\M at default@otf at features;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\itdefault}
-          {<->"\@tempbase/I:\M at default@otf at features;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\shapedefault}
-          {<->"\@tempbase/B:\M at default@otf at features;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\itdefault}
-          {<->"\@tempbase/BI:\M at default@otf at features;\@tempfeatures"}{}
-%    \end{macrocode}
-% Attempt to load small caps. The font may or may not have a small caps feature, but we will request it anyway. See the portion of |\M at check@in at nfss| for disclaimers on loading small caps fonts.
-%    \begin{macrocode}
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\scdefault}
-          {<->"\@tempbase:\M at default@otf at features@sc;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\scdefault\itdefault}
-          {<->"\@tempbase/I:\M at default@otf at features@sc;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\scdefault}
-          {<->"\@tempbase/B:\M at default@otf at features@sc;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\scdefault\itdefault}
-          {<->"\@tempbase/BI:\M at default@otf at features@sc;\@tempfeatures"}{}
-      \fi}
-  \fi}
-%    \end{macrocode}
-% Finally, both font-loading commands should appear only in the preamble.
-%    \begin{macrocode}
-\@onlypreamble\M at check@in at nfss
-\@onlypreamble\M at newfont
-%    \end{macrocode}
-% At this point, the font information is stored in the \textsc{nfss}, but nothing has been loaded. I've played with the idea of loading certain fonts now to check whether they have been defined correctly, but I'm hesitant to force loading in a way that isn't systematic and could change \LaTeX's standard font-loading behavior. This issue may be addressed in future versions of \textsf{mathfont}.
-% 
-% 
 % \section{Default Font Changes}
 % 
 % This section documents default math font changes. The user-level font-changing command is |\mathfont|, and it feeds the font information to |\@mathfont|, the internal command that does the actual font changing. This macro is basically a wrapper around |\DeclareSymbolFont| and a bunch of calls to |\DeclareMathSymbol|, and when the user calls |\@mathfont|, the command declares the user's font in the \textsc{nfss} with |\M at newfont| and loops through the optional argument. On each iteration, |\@mathfont| validates the option and suboption, calls |\DeclareSymbolFont| if necessary, and sets the math codes with |\M@|\meta{keyword}|@set|. 
 % \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
 %    \begin{macrocode}
-\protected\def\mathfont{\@ifnextchar[{\m at thf@nt}{\@mathfont[\M at defaultkeys]}}
-\def\m at thf@nt[#1]{\@mathfont[#1]}
+\protected\def\mathfont{\@ifnextchar[{\@mathfont}{\@mathfont[\M at defaultkeys]}}
 %    \end{macrocode}
-% The internal default-font-changing command.
+% The internal font-changing command.
 %    \begin{macrocode}
 \def\@mathfont[#1]#2{%
   \ifx\set at mathchar\@@set at mathchar
     \M at InternalsRestoredError
 %    \end{macrocode}
-% If the kernel commands have not been reset, we can do fun stuff. As of version 2.0, I'm removing the documentation for |\restoremathinternals| in the user guide, but the code is going to stay in for backwards compatibility.
+% If the kernel commands have not been reset, we can do fun stuff. As of version 2.0, I'm removing the documentation for |\restoremathinternals| in the user guide, but the code will stay in for backwards compatibility.
 %    \begin{macrocode}
   \else
     \M at toks{}
 %    \end{macrocode}
-% We immediately call |\M at newfont| on the mandatory argument of |\mathfont|. We store the \textsc{nfss} family name in |\M at fontfamily@|\meta{argument}. If we need a new value of |\M at count|, we store it in |\M at fontid@|\meta{\textsc{nfss} family name}. We will not need a new value of |\M at count| if the user asks for the same \textsc{nfss} font family twice. Throughout the definition of |\mathfont|, |\@tempa| stores the value of |\M at count| that corresponds to the current font.
+% We immediately call |\M at newfont| on the mandatory argument of |\mathfont|. We store the \textsc{nfss} family name in |\M at fontfamily@|\meta{argument} and |M at fontfamily@base@|\meta{argument}. If we need a new value of |\M at count|, we store it in |\M at fontid@|\meta{\textsc{nfss} family name}. We will not need a new value of |\M at count| if the user asks for the same \textsc{nfss} font family twice. Throughout the definition of |\mathfont|, |\@tempa| stores the value of |\M at count| that corresponds to the current font.
 % \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
 %    \begin{macrocode}
     \M at newfont{#2}
     \expandafter\edef\csname M at fontfamily@#2\endcsname{\M at f@ntn at me}
+    \expandafter\edef\csname M at fontfamily@base@#2\endcsname{\M at f@ntn at meb@se}
     \ifcsname M at fontid@\M at f@ntn at me\endcsname\else % need new \M at count value?
       \expandafter\edef\csname M at fontid@\M at f@ntn at me\endcsname{\the\M at count}
+      \expandafter\let\csname M at fontid@\M at f@ntn at meb@se\expandafter\endcsname
+        \csname M at fontid@\M at f@ntn at me\endcsname
       \advance\M at count\@ne
     \fi
     \edef\@tempa{\csname M at fontid@\M at f@ntn at me\endcsname}
@@ -1315,7 +1342,7 @@
       \if at optionpresent
 %    \end{macrocode}
 % If the user calls |\mathfont| and tries multiple times to set the font for a certain class of characters, \textsf{mathfont} will issue a warning,  and the package will not adjust the font for those characters. Notice the particularly awkward syntax with the |\csname|-|\endcsname| pairs. Without this construct, \TeX\ won't realize that |\csname if@\@tempa\endcsname| matches the eventual |\fi|, and the |\@for| loop will break. (\TeX\ does not have a smart if-parser!)
-% \indexpage{parse conditionals}
+% \indexpage{I already set the font}
 % \indexpage{if-parser}
 % \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
 %    \begin{macrocode}
@@ -1353,8 +1380,10 @@
 % At this point we have the information we need to declare the symbol font: the \textsc{nfss} family (|\M at f@ntn at me|), series (|\mddefault|), and shape (|\@tempb|) information. The symbol font name will be |M|\meta{suboption}\meta{value of {\fontshape\shapedefault\fontfamily\ttdefault\selectfont\string\M at count}}. We check if the symbol font we need for the current set of characters is defined, and if not, we define it using this information.
 %    \begin{macrocode}
           \ifcsname symM\@tempc\@tempa\endcsname\else
+            \M at SymbolFontInfo{\@tempbase}{\M at f@ntn at meb@se}
+              {\mddefault/\@tempb}{M\@tempc\@tempa}
             \DeclareSymbolFont
-              {M\@tempc\@tempa}{TU}{\M at f@ntn at me}{\mddefault}{\@tempb}
+              {M\@tempc\@tempa}{TU}{\M at f@ntn at meb@se}{\mddefault}{\@tempb}
           \fi
 %    \end{macrocode}
 % We store the new font information so we can write it to the |log| file |\AtBeginDocument| and send an informational message to the user.\indexpage{log file=\texttt{log} file}
@@ -1361,8 +1390,7 @@
 %    \begin{macrocode}
           \expandafter
             \edef\csname M@\@temp at opt @fontinfo\endcsname{\@tempbase}
-          \M at FontChangeInfo{\@temp at opt}{\@tempbase}{\M at f@ntn at me}
-            {\mddefault/\@tempb}{M\@tempc\@tempa}
+          \M at FontChangeInfo{\@temp at opt}{\@tempbase}
 %    \end{macrocode}
 % And now the magic happens!
 % \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
@@ -1405,9 +1433,10 @@
       \wlog{The \string\mathfont\space command on line \the\inputlineno\space
         did not change the font for any characters!}
     \else
+      \wlog{}
       \typeout{:: mathfont :: Using font \@tempbase\space
         on line \the\inputlineno.}
-      \wlog{Character classes changed:\the\M at toks^^J}
+      \wlog{Character classes changed:\the\M at toks}
     \fi
   \fi}
 \@onlypreamble\mathfont
@@ -1423,195 +1452,79 @@
   \let\rmdefault\M at f@ntn at me}
 \@onlypreamble\setfont
 %    \end{macrocode}
-% We come to the tricky problem of making sure to use the correct MathConstants table. Lua\TeX\ automatically initializes all math parameters based on the most recent |\textfont|, etc.\ assignment, so we want to tell \LaTeX\ to reassign whatever default font we're using to the correct math family whenever we load new math fonts. This is possible, but the implementation is super hacky. When \LaTeX\ enters math mode, it checks whether it needs to redo any math family assignments, typically because of a change in font size, and if so, it calls |\getanddefine at fonts| repeatedly to append |\textfont|, etc.\ assignments onto the macro |\math at fonts|. Usually |\math at fonts| is empty because this process always happens inside a group, so we can hook into the code by defining |\math at code| to be |\aftergroup|\meta{extra code}. In this case, the \textit{extra code} will be another call to |\getanddefine at fonts|. The macro |\mathconstantsfont| handles choosing the font for setting math parameters in Lua\TeX. It checks if the argument was previously fed to |\mathfont| by seeing whether |\M at fontfamily@|\meta{|\string#1|} is equal to |\relax|. If yes, |#1| was never an argument of |\mathfont|, and we raise an error.
+% The macro |\mathconstantsfont| handles choosing the font for setting math parameters in Lua\TeX. It issues a warning if called in \XeTeX. First, it checks if the argument was previously fed to |\mathfont| by seeing whether |\M at fontfamily@|\meta{|\string#1|} is equal to |\relax|. If yes, |#1| was never an argument of |\mathfont|, and we raise an error.
 %    \begin{macrocode}
-\ifM at adjust@font
-  \protected\def\mathconstantsfont#1{%
-    \edef\@tempa{\csname M at fontfamily@#1\endcsname}
-    \ifx\@tempa\relax
-      \PackageError{mathfont}{Invalid font specifier}
-      {Your command was ignored--I can't parse your argument.\MessageBreak
-      Please make sure to use text that you have previously\MessageBreak
-      fed to \string\mathfont\space for the argument of 
-      \string\mathconstantsfont.^^J}
+\ifdefined\directlua
+  \let\M at SetMathConstants\relax
+  \protected\def\mathconstantsfont{\@ifnextchar[{\@mathconstantsfont}
+      {\@mathconstantsfont[upright]}}
+  \def\@mathconstantsfont[#1]#2{%
+    \edef\@tempa{\csname M at fontfamily@base@#2\endcsname}
+    \expandafter\ifx\@tempa\relax
+      \M at BadMathConstantsFontError{#2}
     \else
 %    \end{macrocode}
-% We initialize |\M at SetMathConstants| to be |\relax|, so we define it the first time the user calls |\mathconstantsfont|. The command calls |\getanddefine at fonts| inside a group and uses as arguments the upright face of the font corresponding to |#1|. Then we call |\math at fonts|, and to avoid an infinite loop, we gobble the |\aftergroup||\M at SetMathConstants| macros that \textsf{mathfont} has inserted at the start of |\math at fonts|. Setting |\globaldefs| to 1 makes the |\textfont|, etc.\ assignments from |\getanddefine at fonts| global when we call |\math at fonts|.
-% \indexpage{LaTeX kernel=\LaTeX\ kernel}
+% Some error checking. If |#1| isn't ``upright'' or ``italic,'' we should raise an error. If the |\@tempa| font doesn't correspond to a symbol font, we declare it. Before defining |\M at SetMathConstants| if necessary, we store the \textsc{nfss} family name in |\m at th@const at nts@font|.
 %    \begin{macrocode}
-      \ifx\M at SetMathConstants\relax
-        \protected\def\M at SetMathConstants{%
-          \begingroup
-          \escapechar\m at ne
-          \expandafter\getanddefine at fonts
-            \csname symMupright\csname M at fontid@\m at th@const at nts@font\endcsname
-              \expandafter\endcsname % expands to \symMupright<id>
-            \csname TU/\m at th@const at nts@font/\seriesdefault/\shapedefault
-              \endcsname % expands to \TU/<nfss family name>/m/n
-          \globaldefs\@ne
-          \expandafter\@gobbletwo\math at fonts % gobble to avoid infinite loop
-          \endgroup}
+      \def\@tempb{#1}
+      \def\@tempc{upright}
+      \ifx\@tempb\@tempc
+        \let\@tempc\shapedefault
+      \else
+        \def\@tempc{italic}
+        \ifx\@tempb\@tempc
+          \let\@tempc\itdefault
+        \else
+          \M at BadMathConstantsFontTypeError{#1}
+        \fi
       \fi
+      \ifcsname symM#1\csname M at fontid@\@tempa\endcsname\endcsname\else
+        \DeclareSymbolFont{M#1\csname M at fontid@\@tempa\endcsname}
+          {TU}{\@tempa}{\mddefault}{\@tempc}
+      \fi
+      \let\m at th@const at nts@font\@tempa
 %    \end{macrocode}
-% After initializing |\M at SetMathConstants| if necessary, we store the \textsc{nfss} family name in |\m at th@const at nts@font|.
+% We come to the tricky problem of making sure to use the correct MathConstants table. Lua\TeX\ automatically initializes all math parameters based on the most recent |\textfont|, etc.\ assignment, so we want to tell \LaTeX\ to reassign whatever default font we're using to the correct math family whenever we load new math fonts. This is possible, but the implementation is super hacky. When \LaTeX\ enters math mode, it checks whether it needs to redo any math family assignments, typically because of a change in font size, and if so, it calls |\getanddefine at fonts| repeatedly to append |\textfont|, etc.\ assignments onto the macro |\math at fonts|. Usually |\math at fonts| is empty because this process always happens inside a group, so we can hook into the code by defining |\math at font| to be |\aftergroup|\meta{extra code}. In this case, the \textit{extra code} will be another call to |\getanddefine at fonts|.
+% 
+% We initialize |\M at SetMathConstants| to be |\relax|, so we define it the first time the user calls |\mathconstantsfont|. The command calls |\getanddefine at fonts| inside a group and uses as arguments the upright face of the font corresponding to |#1|. Then we call |\math at fonts|, and to avoid an infinite loop, we gobble the |\aftergroup||\M at SetMathConstants| macros that \textsf{mathfont} has inserted at the start of |\math at fonts|. Setting |\globaldefs| to 1 makes the |\textfont|, etc.\ assignments from |\getanddefine at fonts| global when we call |\math at fonts|.\indexpage{LaTeX kernel=\LaTeX\ kernel}^^A
 %    \begin{macrocode}
-      \let\m at th@const at nts@font\@tempa
-    \fi}
-  \let\M at SetMathConstants\relax
+      \protected\def\M at SetMathConstants{%
+        \begingroup
+        \escapechar\m at ne
+        \expandafter\getanddefine at fonts
+          \csname symM#1\csname M at fontid@\m at th@const at nts@font\endcsname
+            \expandafter
+          \endcsname % expands to \symMupright<id>
+          \csname TU/\m at th@const at nts@font/\seriesdefault/\@tempc
+            \endcsname % expands to \TU/<nfss family name>/m/<shape>
+        \globaldefs\@ne
+        \expandafter\@gobbletwo\math at fonts % gobble to avoid infinite loop
+        \endgroup}
+      \fi}
   \def\math at fonts{\aftergroup\M at SetMathConstants}
-  \@onlypreamble\mathconstantsfont
+\else
+  \protected\def\mathconstantsfont{\M at LuaTeXOnlyWarning
+    \@ifnextchar[\@gobbletwo at brackets\@gobble}
 \fi
+\@onlypreamble\mathconstantsfont
 %    \end{macrocode}
 % If the user has not enabled Lua font adjustments, then |\mathconstantsfont| will generate an error message and gobble its argument. This definition happens later in |mathfont.sty| when we define other Lua-related macros such as |\IntegralItalicFactor| to do the same thing absent font adjustments.
 % 
 % 
 % 
-% \section{Letterlike Symbols}
-% 
-% This section documents the implementation of the |\math|\meta{keyword} commands for blackboard bold, caligraphic, and fraktur characters. These commands work differently from other local font-changing commands. Unlike with the macros in the next section, we can't just change the |\fam| number because in unicode, the letterlike characters have different encoding slots from the regular Latin letters, so we need to somehow get different math codes as well as a different font. Future versions of \textsf{mathfont} will change the math codes of letters directly. For now though, we keep the old implementation where each |\math|\meta{keyword} macro inserts each token from its argument into an appropriate |\csname||\endcsname| construction. The first thing we have to do is check if \TeX\ is in math mode using |\M at check@mode|, and the argument of |\M at check@mode| should be one of the macros |\@math|\meta{keyword}. If yes, we call |#1|, and if no, we issue a ``missing |$|'' error.
-%    \begin{macrocode}
-\def\M at check@mode#1{%
-  \let\@tempa#1%
-  \ifmmode
-    \expandafter\@tempa
-  \else
-%    \end{macrocode}
-% Temporarily set the escape character code to $-1$ so we can gobble the |@| in |\@math|\meta{keyword} without worrying about the escape character. We need to do this for error messaging purposes, so |\M at HModeError| displays the user-level command that caused the error. Finally, the package adds the missing |$| to enter math mode before calling |#1|.
-% \indexpage{Missing \$ inserted=Missing \texttt\$ inserted}
-%    \begin{macrocode}
-    \bgroup
-      \escapechar\m at ne
-      \expandafter
-    \egroup
-    \expandafter\M at HModeError\csname\expandafter\@gobble\string#1\endcsname
-    \expandafter$\expandafter\@tempa
-  \fi}
-%    \end{macrocode}
-% The |\M at process@tokens| macro turns the letters into letterlike symbols. The first argument should be the user's original argument of |\math|\meta{keyword}, and the second argument will be the keyword-option for |\mathfont| corresponding to this set of letterlike symbols. The macro loops through |#1| with |\@tfor| and calls |\M at check@token|, which sets the count variable |\M at errcode| as part of validating the token, on each |\@k|. If |\M at errcode| is 0, the \textit{token} is valid, and \TeX\ calls |\M@|\meta{keyword}|@|\meta{token} to typeset the letterlike character. If |\M at errcode| is anything else, |\M at check@token| will issue an error.
-%    \begin{macrocode}
-\def\M at process@tokens#1#2{%
-  \edef\@tempa{#1}%
-  \expandafter\@tfor\expandafter\@k\expandafter:\expandafter=\@tempa\do{%
-    \expandafter\M at check@token\expandafter{\@k}%
-%    \end{macrocode}
-% Now that |\M at check@token| has set |\M at errcode|, we either typeset |\@k| or raise an error.
-%    \begin{macrocode}
-    \ifcase\M at errcode
-      \csname M@#2@\@k\endcsname
-    \or\expandafter\M at NestedArgWarning\csname math#2\endcsname{\@k}%
-    \or\expandafter\M at CSArgWarning\csname math#2\endcsname{\@k}%
-    \or\expandafter\M at CharacterArgWarning\csname math#2\endcsname{\@k}%
-    \or\expandafter\M at DoubleArgWarning\csname math#2\endcsname{\@k}%
-    \fi}}
-%    \end{macrocode}
-% We check for errors with |\M at check@token|. The argument |#1| is the argument to be checked, and we are expecting |#1| to be a single letter or digit. Checking happens in five steps: (1) verify \TeX\ cannot split the contents of |#1| (which in |\M at process@tokens| is |\@k|) into multiple arguments; (2) verify that the argument does not begin with a character of catcode 1, i.e.\ |{|; (3) verify that the token is not a control sequence; (4) check whether the character is a letter; and (5) if the argument does not have catcode 11, check that it's a number. If any of these checks fail, \textsf{mathfont} sets |\M at errcode| to the corresponding error code and skips the remaining steps.\indexpage{multiple characters warning}\indexpage{error checking}
-%    \begin{macrocode}
-\def\M at check@token#1{%
-  \M at errcode\z@
-  \expandafter\ifx\expandafter\@nnil\@gobble#1\@nnil% good
-%    \end{macrocode}
-% Checking for a nested argument involves what I think of as catcode jujitsu and inevitably feels super hacky. We use |\ifcat\bgroup| to check whether the first token of |#1| has catcode 1, and we take care to avoid unbalanced braces because |\ifcat| will eat the first token in the |#1| argument when it expands. If the comparison succeeds, the first token had catcode 1, and we are now missing a |{|. We place one before |\ifcat|, and we |\@gobble| the argument to prevent \TeX\ from typesetting it. The extra left brace balances the final right brace in |#1|, and both tokens delimit the argument of |\@gobble|. If the comparison fails, \TeX\ eliminates everything in the first branch, and we need to balance the |{| from before |\ifcat|. Thus we add a right brace immediately after |\else|, and the argument of |\@gobble| ends up being empty.%
-% \indexpage{nested argument warning}
-%    \begin{macrocode}
-    \expandafter\@gobble\expandafter{\ifcat\bgroup#1% bad
-      \M at errcode\@ne
-    \else}%
-%    \end{macrocode}
-% Check whether |#1| is a control sequence.\indexpage{control sequence warning}
-%    \begin{macrocode}
-      \ifcat\relax\noexpand#1% bad
-        \M at errcode\tw@
-      \else
-%    \end{macrocode}
-% Check that |#1| is a letter.
-%    \begin{macrocode}
-        \ifnum\catcode`#1=11\relax% good
-        \else
-%    \end{macrocode}
-% Finally, check that |#1| is a digit.
-%    \begin{macrocode}
-          \if 0#1% good
-          \else
-            \if 1#1% good
-            \else
-              \if 2#1% good
-              \else
-                \if 3#1% good
-                \else
-                  \if 4#1% good
-                  \else
-                    \if 5#1% good
-                    \else
-                      \if 6#1% good
-                      \else
-                        \if 7#1% good
-                        \else
-                          \if 8#1% good
-                          \else
-                            \if 9#1% good
-                            \else
-                              \M at errcode\thr@@
-                            \fi
-                          \fi
-                        \fi
-                      \fi
-                    \fi
-                  \fi
-                \fi
-              \fi
-            \fi
-          \fi
-        \fi
-      \fi
-    \fi
-  \else% matches the original \ifx\@nnil, etc.
-    \M at errcode=4\relax
-  \fi}
-%    \end{macrocode}
-% Now initialize the five commands. The |\define@|\meta{keyword} initializes each user-level macro |\math|\meta{keyword}, which checks the mode and calls |\@math|\meta{keyword}. The |@| versions actually do the work by calling |\M at process@tokens| on the user's input. We start with the blackboard-bold font-changing command.\indexpage{keywordbb=keyword \texttt{bb}}
-%    \begin{macrocode}
-\def\define at bb{%
-  \protected\def\mathbb{\M at check@mode\@mathbb}%
-  \def\@mathbb##1{\M at process@tokens{##1}{bb}}}
-%    \end{macrocode}
-% Calligraphic characters.\indexpage{keywordcal=keyword \texttt{cal}}
-%    \begin{macrocode}
-\def\define at cal{%
-  \protected\def\mathcal{\M at check@mode\@mathcal}%
-  \def\@mathcal##1{\M at process@tokens{##1}{cal}}}
-%    \end{macrocode}
-% Fraktur characters.\indexpage{keywordfrak=keyword \texttt{frak}}
-%    \begin{macrocode}
-\def\define at frak{%
-  \protected\def\mathfrak{\M at check@mode\@mathfrak}%
-  \def\@mathfrak##1{\M at process@tokens{##1}{frak}}}
-%    \end{macrocode}
-% Bold calligraphic characters.\indexpage{keywordbcal=keyword \texttt{bcal}}
-%    \begin{macrocode}
-\def\define at bcal{%
-  \protected\def\mathbcal{\M at check@mode\@mathbcal}%
-  \def\@mathbcal##1{\M at process@tokens{##1}{bcal}}}
-%    \end{macrocode}
-% Bold fraktur characters.\indexpage{keywordbfrak=keyword \texttt{bfrak}}
-%    \begin{macrocode}
-\def\define at bfrak{%
-  \protected\def\mathbfrak{\M at check@mode\@mathbfrak}%
-  \def\@mathbfrak##1{\M at process@tokens{##1}{bfrak}}}
-%    \end{macrocode}
-% 
 % \section{Local Font Changes}\indexpage{local font changes}
 % 
 % This section deals with local font changes. The |\newmathfontcommand| creates macros that change the font for math alphabet characters and is basically a wrapper around |\DeclareMathAlphabet|. First we code |\M at check@csarg|, which accepts two arguments. The |#1| argument is the user-level command that called |\M at check@csarg|, which we use for error messaging, and |#2| should be a single control sequence. The way |\M at check@csarg| scans the following tokens is a bit tricky: (1) check the length of the argument using |\M at check@arglength|; and (2) check that the argument is a control sequence. If the user specifies an argument of the form |{..}|, i.e.\ extra text inside braces, the |\ifcat| will catch it and issue an error. If |\M at check@csarg| likes the input, it sets |\ifM at good@arg| to true, and otherwise, it sets |\ifM at arg@good| to false.
 %    \begin{macrocode}
 \def\M at check@csarg#1#2{%
-  \expandafter\ifx\expandafter\@nnil\@gobble#2\@nnil% good
-    \ifcat\relax\noexpand#2% good
+  \expandafter\ifx\expandafter\@nnil\@gobble#2\@nnil % good
+    \ifcat\relax\noexpand#2 % good
       \M at arg@goodtrue
-    \else
+    \else % if #2 not a control sequence
       \M at MissingControlSequenceError#1{#2}
       \M at arg@goodfalse
     \fi
-  \else
+  \else % if #2 is multiple tokens
     \M at DoubleArgError#1{#2}
     \M at arg@goodfalse
   \fi}
@@ -1622,8 +1535,8 @@
   \M at check@csarg\newmathfontcommand{#1}
   \ifM at arg@good
     \M at newfont{#2}
-    \M at NewFontCommandInfo{#1}{\@tempbase}{\M at f@ntn at me}{#3}{#4}
-    \DeclareMathAlphabet{#1}{TU}{\M at f@ntn at me}{#3}{#4}
+    \M at NewFontCommandInfo{#1}{\@tempbase}{\M at f@ntn at meb@se}{#3}{#4}
+    \DeclareMathAlphabet{#1}{TU}{\M at f@ntn at meb@se}{#3}{#4}
   \fi}
 \@onlypreamble\newmathfontcommand
 %    \end{macrocode}
@@ -1670,11 +1583,9 @@
 % We provide |\newmathbold| and |\newmathboldit| for backwards compatibility but issue a warning.
 %    \begin{macrocode}
 \protected\def\newmathbold{%
-  \M at DeprecatedWarning\newmathbold\newmathbf
-  \newmathbf}
+  \M at DeprecatedWarning\newmathbold\newmathbf\newmathbf}
 \protected\def\newmathboldit{%
-  \M at DeprecatedWarning\newmathboldit\newmathbfit
-  \newmathbfit}
+  \M at DeprecatedWarning\newmathboldit\newmathbfit\newmathbfit}
 %    \end{macrocode}
 % 
 % \section{Miscellaneous Material}
@@ -1697,7 +1608,7 @@
     \endgroup % first branch \endgroup
   \else
     \@expandtwoargs\in@{\@backslashchar}{\@tempa}
-    \ifin@ % is \ in #1?
+    \ifin@ % is backslash in #1?
       \endgroup % second branch \endgroup
     \else
       \directlua{
@@ -1715,7 +1626,7 @@
 %    \end{macrocode}
 % Define |\RuleThicknessFactor|.
 %    \begin{macrocode}
-  \def\RuleThicknessFactor#1{%
+  \protected\def\RuleThicknessFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at rule@thickness at factor=#1\relax
@@ -1725,7 +1636,7 @@
 %    \end{macrocode}
 % Define |\IntegralItalicFactor|.
 %    \begin{macrocode}
-  \def\IntegralItalicFactor#1{%
+  \protected\def\IntegralItalicFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at integral@italic at factor=#1\relax
@@ -1735,7 +1646,7 @@
 %    \end{macrocode}
 % Define |\SurdHorizontalFactor|.
 %    \begin{macrocode}
-  \def\SurdHorizontalFactor#1{%
+  \protected\def\SurdHorizontalFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at surd@horizontal at factor=#1\relax
@@ -1745,7 +1656,7 @@
 %    \end{macrocode}
 % Define |\SurdVerticalFactor|.
 %    \begin{macrocode}
-  \def\SurdVerticalFactor#1{%
+  \protected\def\SurdVerticalFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at surd@vertical at factor=#1\relax
@@ -1757,9 +1668,9 @@
 %    \begin{macrocode}
 \else
   \@tfor\@i:=\RuleThicknessFactor\IntegralItalicFactor\SurdHorizontalFactor
-    \SurdVerticalFactor\CharmLine\CharmFile\mathconstantsfont
+    \SurdVerticalFactor\CharmLine\CharmFile
       \do{%
-        \expandafter\edef\@i{\noexpand\M at NoFontAdjustError
+        \protected\expandafter\edef\@i{\noexpand\M at NoFontAdjustError
           \expandafter\noexpand\@i
           \noexpand\@gobble}}
 \fi
@@ -1774,6 +1685,7 @@
 \@onlypreamble\CharmFile
 %    \end{macrocode}
 % Provide the command to reset the kernel. I am not sure that we need this macro, but it will stay in the package for backwards compatibility.
+% \indexpage{Internal commands restored}
 %    \begin{macrocode}
 \def\restoremathinternals{%
   \ifx\set at mathchar\@@set at mathchar
@@ -1830,31 +1742,8 @@
   \fi
 \fi
 %    \end{macrocode}
-% Warn the user about a possible cosmetic issue arising from a clash with the |align| environment from \textsf{amsmath}. Inside a group, we use |\@tempswa| to check whether the user declared one of the letterlike symbol keywords. If yes, we test whether the user loaded \textsf{amsmath} and if so issue a warning.\indexpage{amsmath=\textsf{amsmath}}
+% Write to the |log| file |\AtBeginDocument| all font changes carried out by \textsf{mathfont}. The command |\keyword at info@begindocument| accepts two arguments and is what acutally prints the informational message after the preamble. One argument is a keyword-argument from |\mathfont|, and the other is a number of spaces. The spaces make the messages line up with each other in the log file.\indexpage{log file=\texttt{log} file}
 %    \begin{macrocode}
-\AtBeginDocument{%
-  \bgroup\@tempswafalse
-  \ifM at bb
-    \@tempswatrue
-    \else\ifM at cal
-      \@tempswatrue
-      \else\ifM at frak
-        \@tempawatrue
-        \else\ifM at bfrak
-          \@tempswatrue
-        \fi
-      \fi
-    \fi
-  \fi
-  \expandafter\egroup\if at tempswa
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {\MessageBreak Package amsmath detected. Some warning\MessageBreak
-    messages for letterlike characters may be\MessageBreak
-    duplicated inside the align environment}}{}
-  \fi}
-%    \end{macrocode}
-% Write to the |log| file |\AtBeginDocument| all font changes carried out by \textsf{mathfont}. The command |\keyword at info@begindocument| accepts two arguments. One is a keyword-argument from |\mathfont|, and the other is a number of spaces. The spaces make the messages line up with each other in the log file.\indexpage{log file=\texttt{log} file}
-%    \begin{macrocode}
 \def\keyword at info@begindocument#1:#2\@nil{%
   \expandafter\ifx % next line is two cs to be compared
         \csname ifM@#1\expandafter\endcsname\csname iftrue\endcsname
@@ -1868,7 +1757,7 @@
 % Now print the messages.
 %    \begin{macrocode}
 \AtBeginDocument{%
-  \def\@tempa{%    <---- everything should be 13 characters long plus :
+  \def\@tempa{%    <-- everything should be 14 characters long
     upper:\@spaces\@spaces,%
     lower:\@spaces\@spaces,%
     diacritics:\space\space\space,%
@@ -1893,7 +1782,7 @@
     frak:\@spaces\@spaces\space,%
     bcal:\@spaces\@spaces\space,%
     bfrak:\@spaces\@spaces}
-  \wlog{^^JPackage mathfont Info: List of changes made in the preamble---}
+  \wlog{^^JPackage mathfont Info: List of changes made in the preamble.}
   \@for\@i:=\@tempa\do{%
     \expandafter\keyword at info@begindocument\@i\@nil}
   \wlog{}}
@@ -1940,7 +1829,7 @@
 % 
 % 
 % 
-% The next three sections implement Lua-based font adjustments and apply only if the user has enabled font adjustment. Most of the implementation happens through Lua code, but we need some \TeX\ code in case the user wants to adjust character metric information. Here is a rough outline of what needs to happen in the next three sections:
+% The next three sections implement Lua-based font adjustments and apply only if the user has enabled font adjustment. Most of the implementation happens through Lua code, but we need some \TeX\ code in case the user wants to adjust character metric information. Here is a rough outline of what happens in the next three sections:
 % \begin{enumerate}\itemsep\z@
 % \item Initialize a Lua table that contains new metrics for certain characters specific to math mode, such as letters with wider bounding boxes and large operator symbols.
 % \item Provide an interface for the user to change this metric information.
@@ -2053,7 +1942,7 @@
     \fi
   \else
     \@expandtwoargs\in@{\@backslashchar}{\@tempa}
-    \ifin@ % is \ in #1?
+    \ifin@ % is backslash in #1?
       \ifM at fromCharmFile
         \M at ForbiddenCharmFile{\@backslashchar}
       \else
@@ -2353,7 +2242,7 @@
 %
 %
 % \begin{figure}[t]
-% \centerline{\bfseries Table 3: Callbacks Created by \textsf{mathfont}\strut}
+% \centerline{\bfseries Table 4: Callbacks Created by \textsf{mathfont}\strut}
 % \begin{tabularx}\textwidth{lXl}\toprule
 % Callback Name & Called? & Default Behavior\\\midrule
 % |"mathfont.inspect_font"| & Always & none\\\midrule
@@ -2369,7 +2258,7 @@
 %
 %
 % 
-% This section contains the Lua functions that actually modify the font during loading. The three functions |set_nomath_true|, |math_constants|, and |apply_charm_info| do most of the heavy lifting, and we set them as the default behavior for three callbacks. In total, \textsf{mathfont} defines six different callbacks and calls them inside the function |adjust_font|---see table~3 for a list. Each callback accepts a fontdata object as an argument and returns nothing. You can use these callbacks to change \textsf{mathfont}'s default modifications or to modify a fontdata object before or after \textsf{mathfont} looks at it. Be aware that if you add a function to any of the |disable_nomath|, |add_math_constants|, or |fix_character_metrics| callbacks, Lua\TeX\ will not call the default |mathfont| function associated with the callback anymore. In other words, do not mess with these three callbacks unless you are duplicating the functionality of the corresponding ``Default Behavior'' function from table~3. 
+% This section contains the Lua functions that actually modify the font during loading. The three functions |set_nomath_true|, |math_constants|, and |apply_charm_info| do most of the heavy lifting, and we set them as the default behavior for three callbacks. In total, \textsf{mathfont} defines six different callbacks and calls them inside the function |adjust_font|---see table~4 for a list. Each callback accepts a fontdata object as an argument and returns nothing. You can use these callbacks to change \textsf{mathfont}'s default modifications or to modify a fontdata object before or after \textsf{mathfont} looks at it. Be aware that if you add a function to any of the |disable_nomath|, |add_math_constants|, or |fix_character_metrics| callbacks, Lua\TeX\ will not call the default |mathfont| function associated with the callback anymore. In other words, do not mess with these three callbacks unless you are duplicating the functionality of the corresponding ``Default Behavior'' function from table~4. 
 % 
 % We begin with the functions that modify character subtables in the font table, and in all cases, we return a new character table (or set of character tables in the case of type |e|) that we insert into the font object. For types |a| and |e|, we code the table from scratch, and for type |u|, we add information to the character tables that already exist in the font object. The three functions for assembling character tables take three arguments. The |index| argument is the unicode index of the base character that the function is modifying. The |charm_data| argument is the subtable in |mathfont| of charm information that corresponds to |index|, and the |fontdata| argument is a font object. We will pull information from |charm_data| and |fontdata| to assemble the new table.
 % 
@@ -2686,7 +2575,7 @@
 function mathfont.math_constants(fontdata)
   fontdata.MathConstants = fontdata.MathConstants or {}
 %    \end{macrocode}
-% First evaluate the dimensions from the font object that we will use in determining other math parameter values. The |A_height| is the height of the capital ``A'' character, and the |y_depth| is the depth of the minuscule ``y'' character. Both will be 0 if the font does not have the correct character.
+% First evaluate the dimensions from the font object that we will use in determining other math parameter values. The |A_height| is the height of the capital ``A'' character, and the |y_depth| is the depth of the lower-case ``y'' character. Both will be 0 if the font does not have the correct character.
 %    \begin{macrocode}
   local size = fontdata.size or 0
   local ex = fontdata.parameters.x_height or 0
@@ -3113,7 +3002,7 @@
 mathfont:new_type_a(305, 1044506, {100, 100, -150, 0}) % \imath
 mathfont:new_type_a(567, 1044507, {700, 50, -150, 0}) % \jmath
 %    \end{macrocode}
-% Capital Latin letters will fill unicode slots U+FF020 through U+FF039.
+% Upper-case Latin letters will fill unicode slots U+FF020 through U+FF039.
 %    \begin{macrocode}
 mathfont:new_type_a(65, 1044512, {50, 0, 150, 0}) % A
 mathfont:new_type_a(66, 1044513, {50, 0, 0, 0}) % B
@@ -3175,7 +3064,7 @@
 mathfont:new_type_u(962, {-50, 0}) % \varsigma
 mathfont:new_type_u(966, {0, 0}) % \varphi
 %    \end{macrocode}
-% Capital Greek characters. Same as previously.
+% Upper-case Greek characters. Same as previously.
 %    \begin{macrocode}
 mathfont:new_type_u(913, {0, 0}) % \Alpha
 mathfont:new_type_u(914, {0, 0}) % \Beta
@@ -3209,7 +3098,7 @@
   41, % )
   47, % /
   91, % [
-  92, % \
+  92, % backslash
   93, % ]
   123, % {
   125, % }
@@ -3719,7 +3608,7 @@
 \def\M at operator@set{%
   \ifM at adjust@font
     \edef\M at operator@num{\number\csname symM\M at operatorshape\@tempa\endcsname}
-    \def\M at default@latin at operator{%
+    \protected\edef\M at operator@mathcodes{%
       \Umathcode`A=7+\M at operator@num+`A\relax
       \Umathcode`B=7+\M at operator@num+`B\relax
       \Umathcode`C=7+\M at operator@num+`C\relax
@@ -3775,13 +3664,13 @@
       \Umathchardef\imath=7+\M at operator@num+1044506\relax
       \Umathchardef\jmath=7+\M at operator@num+1044500\relax}
   \else
-    \let\M at default@latin at operator\@empty
+    \let\M at operator@mathcodes\@empty
   \fi
 %    \end{macrocode}
 % Then we change the |\operator at font| definition and if necessary change the math codes.
 %    \begin{macrocode}
   \xdef\operator at font{\noexpand\mathgroup
-      \csname symM\M at operatorshape\@tempa\endcsname\M at default@latin at operator}}
+      \csname symM\M at operatorshape\@tempa\endcsname\M at operator@mathcodes}}
 %    \end{macrocode}
 % Set delimiters.\indexpage{keyworddelimiters=keyword \texttt{delimiters}}
 %    \begin{macrocode}
@@ -3807,7 +3696,7 @@
     \protected\gdef\backslash{\ifmmode\mathbackslash\else\textbackslash\fi}
     \protected\xdef\mathbackslash{%
       \Udelimiter+2+\number\csname sym\M at delimiters@font\endcsname
-        +92\relax} % \
+        +92\relax} % backslash
     \protected\xdef\lbrace{%
       \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
         +123\relax} % {
@@ -3885,7 +3774,7 @@
     \gdef\sqrtsign##1{\@sqrts at gn{\mkern\radicandoffset##1}}}
 \else
   \def\M at radical@set{%
-    \edef\M at radical@font{M\@radicalshape\@tempa}
+    \edef\M at radical@font{M\M at radicalshape\@tempa}
     \DeclareMathSymbol{\surd}{\mathord}{\M at radical@font}{"221A}}
 \fi
 %    \end{macrocode}
@@ -4346,311 +4235,352 @@
   \DeclareMathSymbol{\lcirclearrow}{\mathrel}{\M at arrows@font}{"27F2}
   \DeclareMathSymbol{\rcirclearrow}{\mathrel}{\M at arrows@font}{"27F3}}
 %    \end{macrocode}
-% Set blackboard bold letters and numbers.\indexpage{keywordbb=keyword \texttt{bb}}
+% Set blackboard bold letters and numbers. The alphanumeric keywords work a bit differently from the other font-setting commands. We define |\mathbb| here, which takes a single argument and is essentially a wrapper around |\M at bb@mathcodes|. That command changes the |\Umathcode|s of letters to the unicode hex values of corresponding blackboard-bold characters, and throughout, |\M at bb@num| stores the family number of the sumbol font for the |bb| character class. In the definition of |\mathbb|, we use |\begingroup| and |\endgroup| to avoid creating unexpected atoms. The other alphanumeric keywords work similarly.\indexpage{keywordbb=keyword \texttt{bb}}
 %    \begin{macrocode}
 \def\M at bb@set{%
-  \edef\M at bb@font{M\M at bbshape\@tempa}
-  \DeclareMathSymbol{\M at bb@A}{\mathord}{\M at bb@font}{"1D538}
-  \DeclareMathSymbol{\M at bb@B}{\mathord}{\M at bb@font}{"1D539}
-  \DeclareMathSymbol{\M at bb@C}{\mathord}{\M at bb@font}{"2102}
-  \DeclareMathSymbol{\M at bb@D}{\mathord}{\M at bb@font}{"1D53B}
-  \DeclareMathSymbol{\M at bb@E}{\mathord}{\M at bb@font}{"1D53C}
-  \DeclareMathSymbol{\M at bb@F}{\mathord}{\M at bb@font}{"1D53D}
-  \DeclareMathSymbol{\M at bb@G}{\mathord}{\M at bb@font}{"1D53E}
-  \DeclareMathSymbol{\M at bb@H}{\mathord}{\M at bb@font}{"210D}
-  \DeclareMathSymbol{\M at bb@I}{\mathord}{\M at bb@font}{"1D540}
-  \DeclareMathSymbol{\M at bb@J}{\mathord}{\M at bb@font}{"1D541}
-  \DeclareMathSymbol{\M at bb@K}{\mathord}{\M at bb@font}{"1D542}
-  \DeclareMathSymbol{\M at bb@L}{\mathord}{\M at bb@font}{"1D543}
-  \DeclareMathSymbol{\M at bb@M}{\mathord}{\M at bb@font}{"1D544}
-  \DeclareMathSymbol{\M at bb@N}{\mathord}{\M at bb@font}{"2115}
-  \DeclareMathSymbol{\M at bb@O}{\mathord}{\M at bb@font}{"1D546}
-  \DeclareMathSymbol{\M at bb@P}{\mathord}{\M at bb@font}{"2119}
-  \DeclareMathSymbol{\M at bb@Q}{\mathord}{\M at bb@font}{"211A}
-  \DeclareMathSymbol{\M at bb@R}{\mathord}{\M at bb@font}{"211D}
-  \DeclareMathSymbol{\M at bb@S}{\mathord}{\M at bb@font}{"1D54A}
-  \DeclareMathSymbol{\M at bb@T}{\mathord}{\M at bb@font}{"1D54B}
-  \DeclareMathSymbol{\M at bb@U}{\mathord}{\M at bb@font}{"1D54C}
-  \DeclareMathSymbol{\M at bb@V}{\mathord}{\M at bb@font}{"1D54D}
-  \DeclareMathSymbol{\M at bb@W}{\mathord}{\M at bb@font}{"1D54E}
-  \DeclareMathSymbol{\M at bb@X}{\mathord}{\M at bb@font}{"1D54F}
-  \DeclareMathSymbol{\M at bb@Y}{\mathord}{\M at bb@font}{"1D550}
-  \DeclareMathSymbol{\M at bb@Z}{\mathord}{\M at bb@font}{"2124}
-  \DeclareMathSymbol{\M at bb@a}{\mathord}{\M at bb@font}{"1D552}
-  \DeclareMathSymbol{\M at bb@b}{\mathord}{\M at bb@font}{"1D553}
-  \DeclareMathSymbol{\M at bb@c}{\mathord}{\M at bb@font}{"1D554}
-  \DeclareMathSymbol{\M at bb@d}{\mathord}{\M at bb@font}{"1D555}
-  \DeclareMathSymbol{\M at bb@e}{\mathord}{\M at bb@font}{"1D556}
-  \DeclareMathSymbol{\M at bb@f}{\mathord}{\M at bb@font}{"1D557}
-  \DeclareMathSymbol{\M at bb@g}{\mathord}{\M at bb@font}{"1D558}
-  \DeclareMathSymbol{\M at bb@h}{\mathord}{\M at bb@font}{"1D559}
-  \DeclareMathSymbol{\M at bb@i}{\mathord}{\M at bb@font}{"1D55A}
-  \DeclareMathSymbol{\M at bb@j}{\mathord}{\M at bb@font}{"1D55B}
-  \DeclareMathSymbol{\M at bb@k}{\mathord}{\M at bb@font}{"1D55C}
-  \DeclareMathSymbol{\M at bb@l}{\mathord}{\M at bb@font}{"1D55D}
-  \DeclareMathSymbol{\M at bb@m}{\mathord}{\M at bb@font}{"1D55E}
-  \DeclareMathSymbol{\M at bb@n}{\mathord}{\M at bb@font}{"1D55F}
-  \DeclareMathSymbol{\M at bb@o}{\mathord}{\M at bb@font}{"1D560}
-  \DeclareMathSymbol{\M at bb@p}{\mathord}{\M at bb@font}{"1D561}
-  \DeclareMathSymbol{\M at bb@q}{\mathord}{\M at bb@font}{"1D562}
-  \DeclareMathSymbol{\M at bb@r}{\mathord}{\M at bb@font}{"1D563}
-  \DeclareMathSymbol{\M at bb@s}{\mathord}{\M at bb@font}{"1D564}
-  \DeclareMathSymbol{\M at bb@t}{\mathord}{\M at bb@font}{"1D565}
-  \DeclareMathSymbol{\M at bb@u}{\mathord}{\M at bb@font}{"1D566}
-  \DeclareMathSymbol{\M at bb@v}{\mathord}{\M at bb@font}{"1D567}
-  \DeclareMathSymbol{\M at bb@w}{\mathord}{\M at bb@font}{"1D568}
-  \DeclareMathSymbol{\M at bb@x}{\mathord}{\M at bb@font}{"1D569}
-  \DeclareMathSymbol{\M at bb@y}{\mathord}{\M at bb@font}{"1D56A}
-  \DeclareMathSymbol{\M at bb@z}{\mathord}{\M at bb@font}{"1D56B}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@0\endcsname}{\mathord}{\M at bb@font}{"1D7D8}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@1\endcsname}{\mathord}{\M at bb@font}{"1D7D9}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@2\endcsname}{\mathord}{\M at bb@font}{"1D7DA}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@3\endcsname}{\mathord}{\M at bb@font}{"1D7DB}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@4\endcsname}{\mathord}{\M at bb@font}{"1D7DC}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@5\endcsname}{\mathord}{\M at bb@font}{"1D7DD}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@6\endcsname}{\mathord}{\M at bb@font}{"1D7DE}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@7\endcsname}{\mathord}{\M at bb@font}{"1D7DF}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@8\endcsname}{\mathord}{\M at bb@font}{"1D7E0}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@9\endcsname}{\mathord}{\M at bb@font}{"1D7E1}}
+  \protected\def\mathbb##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathbb
+      $%
+    \fi
+    \begingroup
+      \M at bb@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at bb@num{\number\csname symM\M at bbshape\@tempa\endcsname}
+  \protected\edef\M at bb@mathcodes{%
+  \Umathcode`A=0+\M at bb@num"1D538\relax
+  \Umathcode`B=0+\M at bb@num"1D539\relax
+  \Umathcode`C=0+\M at bb@num"2102\relax
+  \Umathcode`D=0+\M at bb@num"1D53B\relax
+  \Umathcode`E=0+\M at bb@num"1D53C\relax
+  \Umathcode`F=0+\M at bb@num"1D53D\relax
+  \Umathcode`G=0+\M at bb@num"1D53E\relax
+  \Umathcode`H=0+\M at bb@num"210D\relax
+  \Umathcode`I=0+\M at bb@num"1D540\relax
+  \Umathcode`J=0+\M at bb@num"1D541\relax
+  \Umathcode`K=0+\M at bb@num"1D542\relax
+  \Umathcode`L=0+\M at bb@num"1D543\relax
+  \Umathcode`M=0+\M at bb@num"1D544\relax
+  \Umathcode`N=0+\M at bb@num"2115\relax
+  \Umathcode`O=0+\M at bb@num"1D546\relax
+  \Umathcode`P=0+\M at bb@num"2119\relax
+  \Umathcode`Q=0+\M at bb@num"211A\relax
+  \Umathcode`R=0+\M at bb@num"211D\relax
+  \Umathcode`S=0+\M at bb@num"1D54A\relax
+  \Umathcode`T=0+\M at bb@num"1D54B\relax
+  \Umathcode`U=0+\M at bb@num"1D54C\relax
+  \Umathcode`V=0+\M at bb@num"1D54D\relax
+  \Umathcode`W=0+\M at bb@num"1D54E\relax
+  \Umathcode`X=0+\M at bb@num"1D54F\relax
+  \Umathcode`Y=0+\M at bb@num"1D550\relax
+  \Umathcode`Z=0+\M at bb@num"2124\relax
+  \Umathcode`a=0+\M at bb@num"1D552\relax
+  \Umathcode`b=0+\M at bb@num"1D553\relax
+  \Umathcode`c=0+\M at bb@num"1D554\relax
+  \Umathcode`d=0+\M at bb@num"1D555\relax
+  \Umathcode`e=0+\M at bb@num"1D556\relax
+  \Umathcode`f=0+\M at bb@num"1D557\relax
+  \Umathcode`g=0+\M at bb@num"1D558\relax
+  \Umathcode`h=0+\M at bb@num"1D559\relax
+  \Umathcode`i=0+\M at bb@num"1D55A\relax
+  \Umathcode`j=0+\M at bb@num"1D55B\relax
+  \Umathcode`k=0+\M at bb@num"1D55C\relax
+  \Umathcode`l=0+\M at bb@num"1D55D\relax
+  \Umathcode`m=0+\M at bb@num"1D55E\relax
+  \Umathcode`n=0+\M at bb@num"1D55F\relax
+  \Umathcode`o=0+\M at bb@num"1D560\relax
+  \Umathcode`p=0+\M at bb@num"1D561\relax
+  \Umathcode`q=0+\M at bb@num"1D562\relax
+  \Umathcode`r=0+\M at bb@num"1D563\relax
+  \Umathcode`s=0+\M at bb@num"1D564\relax
+  \Umathcode`t=0+\M at bb@num"1D565\relax
+  \Umathcode`u=0+\M at bb@num"1D566\relax
+  \Umathcode`v=0+\M at bb@num"1D567\relax
+  \Umathcode`w=0+\M at bb@num"1D568\relax
+  \Umathcode`x=0+\M at bb@num"1D569\relax
+  \Umathcode`y=0+\M at bb@num"1D56A\relax
+  \Umathcode`z=0+\M at bb@num"1D56B\relax
+  \Umathcode`0=0+\M at bb@num"1D7D8\relax
+  \Umathcode`1=0+\M at bb@num"1D7D9\relax
+  \Umathcode`2=0+\M at bb@num"1D7DA\relax
+  \Umathcode`3=0+\M at bb@num"1D7DB\relax
+  \Umathcode`4=0+\M at bb@num"1D7DC\relax
+  \Umathcode`5=0+\M at bb@num"1D7DD\relax
+  \Umathcode`6=0+\M at bb@num"1D7DE\relax
+  \Umathcode`7=0+\M at bb@num"1D7DF\relax
+  \Umathcode`8=0+\M at bb@num"1D7E0\relax
+  \Umathcode`9=0+\M at bb@num"1D7E1\relax}}
 %    \end{macrocode}
 % Set caligraphic letters.\indexpage{keywordcal=keyword \texttt{cal}}
 %    \begin{macrocode}
 \def\M at cal@set{%
-  \edef\M at cal@font{M\M at calshape\@tempa}
-  \DeclareMathSymbol{\M at cal@A}{\mathord}{\M at cal@font}{"1D49C}
-  \DeclareMathSymbol{\M at cal@B}{\mathord}{\M at cal@font}{"212C}
-  \DeclareMathSymbol{\M at cal@C}{\mathord}{\M at cal@font}{"1D49E}
-  \DeclareMathSymbol{\M at cal@D}{\mathord}{\M at cal@font}{"1D49F}
-  \DeclareMathSymbol{\M at cal@E}{\mathord}{\M at cal@font}{"2130}
-  \DeclareMathSymbol{\M at cal@F}{\mathord}{\M at cal@font}{"2131}
-  \DeclareMathSymbol{\M at cal@G}{\mathord}{\M at cal@font}{"1D4A2}
-  \DeclareMathSymbol{\M at cal@H}{\mathord}{\M at cal@font}{"210B}
-  \DeclareMathSymbol{\M at cal@I}{\mathord}{\M at cal@font}{"2110}
-  \DeclareMathSymbol{\M at cal@J}{\mathord}{\M at cal@font}{"1D4A5}
-  \DeclareMathSymbol{\M at cal@K}{\mathord}{\M at cal@font}{"1D4A6}
-  \DeclareMathSymbol{\M at cal@L}{\mathord}{\M at cal@font}{"2112}
-  \DeclareMathSymbol{\M at cal@M}{\mathord}{\M at cal@font}{"2133}
-  \DeclareMathSymbol{\M at cal@N}{\mathord}{\M at cal@font}{"1D4A9}
-  \DeclareMathSymbol{\M at cal@O}{\mathord}{\M at cal@font}{"1D4AA}
-  \DeclareMathSymbol{\M at cal@P}{\mathord}{\M at cal@font}{"1D4AB}
-  \DeclareMathSymbol{\M at cal@Q}{\mathord}{\M at cal@font}{"1D4AC}
-  \DeclareMathSymbol{\M at cal@R}{\mathord}{\M at cal@font}{"211B}
-  \DeclareMathSymbol{\M at cal@S}{\mathord}{\M at cal@font}{"1D4AE}
-  \DeclareMathSymbol{\M at cal@T}{\mathord}{\M at cal@font}{"1D4AF}
-  \DeclareMathSymbol{\M at cal@U}{\mathord}{\M at cal@font}{"1D4B0}
-  \DeclareMathSymbol{\M at cal@V}{\mathord}{\M at cal@font}{"1D4B1}
-  \DeclareMathSymbol{\M at cal@W}{\mathord}{\M at cal@font}{"1D4B2}
-  \DeclareMathSymbol{\M at cal@X}{\mathord}{\M at cal@font}{"1D4B3}
-  \DeclareMathSymbol{\M at cal@Y}{\mathord}{\M at cal@font}{"1D4B4}
-  \DeclareMathSymbol{\M at cal@Z}{\mathord}{\M at cal@font}{"1D4B5}
-  \DeclareMathSymbol{\M at cal@a}{\mathord}{\M at cal@font}{"1D4B6}
-  \DeclareMathSymbol{\M at cal@b}{\mathord}{\M at cal@font}{"1D4B7}
-  \DeclareMathSymbol{\M at cal@c}{\mathord}{\M at cal@font}{"1D4B8}
-  \DeclareMathSymbol{\M at cal@d}{\mathord}{\M at cal@font}{"1D4B9}
-  \DeclareMathSymbol{\M at cal@e}{\mathord}{\M at cal@font}{"212F}
-  \DeclareMathSymbol{\M at cal@f}{\mathord}{\M at cal@font}{"1D4BB}
-  \DeclareMathSymbol{\M at cal@g}{\mathord}{\M at cal@font}{"210A}
-  \DeclareMathSymbol{\M at cal@h}{\mathord}{\M at cal@font}{"1D4BD}
-  \DeclareMathSymbol{\M at cal@i}{\mathord}{\M at cal@font}{"1D4BE}
-  \DeclareMathSymbol{\M at cal@j}{\mathord}{\M at cal@font}{"1D4BF}
-  \DeclareMathSymbol{\M at cal@k}{\mathord}{\M at cal@font}{"1D4C0}
-  \DeclareMathSymbol{\M at cal@l}{\mathord}{\M at cal@font}{"1D4C1}
-  \DeclareMathSymbol{\M at cal@m}{\mathord}{\M at cal@font}{"1D4C2}
-  \DeclareMathSymbol{\M at cal@n}{\mathord}{\M at cal@font}{"1D4C3}
-  \DeclareMathSymbol{\M at cal@o}{\mathord}{\M at cal@font}{"2134}
-  \DeclareMathSymbol{\M at cal@p}{\mathord}{\M at cal@font}{"1D4C5}
-  \DeclareMathSymbol{\M at cal@q}{\mathord}{\M at cal@font}{"1D4C6}
-  \DeclareMathSymbol{\M at cal@r}{\mathord}{\M at cal@font}{"1D4C7}
-  \DeclareMathSymbol{\M at cal@s}{\mathord}{\M at cal@font}{"1D4C8}
-  \DeclareMathSymbol{\M at cal@t}{\mathord}{\M at cal@font}{"1D4C9}
-  \DeclareMathSymbol{\M at cal@u}{\mathord}{\M at cal@font}{"1D4CA}
-  \DeclareMathSymbol{\M at cal@v}{\mathord}{\M at cal@font}{"1D4CB}
-  \DeclareMathSymbol{\M at cal@w}{\mathord}{\M at cal@font}{"1D4CC}
-  \DeclareMathSymbol{\M at cal@x}{\mathord}{\M at cal@font}{"1D4CD}
-  \DeclareMathSymbol{\M at cal@y}{\mathord}{\M at cal@font}{"1D4CE}
-  \DeclareMathSymbol{\M at cal@z}{\mathord}{\M at cal@font}{"1D4CF}}
+  \protected\def\mathcal##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathcal
+      $%
+    \fi
+    \begingroup
+      \M at cal@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at cal@num{\number\csname symM\M at calshape\@tempa\endcsname}
+  \protected\edef\M at cal@mathcodes{%
+  \Umathcode`A=0+\M at cal@num"1D49C\relax
+  \Umathcode`B=0+\M at cal@num"212C\relax
+  \Umathcode`C=0+\M at cal@num"1D49E\relax
+  \Umathcode`D=0+\M at cal@num"1D49F\relax
+  \Umathcode`E=0+\M at cal@num"2130\relax
+  \Umathcode`F=0+\M at cal@num"2131\relax
+  \Umathcode`G=0+\M at cal@num"1D4A2\relax
+  \Umathcode`H=0+\M at cal@num"210B\relax
+  \Umathcode`I=0+\M at cal@num"2110\relax
+  \Umathcode`J=0+\M at cal@num"1D4A5\relax
+  \Umathcode`K=0+\M at cal@num"1D4A6\relax
+  \Umathcode`L=0+\M at cal@num"2112\relax
+  \Umathcode`M=0+\M at cal@num"2133\relax
+  \Umathcode`N=0+\M at cal@num"1D4A9\relax
+  \Umathcode`O=0+\M at cal@num"1D4AA\relax
+  \Umathcode`P=0+\M at cal@num"1D4AB\relax
+  \Umathcode`Q=0+\M at cal@num"1D4AC\relax
+  \Umathcode`R=0+\M at cal@num"211B\relax
+  \Umathcode`S=0+\M at cal@num"1D4AE\relax
+  \Umathcode`T=0+\M at cal@num"1D4AF\relax
+  \Umathcode`U=0+\M at cal@num"1D4B0\relax
+  \Umathcode`V=0+\M at cal@num"1D4B1\relax
+  \Umathcode`W=0+\M at cal@num"1D4B2\relax
+  \Umathcode`X=0+\M at cal@num"1D4B3\relax
+  \Umathcode`Y=0+\M at cal@num"1D4B4\relax
+  \Umathcode`Z=0+\M at cal@num"1D4B5\relax
+  \Umathcode`a=0+\M at cal@num"1D4B6\relax
+  \Umathcode`b=0+\M at cal@num"1D4B7\relax
+  \Umathcode`c=0+\M at cal@num"1D4B8\relax
+  \Umathcode`d=0+\M at cal@num"1D4B9\relax
+  \Umathcode`e=0+\M at cal@num"212F\relax
+  \Umathcode`f=0+\M at cal@num"1D4BB\relax
+  \Umathcode`g=0+\M at cal@num"210A\relax
+  \Umathcode`h=0+\M at cal@num"1D4BD\relax
+  \Umathcode`i=0+\M at cal@num"1D4BE\relax
+  \Umathcode`j=0+\M at cal@num"1D4BF\relax
+  \Umathcode`k=0+\M at cal@num"1D4C0\relax
+  \Umathcode`l=0+\M at cal@num"1D4C1\relax
+  \Umathcode`m=0+\M at cal@num"1D4C2\relax
+  \Umathcode`n=0+\M at cal@num"1D4C3\relax
+  \Umathcode`o=0+\M at cal@num"2134\relax
+  \Umathcode`p=0+\M at cal@num"1D4C5\relax
+  \Umathcode`q=0+\M at cal@num"1D4C6\relax
+  \Umathcode`r=0+\M at cal@num"1D4C7\relax
+  \Umathcode`s=0+\M at cal@num"1D4C8\relax
+  \Umathcode`t=0+\M at cal@num"1D4C9\relax
+  \Umathcode`u=0+\M at cal@num"1D4CA\relax
+  \Umathcode`v=0+\M at cal@num"1D4CB\relax
+  \Umathcode`w=0+\M at cal@num"1D4CC\relax
+  \Umathcode`x=0+\M at cal@num"1D4CD\relax
+  \Umathcode`y=0+\M at cal@num"1D4CE\relax
+  \Umathcode`z=0+\M at cal@num"1D4CF\relax}}
 %    \end{macrocode}
 % Set fraktur letters.\indexpage{keywordfrak=keyword \texttt{frak}}
 %    \begin{macrocode}
 \def\M at frak@set{%
-  \edef\M at frak@font{M\M at frakshape\@tempa}
-  \DeclareMathSymbol{\M at frak@A}{\mathord}{\M at frak@font}{"1D504}
-  \DeclareMathSymbol{\M at frak@B}{\mathord}{\M at frak@font}{"1D505}
-  \DeclareMathSymbol{\M at frak@C}{\mathord}{\M at frak@font}{"212D}
-  \DeclareMathSymbol{\M at frak@D}{\mathord}{\M at frak@font}{"1D507}
-  \DeclareMathSymbol{\M at frak@E}{\mathord}{\M at frak@font}{"1D508}
-  \DeclareMathSymbol{\M at frak@F}{\mathord}{\M at frak@font}{"1D509}
-  \DeclareMathSymbol{\M at frak@G}{\mathord}{\M at frak@font}{"1D50A}
-  \DeclareMathSymbol{\M at frak@H}{\mathord}{\M at frak@font}{"210C}
-  \DeclareMathSymbol{\M at frak@I}{\mathord}{\M at frak@font}{"2111}
-  \DeclareMathSymbol{\M at frak@J}{\mathord}{\M at frak@font}{"1D50D}
-  \DeclareMathSymbol{\M at frak@K}{\mathord}{\M at frak@font}{"1D50E}
-  \DeclareMathSymbol{\M at frak@L}{\mathord}{\M at frak@font}{"1D50F}
-  \DeclareMathSymbol{\M at frak@M}{\mathord}{\M at frak@font}{"1D510}
-  \DeclareMathSymbol{\M at frak@N}{\mathord}{\M at frak@font}{"1D511}
-  \DeclareMathSymbol{\M at frak@O}{\mathord}{\M at frak@font}{"1D512}
-  \DeclareMathSymbol{\M at frak@P}{\mathord}{\M at frak@font}{"1D513}
-  \DeclareMathSymbol{\M at frak@Q}{\mathord}{\M at frak@font}{"1D514}
-  \DeclareMathSymbol{\M at frak@R}{\mathord}{\M at frak@font}{"211C}
-  \DeclareMathSymbol{\M at frak@S}{\mathord}{\M at frak@font}{"1D516}
-  \DeclareMathSymbol{\M at frak@T}{\mathord}{\M at frak@font}{"1D517}
-  \DeclareMathSymbol{\M at frak@U}{\mathord}{\M at frak@font}{"1D518}
-  \DeclareMathSymbol{\M at frak@V}{\mathord}{\M at frak@font}{"1D519}
-  \DeclareMathSymbol{\M at frak@W}{\mathord}{\M at frak@font}{"1D51A}
-  \DeclareMathSymbol{\M at frak@X}{\mathord}{\M at frak@font}{"1D51B}
-  \DeclareMathSymbol{\M at frak@Y}{\mathord}{\M at frak@font}{"1D51C}
-  \DeclareMathSymbol{\M at frak@Z}{\mathord}{\M at frak@font}{"2128}
-  \DeclareMathSymbol{\M at frak@a}{\mathord}{\M at frak@font}{"1D51E}
-  \DeclareMathSymbol{\M at frak@b}{\mathord}{\M at frak@font}{"1D51F}
-  \DeclareMathSymbol{\M at frak@c}{\mathord}{\M at frak@font}{"1D520}
-  \DeclareMathSymbol{\M at frak@d}{\mathord}{\M at frak@font}{"1D521}
-  \DeclareMathSymbol{\M at frak@e}{\mathord}{\M at frak@font}{"1D522}
-  \DeclareMathSymbol{\M at frak@f}{\mathord}{\M at frak@font}{"1D523}
-  \DeclareMathSymbol{\M at frak@g}{\mathord}{\M at frak@font}{"1D524}
-  \DeclareMathSymbol{\M at frak@h}{\mathord}{\M at frak@font}{"1D525}
-  \DeclareMathSymbol{\M at frak@i}{\mathord}{\M at frak@font}{"1D526}
-  \DeclareMathSymbol{\M at frak@j}{\mathord}{\M at frak@font}{"1D527}
-  \DeclareMathSymbol{\M at frak@k}{\mathord}{\M at frak@font}{"1D528}
-  \DeclareMathSymbol{\M at frak@l}{\mathord}{\M at frak@font}{"1D529}
-  \DeclareMathSymbol{\M at frak@m}{\mathord}{\M at frak@font}{"1D52A}
-  \DeclareMathSymbol{\M at frak@n}{\mathord}{\M at frak@font}{"1D52B}
-  \DeclareMathSymbol{\M at frak@o}{\mathord}{\M at frak@font}{"1D52C}
-  \DeclareMathSymbol{\M at frak@p}{\mathord}{\M at frak@font}{"1D52D}
-  \DeclareMathSymbol{\M at frak@q}{\mathord}{\M at frak@font}{"1D52E}
-  \DeclareMathSymbol{\M at frak@r}{\mathord}{\M at frak@font}{"1D52F}
-  \DeclareMathSymbol{\M at frak@s}{\mathord}{\M at frak@font}{"1D530}
-  \DeclareMathSymbol{\M at frak@t}{\mathord}{\M at frak@font}{"1D531}
-  \DeclareMathSymbol{\M at frak@u}{\mathord}{\M at frak@font}{"1D532}
-  \DeclareMathSymbol{\M at frak@v}{\mathord}{\M at frak@font}{"1D533}
-  \DeclareMathSymbol{\M at frak@w}{\mathord}{\M at frak@font}{"1D534}
-  \DeclareMathSymbol{\M at frak@x}{\mathord}{\M at frak@font}{"1D535}
-  \DeclareMathSymbol{\M at frak@y}{\mathord}{\M at frak@font}{"1D536}
-  \DeclareMathSymbol{\M at frak@z}{\mathord}{\M at frak@font}{"1D537}}
+  \protected\def\mathfrak##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathfrak
+      $%
+    \fi
+    \begingroup
+      \M at frak@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at frak@num{\number\csname symM\M at frakshape\@tempa\endcsname}
+  \protected\edef\M at frak@mathcodes{%
+  \Umathcode`A=0+\M at frak@num"1D504\relax
+  \Umathcode`B=0+\M at frak@num"1D505\relax
+  \Umathcode`C=0+\M at frak@num"212D\relax
+  \Umathcode`D=0+\M at frak@num"1D507\relax
+  \Umathcode`E=0+\M at frak@num"1D508\relax
+  \Umathcode`F=0+\M at frak@num"1D509\relax
+  \Umathcode`G=0+\M at frak@num"1D50A\relax
+  \Umathcode`H=0+\M at frak@num"210C\relax
+  \Umathcode`I=0+\M at frak@num"2111\relax
+  \Umathcode`J=0+\M at frak@num"1D50D\relax
+  \Umathcode`K=0+\M at frak@num"1D50E\relax
+  \Umathcode`L=0+\M at frak@num"1D50F\relax
+  \Umathcode`M=0+\M at frak@num"1D510\relax
+  \Umathcode`N=0+\M at frak@num"1D511\relax
+  \Umathcode`O=0+\M at frak@num"1D512\relax
+  \Umathcode`P=0+\M at frak@num"1D513\relax
+  \Umathcode`Q=0+\M at frak@num"1D514\relax
+  \Umathcode`R=0+\M at frak@num"211C\relax
+  \Umathcode`S=0+\M at frak@num"1D516\relax
+  \Umathcode`T=0+\M at frak@num"1D517\relax
+  \Umathcode`U=0+\M at frak@num"1D518\relax
+  \Umathcode`V=0+\M at frak@num"1D519\relax
+  \Umathcode`W=0+\M at frak@num"1D51A\relax
+  \Umathcode`X=0+\M at frak@num"1D51B\relax
+  \Umathcode`Y=0+\M at frak@num"1D51C\relax
+  \Umathcode`Z=0+\M at frak@num"2128\relax
+  \Umathcode`a=0+\M at frak@num"1D51E\relax
+  \Umathcode`b=0+\M at frak@num"1D51F\relax
+  \Umathcode`c=0+\M at frak@num"1D520\relax
+  \Umathcode`d=0+\M at frak@num"1D521\relax
+  \Umathcode`e=0+\M at frak@num"1D522\relax
+  \Umathcode`f=0+\M at frak@num"1D523\relax
+  \Umathcode`g=0+\M at frak@num"1D524\relax
+  \Umathcode`h=0+\M at frak@num"1D525\relax
+  \Umathcode`i=0+\M at frak@num"1D526\relax
+  \Umathcode`j=0+\M at frak@num"1D527\relax
+  \Umathcode`k=0+\M at frak@num"1D528\relax
+  \Umathcode`l=0+\M at frak@num"1D529\relax
+  \Umathcode`m=0+\M at frak@num"1D52A\relax
+  \Umathcode`n=0+\M at frak@num"1D52B\relax
+  \Umathcode`o=0+\M at frak@num"1D52C\relax
+  \Umathcode`p=0+\M at frak@num"1D52D\relax
+  \Umathcode`q=0+\M at frak@num"1D52E\relax
+  \Umathcode`r=0+\M at frak@num"1D52F\relax
+  \Umathcode`s=0+\M at frak@num"1D530\relax
+  \Umathcode`t=0+\M at frak@num"1D531\relax
+  \Umathcode`u=0+\M at frak@num"1D532\relax
+  \Umathcode`v=0+\M at frak@num"1D533\relax
+  \Umathcode`w=0+\M at frak@num"1D534\relax
+  \Umathcode`x=0+\M at frak@num"1D535\relax
+  \Umathcode`y=0+\M at frak@num"1D536\relax
+  \Umathcode`z=0+\M at frak@num"1D537\relax}}
 %    \end{macrocode}
 % Set bold caligraphic letters.\indexpage{keywordbcal=keyword \texttt{bcal}}
 %    \begin{macrocode}
 \def\M at bcal@set{%
-  \edef\M at bcal@font{M\M at bcalshape\@tempa}
-  \DeclareMathSymbol{\M at bcal@A}{\mathord}{\M at bcal@font}{"1D4D0}
-  \DeclareMathSymbol{\M at bcal@B}{\mathord}{\M at bcal@font}{"1D4D1}
-  \DeclareMathSymbol{\M at bcal@C}{\mathord}{\M at bcal@font}{"1D4D2}
-  \DeclareMathSymbol{\M at bcal@D}{\mathord}{\M at bcal@font}{"1D4D3}
-  \DeclareMathSymbol{\M at bcal@E}{\mathord}{\M at bcal@font}{"1D4D4}
-  \DeclareMathSymbol{\M at bcal@F}{\mathord}{\M at bcal@font}{"1D4D5}
-  \DeclareMathSymbol{\M at bcal@G}{\mathord}{\M at bcal@font}{"1D4D6}
-  \DeclareMathSymbol{\M at bcal@H}{\mathord}{\M at bcal@font}{"1D4D7}
-  \DeclareMathSymbol{\M at bcal@I}{\mathord}{\M at bcal@font}{"1D4D8}
-  \DeclareMathSymbol{\M at bcal@J}{\mathord}{\M at bcal@font}{"1D4D9}
-  \DeclareMathSymbol{\M at bcal@K}{\mathord}{\M at bcal@font}{"1D4DA}
-  \DeclareMathSymbol{\M at bcal@L}{\mathord}{\M at bcal@font}{"1D4DB}
-  \DeclareMathSymbol{\M at bcal@M}{\mathord}{\M at bcal@font}{"1D4DC}
-  \DeclareMathSymbol{\M at bcal@N}{\mathord}{\M at bcal@font}{"1D4DD}
-  \DeclareMathSymbol{\M at bcal@O}{\mathord}{\M at bcal@font}{"1D4DE}
-  \DeclareMathSymbol{\M at bcal@P}{\mathord}{\M at bcal@font}{"1D4DF}
-  \DeclareMathSymbol{\M at bcal@Q}{\mathord}{\M at bcal@font}{"1D4E0}
-  \DeclareMathSymbol{\M at bcal@R}{\mathord}{\M at bcal@font}{"1D4E1}
-  \DeclareMathSymbol{\M at bcal@S}{\mathord}{\M at bcal@font}{"1D4E2}
-  \DeclareMathSymbol{\M at bcal@T}{\mathord}{\M at bcal@font}{"1D4E3}
-  \DeclareMathSymbol{\M at bcal@U}{\mathord}{\M at bcal@font}{"1D4E4}
-  \DeclareMathSymbol{\M at bcal@V}{\mathord}{\M at bcal@font}{"1D4E5}
-  \DeclareMathSymbol{\M at bcal@W}{\mathord}{\M at bcal@font}{"1D4E6}
-  \DeclareMathSymbol{\M at bcal@X}{\mathord}{\M at bcal@font}{"1D4E7}
-  \DeclareMathSymbol{\M at bcal@Y}{\mathord}{\M at bcal@font}{"1D4E8}
-  \DeclareMathSymbol{\M at bcal@Z}{\mathord}{\M at bcal@font}{"1D4E9}
-  \DeclareMathSymbol{\M at bcal@a}{\mathord}{\M at bcal@font}{"1D4EA}
-  \DeclareMathSymbol{\M at bcal@b}{\mathord}{\M at bcal@font}{"1D4EB}
-  \DeclareMathSymbol{\M at bcal@c}{\mathord}{\M at bcal@font}{"1D4EC}
-  \DeclareMathSymbol{\M at bcal@d}{\mathord}{\M at bcal@font}{"1D4ED}
-  \DeclareMathSymbol{\M at bcal@e}{\mathord}{\M at bcal@font}{"1D4EE}
-  \DeclareMathSymbol{\M at bcal@f}{\mathord}{\M at bcal@font}{"1D4EF}
-  \DeclareMathSymbol{\M at bcal@g}{\mathord}{\M at bcal@font}{"1D4F0}
-  \DeclareMathSymbol{\M at bcal@h}{\mathord}{\M at bcal@font}{"1D4F1}
-  \DeclareMathSymbol{\M at bcal@i}{\mathord}{\M at bcal@font}{"1D4F2}
-  \DeclareMathSymbol{\M at bcal@j}{\mathord}{\M at bcal@font}{"1D4F3}
-  \DeclareMathSymbol{\M at bcal@k}{\mathord}{\M at bcal@font}{"1D4F4}
-  \DeclareMathSymbol{\M at bcal@l}{\mathord}{\M at bcal@font}{"1D4F5}
-  \DeclareMathSymbol{\M at bcal@m}{\mathord}{\M at bcal@font}{"1D4F6}
-  \DeclareMathSymbol{\M at bcal@n}{\mathord}{\M at bcal@font}{"1D4F7}
-  \DeclareMathSymbol{\M at bcal@o}{\mathord}{\M at bcal@font}{"1D4F8}
-  \DeclareMathSymbol{\M at bcal@p}{\mathord}{\M at bcal@font}{"1D4F9}
-  \DeclareMathSymbol{\M at bcal@q}{\mathord}{\M at bcal@font}{"1D4FA}
-  \DeclareMathSymbol{\M at bcal@r}{\mathord}{\M at bcal@font}{"1D4FB}
-  \DeclareMathSymbol{\M at bcal@s}{\mathord}{\M at bcal@font}{"1D4FC}
-  \DeclareMathSymbol{\M at bcal@t}{\mathord}{\M at bcal@font}{"1D4FD}
-  \DeclareMathSymbol{\M at bcal@u}{\mathord}{\M at bcal@font}{"1D4FE}
-  \DeclareMathSymbol{\M at bcal@v}{\mathord}{\M at bcal@font}{"1D4FF}
-  \DeclareMathSymbol{\M at bcal@w}{\mathord}{\M at bcal@font}{"1D500}
-  \DeclareMathSymbol{\M at bcal@x}{\mathord}{\M at bcal@font}{"1D501}
-  \DeclareMathSymbol{\M at bcal@y}{\mathord}{\M at bcal@font}{"1D502}
-  \DeclareMathSymbol{\M at bcal@z}{\mathord}{\M at bcal@font}{"1D503}}
+  \protected\def\mathbcal##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathbcal
+      $%
+    \fi
+    \begingroup
+      \M at bcal@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at bcal@num{\number\csname symM\M at bcalshape\@tempa\endcsname}
+  \protected\edef\M at bcal@mathcodes{%
+  \Umathcode`A=0+\M at bcal@num"1D4D0\relax
+  \Umathcode`B=0+\M at bcal@num"1D4D1\relax
+  \Umathcode`C=0+\M at bcal@num"1D4D2\relax
+  \Umathcode`D=0+\M at bcal@num"1D4D3\relax
+  \Umathcode`E=0+\M at bcal@num"1D4D4\relax
+  \Umathcode`F=0+\M at bcal@num"1D4D5\relax
+  \Umathcode`G=0+\M at bcal@num"1D4D6\relax
+  \Umathcode`H=0+\M at bcal@num"1D4D7\relax
+  \Umathcode`I=0+\M at bcal@num"1D4D8\relax
+  \Umathcode`J=0+\M at bcal@num"1D4D9\relax
+  \Umathcode`K=0+\M at bcal@num"1D4DA\relax
+  \Umathcode`L=0+\M at bcal@num"1D4DB\relax
+  \Umathcode`M=0+\M at bcal@num"1D4DC\relax
+  \Umathcode`N=0+\M at bcal@num"1D4DD\relax
+  \Umathcode`O=0+\M at bcal@num"1D4DE\relax
+  \Umathcode`P=0+\M at bcal@num"1D4DF\relax
+  \Umathcode`Q=0+\M at bcal@num"1D4E0\relax
+  \Umathcode`R=0+\M at bcal@num"1D4E1\relax
+  \Umathcode`S=0+\M at bcal@num"1D4E2\relax
+  \Umathcode`T=0+\M at bcal@num"1D4E3\relax
+  \Umathcode`U=0+\M at bcal@num"1D4E4\relax
+  \Umathcode`V=0+\M at bcal@num"1D4E5\relax
+  \Umathcode`W=0+\M at bcal@num"1D4E6\relax
+  \Umathcode`X=0+\M at bcal@num"1D4E7\relax
+  \Umathcode`Y=0+\M at bcal@num"1D4E8\relax
+  \Umathcode`Z=0+\M at bcal@num"1D4E9\relax
+  \Umathcode`a=0+\M at bcal@num"1D4EA\relax
+  \Umathcode`b=0+\M at bcal@num"1D4EB\relax
+  \Umathcode`c=0+\M at bcal@num"1D4EC\relax
+  \Umathcode`d=0+\M at bcal@num"1D4ED\relax
+  \Umathcode`e=0+\M at bcal@num"1D4EE\relax
+  \Umathcode`f=0+\M at bcal@num"1D4EF\relax
+  \Umathcode`g=0+\M at bcal@num"1D4F0\relax
+  \Umathcode`h=0+\M at bcal@num"1D4F1\relax
+  \Umathcode`i=0+\M at bcal@num"1D4F2\relax
+  \Umathcode`j=0+\M at bcal@num"1D4F3\relax
+  \Umathcode`k=0+\M at bcal@num"1D4F4\relax
+  \Umathcode`l=0+\M at bcal@num"1D4F5\relax
+  \Umathcode`m=0+\M at bcal@num"1D4F6\relax
+  \Umathcode`n=0+\M at bcal@num"1D4F7\relax
+  \Umathcode`o=0+\M at bcal@num"1D4F8\relax
+  \Umathcode`p=0+\M at bcal@num"1D4F9\relax
+  \Umathcode`q=0+\M at bcal@num"1D4FA\relax
+  \Umathcode`r=0+\M at bcal@num"1D4FB\relax
+  \Umathcode`s=0+\M at bcal@num"1D4FC\relax
+  \Umathcode`t=0+\M at bcal@num"1D4FD\relax
+  \Umathcode`u=0+\M at bcal@num"1D4FE\relax
+  \Umathcode`v=0+\M at bcal@num"1D4FF\relax
+  \Umathcode`w=0+\M at bcal@num"1D500\relax
+  \Umathcode`x=0+\M at bcal@num"1D501\relax
+  \Umathcode`y=0+\M at bcal@num"1D502\relax
+  \Umathcode`z=0+\M at bcal@num"1D503\relax}}
 %    \end{macrocode}
 % Set bold fraktur letters.\indexpage{keywordbfrak=keyword \texttt{bfrak}}
 %    \begin{macrocode}
 \def\M at bfrak@set{%
-  \edef\M at bfrak@font{M\M at bfrakshape\@tempa}
-  \DeclareMathSymbol{\M at bfrak@A}{\mathord}{\M at bfrak@font}{"1D56C}
-  \DeclareMathSymbol{\M at bfrak@B}{\mathord}{\M at bfrak@font}{"1D56D}
-  \DeclareMathSymbol{\M at bfrak@C}{\mathord}{\M at bfrak@font}{"1D56E}
-  \DeclareMathSymbol{\M at bfrak@D}{\mathord}{\M at bfrak@font}{"1D56F}
-  \DeclareMathSymbol{\M at bfrak@E}{\mathord}{\M at bfrak@font}{"1D570}
-  \DeclareMathSymbol{\M at bfrak@F}{\mathord}{\M at bfrak@font}{"1D571}
-  \DeclareMathSymbol{\M at bfrak@G}{\mathord}{\M at bfrak@font}{"1D572}
-  \DeclareMathSymbol{\M at bfrak@H}{\mathord}{\M at bfrak@font}{"1D573}
-  \DeclareMathSymbol{\M at bfrak@I}{\mathord}{\M at bfrak@font}{"1D574}
-  \DeclareMathSymbol{\M at bfrak@J}{\mathord}{\M at bfrak@font}{"1D575}
-  \DeclareMathSymbol{\M at bfrak@K}{\mathord}{\M at bfrak@font}{"1D576}
-  \DeclareMathSymbol{\M at bfrak@L}{\mathord}{\M at bfrak@font}{"1D577}
-  \DeclareMathSymbol{\M at bfrak@M}{\mathord}{\M at bfrak@font}{"1D578}
-  \DeclareMathSymbol{\M at bfrak@N}{\mathord}{\M at bfrak@font}{"1D579}
-  \DeclareMathSymbol{\M at bfrak@O}{\mathord}{\M at bfrak@font}{"1D57A}
-  \DeclareMathSymbol{\M at bfrak@P}{\mathord}{\M at bfrak@font}{"1D57B}
-  \DeclareMathSymbol{\M at bfrak@Q}{\mathord}{\M at bfrak@font}{"1D57C}
-  \DeclareMathSymbol{\M at bfrak@R}{\mathord}{\M at bfrak@font}{"1D57D}
-  \DeclareMathSymbol{\M at bfrak@S}{\mathord}{\M at bfrak@font}{"1D57E}
-  \DeclareMathSymbol{\M at bfrak@T}{\mathord}{\M at bfrak@font}{"1D57F}
-  \DeclareMathSymbol{\M at bfrak@U}{\mathord}{\M at bfrak@font}{"1D580}
-  \DeclareMathSymbol{\M at bfrak@V}{\mathord}{\M at bfrak@font}{"1D581}
-  \DeclareMathSymbol{\M at bfrak@W}{\mathord}{\M at bfrak@font}{"1D582}
-  \DeclareMathSymbol{\M at bfrak@X}{\mathord}{\M at bfrak@font}{"1D583}
-  \DeclareMathSymbol{\M at bfrak@Y}{\mathord}{\M at bfrak@font}{"1D584}
-  \DeclareMathSymbol{\M at bfrak@Z}{\mathord}{\M at bfrak@font}{"1D585}
-  \DeclareMathSymbol{\M at bfrak@a}{\mathord}{\M at bfrak@font}{"1D586}
-  \DeclareMathSymbol{\M at bfrak@b}{\mathord}{\M at bfrak@font}{"1D587}
-  \DeclareMathSymbol{\M at bfrak@c}{\mathord}{\M at bfrak@font}{"1D588}
-  \DeclareMathSymbol{\M at bfrak@d}{\mathord}{\M at bfrak@font}{"1D589}
-  \DeclareMathSymbol{\M at bfrak@e}{\mathord}{\M at bfrak@font}{"1D58A}
-  \DeclareMathSymbol{\M at bfrak@f}{\mathord}{\M at bfrak@font}{"1D58B}
-  \DeclareMathSymbol{\M at bfrak@g}{\mathord}{\M at bfrak@font}{"1D58C}
-  \DeclareMathSymbol{\M at bfrak@h}{\mathord}{\M at bfrak@font}{"1D58D}
-  \DeclareMathSymbol{\M at bfrak@i}{\mathord}{\M at bfrak@font}{"1D58E}
-  \DeclareMathSymbol{\M at bfrak@j}{\mathord}{\M at bfrak@font}{"1D58F}
-  \DeclareMathSymbol{\M at bfrak@k}{\mathord}{\M at bfrak@font}{"1D590}
-  \DeclareMathSymbol{\M at bfrak@l}{\mathord}{\M at bfrak@font}{"1D591}
-  \DeclareMathSymbol{\M at bfrak@m}{\mathord}{\M at bfrak@font}{"1D592}
-  \DeclareMathSymbol{\M at bfrak@n}{\mathord}{\M at bfrak@font}{"1D593}
-  \DeclareMathSymbol{\M at bfrak@o}{\mathord}{\M at bfrak@font}{"1D594}
-  \DeclareMathSymbol{\M at bfrak@p}{\mathord}{\M at bfrak@font}{"1D595}
-  \DeclareMathSymbol{\M at bfrak@q}{\mathord}{\M at bfrak@font}{"1D596}
-  \DeclareMathSymbol{\M at bfrak@r}{\mathord}{\M at bfrak@font}{"1D597}
-  \DeclareMathSymbol{\M at bfrak@s}{\mathord}{\M at bfrak@font}{"1D598}
-  \DeclareMathSymbol{\M at bfrak@t}{\mathord}{\M at bfrak@font}{"1D599}
-  \DeclareMathSymbol{\M at bfrak@u}{\mathord}{\M at bfrak@font}{"1D59A}
-  \DeclareMathSymbol{\M at bfrak@v}{\mathord}{\M at bfrak@font}{"1D59B}
-  \DeclareMathSymbol{\M at bfrak@w}{\mathord}{\M at bfrak@font}{"1D59C}
-  \DeclareMathSymbol{\M at bfrak@x}{\mathord}{\M at bfrak@font}{"1D59D}
-  \DeclareMathSymbol{\M at bfrak@y}{\mathord}{\M at bfrak@font}{"1D59E}
-  \DeclareMathSymbol{\M at bfrak@z}{\mathord}{\M at bfrak@font}{"1D59F}}
+  \protected\def\mathbfrak##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathbfrak
+      $%
+    \fi
+    \begingroup
+      \M at bfrak@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at bfrak@num{\number\csname symM\M at bfrakshape\@tempa\endcsname}
+  \protected\edef\M at bfrak@mathcodes{%
+  \Umathcode`A=0+\M at bfrak@num"1D56C\relax
+  \Umathcode`B=0+\M at bfrak@num"1D56D\relax
+  \Umathcode`C=0+\M at bfrak@num"1D56E\relax
+  \Umathcode`D=0+\M at bfrak@num"1D56F\relax
+  \Umathcode`E=0+\M at bfrak@num"1D570\relax
+  \Umathcode`F=0+\M at bfrak@num"1D571\relax
+  \Umathcode`G=0+\M at bfrak@num"1D572\relax
+  \Umathcode`H=0+\M at bfrak@num"1D573\relax
+  \Umathcode`I=0+\M at bfrak@num"1D574\relax
+  \Umathcode`J=0+\M at bfrak@num"1D575\relax
+  \Umathcode`K=0+\M at bfrak@num"1D576\relax
+  \Umathcode`L=0+\M at bfrak@num"1D577\relax
+  \Umathcode`M=0+\M at bfrak@num"1D578\relax
+  \Umathcode`N=0+\M at bfrak@num"1D579\relax
+  \Umathcode`O=0+\M at bfrak@num"1D57A\relax
+  \Umathcode`P=0+\M at bfrak@num"1D57B\relax
+  \Umathcode`Q=0+\M at bfrak@num"1D57C\relax
+  \Umathcode`R=0+\M at bfrak@num"1D57D\relax
+  \Umathcode`S=0+\M at bfrak@num"1D57E\relax
+  \Umathcode`T=0+\M at bfrak@num"1D57F\relax
+  \Umathcode`U=0+\M at bfrak@num"1D580\relax
+  \Umathcode`V=0+\M at bfrak@num"1D581\relax
+  \Umathcode`W=0+\M at bfrak@num"1D582\relax
+  \Umathcode`X=0+\M at bfrak@num"1D583\relax
+  \Umathcode`Y=0+\M at bfrak@num"1D584\relax
+  \Umathcode`Z=0+\M at bfrak@num"1D585\relax
+  \Umathcode`a=0+\M at bfrak@num"1D586\relax
+  \Umathcode`b=0+\M at bfrak@num"1D587\relax
+  \Umathcode`c=0+\M at bfrak@num"1D588\relax
+  \Umathcode`d=0+\M at bfrak@num"1D589\relax
+  \Umathcode`e=0+\M at bfrak@num"1D58A\relax
+  \Umathcode`f=0+\M at bfrak@num"1D58B\relax
+  \Umathcode`g=0+\M at bfrak@num"1D58C\relax
+  \Umathcode`h=0+\M at bfrak@num"1D58D\relax
+  \Umathcode`i=0+\M at bfrak@num"1D58E\relax
+  \Umathcode`j=0+\M at bfrak@num"1D58F\relax
+  \Umathcode`k=0+\M at bfrak@num"1D590\relax
+  \Umathcode`l=0+\M at bfrak@num"1D591\relax
+  \Umathcode`m=0+\M at bfrak@num"1D592\relax
+  \Umathcode`n=0+\M at bfrak@num"1D593\relax
+  \Umathcode`o=0+\M at bfrak@num"1D594\relax
+  \Umathcode`p=0+\M at bfrak@num"1D595\relax
+  \Umathcode`q=0+\M at bfrak@num"1D596\relax
+  \Umathcode`r=0+\M at bfrak@num"1D597\relax
+  \Umathcode`s=0+\M at bfrak@num"1D598\relax
+  \Umathcode`t=0+\M at bfrak@num"1D599\relax
+  \Umathcode`u=0+\M at bfrak@num"1D59A\relax
+  \Umathcode`v=0+\M at bfrak@num"1D59B\relax
+  \Umathcode`w=0+\M at bfrak@num"1D59C\relax
+  \Umathcode`x=0+\M at bfrak@num"1D59D\relax
+  \Umathcode`y=0+\M at bfrak@num"1D59E\relax
+  \Umathcode`z=0+\M at bfrak@num"1D59F\relax}}
 %    \end{macrocode}
+% And that's everything!
 % 
 % \vfill\eject
 % 
@@ -4728,7 +4658,7 @@
 %   \advance\dimen@ by -2\fboxrule
 %   \advance\dimen@ by -2\fboxsep
 %   \fbox{\vbox{\hsize\dimen@
-%     \textbf{Big Change:} Font adjustments for Lua\TeX: new glyph boundaries for Latin letters in math mode, resizable delimiters, actual big operators, MathConstants table based on font metrics}}
+%     \strut\textbf{Big Change:} Font adjustments for Lua\TeX: new glyph boundaries for Latin letters in math mode, resizable delimiters, actual big operators, MathConstants table based on font metrics.\vphantom{y}}}
 %   \par\smallskip}
 % \item added |\CharmLine| and |\CharmFile|
 % \item added |\mathconstantsfont|
@@ -4755,10 +4685,23 @@
 % \item |\setfont| now sets |\mathrm|, etc.
 % \item added |\newmathsc|, other math alphabet commands for small caps
 % 
+% \version{2.1}{November 2022\strut}
+% \item |\mathbb|, etc.\ commands change |\Umathcode|s of letters instead of |\M@|\meta{bb,etc.}|@|\meta{letter} commands
+% \item removed warnings about non-letter contents of |\mathbb|, etc.
+% \item fonts loaded twice, once with default settings (for text) and once in base mode (for math)
+% \item |mathconstantsfont| accepts ``upright'' or ``italic'' as optional argument
 % 
+% \version{2.2}{December 2022\strut}
+% \item changed the easter egg text
+% \item updated patch for |\DeclareSymbolFont| to work with changes to the kernel
+% \item calling Plain \TeX\ on \texttt{mathfont\_code.dtx} produces sty file and no pdf file
+% 
+% 
 % \egroup
 % \end{multicols*}
 % 
+% 
+% 
 % \iffalse
 % 
 %</package>
@@ -4855,7 +4798,7 @@
 \begin{code}
 |\mathfont[lower=upright, upper=upright]{Times New Roman}|
 \end{code}
-changes all Latin letters to upright Times New Roman. Know that once \textsf{mathfont} has set the default font for a keyword in Table~1, it will ignore any future instructions to do so and prints a warning to the terminal instead.
+changes all Latin letters to upright Times New Roman. Once \textsf{mathfont} has set the default font for a keyword in Table~1, it will ignore any future instructions to do so and prints a warning to the terminal instead.
 
 
 \begin{figure}[t]
@@ -4876,7 +4819,7 @@
 \end{figure}
 
 
-If you want to change the font for your entire document at once, you should use |\setfont| instead of |\mathfont|. This command accepts a single mandatory argument:
+If you want to change the font for both text and math, you should use |\setfont| instead of |\mathfont|. This command accepts a single mandatory argument:
 \begin{code}
 |\setfont{|\meta{font name}|}|.
 \end{code}
@@ -4883,7 +4826,7 @@
 It calls |\mathfont| without an optional argument---i.e.\ for the default keywords---on your \meta{font name} and sets your document's default text font to be the \meta{font name}. The command also defines the eight commands in Table~\ref{SetFont} using the \meta{font name} and the |\new| macros in the next section. Both |\mathfont| and |\setfont| should appear in the preamble only.
 
 
-To select OpenType features, you should put a colon after the font name and follow it with appropriate OpenType tags. For example adding ``|onum=true|'' tells \TeX\ to load your font with oldstyle numbering, assuming that feature is present in the font.\footnote{By default, \textsf{mathfont} enables standard ligatures, traditional \TeX\ ligatures, and lining numbers. The package sets |smcp| to |true| or |false| depending on whether it is attempting to load a small-caps font. For the full list of OpenType features, see \link{https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist}.} Whenever you declare any font setting, such as calling |\mathfont|, the package uses its own fontloader unless you have loaded \textsf{fontspec}. In that case, \textsf{mathfont} feeds your argument directly to \textsf{fontspec}, and if you previously set any font with \textsf{fontspec}, you can say |\mathfont{fontspec}| to call |\mathfont| with the most recent font used by \textsf{fontspec}. I don't recommend using \textsf{fontspec} indirectly like this unless you know what you're doing because Lua\TeX's default font-loading settings are optimized for text fonts, and you may not see any OpenType font features in math mode as a result.\footnote{The default \textsf{luaotfload} (and \textsf{fontspec}) setting is |mode=node|, but \textsf{mathfont} uses |mode=base|. The |node| setting allows users to enable more OpenType font features in text but prevents any OpenType features from showing up in math mode. On the other hand, |base| supports fewer OpenType features but enables them in math mode. This point may seem technical, but it can be very relevant. For example, Cormorant, used in one of the \textsf{mathfont} example pdf files, uses oldstyle numbers by default but includes lining numbers as a separate OpenType feature. (Oldstyle numbers can work well in text, but lining numbers are a much better default for math.) Loading Cormorant with |mode=node| means that the numbers in math mode will be oldstyle, even if you!
  say |lnum=true|, so |base| mode is necessary here. Like I said, fonts are complicated.}
+To select OpenType features, you should put a colon after the font name and follow it with appropriate OpenType tags. For example adding ``|onum=true|'' tells \TeX\ to load your font with oldstyle numbering, assuming that feature is present in the font.\footnote{By default, \textsf{mathfont} enables standard ligatures, traditional \TeX\ ligatures, and lining numbers. The package sets |smcp| to |true| or |false| depending on whether it is attempting to load a small-caps font. For the full list of OpenType features, see \link{https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist}.} Whenever you select a font, \textsf{mathfont} first checks whether you previously loaded \textsf{fontspec}, and if so, the package feeds your entire \meta{font name} argument to \textsf{fontspec}. (You can also say ``|fontspec|'' as the \meta{font name} to select the most recent font used by \textsf{fontspec}.) If you have not loaded \textsf{fontspec}, the package uses its own fontloader. I recommend letting \textsf{mathfont} handle font-loading because when using Lua\TeX, \textsf{mathfont} takes care to load fonts in such a way that full OpenType features are accessible in text and limited OpenType features are accessible in math. While it is also possible to do this in \textsf{fontspec}, it takes some doing.\footnote{The \textsf{luaotfload} package supports two main modes for loading fonts: |node| mode is the default setting, and it supports full OpenType features in text but no OpenType features in math. The |base| mode supports limited OpenType features, but the features will work for both text and math. When \textsf{mathfont} loads a font, it does so twice, once in |node| mode, which is primarily for setting the text font with \vrb\setfont, and once in |base| mode, which is for the package's other font declarations. This way you will be able to use OpenType features throughout your document.}
 
 
 The last five keywords in Table~\ref{Keywords} are a bit different. If you call |\mathfont| on a \meta{keyword} from the last five rows in Table~\ref{Keywords}, the package defines the macro
@@ -4894,7 +4837,7 @@
 \begin{code}
 |\mathfont[bb]{STIXGeneral}|
 \end{code}
-sets STIXGeneral as the font for bold calligraphic characters and defines |\mathbb| to access them. The argument of |\mathbb| should contain only digits and Latin letters, and for the other four keywords, the argument of |\math|\meta{keyword} should contain only Latin letters. \TeX\ will ignore and issue a warning in response to any other characters in the argument of these macros.
+sets STIXGeneral as the font for bold calligraphic characters and defines |\mathbb| to access them. These are not for use with any double-struck, caligraphic, or fraktur font. Rather, they access Unicode's math alphanumeric symbols block. If you want to use a font where the regular letters appear double-struck, caligraphic, or fraktur, consider the font-changing control sequences in the next section.
 
 \section{Local Font Changes}
 
@@ -4933,12 +4876,22 @@
 \begin{code}
 |\newmathfontcommand{|\meta{control sequence}|}{|\meta{font name}|}{|\meta{series}|}{|\meta{shape}|}|,
 \end{code}
-where the \meta{control sequence} in the first argument again becomes the macro that changes characters to the \meta{font name}. You are welcome to use a system font name with |\newmathfontcommand|, but the intention behind this command is that you can use an \textsc{nfss} family name for the \meta{font name}. The series and shape values will then correspond to more obscure font faces from the \textsc{nfss} family that you would be otherwise unable to access. The commands from Table~\ref{MathAlpha} as well as |\newmathfontcommand| should appear in the preamble only.
+where the \meta{control sequence} in the first argument again becomes the macro that changes characters to the \meta{font name}. You are welcome to use a system font name with |\newmathfontcommand|, but the intention behind this command is that you can use an \textsc{nfss} family name for the \meta{font name}. Then the series and shape values can correspond to more obscure font faces from the \textsc{nfss} family that you would be otherwise unable to access. The commands from Table~\ref{MathAlpha} as well as |\newmathfontcommand| should appear in the preamble only.
 
 
+\section{Default Math Parameters}
+
+Lua\TeX\ uses the MathConstants table from the most recent font assigned for use in math mode, and this means that in a document with multiple math fonts, the choice of MathConstants table can depend on the order of font declaration and be unpredictable. To avoid potential problems from using the wrong MathConstants table, \textsf{mathfont} provides the command
+\begin{code}
+|\mathconstantsfont[|\meta{shape}|]{|\meta{prev arg}|}|,
+\end{code}
+where \meta{shape} is an optional argument that can be ``|upright|'' (default) or ``|italic|,'' and \meta{prev arg} should be any argument that you have previously fed to |\mathfont|. When you call |\mathconstantsfont|, \textsf{mathfont} forces Lua\TeX\ to always use the MathConstants table from the font that corresponded to that instance of |\mathfont| in the specified \meta{shape}. You don't need to set the MathConstants table when you use |\setfont| because the package calls |\mathconstantsfont| automatically when you use |\setfont|. This command will not work in \XeTeX\ and should appear only in the preamble.
+
+
+
 \section{Lua Font Adjustments}
 
-\begin{figure}[b]
+\begin{figure}[t]
 \labelfig{Charm}
 \centerline{\bfseries Table \the\fig: Number of Integers Required in \vrb\CharmLine\strut}
 \global\advance\fig by 1\relax
@@ -4959,14 +4912,7 @@
 \end{itemize}
 Writing an asterisk tells \textsf{mathfont} to use whatever value it has saved in memory, either the default value or the value from the most recent call to |\CharmLine| or |\CharmFile|. If you specify too few charm values, \textsf{mathfont} will raise an error, but if you provide too many, \textsf{mathfont} will silently ignore the extras.
 
-For most applications, you can probably ignore charm information altogether, but if you find bounding boxes or accent placement to be off slightly or if you want to change the scaling for a delimiter or big operator, you should try calling |\CharmLine| with different values to see what works. As is typical with decimal inputs in \TeX, \textsf{mathfont} divides your inputs by 1000 before computing with them. Positive integers mean ``increase,'' and negative integers mean ``decrease.'' For a given character, the scale is usually the glyph width. For example,
-\begin{code}
-|\CharmLine{97, 200, -200, *, 50}|
-\end{code}
-tells \textsf{mathfont} to take the lower-case ``a'' (unicode encoding value of 97), increase the bounding box on the left side by 20\% of the glyph width, decrease the bounding box on the right side by 20\% of the glyph width, do nothing to the top accent, and shift the bottom accent right by 5\% of the glyph width. There is no general formula for what charm values to use for a given font! Rather, you will need to make a design choice based on what looks best, and if you regularly use a particular font, consider making a custom set of charm values uploading it to \textsc{ctan}. Additionally, if you store your charm information in a file, you can read it in with |\CharmFile|. The argument of this command should be a file name, and \textsf{mathfont} reads the file and feeds each line individually to |\CharmLine|.
-
-
-\begin{figure}[tb]
+\begin{figure}[b]
 \labelfig{Factors}
 \centerline{\bfseries Table \the\fig: Commands to Adjust Individual Characters\strut}
 \global\advance\fig by 1\relax
@@ -4980,6 +4926,13 @@
 \end{figure}
 
 
+For most applications, you can probably ignore charm information altogether, but if you find bounding boxes or accent placement to be off slightly or if you want to change the scaling for a delimiter or big operator, you should try calling |\CharmLine| with different values to see what works. As is typical with decimal inputs in \TeX, \textsf{mathfont} divides your inputs by 1000 before computing with them. Positive integers mean ``increase,'' and negative integers mean ``decrease.'' For a given character, the scale is usually the glyph width. For example,
+\begin{code}
+|\CharmLine{97, 200, -200, *, 50}|
+\end{code}
+tells \textsf{mathfont} to take the lower-case ``a'' (unicode encoding value of 97), increase the bounding box on the left side by 20\% of the glyph width, decrease the bounding box on the right side by 20\% of the glyph width, do nothing to the top accent, and shift the bottom accent right by 5\% of the glyph width. There is no general formula for what charm values to use for a given font! Rather, you will need to make a design choice based on what looks best, and if you regularly use a particular font, consider making a custom set of charm values uploading it to \textsc{ctan}. Additionally, if you store your charm information in a file, you can read it in with |\CharmFile|. The argument of this command should be a file name, and \textsf{mathfont} reads the file and feeds each line individually to |\CharmLine|.
+
+
 The commands in Table~\ref{Factors} adjust other aspects of the font as indicated. Each command accepts a single integer as an argument, and \textsf{mathfont} once again divides the input by 1000. With each of these macros, \textsf{mathfont} multiplies the quotient by some default length, so values greater than or less than 1000 mean ``scale up'' or ``scale down'' respectively. For example,
 \begin{code}
 |\RuleThicknessFactor{2000}|
@@ -5005,16 +4958,7 @@
 Finally, advanced users who want to interact with the font adjustment process directly should use the six callbacks in Table~\ref{Callbacks}. When Lua\TeX\ loads a font, \textsf{mathfont} (1) always calls |mathfont.inspect_font| and (2) calls the other five callbacks in the order that they appear in Table~\ref{Callbacks} if the font object contains |nomath=true|. Functions added to these callbacks should accept a font object as a single argument and return nothing. Further, please be careful when loading functions in the |disable_nomath|, |add_math_constants|, and |fix_character_metrics| callbacks. If you add a function there, Lua\TeX\ will not carry out the default behvaior associated with the callback, so do not mess with these three callbacks unless you are duplicating the default behavior of the callback or you really know what you're doing. Otherwise, you risk breaking the package. See |mathfont_code.pdf| for more information.
 
 
-\section{Default Math Parameters}
 
-Lua\TeX\ uses the MathConstants table from the most recent font assigned for use in math mode, and this means that in a document with multiple math fonts, the choice of MathConstants table can depend on the order of font declaration and be unpredictable. To avoid potential problems from using the wrong MathConstants table, \textsf{mathfont} provides the command
-\begin{code}
-|\mathconstantsfont{|\meta{prev arg}|}|,
-\end{code}
-where \meta{prev arg} should be any argument that you have previously fed to |\mathfont|. When you call |\mathconstantsfont|, \textsf{mathfont} forces Lua\TeX\ to always use the MathConstants table from the font that corresponded to that instance of |\mathfont|. You don't need to worry about MathConstants when you use |\setfont| because the package calls |\mathconstantsfont| automatically when you use |\setfont|. This command should appear in the preamble only.
-
-
-
 \end{document}
 %</user>
 %<*chars>
@@ -5028,7 +4972,7 @@
 \usepackage{mathfont}
 \mathfont[agreeklower=upright,agreekupper]{Crimson}
 \mathfont[hebrew]{Coelacanth}
-\mathfont[\M at normalkeys,\M at letterlikekeys]{STIXGeneral}
+\mathfont[\M at keys]{STIXGeneral}
 \usepackage{shortvrb,doc}
 \MakeShortVerb{|}
 \raggedcolumns
@@ -5956,9 +5900,9 @@
 \usepackage{mathfont}
 \DeclareFontFamily{TU}{Cormorant}{}
 \DeclareFontShape{TU}{Cormorant}{m}{n}
-  {<->"Cormorant Medium:\M at default@otf at features;-liga"}{}
+  {<->"Cormorant Medium:\M at otf@features;-liga"}{}
 \DeclareFontShape{TU}{Cormorant}{m}{it}
-  {<->"Cormorant Medium Italic:\M at default@otf at features"}{}
+  {<->"Cormorant Medium Italic:\M at otf@features"}{}
 \mathfont[greeklower=upright,greekupper]{Crimson}
 \mathfont[diacritics]{Bona Nova}
 \setfont{Cormorant}
@@ -5976,7 +5920,7 @@
 
 \input mathfont_heading.tex
 
-This is Cormorant with Crimson for Greek characters and Bona Nova for diacritics. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Cormorant with Crimson for Greek characters and Bona Nova for diacritics. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 
 \input{mathfont_equations.tex}
@@ -6007,7 +5951,7 @@
 
 \input mathfont_heading.tex
 
-This is Kelvinch with Crimson for the radical signs. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Kelvinch with Crimson for the radical signs. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 \input{mathfont_equations.tex}
 
@@ -6041,7 +5985,7 @@
 
 \input mathfont_heading.tex
 
-This is Roboto with Overpass for the radical signs and STIXGeneral for the tensor product. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Roboto with Overpass for the radical signs and STIXGeneral for the tensor product. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows an example of mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 
 \input{mathfont_equations.tex}
@@ -6058,15 +6002,32 @@
 \DeclareMathOperator{\Res}{Res}
 \usepackage{mathfont}
 \mathfont[radical]{Crimson}
+
+%% We have to declare Typey McTypeface manually because
+%% it has no bold fontface---we use embolden from luaotflaod
+%% to make a fake bold
+
 \DeclareFontFamily{TU}{Typey}{}
 \DeclareFontShape{TU}{Typey}{m}{n}
-  {<->"Typey McTypeface:\M at default@otf at features"}{}
+  {<->"Typey McTypeface:\M at otf@features"}{}
 \DeclareFontShape{TU}{Typey}{m}{it}
-  {<->"Typey McTypeface/I:\M at default@otf at features"}{}
+  {<->"Typey McTypeface/I:\M at otf@features"}{}
 \DeclareFontShape{TU}{Typey}{b}{n}
-  {<->"Typey McTypeface:\M at default@otf at features;embolden=6"}{}
+  {<->"Typey McTypeface:\M at otf@features;embolden=6"}{}
 \DeclareFontShape{TU}{Typey}{b}{it}
-  {<->"Typey McTypeface/I:\M at default@otf at features;embolden=6"}{}
+  {<->"Typey McTypeface/I:\M at otf@features;embolden=6"}{}
+
+%% We also need to declare Typey-base family for math mode
+
+\DeclareFontFamily{TU}{Typey-base}{}
+\DeclareFontShape{TU}{Typey-base}{\mddefault}{\shapedefault}
+  {<->"Typey McTypeface:\M at otf@features;mode=base"}{}
+\DeclareFontShape{TU}{Typey-base}{\mddefault}{\itdefault}
+  {<->"Typey McTypeface/I:\M at otf@features;mode=base"}{}
+\DeclareFontShape{TU}{Typey-base}{\bfdefault}{\shapedefault}
+  {<->"Typey McTypeface:\M at otf@features;embolden=6;mode=base"}{}
+\DeclareFontShape{TU}{Typey-base}{\bfdefault}{\itdefault}
+  {<->"Typey McTypeface/I:\M at otf@features;embolden=6;mode=base"}{}
 \setfont{Typey}
 \mathfont[]{STIXGeneral}
 \DeclareSymbolFont{Mroman2}{TU}{STIXGeneral}{m}{n}
@@ -6084,7 +6045,7 @@
 
 \input mathfont_heading.tex
 
-This is Typey McTypeface with Crimson for the radical signs and STIXGeneral for the tensor product. Testing. Testing. Brown foxes quickly jump over dazzling does and harts. This document shows mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
+This is Typey McTypeface with Crimson for the radical signs and STIXGeneral for the tensor product. ``Testing. Testing.'' Brown foxes quickly jump over dazzling does and harts. This document shows mathfont in action. Unfortunately, there are many more equations in the world than I have space for here. Nevertheless, I hope I hit some of the highlights. Happy \TeX ing!
 
 \let\bullet\cdot
 \input{mathfont_equations.tex}
@@ -6094,8 +6055,8 @@
 %<*heading>
 
 % package date and edition
-\def\packagedate{December 2021}
-\def\packageversion{2.0}
+\def\packagedate{December 2022}
+\def\packageversion{2.2}
 
 % header and footer commands
 
@@ -6150,6 +6111,7 @@
 \egroup
 \def\topfraction{1}
 \def\bottomfraction{1}
+\let\code\@undefined
 \newenvironment{code}
   {\strut\vadjust\bgroup\medskip\parindent\z@\leftskip2em\relax
     \noindent\strut\ignorespaces}

Modified: trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty	2022-12-04 21:07:43 UTC (rev 65192)
+++ trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty	2022-12-04 21:08:16 UTC (rev 65193)
@@ -6,16 +6,16 @@
 %%
 %% mathfont_code.dtx  (with options: `package')
 %% 
-%% This file is from version 2.0 of the free and open-source
+%% This file is from version 2.2 of the free and open-source
 %% LaTeX package "mathfont," to be used with the XeTeX or
 %% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
 %% 
-%% Copyright 2018-2021 by Conrad Kosowsky
+%% Copyright 2018-2022 by Conrad Kosowsky
 %% 
-%% This file may be distributed and modified under the terms
-%% of the LaTeX Public Project License, version 1.3c or any
-%% later version. The most recent version of this license is
-%% available online at
+%% This Work may be used, distributed, and modified under the
+%% terms of the LaTeX Public Project License, version 1.3c or
+%% any later version. The most recent version of this license
+%% is available online at
 %% 
 %%           https://www.latex-project.org/lppl/.
 %% 
@@ -23,34 +23,43 @@
 %% maintainer is the package author, Conrad Kosowsky. He can
 %% be reached at kosowsky.latex at gmail.com.
 %% 
-%% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS
-%% OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES
-%% OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-%% IF THE SOFTWARE IS DEFECTIVE, YOU AGREE TO ASSUME THE
-%% COST FOR ANY REPAIR OR CORRECTION.
+%% PLEASE KNOW THAT THIS FREE SOFTWARE IS PROVIDED WITHOUT
+%% ANY WARRANTY. SPECIFICALLY, THE "NO WARRANTY" SECTION OF
+%% THE LATEX PROJECT PUBLIC LICENSE STATES THE FOLLOWING:
 %% 
-%% BY USING OR DISTRIBUTING THIS SOFTWARE, YOU AGREE
-%% TO RELEASE THE PACKAGE AUTHOR FROM ANY LIABILITY FOR
-%% DAMAGES ARISING OUT OF YOUR USE OF THE SOFTWARE. YOU
-%% AGREE TO DO SO TO THE MAXIMUM EXTENT ALLOWED UNDER
-%% APPLICABLE LAW AND EVEN IF THE PACKAGE AUTHOR HAS
-%% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+%% THERE IS NO WARRANTY FOR THE WORK. EXCEPT WHEN OTHERWISE
+%% STATED IN WRITING, THE COPYRIGHT HOLDER PROVIDES THE WORK
+%% `AS IS’, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+%% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+%% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+%% PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+%% OF THE WORK IS WITH YOU. SHOULD THE WORK PROVE DEFECTIVE,
+%% YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
+%% CORRECTION.
 %% 
-%% See also the "No Warranty" section of the LaTeX Project
-%% Public License. In releasing the package author from
-%% liability, you also release from liability any third
-%% parties who distribute the software under the terms
-%% of the LaTeX Project Public License. Derivative works
-%% based on this package may come with their own license or
-%% terms of use, and the package author is not responsible
-%% for any third-party software.
+%% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+%% TO IN WRITING WILL THE COPYRIGHT HOLDER, OR ANY AUTHOR
+%% NAMED IN THE COMPONENTS OF THE WORK, OR ANY OTHER PARTY
+%% WHO MAY DISTRIBUTE AND/OR MODIFY THE WORK AS PERMITTED
+%% ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+%% SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
+%% OF ANY USE OF THE WORK OR OUT OF INABILITY TO USE THE WORK
+%% (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, DATA BEING
+%% RENDERED INACCURATE, OR LOSSES SUSTAINED BY ANYONE AS A
+%% RESULT OF ANY FAILURE OF THE WORK TO OPERATE WITH ANY
+%% OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDER OR SAID
+%% AUTHOR OR SAID OTHER PARTY HAS BEEN ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGES.
 %% 
-%% For more information, see the mathfont_code.dtx.
+%% For more information, see the LaTeX Project Public License.
+%% Derivative works based on this package may come with their
+%% own license or terms of use, and the package author is not
+%% responsible for any third-party software.
 %% 
-%% Happy TeXing!
+%% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mathfont}[2021/12/28 v. 2.0 Package mathfont]
+\ProvidesPackage{mathfont}[2022/12/04 v. 2.2 Package mathfont]
 \newif\ifM at XeTeXLuaTeX     % is engine one of xetex or luatex?
 \newif\ifM at Noluaotfload    % cannot find luaotfload.sty?
 \newif\ifM at adjust@font     % should adjust fonts with lua script?
@@ -63,25 +72,33 @@
   {Your command was ignored. I couldn't\MessageBreak
   load mathfont, so I never defined this\MessageBreak
   control sequence.}}
-\def\mathfont{\M at NoMathfontError\mathfont
+\protected\def\mathfont{\M at NoMathfontError\mathfont
   \@ifnextchar[\@gobbletwo at brackets\@gobble}
-\def\mathconstantsfont{\M at NoMathfontError\mathconstantsfont\@gobble}
-\def\setfont{\M at NoMathfontError\setfont\@gobble}
-\def\newmathrm{\M at NoMathfontError\newmathrm\@gobbletwo}
-\def\newmathit{\M at NoMathfontError\newmathit\@gobbletwo}
-\def\newmathbf{\M at NoMathfontError\newmathbf\@gobbletwo}
-\def\newmathbfit{\M at NoMathfontError\newmathbf\@gobbletwo}
-\def\newmathsc{\M at NoMathfontError\newmathsc\@gobbletwo}
-\def\newmathscit{\M at NoMathfontError\newmathscit\@gobbletwo}
-\def\newmathbfsc{\M at NoMathfontError\newmathbfsc\@gobbletwo}
-\def\newmathbfscit{\M at NoMathfontError\newmathbfscit\@gobbletwo}
-\def\newmathfontcommand{\M at NoMathfontError\newmathfontcommand\@gobblefour}
-\def\RuleThicknessFactor{\M at NoMathfontError\RuleThicknessFactor\@gobble}
-\def\IntegralItalicFactor{\M at NoMathfontError\IntegralItalicFactor\@gobble}
-\def\SurdVerticalFactor{\M at NoMathfontError\SurdVerticalFactor\@gobble}
-\def\SurdHorizontalFactor{\M at NoMathfontError\SurdHorizontalFactor\@gobble}
-\def\CharmLine{\M at NoMathfontError\CharmLine\@gobble}
-\def\CharmFile{\M at NoMathfontError\CharmFile\@gobble}
+\protected\def\setfont{\M at NoMathfontError\setfont\@gobble}
+\protected\def\mathconstantsfont{\M at NoMathfontError\mathconstantsfont
+  \@ifnextchar[\@gobbletwo at brackets\@gobble}
+\protected\def\newmathrm{\M at NoMathfontError\newmathrm\@gobbletwo}
+\protected\def\newmathit{\M at NoMathfontError\newmathit\@gobbletwo}
+\protected\def\newmathbf{\M at NoMathfontError\newmathbf\@gobbletwo}
+\protected\def\newmathbfit{\M at NoMathfontError\newmathbf\@gobbletwo}
+\protected\def\newmathbold{\M at NoMathfontError\newmathbold\@gobbletwo}
+\protected\def\newmathboldit{\M at NoMathfontError\newmathbold\@gobbletwo}
+\protected\def\newmathsc{\M at NoMathfontError\newmathsc\@gobbletwo}
+\protected\def\newmathscit{\M at NoMathfontError\newmathscit\@gobbletwo}
+\protected\def\newmathbfsc{\M at NoMathfontError\newmathbfsc\@gobbletwo}
+\protected\def\newmathbfscit{\M at NoMathfontError\newmathbfscit\@gobbletwo}
+\protected\def\newmathfontcommand{%
+  \M at NoMathfontError\newmathfontcommand\@gobblefour}
+\protected\def\RuleThicknessFactor{%
+  \M at NoMathfontError\RuleThicknessFactor\@gobble}
+\protected\def\IntegralItalicFactor{%
+  \M at NoMathfontError\IntegralItalicFactor\@gobble}
+\protected\def\SurdVerticalFactor{%
+  \M at NoMathfontError\SurdVerticalFactor\@gobble}
+\protected\def\SurdHorizontalFactor{%
+  \M at NoMathfontError\SurdHorizontalFactor\@gobble}
+\protected\def\CharmLine{\M at NoMathfontError\CharmLine\@gobble}
+\protected\def\CharmFile{\M at NoMathfontError\CharmFile\@gobble}
 \ifdefined\directlua
   \M at XeTeXLuaTeXtrue
 \fi
@@ -116,7 +133,7 @@
       with one of those two engines.^^J}}
     \M at XeTeXLuaTeXError
   \endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line.}}
+  \AtEndOfPackage{\typeout{:: mathfont :: Failed to load\on at line.}}
   \expandafter\endinput % we should \endinput with a balanced conditional
 \fi
 \ifdefined\directlua
@@ -162,7 +179,7 @@
       XeLaTeX.^^J}}
     \M at NoluaotfloadError
   \endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line.}}
+  \AtEndOfPackage{\typeout{:: mathfont :: Failed to load\on at line.}}
   \expandafter\endinput % we should \endinput with a balanced conditional
 \fi
 \def\M at Optiondeprecated#1#2{\PackageError{mathfont}
@@ -171,9 +188,6 @@
   use #2\MessageBreak
   instead. For more information,\MessageBreak
   see the mathfont documentation.}}
-\IfFileExists{atveryend.sty}
-  {\RequirePackage{atveryend}\let\E at sterEggHook\AtVeryVeryEnd}
-  {\let\E at sterEggHook\AtEndDocument}
 \DeclareOption{packages}{%
   \M at Optiondeprecated{packages}
   {the macro \string\restoremathinternals}}
@@ -187,25 +201,36 @@
   \ifE at sterEggDecl@red\else
     \E at sterEggDecl@redtrue
     \def\EasterEggUpdate{\show\E at sterEggUpd@te}
-    \def\E at sterEggUpd@te{Okay, opening your Easter egg}
+    \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Okay, opening your Easter egg.^^J^^J}
       \EasterEggUpdate
-    \def\E at sterEggUpd@te{..}
+    \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Uh oh. It looks like^^J%
+        your Easter egg flew^^J%
+        out the window. I don't^^J%
+        suppose you know the^^J%
+        best kind of bait to^^J%
+        lure an egg?^^J^^J}
       \EasterEggUpdate
+    \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Still wrangling. Try back later.^^J^^J}
+    \AtBeginDocument{\bgroup
+      \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J:%
+        If we have zero eggs^^J%
+        and zero bunnies, how^^J%
+        many gnats does it take^^J%
+        to change a lightbulb??^^J^^J}
       \EasterEggUpdate
-    \typeout{^^JHm, I think it flew out the^^J%
-      window. Check back here when^^J%
-      everything's done compiling^^J}
-    \def\E at sterEggUpd@te{Uh oh}
-      \EasterEggUpdate
-    \def\E at sterEggUpd@te{Still wrangling. Try back later}
-    \AtBeginDocument\EasterEggUpdate
-    \E at sterEggHook{%
-      \typeout{^^JHappy, happy day! Happy,^^J%
-      happy day! Clap your hands,^^J%
-      and be glad your hovercraft^^J%
-      isn't full of eels!^^J}
-      \def\E at sterEggUpd@te{Got it :) }
-        \EasterEggUpdate}
+      \egroup}
+    \AtEndDocument{%
+      \def\E at sterEggUpd@te{Easter Egg Status:^^J^^J%
+        Happy, happy day! Happy,^^J%
+        happy day! Clap your hands,^^J%
+        and be glad your hovercraft^^J%
+        isn't full of eels!^^J^^J}
+        \EasterEggUpdate
+      \let\E at sterEggUpd@te\relax
+      \let\EasterEggUpdate\relax}
   \fi}% my easter egg :)
 \DeclareOption{adjust}{\M at adjust@fonttrue}
 \DeclareOption{no-adjust}{\M at adjust@fontfalse}
@@ -233,17 +258,16 @@
     \M at adjust@fontfalse
   \fi
 \fi
-\def\M at FontChangeInfo#1#2#3#4#5{\wlog{Package mathfont Info:
-  Setting #1 chars to #2!^^J%
-  NFSS Family Name:  #3^^J%
-  Series/Shape Info: #4^^J%
-  Symbol Font Name:  #5^^J}}
-\def\M at CommandInitializeInfo#1{\wlog{Package mathfont Info: Initializing
-  \noexpand#1 font-change command on line \the\inputlineno.}}
-\def\M at NewFontCommandInfo#1#2#3#4#5{\wlog{Package mathfont Info: Creating
-  math-alphabet command^^J%
-  \string#1 using #2 on line \the\inputlineno!^^J%
-  NFSS Family Name: #3^^J%
+\def\M at SymbolFontInfo#1#2#3#4{\wlog{^^JPackage mathfont Info:
+  Declaring new symbol font from #1!^^J%
+  NFSS Family Name: \space#2^^J%
+  Series/Shape Info: #3^^J%
+  Symbol Font Name:  \space#4^^J}}
+\def\M at FontChangeInfo#1#2{\wlog{Package mathfont Info:
+  Setting #1 chars to #2!}}
+\def\M at NewFontCommandInfo#1#2#3#4#5{\wlog{^^JPackage mathfont Info:
+  Creating \string#1 using #2!^^J%
+  NFSS Family Name: \space#3^^J%
   Series/Shape Info: #4/#5^^J}}
 \def\M at CharsSetWarning#1{\PackageWarning{mathfont}
   {I already set the font for\MessageBreak
@@ -250,23 +274,6 @@
   #1 chars, so I'm ignoring\MessageBreak
   this option for \string\mathfont\space
   on line \the\inputlineno\@gobble}}
-\def\M at DoubleArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the multiple characters\MessageBreak
-  "#2" that are grouped together in\MessageBreak
-  the argument of your \string#1\space command\MessageBreak}}
-\def\M at NestedArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the nested argument\MessageBreak
-  "#2" from your \string#1\MessageBreak
-  command}}
-\def\M at CSArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the unexpandable control\MessageBreak
-  sequence \string#2\space that appears in the\MessageBreak
-  argument of your \string#1\space command\MessageBreak}}
-\def\M at CharacterArgWarning#1#2{\PackageWarning{mathfont}
-  {I'm ignoring the "#2" in the\MessageBreak
-  argument of your \string#1\MessageBreak
-  command because it isn't a\MessageBreak
-  letter or digit}}
 \def\M at DeprecatedWarning#1#2{\PackageWarning{mathfont}
   {Your \string#1\space command on\MessageBreak
   line \the\inputlineno\space is deprecated, and I\MessageBreak
@@ -333,6 +340,23 @@
   haven't loaded fontspec, so some things are about\MessageBreak
   to get messed up. To resolve this error, load\MessageBreak
   fontspec before calling \string\mathfont.^^J}}
+\def\M at BadMathConstantsFontError#1{\PackageError{mathfont}
+  {Invalid\MessageBreak font specifier for
+  \string\mathconstantsfont:\MessageBreak"#1"}
+  {Your command was ignored--I can't parse your argument.\MessageBreak
+  Please make sure to use text that you have previously\MessageBreak
+  fed to \string\mathfont\space for the argument of
+  \string\mathconstantsfont.^^J}}
+\def\M at BadMathConstantsFontTypeError#1{\PackageError{mathfont}
+  {Invalid\MessageBreak font specifier for
+  \string\mathconstantsfont:\MessageBreak"#1"}
+  {The optional argument of \string\mathconstantsfont\MessageBreak
+  should be "upright" or "italic." Right now,\MessageBreak
+  it's "#1."^^J}}
+\def\M at LuaTeXOnlyWarning{\PackageWarning{mathfont}
+    {Your \string\mathconstantsfont\space
+    on line \the\inputlineno\space is\MessageBreak
+    for LuaTeX only, and I'm ignoring it\@gobble}}
 \def\M at MissingControlSequenceError#1#2{\PackageError{mathfont}
   {Missing control sequence\MessageBreak
   for\string#1\MessageBreak on input line \the\inputlineno}
@@ -349,13 +373,12 @@
   a single character instead.^^J}}
 \def\M at HModeError#1{\PackageError{mathfont}
   {Missing \string$ inserted\MessageBreak
-  inserted\on at line. Command\MessageBreak
-  \string#1\space is for math mode only\MessageBreak}
+  on input line line \the\inputlineno}
   {I generated an error because
   you used \string#1\space outside of\MessageBreak
-  math mode. I've inserted a \string$
-  just before your \string#1, so\MessageBreak
-  we should be all good now.^^J}}
+  math mode. I inserted a \string$
+  before your \string#1, so we\MessageBreak
+  should be all good now.^^J}}
 \def\M at ForbiddenCharmLine#1{\PackageError{mathfont}
   {Forbidden charm info contains #1}
   {The argument of your \string\CharmLine\space
@@ -389,9 +412,15 @@
   is a nonnegative integer. Right now it's\MessageBreak
   "#2".^^J}}
 \@ifpackageloaded{fontspec}
-  {\csname bool_set_false:N\expandafter\endcsname
+  {\wlog{Package mathfont Info: Package fontspec detected.}
+    \wlog{Package mathfont Info: Setting \string\g__fontspec_math_bool
+      to false.}
+    \csname bool_set_false:N\expandafter\endcsname
     \csname g__fontspec_math_bool\endcsname}
-  {\PassOptionsToPackage{no-math}{fontspec}}
+  {\wlog{Package mathfont Info: Package fontspec not detected.}
+    \wlog{Package mathfont Info: Will pass no-math option to fontspec
+      if it gets loaded.}
+    \PassOptionsToPackage{no-math}{fontspec}}
 \let\@@set at mathchar\set at mathchar
 \let\@@set at mathsymbol\set at mathsymbol
 \let\@@set at mathaccent\set at mathaccent
@@ -418,12 +447,17 @@
   \advance\count\z@\count\tw@
   \protected\xdef#2{%
     \Umathaccent\mathchar at type#3+\number#1+\the\count\z@\relax}}
+\ifx\DeclareSymbolFont at m@dropped\@undefined
+  \edef\@tempa{\expandafter\strip at prefix\meaning\DeclareSymbolFont}
+  \def\@tempb{\def\DeclareSymbolFont##1##2##3##4##5}
+\else
+  \edef\@tempa{\expandafter\strip at prefix\meaning\DeclareSymbolFont at m@dropped}
+  \def\@tempb{\def\DeclareSymbolFont at m@dropped##1##2##3##4##5}
+\fi
 \def\M at p@tch at decl@re#1<15#2\@nil{#1<\e at mathgroup@top#2}
-\edef\M at DecSymDef{\expandafter\expandafter\expandafter
-  \M at p@tch at decl@re\expandafter\strip at prefix\meaning\DeclareSymbolFont\@nil}
-\def\@tempa{\def\DeclareSymbolFont##1##2##3##4##5}
+\edef\M at DecSymDef{\expandafter\M at p@tch at decl@re\@tempa\@nil}
 \ifdefined\directlua
-  \expandafter\@tempa\expandafter{\scantextokens\expandafter{\M at DecSymDef}}
+  \expandafter\@tempb\expandafter{\scantextokens\expandafter{\M at DecSymDef}}
 \else
   \begingroup
   \everyeof{\noexpand}
@@ -431,12 +465,10 @@
   \edef\M at retokenize{\noexpand\scantokens{\noexpand\unexpanded{\M at DecSymDef}}}
   \edef\M at retokenize{\M at retokenize}
   \expandafter\endgroup
-    \expandafter\@tempa\expandafter{\M at retokenize}
+    \expandafter\@tempb\expandafter{\M at retokenize}
 \fi
-\@onlypreamble\@@DeclareSymbolFont
 \newbox\surdbox
 \newcount\M at count
-\newcount\M at errcode
 \newcount\M at rule@thickness at factor
 \newcount\M at integral@italic at factor
 \newcount\M at surd@vertical at factor
@@ -478,6 +510,7 @@
 \newif\if at suboptionpresent
 \newif\ifM at arg@good
 \newif\ifM at Decl@reF at mily
+\newif\ifM at Decl@reF at milyB@se
 \newif\ifM at fromCharmFile
 \def\M at uppershape{italic} % latin upper
 \def\M at lowershape{italic} % latin lower
@@ -503,39 +536,143 @@
 \def\M at frakshape{upright} % fraktur
 \def\M at bcalshape{upright} % bold caligraphic
 \def\M at bfrakshape{upright} % bold fraktur
+\def\M at keys{upper,lower,diacritics,greekupper,%
+  greeklower,agreekupper,agreeklower,cyrillicupper,%
+  cyrilliclower,hebrew,digits,operator,delimiters,%
+  radical,bigops,extbigops,symbols,extsymbols,arrows,%
+  bb,cal,frak,bcal,bfrak}
 \def\M at defaultkeys{upper,lower,diacritics,greekupper,%
   greeklower,digits,operator,symbols}
 \ifM at adjust@font
   \edef\M at defaultkeys{\M at defaultkeys,delimiters,radical,bigops}
 \fi
-\def\M at normalkeys{upper,lower,diacritics,greekupper,%
-  greeklower,agreekupper,agreeklower,cyrillicupper,%
-  cyrilliclower,hebrew,digits,operator,delimiters,%
-  radical,bigops,extbigops,symbols,extsymbols,arrows}
-\def\M at letterlikekeys{bb,cal,frak,bcal,bfrak}
-\def\M at default@otf at features{script=latin;language=DFLT;%
+\def\M at otf@features{script=latin;language=DFLT;%
   tlig=true;liga=true;smcp=false;lnum=true}
-\def\M at default@otf at features@sc{script=latin;language=DFLT;%
+\def\M at otf@features at sc{script=latin;language=DFLT;%
   tlig=true;liga=true;smcp=true;lnum=true}
-\ifdefined\directlua
-  \edef\M at default@otf at features{mode=base;\M at default@otf at features}
-  \edef\M at default@otf at features@sc{mode=base;\M at default@otf at features@sc}
-\fi
+\def\M at split@colon#1:#2\@nil{%
+  \def\@tempbase{#1}
+  \def\@tempfeatures{#2}}
+\def\M at strip@colon#1:{#1}
+\def\M at fill@nfss at shapes#1#2{%
+  \ifcsname TU/#1/\mddefault/\shapedefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\shapedefault}
+      {<->"\@tempbase:\M at otf@features;#2"}{}
+  \fi
+  \ifcsname TU/#1/\mddefault/\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\itdefault}
+      {<->"\@tempbase/I:\M at otf@features;#2"}{}
+  \fi
+  \ifcsname TU/#1/\bfdefault/\shapedefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\shapedefault}
+      {<->"\@tempbase/B:\M at otf@features;#2"}{}
+  \fi
+  \ifcsname TU/#1/\bfdefault/\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\itdefault}
+      {<->"\@tempbase/BI:\M at otf@features;#2"}{}
+  \fi
+  \ifcsname TU/#1/\mddefault/\scdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault}
+      {<->"\@tempbase:\M at otf@features at sc;#2"}{}
+  \fi
+  \ifcsname TU/#1/\mddefault/\scdefault\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault\itdefault}
+      {<->"\@tempbase/I:\M at otf@features at sc;#2"}{}
+  \fi
+  \ifcsname TU/#1/\bfdefault/\scdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault}
+      {<->"\@tempbase/B:\M at otf@features at sc;#2"}{}
+  \fi
+  \ifcsname TU/#1/\bfdefault/\scdefault\itdefault\endcsname
+  \else
+    \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault\itdefault}
+      {<->"\@tempbase/BI:\M at otf@features at sc;#2"}{}
+  \fi}
+\def\M at newfont#1{%
+  \edef\@tempa{#1}
+  \expandafter\M at split@colon\@tempa:\@nil
+  \def\@tempb{fontspec}
+  \ifx\@tempa\@tempb
+    \@ifpackageloaded{fontspec}{%
+      \expandafter\ifx\csname l_fontspec_family_tl\endcsname\@empty
+        \M at NoFontspecFamilyError
+      \else
+        \expandafter
+          \let\expandafter\M at f@ntn at me\csname l_fontspec_family_tl\encsname
+        \def\@tempbase{\M at f@ntn at me\space(from fontspec)}
+        \let\M at f@ntn at meb@se\M at f@ntn at me % no separate font in base mode
+      \fi}{\M at NoFontspecError}
+  \else
+    \@ifpackageloaded{fontspec}
+    {\csname fontspec_set_family:Nnn\endcsname\M at f@ntn at me{}{\@tempa}
+      % no separate font in base mode
+      \let\M at f@ntn at meb@se\M at f@ntn at me}
+    {\M at Decl@reF at milytrue
+      \M at Decl@reF at milyB@setrue
+      \ifx\@tempfeatures\@empty
+        \ifdefined\directlua
+          \edef\@basefeatures{mode=base}
+        \else
+          \let\@basefeatures\@tempfeatures
+        \fi
+      \else
+        \edef\@tempfeatures{\expandafter\M at strip@colon\@tempfeatures}
+        \ifdefined\directlua
+          \edef\@basefeatures{\@tempfeatures;mode=base}
+        \else
+          \let\@basefeatures\@tempfeatures
+        \fi
+      \fi
+      \edef at nospace\@tempa{\@tempa}
+      \edef at nospace\@tempb{\@tempbase}
+      \M at Decl@reF at milytrue
+      \@tfor\@i:=\@tempa\@tempb\@tempbase\do{%
+        \ifcsname TU+\@i\endcsname
+          \expandafter\let\expandafter\M at f@ntn at me\@i
+          \M at Decl@reF at milyfalse
+          \M at fill@nfss at shapes\M at f@ntn at me\@tempfeatures
+          \@break at tfor
+        \fi}
+      \ifM at Decl@reF at mily
+        \let\M at f@ntn at me\@tempa
+        \wlog{Package mathfont Info: Adding \M at f@ntn at me\space to the nfss!}
+        \DeclareFontFamily{TU}{\M at f@ntn at me}{}
+        \M at fill@nfss at shapes\M at f@ntn at me\@tempfeatures
+      \fi
+      \ifdefined\directlua
+        \edef\M at f@ntn at meb@se{\M at f@ntn at me-base}
+      \else
+        \let\M at f@ntn at meb@se\M at f@ntn at me
+      \fi
+      \ifcsname TU+\M at f@ntn at meb@se\endcsname\else
+        \wlog{Package mathfont Info: Adding \M at f@ntn at meb@se\space
+          to the nfss!}
+        \DeclareFontFamily{TU}{\M at f@ntn at meb@se}{}
+      \fi
+      \M at fill@nfss at shapes\M at f@ntn at meb@se\@basefeatures}
+  \fi}
+\@onlypreamble\M at fill@nfss at shapes
+\@onlypreamble\M at newfont
 \def\M at check@option at valid#1{%
   \let\@temperror\M at InvalidOptionError % error by default
-  \@for\@j:=\M at normalkeys\do{%
+  \@for\@j:=\M at keys\do{%
     \ifx\@j#1
       \let\@temperror\@gobble % eliminate error
       \@optionpresenttrue % set switch to true
     \fi}
-  \@for\@j:=\M at letterlikekeys\do{%
-    \ifx\@j#1
-      \expandafter\M at CommandInitializeInfo\csname math#1\endcsname
-      \csname define@#1\endcsname % initialize command
-      \let\@temperror\@gobble % eliminate error
-      \@optionpresenttrue % set switch to true
-    \fi}
-    \@temperror{#1}}
+  \def\@j{empty} % if option is "empty," we do nothing
+  \ifx\@j#1
+    \let\@temperror\@gobble
+    \@optionpresentfalse
+  \fi
+  \@temperror{#1}}
 \def\M at check@suboption at valid#1{%
   \let\@temperror\M at InvalidSuboptionError % error by default
   \@for\@j:=roman,upright,italic\do{%
@@ -577,106 +714,7 @@
 \long\def\edef at nospace#1#2{%
   \edef#1{#2}%
   \edef#1{\expandafter\zap at space#1 \@empty}}
-\def\M at split@colon#1:#2\@nil{%
-  \def\@tempbase{#1}
-  \def\@tempfeatures{#2}}
-\def\M at strip@colon#1:{#1}
-\def\M at check@in at nfss#1{%
-  \ifcsname TU+#1\endcsname
-    \let\M at f@ntn at me#1
-    \ifcsname TU/#1/\mddefault/\shapedefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\shapedefault}
-        {<->"\@tempbase:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\mddefault/\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\itdefault}
-        {<->"\@tempbase/I:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\bfdefault/\shapedefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\shapedefault}
-        {<->"\@tempbase/B:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\bfdefault/\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\itdefault}
-        {<->"\@tempbase/BI:\M at default@otf at features;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\mddefault/\scdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault}
-        {<->"\@tempbase:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\mddefault/\scdefault\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\mddefault}{\scdefault\itdefault}
-        {<->"\@tempbase/I:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\bfdefault/\scdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault}
-        {<->"\@tempbase/B:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-    \ifcsname TU/#1/\bfdefault/\scdefault\itdefault\endcsname
-    \else
-      \DeclareFontShape{TU}{#1}{\bfdefault}{\scdefault\itdefault}
-        {<->"\@tempbase/BI:\M at default@otf at features@sc;\@tempfeatures"}{}
-    \fi
-    \M at Decl@reF at milyfalse
-    \@break at tfor
-  \fi}
-\def\M at newfont#1{%
-  \edef\@tempa{#1}
-  \expandafter\M at split@colon\@tempa:\@nil
-  \def\@tempb{fontspec}
-  \ifx\@tempa\@tempb
-    \@ifpackageloaded{fontspec}{%
-      \expandafter\ifx\csname l_fontspec_family_tl\endcsname\@empty
-        \M at NoFontspecFamilyError
-      \else
-        \expandafter
-          \let\expandafter\M at f@ntn at me\csname l_fontspec_family_tl\encsname
-        \def\@tempbase{\M at f@ntn at me\space(from fontspec)}
-      \fi}{\M at NoFontspecError}
-  \else
-    \@ifpackageloaded{fontspec}
-    {\csname fontspec_set_family:Nnn\endcsname\M at f@ntn at me{}{\@tempa}}
-    {\M at Decl@reF at milytrue
-      \ifx\@tempfeatures\@empty\else
-        \edef\@tempfeatures{\expandafter\M at strip@colon\@tempfeatures}
-      \fi
-      \edef at nospace\@tempa{\@tempa}
-      \edef at nospace\@tempb{\@tempbase}
-      \@tfor\@i:=\@tempa\@tempb\@tempbase\do{\expandafter\M at check@in at nfss\@i}
-      \ifM at Decl@reF at mily
-        \wlog{^^JPackage mathfont Info:
-          Adding the font family \@tempa\space to the nfss.}
-        \DeclareFontFamily{TU}{\@tempa}{}
-        \let\M at f@ntn at me\@tempa
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\shapedefault}
-          {<->"\@tempbase:\M at default@otf at features;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\itdefault}
-          {<->"\@tempbase/I:\M at default@otf at features;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\shapedefault}
-          {<->"\@tempbase/B:\M at default@otf at features;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\itdefault}
-          {<->"\@tempbase/BI:\M at default@otf at features;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\scdefault}
-          {<->"\@tempbase:\M at default@otf at features@sc;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\mddefault}{\scdefault\itdefault}
-          {<->"\@tempbase/I:\M at default@otf at features@sc;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\scdefault}
-          {<->"\@tempbase/B:\M at default@otf at features@sc;\@tempfeatures"}{}
-        \DeclareFontShape{TU}{\@tempa}{\bfdefault}{\scdefault\itdefault}
-          {<->"\@tempbase/BI:\M at default@otf at features@sc;\@tempfeatures"}{}
-      \fi}
-  \fi}
-\@onlypreamble\M at check@in at nfss
-\@onlypreamble\M at newfont
-\protected\def\mathfont{\@ifnextchar[{\m at thf@nt}{\@mathfont[\M at defaultkeys]}}
-\def\m at thf@nt[#1]{\@mathfont[#1]}
+\protected\def\mathfont{\@ifnextchar[{\@mathfont}{\@mathfont[\M at defaultkeys]}}
 \def\@mathfont[#1]#2{%
   \ifx\set at mathchar\@@set at mathchar
     \M at InternalsRestoredError
@@ -684,8 +722,11 @@
     \M at toks{}
     \M at newfont{#2}
     \expandafter\edef\csname M at fontfamily@#2\endcsname{\M at f@ntn at me}
+    \expandafter\edef\csname M at fontfamily@base@#2\endcsname{\M at f@ntn at meb@se}
     \ifcsname M at fontid@\M at f@ntn at me\endcsname\else % need new \M at count value?
       \expandafter\edef\csname M at fontid@\M at f@ntn at me\endcsname{\the\M at count}
+      \expandafter\let\csname M at fontid@\M at f@ntn at meb@se\expandafter\endcsname
+        \csname M at fontid@\M at f@ntn at me\endcsname
       \advance\M at count\@ne
     \fi
     \edef\@tempa{\csname M at fontid@\M at f@ntn at me\endcsname}
@@ -712,13 +753,14 @@
             \let\@tempb\itdefault
           \fi
           \ifcsname symM\@tempc\@tempa\endcsname\else
+            \M at SymbolFontInfo{\@tempbase}{\M at f@ntn at meb@se}
+              {\mddefault/\@tempb}{M\@tempc\@tempa}
             \DeclareSymbolFont
-              {M\@tempc\@tempa}{TU}{\M at f@ntn at me}{\mddefault}{\@tempb}
+              {M\@tempc\@tempa}{TU}{\M at f@ntn at meb@se}{\mddefault}{\@tempb}
           \fi
           \expandafter
             \edef\csname M@\@temp at opt @fontinfo\endcsname{\@tempbase}
-          \M at FontChangeInfo{\@temp at opt}{\@tempbase}{\M at f@ntn at me}
-            {\mddefault/\@tempb}{M\@tempc\@tempa}
+          \M at FontChangeInfo{\@temp at opt}{\@tempbase}
           \csname M@\@temp at opt @set\endcsname % set default font
           \csname M@\@temp at opt true\endcsname % set switch to true
         \fi
@@ -728,9 +770,10 @@
       \wlog{The \string\mathfont\space command on line \the\inputlineno\space
         did not change the font for any characters!}
     \else
+      \wlog{}
       \typeout{:: mathfont :: Using font \@tempbase\space
         on line \the\inputlineno.}
-      \wlog{Character classes changed:\the\M at toks^^J}
+      \wlog{Character classes changed:\the\M at toks}
     \fi
   \fi}
 \@onlypreamble\mathfont
@@ -742,130 +785,60 @@
   \setmathfontcommands{#1}
   \let\rmdefault\M at f@ntn at me}
 \@onlypreamble\setfont
-\ifM at adjust@font
-  \protected\def\mathconstantsfont#1{%
-    \edef\@tempa{\csname M at fontfamily@#1\endcsname}
-    \ifx\@tempa\relax
-      \PackageError{mathfont}{Invalid font specifier}
-      {Your command was ignored--I can't parse your argument.\MessageBreak
-      Please make sure to use text that you have previously\MessageBreak
-      fed to \string\mathfont\space for the argument of
-      \string\mathconstantsfont.^^J}
+\ifdefined\directlua
+  \let\M at SetMathConstants\relax
+  \protected\def\mathconstantsfont{\@ifnextchar[{\@mathconstantsfont}
+      {\@mathconstantsfont[upright]}}
+  \def\@mathconstantsfont[#1]#2{%
+    \edef\@tempa{\csname M at fontfamily@base@#2\endcsname}
+    \expandafter\ifx\@tempa\relax
+      \M at BadMathConstantsFontError{#2}
     \else
-      \ifx\M at SetMathConstants\relax
-        \protected\def\M at SetMathConstants{%
-          \begingroup
-          \escapechar\m at ne
-          \expandafter\getanddefine at fonts
-            \csname symMupright\csname M at fontid@\m at th@const at nts@font\endcsname
-              \expandafter\endcsname % expands to \symMupright<id>
-            \csname TU/\m at th@const at nts@font/\seriesdefault/\shapedefault
-              \endcsname % expands to \TU/<nfss family name>/m/n
-          \globaldefs\@ne
-          \expandafter\@gobbletwo\math at fonts % gobble to avoid infinite loop
-          \endgroup}
+      \def\@tempb{#1}
+      \def\@tempc{upright}
+      \ifx\@tempb\@tempc
+        \let\@tempc\shapedefault
+      \else
+        \def\@tempc{italic}
+        \ifx\@tempb\@tempc
+          \let\@tempc\itdefault
+        \else
+          \M at BadMathConstantsFontTypeError{#1}
+        \fi
       \fi
+      \ifcsname symM#1\csname M at fontid@\@tempa\endcsname\endcsname\else
+        \DeclareSymbolFont{M#1\csname M at fontid@\@tempa\endcsname}
+          {TU}{\@tempa}{\mddefault}{\@tempc}
+      \fi
       \let\m at th@const at nts@font\@tempa
-    \fi}
-  \let\M at SetMathConstants\relax
+      \protected\def\M at SetMathConstants{%
+        \begingroup
+        \escapechar\m at ne
+        \expandafter\getanddefine at fonts
+          \csname symM#1\csname M at fontid@\m at th@const at nts@font\endcsname
+            \expandafter
+          \endcsname % expands to \symMupright<id>
+          \csname TU/\m at th@const at nts@font/\seriesdefault/\@tempc
+            \endcsname % expands to \TU/<nfss family name>/m/<shape>
+        \globaldefs\@ne
+        \expandafter\@gobbletwo\math at fonts % gobble to avoid infinite loop
+        \endgroup}
+      \fi}
   \def\math at fonts{\aftergroup\M at SetMathConstants}
-  \@onlypreamble\mathconstantsfont
+\else
+  \protected\def\mathconstantsfont{\M at LuaTeXOnlyWarning
+    \@ifnextchar[\@gobbletwo at brackets\@gobble}
 \fi
-\def\M at check@mode#1{%
-  \let\@tempa#1%
-  \ifmmode
-    \expandafter\@tempa
-  \else
-    \bgroup
-      \escapechar\m at ne
-      \expandafter
-    \egroup
-    \expandafter\M at HModeError\csname\expandafter\@gobble\string#1\endcsname
-    \expandafter$\expandafter\@tempa
-  \fi}
-\def\M at process@tokens#1#2{%
-  \edef\@tempa{#1}%
-  \expandafter\@tfor\expandafter\@k\expandafter:\expandafter=\@tempa\do{%
-    \expandafter\M at check@token\expandafter{\@k}%
-    \ifcase\M at errcode
-      \csname M@#2@\@k\endcsname
-    \or\expandafter\M at NestedArgWarning\csname math#2\endcsname{\@k}%
-    \or\expandafter\M at CSArgWarning\csname math#2\endcsname{\@k}%
-    \or\expandafter\M at CharacterArgWarning\csname math#2\endcsname{\@k}%
-    \or\expandafter\M at DoubleArgWarning\csname math#2\endcsname{\@k}%
-    \fi}}
-\def\M at check@token#1{%
-  \M at errcode\z@
-  \expandafter\ifx\expandafter\@nnil\@gobble#1\@nnil% good
-    \expandafter\@gobble\expandafter{\ifcat\bgroup#1% bad
-      \M at errcode\@ne
-    \else}%
-      \ifcat\relax\noexpand#1% bad
-        \M at errcode\tw@
-      \else
-        \ifnum\catcode`#1=11\relax% good
-        \else
-          \if 0#1% good
-          \else
-            \if 1#1% good
-            \else
-              \if 2#1% good
-              \else
-                \if 3#1% good
-                \else
-                  \if 4#1% good
-                  \else
-                    \if 5#1% good
-                    \else
-                      \if 6#1% good
-                      \else
-                        \if 7#1% good
-                        \else
-                          \if 8#1% good
-                          \else
-                            \if 9#1% good
-                            \else
-                              \M at errcode\thr@@
-                            \fi
-                          \fi
-                        \fi
-                      \fi
-                    \fi
-                  \fi
-                \fi
-              \fi
-            \fi
-          \fi
-        \fi
-      \fi
-    \fi
-  \else% matches the original \ifx\@nnil, etc.
-    \M at errcode=4\relax
-  \fi}
-\def\define at bb{%
-  \protected\def\mathbb{\M at check@mode\@mathbb}%
-  \def\@mathbb##1{\M at process@tokens{##1}{bb}}}
-\def\define at cal{%
-  \protected\def\mathcal{\M at check@mode\@mathcal}%
-  \def\@mathcal##1{\M at process@tokens{##1}{cal}}}
-\def\define at frak{%
-  \protected\def\mathfrak{\M at check@mode\@mathfrak}%
-  \def\@mathfrak##1{\M at process@tokens{##1}{frak}}}
-\def\define at bcal{%
-  \protected\def\mathbcal{\M at check@mode\@mathbcal}%
-  \def\@mathbcal##1{\M at process@tokens{##1}{bcal}}}
-\def\define at bfrak{%
-  \protected\def\mathbfrak{\M at check@mode\@mathbfrak}%
-  \def\@mathbfrak##1{\M at process@tokens{##1}{bfrak}}}
+\@onlypreamble\mathconstantsfont
 \def\M at check@csarg#1#2{%
-  \expandafter\ifx\expandafter\@nnil\@gobble#2\@nnil% good
-    \ifcat\relax\noexpand#2% good
+  \expandafter\ifx\expandafter\@nnil\@gobble#2\@nnil % good
+    \ifcat\relax\noexpand#2 % good
       \M at arg@goodtrue
-    \else
+    \else % if #2 not a control sequence
       \M at MissingControlSequenceError#1{#2}
       \M at arg@goodfalse
     \fi
-  \else
+  \else % if #2 is multiple tokens
     \M at DoubleArgError#1{#2}
     \M at arg@goodfalse
   \fi}
@@ -873,8 +846,8 @@
   \M at check@csarg\newmathfontcommand{#1}
   \ifM at arg@good
     \M at newfont{#2}
-    \M at NewFontCommandInfo{#1}{\@tempbase}{\M at f@ntn at me}{#3}{#4}
-    \DeclareMathAlphabet{#1}{TU}{\M at f@ntn at me}{#3}{#4}
+    \M at NewFontCommandInfo{#1}{\@tempbase}{\M at f@ntn at meb@se}{#3}{#4}
+    \DeclareMathAlphabet{#1}{TU}{\M at f@ntn at meb@se}{#3}{#4}
   \fi}
 \@onlypreamble\newmathfontcommand
 \def\M at define@newmath at cmd#1#2#3{%
@@ -912,11 +885,9 @@
   \newmathbfscit\mathbfscit{#1}}
 \@onlypreamble\setmathfontcommands
 \protected\def\newmathbold{%
-  \M at DeprecatedWarning\newmathbold\newmathbf
-  \newmathbf}
+  \M at DeprecatedWarning\newmathbold\newmathbf\newmathbf}
 \protected\def\newmathboldit{%
-  \M at DeprecatedWarning\newmathboldit\newmathbfit
-  \newmathbfit}
+  \M at DeprecatedWarning\newmathboldit\newmathbfit\newmathbfit}
 \ifM at adjust@font
   \def\M at check@int#1{%
   \M at arg@goodfalse
@@ -928,7 +899,7 @@
     \endgroup % first branch \endgroup
   \else
     \@expandtwoargs\in@{\@backslashchar}{\@tempa}
-    \ifin@ % is \ in #1?
+    \ifin@ % is backslash in #1?
       \endgroup % second branch \endgroup
     \else
       \directlua{
@@ -943,7 +914,7 @@
       end}
     \fi
   \fi}
-  \def\RuleThicknessFactor#1{%
+  \protected\def\RuleThicknessFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at rule@thickness at factor=#1\relax
@@ -950,7 +921,7 @@
     \else
       \M at BadIntegerError\RuleThicknessFactor{#1}
     \fi}
-  \def\IntegralItalicFactor#1{%
+  \protected\def\IntegralItalicFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at integral@italic at factor=#1\relax
@@ -957,7 +928,7 @@
     \else
       \M at BadIntegerError\IntegralItalicFactor{#1}
     \fi}
-  \def\SurdHorizontalFactor#1{%
+  \protected\def\SurdHorizontalFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at surd@horizontal at factor=#1\relax
@@ -964,7 +935,7 @@
     \else
       \M at BadIntegerError\SurdHorizontalFactor{#1}
     \fi}
-  \def\SurdVerticalFactor#1{%
+  \protected\def\SurdVerticalFactor#1{%
     \M at check@int{#1}
     \ifM at arg@good
       \global\M at surd@vertical at factor=#1\relax
@@ -973,9 +944,9 @@
     \fi}
 \else
   \@tfor\@i:=\RuleThicknessFactor\IntegralItalicFactor\SurdHorizontalFactor
-    \SurdVerticalFactor\CharmLine\CharmFile\mathconstantsfont
+    \SurdVerticalFactor\CharmLine\CharmFile
       \do{%
-        \expandafter\edef\@i{\noexpand\M at NoFontAdjustError
+        \protected\expandafter\edef\@i{\noexpand\M at NoFontAdjustError
           \expandafter\noexpand\@i
           \noexpand\@gobble}}
 \fi
@@ -1030,26 +1001,6 @@
     manually}}
   \fi
 \fi
-\AtBeginDocument{%
-  \bgroup\@tempswafalse
-  \ifM at bb
-    \@tempswatrue
-    \else\ifM at cal
-      \@tempswatrue
-      \else\ifM at frak
-        \@tempawatrue
-        \else\ifM at bfrak
-          \@tempswatrue
-        \fi
-      \fi
-    \fi
-  \fi
-  \expandafter\egroup\if at tempswa
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {\MessageBreak Package amsmath detected. Some warning\MessageBreak
-    messages for letterlike characters may be\MessageBreak
-    duplicated inside the align environment}}{}
-  \fi}
 \def\keyword at info@begindocument#1:#2\@nil{%
   \expandafter\ifx % next line is two cs to be compared
         \csname ifM@#1\expandafter\endcsname\csname iftrue\endcsname
@@ -1060,7 +1011,7 @@
     \wlog{#1:#2\@spaces No change.}
   \fi}
 \AtBeginDocument{%
-  \def\@tempa{%    <---- everything should be 13 characters long plus :
+  \def\@tempa{%    <-- everything should be 14 characters long
     upper:\@spaces\@spaces,%
     lower:\@spaces\@spaces,%
     diacritics:\space\space\space,%
@@ -1085,7 +1036,7 @@
     frak:\@spaces\@spaces\space,%
     bcal:\@spaces\@spaces\space,%
     bfrak:\@spaces\@spaces}
-  \wlog{^^JPackage mathfont Info: List of changes made in the preamble---}
+  \wlog{^^JPackage mathfont Info: List of changes made in the preamble.}
   \@for\@i:=\@tempa\do{%
     \expandafter\keyword at info@begindocument\@i\@nil}
   \wlog{}}
@@ -1155,7 +1106,7 @@
     \fi
   \else
     \@expandtwoargs\in@{\@backslashchar}{\@tempa}
-    \ifin@ % is \ in #1?
+    \ifin@ % is backslash in #1?
       \ifM at fromCharmFile
         \M at ForbiddenCharmFile{\@backslashchar}
       \else
@@ -1953,7 +1904,7 @@
   41, % )
   47, % /
   91, % [
-  92, % \
+  92, % backslash
   93, % ]
   123, % {
   125, % }
@@ -2384,7 +2335,7 @@
 \def\M at operator@set{%
   \ifM at adjust@font
     \edef\M at operator@num{\number\csname symM\M at operatorshape\@tempa\endcsname}
-    \def\M at default@latin at operator{%
+    \protected\edef\M at operator@mathcodes{%
       \Umathcode`A=7+\M at operator@num+`A\relax
       \Umathcode`B=7+\M at operator@num+`B\relax
       \Umathcode`C=7+\M at operator@num+`C\relax
@@ -2440,10 +2391,10 @@
       \Umathchardef\imath=7+\M at operator@num+1044506\relax
       \Umathchardef\jmath=7+\M at operator@num+1044500\relax}
   \else
-    \let\M at default@latin at operator\@empty
+    \let\M at operator@mathcodes\@empty
   \fi
   \xdef\operator at font{\noexpand\mathgroup
-      \csname symM\M at operatorshape\@tempa\endcsname\M at default@latin at operator}}
+      \csname symM\M at operatorshape\@tempa\endcsname\M at operator@mathcodes}}
 \ifM at adjust@font
   \def\M at delimiters@set{%
     \edef\M at delimiters@font{M\M at delimitersshape\@tempa}
@@ -2466,7 +2417,7 @@
     \protected\gdef\backslash{\ifmmode\mathbackslash\else\textbackslash\fi}
     \protected\xdef\mathbackslash{%
       \Udelimiter+2+\number\csname sym\M at delimiters@font\endcsname
-        +92\relax} % \
+        +92\relax} % backslash
     \protected\xdef\lbrace{%
       \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
         +123\relax} % {
@@ -2537,7 +2488,7 @@
     \gdef\sqrtsign##1{\@sqrts at gn{\mkern\radicandoffset##1}}}
 \else
   \def\M at radical@set{%
-    \edef\M at radical@font{M\@radicalshape\@tempa}
+    \edef\M at radical@font{M\M at radicalshape\@tempa}
     \DeclareMathSymbol{\surd}{\mathord}{\M at radical@font}{"221A}}
 \fi
 \def\M at bigops@set{%
@@ -2971,295 +2922,335 @@
   \DeclareMathSymbol{\lcirclearrow}{\mathrel}{\M at arrows@font}{"27F2}
   \DeclareMathSymbol{\rcirclearrow}{\mathrel}{\M at arrows@font}{"27F3}}
 \def\M at bb@set{%
-  \edef\M at bb@font{M\M at bbshape\@tempa}
-  \DeclareMathSymbol{\M at bb@A}{\mathord}{\M at bb@font}{"1D538}
-  \DeclareMathSymbol{\M at bb@B}{\mathord}{\M at bb@font}{"1D539}
-  \DeclareMathSymbol{\M at bb@C}{\mathord}{\M at bb@font}{"2102}
-  \DeclareMathSymbol{\M at bb@D}{\mathord}{\M at bb@font}{"1D53B}
-  \DeclareMathSymbol{\M at bb@E}{\mathord}{\M at bb@font}{"1D53C}
-  \DeclareMathSymbol{\M at bb@F}{\mathord}{\M at bb@font}{"1D53D}
-  \DeclareMathSymbol{\M at bb@G}{\mathord}{\M at bb@font}{"1D53E}
-  \DeclareMathSymbol{\M at bb@H}{\mathord}{\M at bb@font}{"210D}
-  \DeclareMathSymbol{\M at bb@I}{\mathord}{\M at bb@font}{"1D540}
-  \DeclareMathSymbol{\M at bb@J}{\mathord}{\M at bb@font}{"1D541}
-  \DeclareMathSymbol{\M at bb@K}{\mathord}{\M at bb@font}{"1D542}
-  \DeclareMathSymbol{\M at bb@L}{\mathord}{\M at bb@font}{"1D543}
-  \DeclareMathSymbol{\M at bb@M}{\mathord}{\M at bb@font}{"1D544}
-  \DeclareMathSymbol{\M at bb@N}{\mathord}{\M at bb@font}{"2115}
-  \DeclareMathSymbol{\M at bb@O}{\mathord}{\M at bb@font}{"1D546}
-  \DeclareMathSymbol{\M at bb@P}{\mathord}{\M at bb@font}{"2119}
-  \DeclareMathSymbol{\M at bb@Q}{\mathord}{\M at bb@font}{"211A}
-  \DeclareMathSymbol{\M at bb@R}{\mathord}{\M at bb@font}{"211D}
-  \DeclareMathSymbol{\M at bb@S}{\mathord}{\M at bb@font}{"1D54A}
-  \DeclareMathSymbol{\M at bb@T}{\mathord}{\M at bb@font}{"1D54B}
-  \DeclareMathSymbol{\M at bb@U}{\mathord}{\M at bb@font}{"1D54C}
-  \DeclareMathSymbol{\M at bb@V}{\mathord}{\M at bb@font}{"1D54D}
-  \DeclareMathSymbol{\M at bb@W}{\mathord}{\M at bb@font}{"1D54E}
-  \DeclareMathSymbol{\M at bb@X}{\mathord}{\M at bb@font}{"1D54F}
-  \DeclareMathSymbol{\M at bb@Y}{\mathord}{\M at bb@font}{"1D550}
-  \DeclareMathSymbol{\M at bb@Z}{\mathord}{\M at bb@font}{"2124}
-  \DeclareMathSymbol{\M at bb@a}{\mathord}{\M at bb@font}{"1D552}
-  \DeclareMathSymbol{\M at bb@b}{\mathord}{\M at bb@font}{"1D553}
-  \DeclareMathSymbol{\M at bb@c}{\mathord}{\M at bb@font}{"1D554}
-  \DeclareMathSymbol{\M at bb@d}{\mathord}{\M at bb@font}{"1D555}
-  \DeclareMathSymbol{\M at bb@e}{\mathord}{\M at bb@font}{"1D556}
-  \DeclareMathSymbol{\M at bb@f}{\mathord}{\M at bb@font}{"1D557}
-  \DeclareMathSymbol{\M at bb@g}{\mathord}{\M at bb@font}{"1D558}
-  \DeclareMathSymbol{\M at bb@h}{\mathord}{\M at bb@font}{"1D559}
-  \DeclareMathSymbol{\M at bb@i}{\mathord}{\M at bb@font}{"1D55A}
-  \DeclareMathSymbol{\M at bb@j}{\mathord}{\M at bb@font}{"1D55B}
-  \DeclareMathSymbol{\M at bb@k}{\mathord}{\M at bb@font}{"1D55C}
-  \DeclareMathSymbol{\M at bb@l}{\mathord}{\M at bb@font}{"1D55D}
-  \DeclareMathSymbol{\M at bb@m}{\mathord}{\M at bb@font}{"1D55E}
-  \DeclareMathSymbol{\M at bb@n}{\mathord}{\M at bb@font}{"1D55F}
-  \DeclareMathSymbol{\M at bb@o}{\mathord}{\M at bb@font}{"1D560}
-  \DeclareMathSymbol{\M at bb@p}{\mathord}{\M at bb@font}{"1D561}
-  \DeclareMathSymbol{\M at bb@q}{\mathord}{\M at bb@font}{"1D562}
-  \DeclareMathSymbol{\M at bb@r}{\mathord}{\M at bb@font}{"1D563}
-  \DeclareMathSymbol{\M at bb@s}{\mathord}{\M at bb@font}{"1D564}
-  \DeclareMathSymbol{\M at bb@t}{\mathord}{\M at bb@font}{"1D565}
-  \DeclareMathSymbol{\M at bb@u}{\mathord}{\M at bb@font}{"1D566}
-  \DeclareMathSymbol{\M at bb@v}{\mathord}{\M at bb@font}{"1D567}
-  \DeclareMathSymbol{\M at bb@w}{\mathord}{\M at bb@font}{"1D568}
-  \DeclareMathSymbol{\M at bb@x}{\mathord}{\M at bb@font}{"1D569}
-  \DeclareMathSymbol{\M at bb@y}{\mathord}{\M at bb@font}{"1D56A}
-  \DeclareMathSymbol{\M at bb@z}{\mathord}{\M at bb@font}{"1D56B}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@0\endcsname}{\mathord}{\M at bb@font}{"1D7D8}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@1\endcsname}{\mathord}{\M at bb@font}{"1D7D9}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@2\endcsname}{\mathord}{\M at bb@font}{"1D7DA}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@3\endcsname}{\mathord}{\M at bb@font}{"1D7DB}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@4\endcsname}{\mathord}{\M at bb@font}{"1D7DC}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@5\endcsname}{\mathord}{\M at bb@font}{"1D7DD}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@6\endcsname}{\mathord}{\M at bb@font}{"1D7DE}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@7\endcsname}{\mathord}{\M at bb@font}{"1D7DF}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@8\endcsname}{\mathord}{\M at bb@font}{"1D7E0}
-  \expandafter\DeclareMathSymbol\expandafter
-    {\csname M at bb@9\endcsname}{\mathord}{\M at bb@font}{"1D7E1}}
+  \protected\def\mathbb##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathbb
+      $%
+    \fi
+    \begingroup
+      \M at bb@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at bb@num{\number\csname symM\M at bbshape\@tempa\endcsname}
+  \protected\edef\M at bb@mathcodes{%
+  \Umathcode`A=0+\M at bb@num"1D538\relax
+  \Umathcode`B=0+\M at bb@num"1D539\relax
+  \Umathcode`C=0+\M at bb@num"2102\relax
+  \Umathcode`D=0+\M at bb@num"1D53B\relax
+  \Umathcode`E=0+\M at bb@num"1D53C\relax
+  \Umathcode`F=0+\M at bb@num"1D53D\relax
+  \Umathcode`G=0+\M at bb@num"1D53E\relax
+  \Umathcode`H=0+\M at bb@num"210D\relax
+  \Umathcode`I=0+\M at bb@num"1D540\relax
+  \Umathcode`J=0+\M at bb@num"1D541\relax
+  \Umathcode`K=0+\M at bb@num"1D542\relax
+  \Umathcode`L=0+\M at bb@num"1D543\relax
+  \Umathcode`M=0+\M at bb@num"1D544\relax
+  \Umathcode`N=0+\M at bb@num"2115\relax
+  \Umathcode`O=0+\M at bb@num"1D546\relax
+  \Umathcode`P=0+\M at bb@num"2119\relax
+  \Umathcode`Q=0+\M at bb@num"211A\relax
+  \Umathcode`R=0+\M at bb@num"211D\relax
+  \Umathcode`S=0+\M at bb@num"1D54A\relax
+  \Umathcode`T=0+\M at bb@num"1D54B\relax
+  \Umathcode`U=0+\M at bb@num"1D54C\relax
+  \Umathcode`V=0+\M at bb@num"1D54D\relax
+  \Umathcode`W=0+\M at bb@num"1D54E\relax
+  \Umathcode`X=0+\M at bb@num"1D54F\relax
+  \Umathcode`Y=0+\M at bb@num"1D550\relax
+  \Umathcode`Z=0+\M at bb@num"2124\relax
+  \Umathcode`a=0+\M at bb@num"1D552\relax
+  \Umathcode`b=0+\M at bb@num"1D553\relax
+  \Umathcode`c=0+\M at bb@num"1D554\relax
+  \Umathcode`d=0+\M at bb@num"1D555\relax
+  \Umathcode`e=0+\M at bb@num"1D556\relax
+  \Umathcode`f=0+\M at bb@num"1D557\relax
+  \Umathcode`g=0+\M at bb@num"1D558\relax
+  \Umathcode`h=0+\M at bb@num"1D559\relax
+  \Umathcode`i=0+\M at bb@num"1D55A\relax
+  \Umathcode`j=0+\M at bb@num"1D55B\relax
+  \Umathcode`k=0+\M at bb@num"1D55C\relax
+  \Umathcode`l=0+\M at bb@num"1D55D\relax
+  \Umathcode`m=0+\M at bb@num"1D55E\relax
+  \Umathcode`n=0+\M at bb@num"1D55F\relax
+  \Umathcode`o=0+\M at bb@num"1D560\relax
+  \Umathcode`p=0+\M at bb@num"1D561\relax
+  \Umathcode`q=0+\M at bb@num"1D562\relax
+  \Umathcode`r=0+\M at bb@num"1D563\relax
+  \Umathcode`s=0+\M at bb@num"1D564\relax
+  \Umathcode`t=0+\M at bb@num"1D565\relax
+  \Umathcode`u=0+\M at bb@num"1D566\relax
+  \Umathcode`v=0+\M at bb@num"1D567\relax
+  \Umathcode`w=0+\M at bb@num"1D568\relax
+  \Umathcode`x=0+\M at bb@num"1D569\relax
+  \Umathcode`y=0+\M at bb@num"1D56A\relax
+  \Umathcode`z=0+\M at bb@num"1D56B\relax
+  \Umathcode`0=0+\M at bb@num"1D7D8\relax
+  \Umathcode`1=0+\M at bb@num"1D7D9\relax
+  \Umathcode`2=0+\M at bb@num"1D7DA\relax
+  \Umathcode`3=0+\M at bb@num"1D7DB\relax
+  \Umathcode`4=0+\M at bb@num"1D7DC\relax
+  \Umathcode`5=0+\M at bb@num"1D7DD\relax
+  \Umathcode`6=0+\M at bb@num"1D7DE\relax
+  \Umathcode`7=0+\M at bb@num"1D7DF\relax
+  \Umathcode`8=0+\M at bb@num"1D7E0\relax
+  \Umathcode`9=0+\M at bb@num"1D7E1\relax}}
 \def\M at cal@set{%
-  \edef\M at cal@font{M\M at calshape\@tempa}
-  \DeclareMathSymbol{\M at cal@A}{\mathord}{\M at cal@font}{"1D49C}
-  \DeclareMathSymbol{\M at cal@B}{\mathord}{\M at cal@font}{"212C}
-  \DeclareMathSymbol{\M at cal@C}{\mathord}{\M at cal@font}{"1D49E}
-  \DeclareMathSymbol{\M at cal@D}{\mathord}{\M at cal@font}{"1D49F}
-  \DeclareMathSymbol{\M at cal@E}{\mathord}{\M at cal@font}{"2130}
-  \DeclareMathSymbol{\M at cal@F}{\mathord}{\M at cal@font}{"2131}
-  \DeclareMathSymbol{\M at cal@G}{\mathord}{\M at cal@font}{"1D4A2}
-  \DeclareMathSymbol{\M at cal@H}{\mathord}{\M at cal@font}{"210B}
-  \DeclareMathSymbol{\M at cal@I}{\mathord}{\M at cal@font}{"2110}
-  \DeclareMathSymbol{\M at cal@J}{\mathord}{\M at cal@font}{"1D4A5}
-  \DeclareMathSymbol{\M at cal@K}{\mathord}{\M at cal@font}{"1D4A6}
-  \DeclareMathSymbol{\M at cal@L}{\mathord}{\M at cal@font}{"2112}
-  \DeclareMathSymbol{\M at cal@M}{\mathord}{\M at cal@font}{"2133}
-  \DeclareMathSymbol{\M at cal@N}{\mathord}{\M at cal@font}{"1D4A9}
-  \DeclareMathSymbol{\M at cal@O}{\mathord}{\M at cal@font}{"1D4AA}
-  \DeclareMathSymbol{\M at cal@P}{\mathord}{\M at cal@font}{"1D4AB}
-  \DeclareMathSymbol{\M at cal@Q}{\mathord}{\M at cal@font}{"1D4AC}
-  \DeclareMathSymbol{\M at cal@R}{\mathord}{\M at cal@font}{"211B}
-  \DeclareMathSymbol{\M at cal@S}{\mathord}{\M at cal@font}{"1D4AE}
-  \DeclareMathSymbol{\M at cal@T}{\mathord}{\M at cal@font}{"1D4AF}
-  \DeclareMathSymbol{\M at cal@U}{\mathord}{\M at cal@font}{"1D4B0}
-  \DeclareMathSymbol{\M at cal@V}{\mathord}{\M at cal@font}{"1D4B1}
-  \DeclareMathSymbol{\M at cal@W}{\mathord}{\M at cal@font}{"1D4B2}
-  \DeclareMathSymbol{\M at cal@X}{\mathord}{\M at cal@font}{"1D4B3}
-  \DeclareMathSymbol{\M at cal@Y}{\mathord}{\M at cal@font}{"1D4B4}
-  \DeclareMathSymbol{\M at cal@Z}{\mathord}{\M at cal@font}{"1D4B5}
-  \DeclareMathSymbol{\M at cal@a}{\mathord}{\M at cal@font}{"1D4B6}
-  \DeclareMathSymbol{\M at cal@b}{\mathord}{\M at cal@font}{"1D4B7}
-  \DeclareMathSymbol{\M at cal@c}{\mathord}{\M at cal@font}{"1D4B8}
-  \DeclareMathSymbol{\M at cal@d}{\mathord}{\M at cal@font}{"1D4B9}
-  \DeclareMathSymbol{\M at cal@e}{\mathord}{\M at cal@font}{"212F}
-  \DeclareMathSymbol{\M at cal@f}{\mathord}{\M at cal@font}{"1D4BB}
-  \DeclareMathSymbol{\M at cal@g}{\mathord}{\M at cal@font}{"210A}
-  \DeclareMathSymbol{\M at cal@h}{\mathord}{\M at cal@font}{"1D4BD}
-  \DeclareMathSymbol{\M at cal@i}{\mathord}{\M at cal@font}{"1D4BE}
-  \DeclareMathSymbol{\M at cal@j}{\mathord}{\M at cal@font}{"1D4BF}
-  \DeclareMathSymbol{\M at cal@k}{\mathord}{\M at cal@font}{"1D4C0}
-  \DeclareMathSymbol{\M at cal@l}{\mathord}{\M at cal@font}{"1D4C1}
-  \DeclareMathSymbol{\M at cal@m}{\mathord}{\M at cal@font}{"1D4C2}
-  \DeclareMathSymbol{\M at cal@n}{\mathord}{\M at cal@font}{"1D4C3}
-  \DeclareMathSymbol{\M at cal@o}{\mathord}{\M at cal@font}{"2134}
-  \DeclareMathSymbol{\M at cal@p}{\mathord}{\M at cal@font}{"1D4C5}
-  \DeclareMathSymbol{\M at cal@q}{\mathord}{\M at cal@font}{"1D4C6}
-  \DeclareMathSymbol{\M at cal@r}{\mathord}{\M at cal@font}{"1D4C7}
-  \DeclareMathSymbol{\M at cal@s}{\mathord}{\M at cal@font}{"1D4C8}
-  \DeclareMathSymbol{\M at cal@t}{\mathord}{\M at cal@font}{"1D4C9}
-  \DeclareMathSymbol{\M at cal@u}{\mathord}{\M at cal@font}{"1D4CA}
-  \DeclareMathSymbol{\M at cal@v}{\mathord}{\M at cal@font}{"1D4CB}
-  \DeclareMathSymbol{\M at cal@w}{\mathord}{\M at cal@font}{"1D4CC}
-  \DeclareMathSymbol{\M at cal@x}{\mathord}{\M at cal@font}{"1D4CD}
-  \DeclareMathSymbol{\M at cal@y}{\mathord}{\M at cal@font}{"1D4CE}
-  \DeclareMathSymbol{\M at cal@z}{\mathord}{\M at cal@font}{"1D4CF}}
+  \protected\def\mathcal##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathcal
+      $%
+    \fi
+    \begingroup
+      \M at cal@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at cal@num{\number\csname symM\M at calshape\@tempa\endcsname}
+  \protected\edef\M at cal@mathcodes{%
+  \Umathcode`A=0+\M at cal@num"1D49C\relax
+  \Umathcode`B=0+\M at cal@num"212C\relax
+  \Umathcode`C=0+\M at cal@num"1D49E\relax
+  \Umathcode`D=0+\M at cal@num"1D49F\relax
+  \Umathcode`E=0+\M at cal@num"2130\relax
+  \Umathcode`F=0+\M at cal@num"2131\relax
+  \Umathcode`G=0+\M at cal@num"1D4A2\relax
+  \Umathcode`H=0+\M at cal@num"210B\relax
+  \Umathcode`I=0+\M at cal@num"2110\relax
+  \Umathcode`J=0+\M at cal@num"1D4A5\relax
+  \Umathcode`K=0+\M at cal@num"1D4A6\relax
+  \Umathcode`L=0+\M at cal@num"2112\relax
+  \Umathcode`M=0+\M at cal@num"2133\relax
+  \Umathcode`N=0+\M at cal@num"1D4A9\relax
+  \Umathcode`O=0+\M at cal@num"1D4AA\relax
+  \Umathcode`P=0+\M at cal@num"1D4AB\relax
+  \Umathcode`Q=0+\M at cal@num"1D4AC\relax
+  \Umathcode`R=0+\M at cal@num"211B\relax
+  \Umathcode`S=0+\M at cal@num"1D4AE\relax
+  \Umathcode`T=0+\M at cal@num"1D4AF\relax
+  \Umathcode`U=0+\M at cal@num"1D4B0\relax
+  \Umathcode`V=0+\M at cal@num"1D4B1\relax
+  \Umathcode`W=0+\M at cal@num"1D4B2\relax
+  \Umathcode`X=0+\M at cal@num"1D4B3\relax
+  \Umathcode`Y=0+\M at cal@num"1D4B4\relax
+  \Umathcode`Z=0+\M at cal@num"1D4B5\relax
+  \Umathcode`a=0+\M at cal@num"1D4B6\relax
+  \Umathcode`b=0+\M at cal@num"1D4B7\relax
+  \Umathcode`c=0+\M at cal@num"1D4B8\relax
+  \Umathcode`d=0+\M at cal@num"1D4B9\relax
+  \Umathcode`e=0+\M at cal@num"212F\relax
+  \Umathcode`f=0+\M at cal@num"1D4BB\relax
+  \Umathcode`g=0+\M at cal@num"210A\relax
+  \Umathcode`h=0+\M at cal@num"1D4BD\relax
+  \Umathcode`i=0+\M at cal@num"1D4BE\relax
+  \Umathcode`j=0+\M at cal@num"1D4BF\relax
+  \Umathcode`k=0+\M at cal@num"1D4C0\relax
+  \Umathcode`l=0+\M at cal@num"1D4C1\relax
+  \Umathcode`m=0+\M at cal@num"1D4C2\relax
+  \Umathcode`n=0+\M at cal@num"1D4C3\relax
+  \Umathcode`o=0+\M at cal@num"2134\relax
+  \Umathcode`p=0+\M at cal@num"1D4C5\relax
+  \Umathcode`q=0+\M at cal@num"1D4C6\relax
+  \Umathcode`r=0+\M at cal@num"1D4C7\relax
+  \Umathcode`s=0+\M at cal@num"1D4C8\relax
+  \Umathcode`t=0+\M at cal@num"1D4C9\relax
+  \Umathcode`u=0+\M at cal@num"1D4CA\relax
+  \Umathcode`v=0+\M at cal@num"1D4CB\relax
+  \Umathcode`w=0+\M at cal@num"1D4CC\relax
+  \Umathcode`x=0+\M at cal@num"1D4CD\relax
+  \Umathcode`y=0+\M at cal@num"1D4CE\relax
+  \Umathcode`z=0+\M at cal@num"1D4CF\relax}}
 \def\M at frak@set{%
-  \edef\M at frak@font{M\M at frakshape\@tempa}
-  \DeclareMathSymbol{\M at frak@A}{\mathord}{\M at frak@font}{"1D504}
-  \DeclareMathSymbol{\M at frak@B}{\mathord}{\M at frak@font}{"1D505}
-  \DeclareMathSymbol{\M at frak@C}{\mathord}{\M at frak@font}{"212D}
-  \DeclareMathSymbol{\M at frak@D}{\mathord}{\M at frak@font}{"1D507}
-  \DeclareMathSymbol{\M at frak@E}{\mathord}{\M at frak@font}{"1D508}
-  \DeclareMathSymbol{\M at frak@F}{\mathord}{\M at frak@font}{"1D509}
-  \DeclareMathSymbol{\M at frak@G}{\mathord}{\M at frak@font}{"1D50A}
-  \DeclareMathSymbol{\M at frak@H}{\mathord}{\M at frak@font}{"210C}
-  \DeclareMathSymbol{\M at frak@I}{\mathord}{\M at frak@font}{"2111}
-  \DeclareMathSymbol{\M at frak@J}{\mathord}{\M at frak@font}{"1D50D}
-  \DeclareMathSymbol{\M at frak@K}{\mathord}{\M at frak@font}{"1D50E}
-  \DeclareMathSymbol{\M at frak@L}{\mathord}{\M at frak@font}{"1D50F}
-  \DeclareMathSymbol{\M at frak@M}{\mathord}{\M at frak@font}{"1D510}
-  \DeclareMathSymbol{\M at frak@N}{\mathord}{\M at frak@font}{"1D511}
-  \DeclareMathSymbol{\M at frak@O}{\mathord}{\M at frak@font}{"1D512}
-  \DeclareMathSymbol{\M at frak@P}{\mathord}{\M at frak@font}{"1D513}
-  \DeclareMathSymbol{\M at frak@Q}{\mathord}{\M at frak@font}{"1D514}
-  \DeclareMathSymbol{\M at frak@R}{\mathord}{\M at frak@font}{"211C}
-  \DeclareMathSymbol{\M at frak@S}{\mathord}{\M at frak@font}{"1D516}
-  \DeclareMathSymbol{\M at frak@T}{\mathord}{\M at frak@font}{"1D517}
-  \DeclareMathSymbol{\M at frak@U}{\mathord}{\M at frak@font}{"1D518}
-  \DeclareMathSymbol{\M at frak@V}{\mathord}{\M at frak@font}{"1D519}
-  \DeclareMathSymbol{\M at frak@W}{\mathord}{\M at frak@font}{"1D51A}
-  \DeclareMathSymbol{\M at frak@X}{\mathord}{\M at frak@font}{"1D51B}
-  \DeclareMathSymbol{\M at frak@Y}{\mathord}{\M at frak@font}{"1D51C}
-  \DeclareMathSymbol{\M at frak@Z}{\mathord}{\M at frak@font}{"2128}
-  \DeclareMathSymbol{\M at frak@a}{\mathord}{\M at frak@font}{"1D51E}
-  \DeclareMathSymbol{\M at frak@b}{\mathord}{\M at frak@font}{"1D51F}
-  \DeclareMathSymbol{\M at frak@c}{\mathord}{\M at frak@font}{"1D520}
-  \DeclareMathSymbol{\M at frak@d}{\mathord}{\M at frak@font}{"1D521}
-  \DeclareMathSymbol{\M at frak@e}{\mathord}{\M at frak@font}{"1D522}
-  \DeclareMathSymbol{\M at frak@f}{\mathord}{\M at frak@font}{"1D523}
-  \DeclareMathSymbol{\M at frak@g}{\mathord}{\M at frak@font}{"1D524}
-  \DeclareMathSymbol{\M at frak@h}{\mathord}{\M at frak@font}{"1D525}
-  \DeclareMathSymbol{\M at frak@i}{\mathord}{\M at frak@font}{"1D526}
-  \DeclareMathSymbol{\M at frak@j}{\mathord}{\M at frak@font}{"1D527}
-  \DeclareMathSymbol{\M at frak@k}{\mathord}{\M at frak@font}{"1D528}
-  \DeclareMathSymbol{\M at frak@l}{\mathord}{\M at frak@font}{"1D529}
-  \DeclareMathSymbol{\M at frak@m}{\mathord}{\M at frak@font}{"1D52A}
-  \DeclareMathSymbol{\M at frak@n}{\mathord}{\M at frak@font}{"1D52B}
-  \DeclareMathSymbol{\M at frak@o}{\mathord}{\M at frak@font}{"1D52C}
-  \DeclareMathSymbol{\M at frak@p}{\mathord}{\M at frak@font}{"1D52D}
-  \DeclareMathSymbol{\M at frak@q}{\mathord}{\M at frak@font}{"1D52E}
-  \DeclareMathSymbol{\M at frak@r}{\mathord}{\M at frak@font}{"1D52F}
-  \DeclareMathSymbol{\M at frak@s}{\mathord}{\M at frak@font}{"1D530}
-  \DeclareMathSymbol{\M at frak@t}{\mathord}{\M at frak@font}{"1D531}
-  \DeclareMathSymbol{\M at frak@u}{\mathord}{\M at frak@font}{"1D532}
-  \DeclareMathSymbol{\M at frak@v}{\mathord}{\M at frak@font}{"1D533}
-  \DeclareMathSymbol{\M at frak@w}{\mathord}{\M at frak@font}{"1D534}
-  \DeclareMathSymbol{\M at frak@x}{\mathord}{\M at frak@font}{"1D535}
-  \DeclareMathSymbol{\M at frak@y}{\mathord}{\M at frak@font}{"1D536}
-  \DeclareMathSymbol{\M at frak@z}{\mathord}{\M at frak@font}{"1D537}}
+  \protected\def\mathfrak##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathfrak
+      $%
+    \fi
+    \begingroup
+      \M at frak@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at frak@num{\number\csname symM\M at frakshape\@tempa\endcsname}
+  \protected\edef\M at frak@mathcodes{%
+  \Umathcode`A=0+\M at frak@num"1D504\relax
+  \Umathcode`B=0+\M at frak@num"1D505\relax
+  \Umathcode`C=0+\M at frak@num"212D\relax
+  \Umathcode`D=0+\M at frak@num"1D507\relax
+  \Umathcode`E=0+\M at frak@num"1D508\relax
+  \Umathcode`F=0+\M at frak@num"1D509\relax
+  \Umathcode`G=0+\M at frak@num"1D50A\relax
+  \Umathcode`H=0+\M at frak@num"210C\relax
+  \Umathcode`I=0+\M at frak@num"2111\relax
+  \Umathcode`J=0+\M at frak@num"1D50D\relax
+  \Umathcode`K=0+\M at frak@num"1D50E\relax
+  \Umathcode`L=0+\M at frak@num"1D50F\relax
+  \Umathcode`M=0+\M at frak@num"1D510\relax
+  \Umathcode`N=0+\M at frak@num"1D511\relax
+  \Umathcode`O=0+\M at frak@num"1D512\relax
+  \Umathcode`P=0+\M at frak@num"1D513\relax
+  \Umathcode`Q=0+\M at frak@num"1D514\relax
+  \Umathcode`R=0+\M at frak@num"211C\relax
+  \Umathcode`S=0+\M at frak@num"1D516\relax
+  \Umathcode`T=0+\M at frak@num"1D517\relax
+  \Umathcode`U=0+\M at frak@num"1D518\relax
+  \Umathcode`V=0+\M at frak@num"1D519\relax
+  \Umathcode`W=0+\M at frak@num"1D51A\relax
+  \Umathcode`X=0+\M at frak@num"1D51B\relax
+  \Umathcode`Y=0+\M at frak@num"1D51C\relax
+  \Umathcode`Z=0+\M at frak@num"2128\relax
+  \Umathcode`a=0+\M at frak@num"1D51E\relax
+  \Umathcode`b=0+\M at frak@num"1D51F\relax
+  \Umathcode`c=0+\M at frak@num"1D520\relax
+  \Umathcode`d=0+\M at frak@num"1D521\relax
+  \Umathcode`e=0+\M at frak@num"1D522\relax
+  \Umathcode`f=0+\M at frak@num"1D523\relax
+  \Umathcode`g=0+\M at frak@num"1D524\relax
+  \Umathcode`h=0+\M at frak@num"1D525\relax
+  \Umathcode`i=0+\M at frak@num"1D526\relax
+  \Umathcode`j=0+\M at frak@num"1D527\relax
+  \Umathcode`k=0+\M at frak@num"1D528\relax
+  \Umathcode`l=0+\M at frak@num"1D529\relax
+  \Umathcode`m=0+\M at frak@num"1D52A\relax
+  \Umathcode`n=0+\M at frak@num"1D52B\relax
+  \Umathcode`o=0+\M at frak@num"1D52C\relax
+  \Umathcode`p=0+\M at frak@num"1D52D\relax
+  \Umathcode`q=0+\M at frak@num"1D52E\relax
+  \Umathcode`r=0+\M at frak@num"1D52F\relax
+  \Umathcode`s=0+\M at frak@num"1D530\relax
+  \Umathcode`t=0+\M at frak@num"1D531\relax
+  \Umathcode`u=0+\M at frak@num"1D532\relax
+  \Umathcode`v=0+\M at frak@num"1D533\relax
+  \Umathcode`w=0+\M at frak@num"1D534\relax
+  \Umathcode`x=0+\M at frak@num"1D535\relax
+  \Umathcode`y=0+\M at frak@num"1D536\relax
+  \Umathcode`z=0+\M at frak@num"1D537\relax}}
 \def\M at bcal@set{%
-  \edef\M at bcal@font{M\M at bcalshape\@tempa}
-  \DeclareMathSymbol{\M at bcal@A}{\mathord}{\M at bcal@font}{"1D4D0}
-  \DeclareMathSymbol{\M at bcal@B}{\mathord}{\M at bcal@font}{"1D4D1}
-  \DeclareMathSymbol{\M at bcal@C}{\mathord}{\M at bcal@font}{"1D4D2}
-  \DeclareMathSymbol{\M at bcal@D}{\mathord}{\M at bcal@font}{"1D4D3}
-  \DeclareMathSymbol{\M at bcal@E}{\mathord}{\M at bcal@font}{"1D4D4}
-  \DeclareMathSymbol{\M at bcal@F}{\mathord}{\M at bcal@font}{"1D4D5}
-  \DeclareMathSymbol{\M at bcal@G}{\mathord}{\M at bcal@font}{"1D4D6}
-  \DeclareMathSymbol{\M at bcal@H}{\mathord}{\M at bcal@font}{"1D4D7}
-  \DeclareMathSymbol{\M at bcal@I}{\mathord}{\M at bcal@font}{"1D4D8}
-  \DeclareMathSymbol{\M at bcal@J}{\mathord}{\M at bcal@font}{"1D4D9}
-  \DeclareMathSymbol{\M at bcal@K}{\mathord}{\M at bcal@font}{"1D4DA}
-  \DeclareMathSymbol{\M at bcal@L}{\mathord}{\M at bcal@font}{"1D4DB}
-  \DeclareMathSymbol{\M at bcal@M}{\mathord}{\M at bcal@font}{"1D4DC}
-  \DeclareMathSymbol{\M at bcal@N}{\mathord}{\M at bcal@font}{"1D4DD}
-  \DeclareMathSymbol{\M at bcal@O}{\mathord}{\M at bcal@font}{"1D4DE}
-  \DeclareMathSymbol{\M at bcal@P}{\mathord}{\M at bcal@font}{"1D4DF}
-  \DeclareMathSymbol{\M at bcal@Q}{\mathord}{\M at bcal@font}{"1D4E0}
-  \DeclareMathSymbol{\M at bcal@R}{\mathord}{\M at bcal@font}{"1D4E1}
-  \DeclareMathSymbol{\M at bcal@S}{\mathord}{\M at bcal@font}{"1D4E2}
-  \DeclareMathSymbol{\M at bcal@T}{\mathord}{\M at bcal@font}{"1D4E3}
-  \DeclareMathSymbol{\M at bcal@U}{\mathord}{\M at bcal@font}{"1D4E4}
-  \DeclareMathSymbol{\M at bcal@V}{\mathord}{\M at bcal@font}{"1D4E5}
-  \DeclareMathSymbol{\M at bcal@W}{\mathord}{\M at bcal@font}{"1D4E6}
-  \DeclareMathSymbol{\M at bcal@X}{\mathord}{\M at bcal@font}{"1D4E7}
-  \DeclareMathSymbol{\M at bcal@Y}{\mathord}{\M at bcal@font}{"1D4E8}
-  \DeclareMathSymbol{\M at bcal@Z}{\mathord}{\M at bcal@font}{"1D4E9}
-  \DeclareMathSymbol{\M at bcal@a}{\mathord}{\M at bcal@font}{"1D4EA}
-  \DeclareMathSymbol{\M at bcal@b}{\mathord}{\M at bcal@font}{"1D4EB}
-  \DeclareMathSymbol{\M at bcal@c}{\mathord}{\M at bcal@font}{"1D4EC}
-  \DeclareMathSymbol{\M at bcal@d}{\mathord}{\M at bcal@font}{"1D4ED}
-  \DeclareMathSymbol{\M at bcal@e}{\mathord}{\M at bcal@font}{"1D4EE}
-  \DeclareMathSymbol{\M at bcal@f}{\mathord}{\M at bcal@font}{"1D4EF}
-  \DeclareMathSymbol{\M at bcal@g}{\mathord}{\M at bcal@font}{"1D4F0}
-  \DeclareMathSymbol{\M at bcal@h}{\mathord}{\M at bcal@font}{"1D4F1}
-  \DeclareMathSymbol{\M at bcal@i}{\mathord}{\M at bcal@font}{"1D4F2}
-  \DeclareMathSymbol{\M at bcal@j}{\mathord}{\M at bcal@font}{"1D4F3}
-  \DeclareMathSymbol{\M at bcal@k}{\mathord}{\M at bcal@font}{"1D4F4}
-  \DeclareMathSymbol{\M at bcal@l}{\mathord}{\M at bcal@font}{"1D4F5}
-  \DeclareMathSymbol{\M at bcal@m}{\mathord}{\M at bcal@font}{"1D4F6}
-  \DeclareMathSymbol{\M at bcal@n}{\mathord}{\M at bcal@font}{"1D4F7}
-  \DeclareMathSymbol{\M at bcal@o}{\mathord}{\M at bcal@font}{"1D4F8}
-  \DeclareMathSymbol{\M at bcal@p}{\mathord}{\M at bcal@font}{"1D4F9}
-  \DeclareMathSymbol{\M at bcal@q}{\mathord}{\M at bcal@font}{"1D4FA}
-  \DeclareMathSymbol{\M at bcal@r}{\mathord}{\M at bcal@font}{"1D4FB}
-  \DeclareMathSymbol{\M at bcal@s}{\mathord}{\M at bcal@font}{"1D4FC}
-  \DeclareMathSymbol{\M at bcal@t}{\mathord}{\M at bcal@font}{"1D4FD}
-  \DeclareMathSymbol{\M at bcal@u}{\mathord}{\M at bcal@font}{"1D4FE}
-  \DeclareMathSymbol{\M at bcal@v}{\mathord}{\M at bcal@font}{"1D4FF}
-  \DeclareMathSymbol{\M at bcal@w}{\mathord}{\M at bcal@font}{"1D500}
-  \DeclareMathSymbol{\M at bcal@x}{\mathord}{\M at bcal@font}{"1D501}
-  \DeclareMathSymbol{\M at bcal@y}{\mathord}{\M at bcal@font}{"1D502}
-  \DeclareMathSymbol{\M at bcal@z}{\mathord}{\M at bcal@font}{"1D503}}
+  \protected\def\mathbcal##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathbcal
+      $%
+    \fi
+    \begingroup
+      \M at bcal@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at bcal@num{\number\csname symM\M at bcalshape\@tempa\endcsname}
+  \protected\edef\M at bcal@mathcodes{%
+  \Umathcode`A=0+\M at bcal@num"1D4D0\relax
+  \Umathcode`B=0+\M at bcal@num"1D4D1\relax
+  \Umathcode`C=0+\M at bcal@num"1D4D2\relax
+  \Umathcode`D=0+\M at bcal@num"1D4D3\relax
+  \Umathcode`E=0+\M at bcal@num"1D4D4\relax
+  \Umathcode`F=0+\M at bcal@num"1D4D5\relax
+  \Umathcode`G=0+\M at bcal@num"1D4D6\relax
+  \Umathcode`H=0+\M at bcal@num"1D4D7\relax
+  \Umathcode`I=0+\M at bcal@num"1D4D8\relax
+  \Umathcode`J=0+\M at bcal@num"1D4D9\relax
+  \Umathcode`K=0+\M at bcal@num"1D4DA\relax
+  \Umathcode`L=0+\M at bcal@num"1D4DB\relax
+  \Umathcode`M=0+\M at bcal@num"1D4DC\relax
+  \Umathcode`N=0+\M at bcal@num"1D4DD\relax
+  \Umathcode`O=0+\M at bcal@num"1D4DE\relax
+  \Umathcode`P=0+\M at bcal@num"1D4DF\relax
+  \Umathcode`Q=0+\M at bcal@num"1D4E0\relax
+  \Umathcode`R=0+\M at bcal@num"1D4E1\relax
+  \Umathcode`S=0+\M at bcal@num"1D4E2\relax
+  \Umathcode`T=0+\M at bcal@num"1D4E3\relax
+  \Umathcode`U=0+\M at bcal@num"1D4E4\relax
+  \Umathcode`V=0+\M at bcal@num"1D4E5\relax
+  \Umathcode`W=0+\M at bcal@num"1D4E6\relax
+  \Umathcode`X=0+\M at bcal@num"1D4E7\relax
+  \Umathcode`Y=0+\M at bcal@num"1D4E8\relax
+  \Umathcode`Z=0+\M at bcal@num"1D4E9\relax
+  \Umathcode`a=0+\M at bcal@num"1D4EA\relax
+  \Umathcode`b=0+\M at bcal@num"1D4EB\relax
+  \Umathcode`c=0+\M at bcal@num"1D4EC\relax
+  \Umathcode`d=0+\M at bcal@num"1D4ED\relax
+  \Umathcode`e=0+\M at bcal@num"1D4EE\relax
+  \Umathcode`f=0+\M at bcal@num"1D4EF\relax
+  \Umathcode`g=0+\M at bcal@num"1D4F0\relax
+  \Umathcode`h=0+\M at bcal@num"1D4F1\relax
+  \Umathcode`i=0+\M at bcal@num"1D4F2\relax
+  \Umathcode`j=0+\M at bcal@num"1D4F3\relax
+  \Umathcode`k=0+\M at bcal@num"1D4F4\relax
+  \Umathcode`l=0+\M at bcal@num"1D4F5\relax
+  \Umathcode`m=0+\M at bcal@num"1D4F6\relax
+  \Umathcode`n=0+\M at bcal@num"1D4F7\relax
+  \Umathcode`o=0+\M at bcal@num"1D4F8\relax
+  \Umathcode`p=0+\M at bcal@num"1D4F9\relax
+  \Umathcode`q=0+\M at bcal@num"1D4FA\relax
+  \Umathcode`r=0+\M at bcal@num"1D4FB\relax
+  \Umathcode`s=0+\M at bcal@num"1D4FC\relax
+  \Umathcode`t=0+\M at bcal@num"1D4FD\relax
+  \Umathcode`u=0+\M at bcal@num"1D4FE\relax
+  \Umathcode`v=0+\M at bcal@num"1D4FF\relax
+  \Umathcode`w=0+\M at bcal@num"1D500\relax
+  \Umathcode`x=0+\M at bcal@num"1D501\relax
+  \Umathcode`y=0+\M at bcal@num"1D502\relax
+  \Umathcode`z=0+\M at bcal@num"1D503\relax}}
 \def\M at bfrak@set{%
-  \edef\M at bfrak@font{M\M at bfrakshape\@tempa}
-  \DeclareMathSymbol{\M at bfrak@A}{\mathord}{\M at bfrak@font}{"1D56C}
-  \DeclareMathSymbol{\M at bfrak@B}{\mathord}{\M at bfrak@font}{"1D56D}
-  \DeclareMathSymbol{\M at bfrak@C}{\mathord}{\M at bfrak@font}{"1D56E}
-  \DeclareMathSymbol{\M at bfrak@D}{\mathord}{\M at bfrak@font}{"1D56F}
-  \DeclareMathSymbol{\M at bfrak@E}{\mathord}{\M at bfrak@font}{"1D570}
-  \DeclareMathSymbol{\M at bfrak@F}{\mathord}{\M at bfrak@font}{"1D571}
-  \DeclareMathSymbol{\M at bfrak@G}{\mathord}{\M at bfrak@font}{"1D572}
-  \DeclareMathSymbol{\M at bfrak@H}{\mathord}{\M at bfrak@font}{"1D573}
-  \DeclareMathSymbol{\M at bfrak@I}{\mathord}{\M at bfrak@font}{"1D574}
-  \DeclareMathSymbol{\M at bfrak@J}{\mathord}{\M at bfrak@font}{"1D575}
-  \DeclareMathSymbol{\M at bfrak@K}{\mathord}{\M at bfrak@font}{"1D576}
-  \DeclareMathSymbol{\M at bfrak@L}{\mathord}{\M at bfrak@font}{"1D577}
-  \DeclareMathSymbol{\M at bfrak@M}{\mathord}{\M at bfrak@font}{"1D578}
-  \DeclareMathSymbol{\M at bfrak@N}{\mathord}{\M at bfrak@font}{"1D579}
-  \DeclareMathSymbol{\M at bfrak@O}{\mathord}{\M at bfrak@font}{"1D57A}
-  \DeclareMathSymbol{\M at bfrak@P}{\mathord}{\M at bfrak@font}{"1D57B}
-  \DeclareMathSymbol{\M at bfrak@Q}{\mathord}{\M at bfrak@font}{"1D57C}
-  \DeclareMathSymbol{\M at bfrak@R}{\mathord}{\M at bfrak@font}{"1D57D}
-  \DeclareMathSymbol{\M at bfrak@S}{\mathord}{\M at bfrak@font}{"1D57E}
-  \DeclareMathSymbol{\M at bfrak@T}{\mathord}{\M at bfrak@font}{"1D57F}
-  \DeclareMathSymbol{\M at bfrak@U}{\mathord}{\M at bfrak@font}{"1D580}
-  \DeclareMathSymbol{\M at bfrak@V}{\mathord}{\M at bfrak@font}{"1D581}
-  \DeclareMathSymbol{\M at bfrak@W}{\mathord}{\M at bfrak@font}{"1D582}
-  \DeclareMathSymbol{\M at bfrak@X}{\mathord}{\M at bfrak@font}{"1D583}
-  \DeclareMathSymbol{\M at bfrak@Y}{\mathord}{\M at bfrak@font}{"1D584}
-  \DeclareMathSymbol{\M at bfrak@Z}{\mathord}{\M at bfrak@font}{"1D585}
-  \DeclareMathSymbol{\M at bfrak@a}{\mathord}{\M at bfrak@font}{"1D586}
-  \DeclareMathSymbol{\M at bfrak@b}{\mathord}{\M at bfrak@font}{"1D587}
-  \DeclareMathSymbol{\M at bfrak@c}{\mathord}{\M at bfrak@font}{"1D588}
-  \DeclareMathSymbol{\M at bfrak@d}{\mathord}{\M at bfrak@font}{"1D589}
-  \DeclareMathSymbol{\M at bfrak@e}{\mathord}{\M at bfrak@font}{"1D58A}
-  \DeclareMathSymbol{\M at bfrak@f}{\mathord}{\M at bfrak@font}{"1D58B}
-  \DeclareMathSymbol{\M at bfrak@g}{\mathord}{\M at bfrak@font}{"1D58C}
-  \DeclareMathSymbol{\M at bfrak@h}{\mathord}{\M at bfrak@font}{"1D58D}
-  \DeclareMathSymbol{\M at bfrak@i}{\mathord}{\M at bfrak@font}{"1D58E}
-  \DeclareMathSymbol{\M at bfrak@j}{\mathord}{\M at bfrak@font}{"1D58F}
-  \DeclareMathSymbol{\M at bfrak@k}{\mathord}{\M at bfrak@font}{"1D590}
-  \DeclareMathSymbol{\M at bfrak@l}{\mathord}{\M at bfrak@font}{"1D591}
-  \DeclareMathSymbol{\M at bfrak@m}{\mathord}{\M at bfrak@font}{"1D592}
-  \DeclareMathSymbol{\M at bfrak@n}{\mathord}{\M at bfrak@font}{"1D593}
-  \DeclareMathSymbol{\M at bfrak@o}{\mathord}{\M at bfrak@font}{"1D594}
-  \DeclareMathSymbol{\M at bfrak@p}{\mathord}{\M at bfrak@font}{"1D595}
-  \DeclareMathSymbol{\M at bfrak@q}{\mathord}{\M at bfrak@font}{"1D596}
-  \DeclareMathSymbol{\M at bfrak@r}{\mathord}{\M at bfrak@font}{"1D597}
-  \DeclareMathSymbol{\M at bfrak@s}{\mathord}{\M at bfrak@font}{"1D598}
-  \DeclareMathSymbol{\M at bfrak@t}{\mathord}{\M at bfrak@font}{"1D599}
-  \DeclareMathSymbol{\M at bfrak@u}{\mathord}{\M at bfrak@font}{"1D59A}
-  \DeclareMathSymbol{\M at bfrak@v}{\mathord}{\M at bfrak@font}{"1D59B}
-  \DeclareMathSymbol{\M at bfrak@w}{\mathord}{\M at bfrak@font}{"1D59C}
-  \DeclareMathSymbol{\M at bfrak@x}{\mathord}{\M at bfrak@font}{"1D59D}
-  \DeclareMathSymbol{\M at bfrak@y}{\mathord}{\M at bfrak@font}{"1D59E}
-  \DeclareMathSymbol{\M at bfrak@z}{\mathord}{\M at bfrak@font}{"1D59F}}
+  \protected\def\mathbfrak##1{\relax
+    \ifmmode\else
+      \M at HModeError\mathbfrak
+      $%
+    \fi
+    \begingroup
+      \M at bfrak@mathcodes
+      ##1%
+    \endgroup}
+  \edef\M at bfrak@num{\number\csname symM\M at bfrakshape\@tempa\endcsname}
+  \protected\edef\M at bfrak@mathcodes{%
+  \Umathcode`A=0+\M at bfrak@num"1D56C\relax
+  \Umathcode`B=0+\M at bfrak@num"1D56D\relax
+  \Umathcode`C=0+\M at bfrak@num"1D56E\relax
+  \Umathcode`D=0+\M at bfrak@num"1D56F\relax
+  \Umathcode`E=0+\M at bfrak@num"1D570\relax
+  \Umathcode`F=0+\M at bfrak@num"1D571\relax
+  \Umathcode`G=0+\M at bfrak@num"1D572\relax
+  \Umathcode`H=0+\M at bfrak@num"1D573\relax
+  \Umathcode`I=0+\M at bfrak@num"1D574\relax
+  \Umathcode`J=0+\M at bfrak@num"1D575\relax
+  \Umathcode`K=0+\M at bfrak@num"1D576\relax
+  \Umathcode`L=0+\M at bfrak@num"1D577\relax
+  \Umathcode`M=0+\M at bfrak@num"1D578\relax
+  \Umathcode`N=0+\M at bfrak@num"1D579\relax
+  \Umathcode`O=0+\M at bfrak@num"1D57A\relax
+  \Umathcode`P=0+\M at bfrak@num"1D57B\relax
+  \Umathcode`Q=0+\M at bfrak@num"1D57C\relax
+  \Umathcode`R=0+\M at bfrak@num"1D57D\relax
+  \Umathcode`S=0+\M at bfrak@num"1D57E\relax
+  \Umathcode`T=0+\M at bfrak@num"1D57F\relax
+  \Umathcode`U=0+\M at bfrak@num"1D580\relax
+  \Umathcode`V=0+\M at bfrak@num"1D581\relax
+  \Umathcode`W=0+\M at bfrak@num"1D582\relax
+  \Umathcode`X=0+\M at bfrak@num"1D583\relax
+  \Umathcode`Y=0+\M at bfrak@num"1D584\relax
+  \Umathcode`Z=0+\M at bfrak@num"1D585\relax
+  \Umathcode`a=0+\M at bfrak@num"1D586\relax
+  \Umathcode`b=0+\M at bfrak@num"1D587\relax
+  \Umathcode`c=0+\M at bfrak@num"1D588\relax
+  \Umathcode`d=0+\M at bfrak@num"1D589\relax
+  \Umathcode`e=0+\M at bfrak@num"1D58A\relax
+  \Umathcode`f=0+\M at bfrak@num"1D58B\relax
+  \Umathcode`g=0+\M at bfrak@num"1D58C\relax
+  \Umathcode`h=0+\M at bfrak@num"1D58D\relax
+  \Umathcode`i=0+\M at bfrak@num"1D58E\relax
+  \Umathcode`j=0+\M at bfrak@num"1D58F\relax
+  \Umathcode`k=0+\M at bfrak@num"1D590\relax
+  \Umathcode`l=0+\M at bfrak@num"1D591\relax
+  \Umathcode`m=0+\M at bfrak@num"1D592\relax
+  \Umathcode`n=0+\M at bfrak@num"1D593\relax
+  \Umathcode`o=0+\M at bfrak@num"1D594\relax
+  \Umathcode`p=0+\M at bfrak@num"1D595\relax
+  \Umathcode`q=0+\M at bfrak@num"1D596\relax
+  \Umathcode`r=0+\M at bfrak@num"1D597\relax
+  \Umathcode`s=0+\M at bfrak@num"1D598\relax
+  \Umathcode`t=0+\M at bfrak@num"1D599\relax
+  \Umathcode`u=0+\M at bfrak@num"1D59A\relax
+  \Umathcode`v=0+\M at bfrak@num"1D59B\relax
+  \Umathcode`w=0+\M at bfrak@num"1D59C\relax
+  \Umathcode`x=0+\M at bfrak@num"1D59D\relax
+  \Umathcode`y=0+\M at bfrak@num"1D59E\relax
+  \Umathcode`z=0+\M at bfrak@num"1D59F\relax}}
 \endinput
 %%
 %% End of file `mathfont.sty'.



More information about the tex-live-commits mailing list.