texlive[61440] Master/texmf-dist: mathfont (29dec21)

commits+karl at tug.org commits+karl at tug.org
Wed Dec 29 22:35:31 CET 2021


Revision: 61440
          http://tug.org/svn/texlive?view=revision&revision=61440
Author:   karl
Date:     2021-12-29 22:35:30 +0100 (Wed, 29 Dec 2021)
Log Message:
-----------
mathfont (29dec21)

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_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

Added Paths:
-----------
    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

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_index_warning.tex

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/README.txt	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/README.txt	2021-12-29 21:35:30 UTC (rev 61440)
@@ -1,51 +1,111 @@
-This README file contains information about the LaTeX2e package
-"mathfont" installation version 1.6. Besides this README, the
-installation contains the following files:
+LaTeX package mathfont version 2.0 installation information.
 
-1. mathfont_code.dtx: the primary file. Typeset this file with
-LaTeX to generate mathfont.sty and complete the installation.
+This file is README.txt from version 2.0 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
+document with LuaLaTeX, mathfont adds resizable delimiters,
+big operators, and a MathConstants table to your font.
 
-2. mathfont_code.pdf: documentation of the package code.
+Besides this file, the installation contains the following
+items:
 
-3. mathfont_symbol_list.pdf: a typeset list of symbols that
-mathfont can act on.
+  (1) mathfont_code.dtx: the primary file. Run this file 
+      through LaTeX to generate mathfont.sty and complete 
+      the installation.
 
-4. mathfont_user_guide.pdf: user-level documentation.
+  (2) mathfont_code.pdf: documentation of the package code.
 
+  (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.
 
-Copyright 2018-2019 by Conrad Kosowsky
+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.
 
-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-2021 by Conrad Kosowsky
 
-           https://www.latex-project.org/lppl/.
+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 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 of the
-following items:
+          https://www.latex-project.org/lppl/.
 
-  (1) the base file mathfont_code.dtx;
+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 
+of the following items:
 
-  (2) the package code contained in mathfont.sty;
+  (1) the base file:
+        mathfont_code.dtx
 
-  (3) the derived files mathfont_symbol_list.tex,
-mathfont_user_guide.tex, mathfont_heading.tex, and
-mathfont_doc_patch.tex, and mathfont_index_warning.tex;
+  (2) the package file:
+        mathfont.sty
 
-  (4) the pdf documentation files mathfont_code.pdf,
-mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+  (3) the derived files:
+        mathfont_doc_patch.tex
+        mathfont_equations.tex
+        mathfont_example_cormorant.tex
+        mathfont_example_kelvinch.tex
+        mathfont_example_roboto.tex
+        mathfont_example_typey.tex
+        mathfont_heading.tex
+        mathfont_symbol_list.tex
+        mathfont_user_guide.tex
 
+  (4) the pdf documentation files:
+        mathfont_code.pdf,
+        mathfont_example_cormorant.pdf
+        mathfont_example_kelvinch.pdf
+        mathfont_example_roboto.pdf
+        mathfont_example_typey.pdf
+        mathfont_symbol_list.pdf
+        mathfont_user_guide.pdf
+
   (5) all other files created through the configuration
-process including mathfont_code.ind; and
+      process
 
-  (6) this README.txt file.
+  (6) the associated README.txt file
 
-For more information, see the original mathfont.dtx file. To
-install mathfont on your computer, run mathfont_code.dtx through
-LaTeX and place the derived file mathfont.sty in a directory
-searchable by TeX.
+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.
 
+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 
+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.
+
+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	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -6,43 +6,49 @@
 %%
 %% mathfont_code.dtx  (with options: `doc')
 %% 
-%% This file is file from version 1.6 of the LaTeX package "mathfont,"
-%% to be used in conjunction with the XeTeX or LuaTeX engines.
+%% This file is from version 2.0 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-2019 by Conrad Kosowsky
+%% 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
+%% 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
 %% 
-%%            https://www.latex-project.org/lppl/.
+%%           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 of the
-%% following items:
+%% 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.
 %% 
-%%   (1) the base file mathfont_code.dtx;
+%% 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.
 %% 
-%%   (2) the package code contained in mathfont.sty;
+%% 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.
 %% 
-%%   (3) the derived files mathfont_symbol_list.tex,
-%% mathfont_user_guide.tex, mathfont_heading.tex, and
-%% mathfont_doc_patch.tex;
+%% 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.
 %% 
-%%   (4) the pdf documentation files mathfont_code.pdf,
-%% mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+%% For more information, see the mathfont_code.dtx.
 %% 
-%%   (5) all other files created through the configuration process
-%% such as mathfont.idx and mathfont.ind; and
+%% Happy TeXing!
 %% 
-%%   (6) the associated README.txt file.
-%% 
-%% For more information, see the original mathfont.dtx file. To
-%% install mathfont on your computer, run mathfont_code.dtx through
-%% LaTeX and place the derived file mathfont.sty in a directory
-%% searchable by TeX.
-%% 
 
 \let\?\SpecialUsageIndex
 \expandafter\newif\csname if at def\endcsname

Added: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -0,0 +1,154 @@
+%%
+%% This is file `mathfont_equations.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mathfont_code.dtx  (with options: `equations')
+%% 
+%% This file is from version 2.0 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
+%% 
+%% 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
+%% 
+%%           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.
+%% 
+%% 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.
+%% 
+%% 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.
+%% 
+%% For more information, see the mathfont_code.dtx.
+%% 
+%% Happy TeXing!
+%% 
+\begin{multicols}{2}
+\let\medskip\relax
+
+Black-Scholes Equation
+\[
+\frac{\partial V}{\partial t}+\frac12\sigma^2S^2\frac{\partial^2V}{\partial S^2}=
+  rV-rS\frac{\partial V}{\partial X}
+\]
+\medskip
+
+Cardano's Formula/Cubic Formula
+\begin{align*}
+t_i&=\omega_i\sqrt[3]{-\frac q2+\sqrt{\frac{q^2}4+\frac{p^3}{27}}}\\
+  &\qquad\qquad{}+\omega_i^2\sqrt[3]{-\frac q2-\sqrt{\frac{q^2}4+\frac{p^3}{27}}}
+\end{align*}
+\medskip
+
+Einstein's Field Equation (General Relativity)
+\[
+R_{\mu\nu}-\frac12Rg_{\mu\nu}+\Lambda g_{\mu\nu}=\frac{8\pi G}{c^4}T_{\mu\nu}
+\]
+\medskip
+
+First Isomorphism Theorem
+\[
+\phi(X)\cong X/\ker(\phi)
+\]
+\medskip
+
+Gauss-Bonnet Formula
+\[
+\int_MK\ dA+\int_{\partial M}k_g\ ds=2\pi\chi(M)
+\]
+\medskip
+
+Maxwell's Equations
+\begin{align*}
+\nabla\bullet\mathbf E&=\frac\rho{\epsilon_0}&
+\nabla\bullet\mathbf B&=0\\
+\nabla\times\mathbf E&=-\frac{\partial\mathbf B}{\partial t}&
+\nabla\times\mathbf B&=\mu_0\left(\mathbf J+
+  \epsilon_0\frac{\partial\mathbf E}{\partial t}\right)
+\end{align*}
+\medskip
+
+Michaelis-Menten Model
+\[
+v=\frac{d[P]}{dt}=V\frac{[S]}{K_M+[S]}
+\]
+
+%% next column begins here
+
+Navier-Stokes Equation
+\begin{align*}
+\frac{\partial}{\partial t}(\rho\mathbf{u})+\nabla\bullet
+  (\rho \mathbf{u}\otimes \mathbf{u})={}
+  &{-}\nabla\bar p+\mu\nabla^2\mathbf{u}\\
+  &+\frac13\mu\nabla(\nabla\bullet u)+
+  \rho\mathbf{g}
+\end{align*}
+\medskip
+
+Quadratic Formula
+\[
+x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
+\]
+\medskip
+
+Ramanujan's Approximation for $\Gamma$
+\[
+\Gamma(1+x)\approx\sqrt\pi\,x^xe^{-x}\,\sqrt[6]{8x^3+4x^2+x+\frac1{30}}
+\]
+\medskip
+
+Residue Theorem
+\[
+\frac1{2i\pi}\int_{\gamma}f(z)\ dz=\sum_{k=1}^n\Res_{a_k}(f)
+\]
+\medskip
+
+Riemann Zeta Function
+\begin{align*}
+\zeta(z)&=\sum_{i=1}^\infty\frac1{z^i}
+  =\frac1{\Gamma(z)}\int_0^\infty\frac{x^{z-1}}{e^x-1}\ dx\\
+  &=2^z\pi^{z-1}\sin\left(\frac{\pi z}2\right)\,\Gamma(1-z)\,\zeta(1-z)
+\end{align*}
+\medskip
+
+Schrodinger Equation
+\[
+i\hbar\frac d{dt}|\Psi(t)\fakerangle=\hat H|\Psi(t)\fakerangle
+\]
+\medskip
+
+Lorentz Transformation (Special Relativity)
+\[
+t'=\left(t-\frac{vx}{c^2}\right)\frac1{\sqrt{1-\frac{v^2}{c^2}}}
+\]
+
+\end{multicols}
+\endinput
+%%
+%% End of file `mathfont_equations.tex'.


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

Index: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.pdf	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.pdf	2021-12-29 21:35:30 UTC (rev 61440)

Property changes on: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -0,0 +1,89 @@
+%%
+%% This is file `mathfont_example_cormorant.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mathfont_code.dtx  (with options: `cormorant')
+%% 
+%% This file is from version 2.0 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
+%% 
+%% 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
+%% 
+%%           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.
+%% 
+%% 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.
+%% 
+%% 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.
+%% 
+%% For more information, see the mathfont_code.dtx.
+%% 
+%% Happy TeXing!
+%% 
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\DeclareFontFamily{TU}{Cormorant}{}
+\DeclareFontShape{TU}{Cormorant}{m}{n}
+  {<->"Cormorant Medium:\M at default@otf at features;-liga"}{}
+\DeclareFontShape{TU}{Cormorant}{m}{it}
+  {<->"Cormorant Medium Italic:\M at default@otf at features"}{}
+\mathfont[greeklower=upright,greekupper]{Crimson}
+\mathfont[diacritics]{Bona Nova}
+\setfont{Cormorant}
+\RuleThicknessFactor{600}
+\DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
+\DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
+\parindent=0pt\relax
+\begin{document}
+
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Cormorant}
+
+\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!
+
+\input{mathfont_equations.tex}
+
+\end{document}
+\endinput
+%%
+%% End of file `mathfont_example_cormorant.tex'.


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

Index: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.pdf	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.pdf	2021-12-29 21:35:30 UTC (rev 61440)

Property changes on: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -0,0 +1,82 @@
+%%
+%% This is file `mathfont_example_kelvinch.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mathfont_code.dtx  (with options: `kelvinch')
+%% 
+%% This file is from version 2.0 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
+%% 
+%% 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
+%% 
+%%           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.
+%% 
+%% 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.
+%% 
+%% 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.
+%% 
+%% For more information, see the mathfont_code.dtx.
+%% 
+%% Happy TeXing!
+%% 
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\mathfont[radical]{Crimson}
+\setfont{Kelvinch}
+\IntegralItalicFactor{500}
+\SurdHorizontalFactor{900}
+\parindent=0pt\relax
+\begin{document}
+
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Kelvinch}
+
+\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!
+
+\input{mathfont_equations.tex}
+
+\end{document}
+\endinput
+%%
+%% End of file `mathfont_example_kelvinch.tex'.


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

Index: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.pdf	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.pdf	2021-12-29 21:35:30 UTC (rev 61440)

Property changes on: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -0,0 +1,86 @@
+%%
+%% This is file `mathfont_example_roboto.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mathfont_code.dtx  (with options: `roboto')
+%% 
+%% This file is from version 2.0 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
+%% 
+%% 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
+%% 
+%%           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.
+%% 
+%% 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.
+%% 
+%% 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.
+%% 
+%% For more information, see the mathfont_code.dtx.
+%% 
+%% Happy TeXing!
+%% 
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\mathfont[radical]{Overpass}
+\setfont{Roboto}
+\mathfont[]{STIXGeneral}
+\DeclareSymbolFont{Mupright2}{TU}{STIXGeneral}{m}{n}
+\DeclareMathSymbol{\otimes}{\mathbin}{Mupright2}{"2297}
+\RuleThicknessFactor{1900}
+\IntegralItalicFactor{500}
+\SurdHorizontalFactor{800}
+\parindent=0pt\relax
+\begin{document}
+
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Roboto}
+
+\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!
+
+\input{mathfont_equations.tex}
+
+\end{document}
+\endinput
+%%
+%% End of file `mathfont_example_roboto.tex'.


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

Index: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.pdf	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.pdf	2021-12-29 21:35:30 UTC (rev 61440)

Property changes on: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -0,0 +1,95 @@
+%%
+%% This is file `mathfont_example_typey.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mathfont_code.dtx  (with options: `typey')
+%% 
+%% This file is from version 2.0 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
+%% 
+%% 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
+%% 
+%%           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.
+%% 
+%% 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.
+%% 
+%% 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.
+%% 
+%% For more information, see the mathfont_code.dtx.
+%% 
+%% Happy TeXing!
+%% 
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\mathfont[radical]{Crimson}
+\DeclareFontFamily{TU}{Typey}{}
+\DeclareFontShape{TU}{Typey}{m}{n}
+  {<->"Typey McTypeface:\M at default@otf at features"}{}
+\DeclareFontShape{TU}{Typey}{m}{it}
+  {<->"Typey McTypeface/I:\M at default@otf at features"}{}
+\DeclareFontShape{TU}{Typey}{b}{n}
+  {<->"Typey McTypeface:\M at default@otf at features;embolden=6"}{}
+\DeclareFontShape{TU}{Typey}{b}{it}
+  {<->"Typey McTypeface/I:\M at default@otf at features;embolden=6"}{}
+\setfont{Typey}
+\mathfont[]{STIXGeneral}
+\DeclareSymbolFont{Mroman2}{TU}{STIXGeneral}{m}{n}
+\DeclareMathSymbol{\otimes}{\mathbin}{Mroman2}{"2297}
+\RuleThicknessFactor{1300}
+\SurdHorizontalFactor{860}
+\parindent=0pt\relax
+\begin{document}
+
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Typey McTypeface}
+
+\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!
+
+\let\bullet\cdot
+\input{mathfont_equations.tex}
+
+\end{document}
+\endinput
+%%
+%% End of file `mathfont_example_typey.tex'.


Property changes on: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -6,96 +6,127 @@
 %%
 %% mathfont_code.dtx  (with options: `heading')
 %% 
-%% This file is file from version 1.6 of the LaTeX package "mathfont,"
-%% to be used in conjunction with the XeTeX or LuaTeX engines.
+%% This file is from version 2.0 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-2019 by Conrad Kosowsky
+%% 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
+%% 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
 %% 
-%%            https://www.latex-project.org/lppl/.
+%%           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 of the
-%% following items:
+%% 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.
 %% 
-%%   (1) the base file mathfont_code.dtx;
+%% 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.
 %% 
-%%   (2) the package code contained in mathfont.sty;
+%% 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.
 %% 
-%%   (3) the derived files mathfont_symbol_list.tex,
-%% mathfont_user_guide.tex, mathfont_heading.tex, and
-%% mathfont_doc_patch.tex;
+%% 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.
 %% 
-%%   (4) the pdf documentation files mathfont_code.pdf,
-%% mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+%% For more information, see the mathfont_code.dtx.
 %% 
-%%   (5) all other files created through the configuration process
-%% such as mathfont.idx and mathfont.ind; and
+%% Happy TeXing!
 %% 
-%%   (6) the associated README.txt file.
-%% 
-%% For more information, see the original mathfont.dtx file. To
-%% install mathfont on your computer, run mathfont_code.dtx through
-%% LaTeX and place the derived file mathfont.sty in a directory
-%% searchable by TeX.
-%% 
 
-\def\packagedate{December 2019}
-\def\packageversion{1.6}
+\def\packagedate{December 2021}
+\def\packageversion{2.0}
 
+
 \let\@@section\section
-\let\@sectionname\relax
-\def\@tempsec#1{\penalty-1000\@@section{#1}\penalty0\gdef\@sectionname{#1}}
-\def\@tempsecstar#1{\@@section*{#1}\gdef\@sectionname{#1}}
-\def\section{\@ifstar\@tempsecstar\@tempsec}
+\def\section{\@ifstar\star at sect\no at star@sect}
+\def\star at sect#1{\@@section*{#1}\section at name{#1}}
+\def\no at star@sect#1{\@@section{#1}\section at name{#1}}
+\def\section at name#1{\expandafter
+  \def\csname section@\thesection\endcsname{#1}}
+\def\sectionname{\csname section@\thesection\endcsname}
+
 \def\@oddhead{\ifnum\count0>1\relax
-  \rlap{\textit{\@sectionname}}\hfil
+  \rlap{\textit{\sectionname}}\hfil
   \hbox to 0pt{\hss\documentname\hss}\hfil
   \llap{\the\count0}\fi}
 \def\@evenhead{\ifnum\count0>1\relax
   \rlap{\the\count0}\hfil
   \hbox to 0pt{\hss\documentname\hss}\hfil
-  \llap{\textit{\@sectionname}}\fi}
+  \llap{\textit{\sectionname}}\fi}
 \def\@oddfoot{\hfil\ifnum\count0=1\relax1\fi\hfil}
 \let\@evenfoot\@empty
 
-\DeclareRobustCommand\XeTeX{X\kern-0.1em
+\pretolerance=20
+\hyphenpenalty=10
+\exhyphenpenalty=5
+\brokenpenalty=0
+\clubpenalty=5
+\widowpenalty=5
+\finalhyphendemerits=300
+\doublehyphendemerits=500
+
+\protected\def\XeTeX{X\kern-0.1em
   \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.15em
   \TeX}
-\DeclareRobustCommand\XeLaTeX{X\kern-0.1em
+\protected\def\XeLaTeX{X\kern-0.1em
   \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.13em
   \LaTeX}
 \bgroup
   \count@\catcode`\|
   \catcode`\|=12\relax
-  \gdef\indexpage#1{\index{#1|textit}}
-  \catcode`\|\count@
+  \gdef\indexpage#1{\index{#1|usage}}
 \egroup
-\edef\fontspeccommand{\noexpand\protect\expandafter\noexpand\csname fontspeccommand \endcsname}
+\protected\def\usage#1{\textit{#1}}
 \bgroup
 \catcode`\_=12
-  \expandafter\gdef\csname fontspeccommand \endcsname{%
-    \texttt{\string\fontspec_set_family:Nnn}}
+  \protected\gdef\fontspeccommand{\texttt{\string\fontspec_set_family:Nnn}}
+  \protected\gdef\fontspecbool{\texttt{\string\g__fontspec_math_bool}}
 \egroup
-\renewcommand\topfraction{1}
-\renewcommand\bottomfraction{1}
+\def\topfraction{1}
+\def\bottomfraction{1}
 \newenvironment{code}
-  {\strut\vadjust\bgroup\medskip\parindent=4em\relax\indent\strut\ignorespaces}
+  {\strut\vadjust\bgroup\medskip\parindent\z@\leftskip2em\relax
+    \noindent\strut\ignorespaces}
   {\strut\par\medskip\egroup\hfill\break\strut\ignorespacesafterend}
-\def\argtext#1{\ensuremath{\langle$\textit{#1}$\rangle}}
 \def\vrb#1{\expandafter\texttt\expandafter{\string#1}}
 \parskip=0pt
 
-\def\makechar#1{\noindent\hbox to 0.4in{$#1{}$\hfil}\vrb#1\par}
-\def\makeaccent#1{\noindent\hbox to 0.4in{$#1 a$\hfil}\vrb#1\par}
-\def\blockheader#1#2#3{\smallskip\bigskip\centerline{#2 Characters (\texttt{#1})}
-  \penalty\@M{\noindent\hfil\fontsize{9pt}{12pt}\selectfont
-  \strut Rendered in #3\par}\penalty\@M
-  \smallskip\hrule height 0.5pt\penalty\@M\smallskip}
+\def\charexample#1{\hbox to \hsize{\hbox to 0.4in{$#1$\hfil}\vrb#1\hfil}}
+\def\accentexample#1{\hbox to \hsize{\hbox to 0.4in{$#1 a$\hfil}\vrb#1\hfil}}
+\def\delimexample#1{\hbox to \hsize{%
+  \hbox to 0.8in{$#1\big#1\Big#1\bigg#1\Bigg#1$\hfil}\vrb#1\hfil}}
+\def\luadelimexample#1{\hbox{\vbox{\hbox to 0.8in{%
+    $#1\big#1\Big#1\bigg#1\Bigg#1$\hfil}\hrule width 0pt height 0pt\relax}%
+  \hbox to \dimexpr\hsize-0.8in{\vbox{\vss
+    \hbox{\vrb#1}
+    \hbox{\quad(Lua\TeX only)}
+    \vss}\hfil}}}
+\def\operatorexample#1{\hbox to \hsize{%
+  \hbox to 0.4in{$#1$\hfil}%
+  \hbox to 0.4in{$\displaystyle#1$\hfil}\vrb#1\hfil}\smallskip}
+\def\blockheader#1#2{%
+  \bigskip\medskip
+  \penalty-9000
+  \hbox{\fbox{\hbox to \dimexpr\hsize-2\fboxrule-2\fboxsep\relax{%
+    \hfil#2 Characters (Keyword \texttt{#1})\strut\hfil}}}
+  \medskip}
 \def\upperalphabet{ABCDEFGHIJKLMNOPQRSTUVWXY}
 \def\loweralphabet{abcdefghijklmnopqrstuvwxy}
 \def\digits{0123456789}
@@ -107,7 +138,7 @@
   \noindent\printchars\loweralphabet\hbox to 0.6em{$\@tempstyle{z}$\hss}\par}
 
 {\large\parindent=0pt\leftskip=0pt plus 1 fil\rightskip=0pt plus 1fil\parfillskip=0pt
-{\strut\Large Package \textsf{mathfont} v.\ \packageversion\ \documentname\let\thefootnote\relax\footnote{Acknowledgements: Thanks to Lyric Bingham for her work checking my unicode hex values. Thanks to Herbert Voss and Andreas Zidak for pointing out bugs in previous versions of \textsf{mathfont}.}\global\advance\c at footnote\m at ne}\par
+{\strut\Large Package \textsf{mathfont} v.\ \packageversion\ \documentname\let\thefootnote\relax\footnote{Acknowledgements: Thanks to Lyric Bingham for her work checking my unicode hex values. Thanks to Herbert Voss and Andreas Zidak for pointing out bugs in previous versions of \textsf{mathfont}. Thanks to Jean-Fran\c cois Burnol for pointing out an error in the documentation in reference to their \textsf{mathastext} package.}\global\advance\c at footnote\m at ne}\par
 {\strut Conrad Kosowsky}\par
 {\strut\packagedate}\par
 {\strut\ttfamily kosowsky.latex at gmail.com}\par}
@@ -114,20 +145,31 @@
 
 \bigskip
 
-\begin{figure}[h]
+\ifnum\showabstract=1\relax
+
 \hrule height \p@\hbox{\vrule width \p@\kern-\p@\relax\vbox{\medskip
-{\leftskip=7em\rightskip=7em
-\noindent\strut For easy, off-the-shelf use, type the following in your document preamble and compile using \XeLaTeX\ or Lua\LaTeX:\par}
+{\leftskip=1.4in\rightskip=1.4in
+\noindent\strut For easy, off-the-shelf use, type the following in your preamble and compile with \XeLaTeX\ or Lua\LaTeX:\par
 \medskip
-\vbox{\noindent\hfil{|\usepackage[|\argtext{font name}|]{mathfont}|}\hfil}
+\vbox{\noindent\hfil{|\usepackage[|\meta{font name}|]{mathfont}|}\hfil}
+\medskip
+\noindent As of version 2.0, using Lua\LaTeX\ is recommended.\par}
 \medskip}\kern-\p@\vrule width \p@}\hrule height \p@
-\end{figure}
 
-\begin{abstract}
-The \textsf{mathfont} package provides a flexible interface for changing the font of math-mode characters. The package allows the user to specify a default unicode font for each of six basic classes of Latin and Greek characters, and it provides additional support for unicode math and alphanumeric symbols, including punctuation. Crucially, \textsf{mathfont} is compatible with both \XeLaTeX\ and Lua\LaTeX, and it provides several font-loading commands that allow the user to change fonts locally or for individual characters within math mode.
-\end{abstract}
+\bigskip
 
-\bigskip
+{\small
+
+\centerline{\bfseries Overview\strut}
+\smallskip
+
+\leftskip=0.5in\relax
+\rightskip=0.5in\relax
+\noindent The \textsf{mathfont} package adapts unicode text fonts for math mode. The package allows the user to specify a default unicode font for different classes of math symbols, and it provides tools to change the font locally for math alphabet characters. When typesetting with Lua\TeX, \textsf{mathfont} adds resizable delimiters, big operators, and a MathConstants table to text fonts.\par}
+
+\bigskip\bigskip\nointerlineskip
+\centerline{\vrule height 0.5pt width 2.5in}\bigskip\medskip
+\fi
 \endinput
 %%
 %% End of file `mathfont_heading.tex'.

Deleted: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_index_warning.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_index_warning.tex	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_index_warning.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -1,70 +0,0 @@
-%%
-%% This is file `mathfont_index_warning.tex',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% mathfont_code.dtx  (with options: `idxwarning')
-%% 
-%% This file is file from version 1.6 of the LaTeX package "mathfont,"
-%% to be used in conjunction with the XeTeX or LuaTeX engines.
-%% 
-%% Copyright 2018-2019 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
-%% 
-%%            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 of the
-%% following items:
-%% 
-%%   (1) the base file mathfont_code.dtx;
-%% 
-%%   (2) the package code contained in mathfont.sty;
-%% 
-%%   (3) the derived files mathfont_symbol_list.tex,
-%% mathfont_user_guide.tex, mathfont_heading.tex, and
-%% mathfont_doc_patch.tex;
-%% 
-%%   (4) the pdf documentation files mathfont_code.pdf,
-%% mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
-%% 
-%%   (5) all other files created through the configuration process
-%% such as mathfont.idx and mathfont.ind; and
-%% 
-%%   (6) the associated README.txt file.
-%% 
-%% For more information, see the original mathfont.dtx file. To
-%% install mathfont on your computer, run mathfont_code.dtx through
-%% LaTeX and place the derived file mathfont.sty in a directory
-%% searchable by TeX.
-%% 
-\begingroup
-\bigskip
-\hrule height \p@\hbox{\vrule width \p@\kern-\p@\relax\vbox{\bigskip
-{\leftskip=12pt\rightskip=12pt\parindent=0pt
-
-\hfil WARNING\hfil
-
-\medskip
-
-It looks like you obtained a copy of |mathfont_code.pdf| without the index. To produce documentation with index, do the following: (1) run |mathfont_code.dtx| through \LaTeX\ to produce the |idx| file; (2) while in the directory containing |mathfont_code.dtx|, type
-
-\medskip
-
-\hfil|makeindex -s gind.ist mathfont_code.idx|\hfil
-
-\medskip
-
-in the command line; and (3) rerun |mathfont_code.dtx| through \LaTeX\ to recreate the full documentation.
-
-}\bigskip}\kern-\p@\vrule width \p@}\hrule height \p@
-\bigskip
-\endgroup
-\endinput
-%%
-%% End of file `mathfont_index_warning.tex'.

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	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -6,708 +6,856 @@
 %%
 %% mathfont_code.dtx  (with options: `chars')
 %% 
-%% This file is file from version 1.6 of the LaTeX package "mathfont,"
-%% to be used in conjunction with the XeTeX or LuaTeX engines.
+%% This file is from version 2.0 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-2019 by Conrad Kosowsky
+%% 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
+%% 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
 %% 
-%%            https://www.latex-project.org/lppl/.
+%%           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 of the
-%% following items:
+%% 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.
 %% 
-%%   (1) the base file mathfont_code.dtx;
+%% 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.
 %% 
-%%   (2) the package code contained in mathfont.sty;
+%% 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.
 %% 
-%%   (3) the derived files mathfont_symbol_list.tex,
-%% mathfont_user_guide.tex, mathfont_heading.tex, and
-%% mathfont_doc_patch.tex;
+%% 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.
 %% 
-%%   (4) the pdf documentation files mathfont_code.pdf,
-%% mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+%% For more information, see the mathfont_code.dtx.
 %% 
-%%   (5) all other files created through the configuration process
-%% such as mathfont.idx and mathfont.ind; and
+%% Happy TeXing!
 %% 
-%%   (6) the associated README.txt file.
-%% 
-%% For more information, see the original mathfont.dtx file. To
-%% install mathfont on your computer, run mathfont_code.dtx through
-%% LaTeX and place the derived file mathfont.sty in a directory
-%% searchable by TeX.
-%% 
 \documentclass[12pt,twoside]{article}
 \makeatletter
-\let\@@imath\imath
-\let\@@jmath\jmath
 \usepackage[margin=72.27pt]{geometry}
+\usepackage{tabularx}
+\usepackage{booktabs}
 \usepackage{multicol}
 \usepackage{graphicx}
 \usepackage{mathfont}
-\mathfont[greekupper]{Courier New}
-\mathfont[greeklower,delimiters,bigops]{Times New Roman}
-\mathfont[agreekupper,extsymbols,bb,cal,frak,bcal,bfrak]{Symbola}
-\mathfont[agreeklower=roman]{Didot Bold}
-\mathfont[hebrew]{New Peninim MT}
-\mathfont[cyrillicupper]{EB Garamond}
-\mathfont[cyrilliclower=roman]{Comic Sans MS}
-\mathfont[symbols]{Arial}
-\mathfont[arrows,extbigops]{STIXGeneral}
-\mathfont[diacritics,lower]{Baskerville}
-\usepackage{shortvrb}
+\mathfont[agreeklower=upright,agreekupper]{Crimson}
+\mathfont[hebrew]{Coelacanth}
+\mathfont[\M at normalkeys,\M at letterlikekeys]{STIXGeneral}
+\usepackage{shortvrb,doc}
 \MakeShortVerb{|}
-\pretolerance=20
-\hyphenpenalty=10
-\exhyphenpenalty=5
-\brokenpenalty=0
-\finalhyphendemerits=300
-\doublehyphendemerits=500
 \raggedcolumns
 \parskip=0pt
 \smallskipamount=2pt plus 1pt minus 1pt
 \multicolsep=0pt
 \premulticols=0pt
+\fboxrule=1pt
+\CharmLine{8747 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8748 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8749 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8750 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8751 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8752 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
 \begin{document}
 
 \def\documentname{Symbol List}
+\def\showabstract{1}
 \input mathfont_heading.tex
 
-The \textsf{mathfont} package acts on some 300 alphanumeric characters and 500 general math symbols, and this document lists all such symbols besides Latin characters and Arabic numerals. The characters are organized by keyword, and when the user calls |\mathfont| on one of the keyword classes below, the package acts on every control sequence listed under that keyword. It changes the math-mode font of the character-commands that already exist in \LaTeX, and for the control sequences that do not exist in \LaTeX, it defines them to be new characters for use in math mode. Unlike most character-providing packages, \textsf{mathfont} does not provide extra symbols by default, and users can access additional control sequences only once they act |\mathfont| on some keyword-option. Of course, typesetting these symbols depends on having a font that contains them, and most major unicode fonts lack many or most of the symbols in this document. Choose your font wisely! Finally, as stated in the user guide, the \texttt{delimiters}, \texttt{bigops}, and |\big|\argtext{symbol} (such as |\bigvee|) characters do not in general change size in different mathematical contexts. I hope to address this limitation in future package updates. For documentation of user-level commands, see |mathfont_user_guide.pdf|, and for version history and code implementation, see |mathfont_code.pdf|. Both documentation files are included with the \textsf{mathfont} installation and available on \textsc{ctan}.
+The \textsf{mathfont} package provides tools to access several hundred characters for math typesetting, and this document lists these symbols along with the control sequences to access them. To get access to the symbols from a section of this document, call |\mathfont| with the keyword-option for that section and the name of a font that contains those symbols. The package does not define any math symbols until you call |\mathfont| or |\setfont| (or load \textsf{mathfont} with a font name as package option), and if you see a symbol or control sequence here that is not part of standard \LaTeX, you will not be able to access it until you call |\mathfont| on the corresponding keyword. Further, \textsf{mathfont} does not come with or load any fonts by itself, so you are responsible for the fonts. Not all fonts contain all math symbols, so choose your font wisely!\footnote{Besides letters and digits, most unicode text fonts should contain diacritics, delimiters, and the basic math characters in the keyword |symbols|. Text fonts will often contain square root and basic operator symbols, but they may not be suitable for math typesetting. Greek characters are hit or miss, and it is unusual for English text fonts to contain Cyrillic, Hebrew, ancient Greek, arrows, letterlike characters, or any extended (keywords |extbigops| and |extsymbols|) set of symbols. After you load \textsf{mathfont}, \TeX\ will print a message to the terminal if you try to typeset a missing character from some font.} This document shows ancient Greek in Crimson, Hebrew in Coelacanth, and all other math characters in STIXGeneral.
 
-This document does not contain tables for the keywords |upper|, |lower|, and |digits|. The first of these keywords contains all capital Latin letters, and the second contains all lower-case Latin letters as well as the ``mathematical i'' $\@@imath$ coded with |\imath| and ``mathematical j'' $\@@jmath$ coded with |\jmath|. The |digits| category contains the digits 0 through 9. Unlike the \LaTeX\ kernel, \textsf{mathfont} declares both |\imath| and |\jmath| as math alphabet characters, so the package's local font-change commands will adjust the font of these two symbols.
+\begin{figure}[t]
+\centerline{\bfseries Table 1: Characters Defined by Multiple Keywords\strut}
+\begin{tabularx}\textwidth{XXX}\toprule
+Character & Keywords & Default Font\\\midrule
+\vrb\increment & \texttt{greekupper} & \texttt{symbols}\\
+ & \texttt{symbols} & \\\midrule
+\vrb\nabla & \texttt{greekupper} & \texttt{(ext)symbols}\\
+ & \texttt{symbols} with Lua\TeX & \\
+ & \texttt{extsymbols} with \XeTeX & \\\midrule
+\expandafter\vrb\string| & \texttt{symbols} & \texttt{symbols} normally\\
+ & \texttt{delimiters} with Lua\TeX & \texttt{delimiters} after |\left|, \hfil\penalty0|\right|, etc.\\\midrule
+\vrb\simeq\ and \vrb\cong & \texttt{symbols} & \texttt{extsymbols} \\
+ & \texttt{extsymbols} & \\\bottomrule
+\end{tabularx}
+\end{figure}
 
+As of version 2.0, \textsf{mathfont} artificially adds resizable delimiters and big operator characters to text fonts when you complile with Lua\LaTeX. In this case, square root symbols will automatically resize, big operators will appear larger in |\displaystyle|, and you can use |\left|, |\right|, and |\big|, etc.\ with characters from the keyword |delimiters|. If you use \XeTeX, \textsf{mathfont} will not create large variants of characters, and your unicode math symbols will all be the same size as they appear in the font. In this case, you may be best off sticking with the Computer Modern defaults for resizable characters provided they don't clash with the rest of your document. Throughout this document, anything labeled ``Lua\TeX\ only'' means that \textsf{mathfont} provides this functionality only if you enable Lua-based font adjustments. If you load \textsf{mathfont} with the |no-adjust| option, you will not be able to access these features the same as if you compile with \XeTeX.
+
+A few characters appear multiple times in this list. When that happens, it means that \textsf{mathfont} defines the control sequence for multiple keywords. If you call |\mathfont| for only one of those keywords, your symbol will appear in the font associated with that keyword. If you call |\mathfont| on multiple keywords, the package uses the font associated with the default keyword/font for that character. Table~1 lists the default keyword for each command that appears multiple times in this document. If you need unicode encoding slot numbers for character metric adjustments, each symbol corresponds to its standard unicode encoding value, with the exception of the fake angle brackets. When you typeset with Lua\TeX, \textsf{mathfont} artificially adds |\fakelangle|, |\fakerangle|, |\fakellangle|, and |\fakerrangle| to the font in encoding slots 1,044,508--1,044,511 respectively.
+
+\bigskip\centerline{\vrule height 0.5pt width 2.5in}\medskip\smallskip
+
 \catcode`\|=12
-\parskip=1pt
 
-\blockheader{diacritics}{Accent}{Baskerville}
+\blockheader{lower}{Lower-Case Latin}
 
 \begin{multicols}{3}
-\makeaccent{\acute}
-\makeaccent{\aacute}
-\makeaccent{\dot}
-\makeaccent{\ddot}
-\makeaccent{\grave}
-\makeaccent{\breve}
-\makeaccent{\hat}
-\makeaccent{\check}
-\makeaccent{\bar}
-\makeaccent{\mathring}
-\makeaccent{\tilde}
+\charexample a
+\charexample b
+\charexample c
+\charexample d
+\charexample e
+\charexample f
+\charexample g
+\charexample h
+\charexample i
+\charexample j
+\charexample k
+\charexample l
+\charexample m
+\charexample n
+\charexample o
+\charexample p
+\charexample q
+\charexample r
+\charexample s
+\charexample t
+\charexample u
+\charexample v
+\charexample w
+\charexample x
+\charexample y
+\charexample z
+\charexample\hbar
+\charexample\imath
+\charexample\jmath
 \end{multicols}
 
-\blockheader{greekupper}{Upper-Case Greek}{Courier New}
+\blockheader{upper}{Upper-Case Latin}
 
 \begin{multicols}{3}
-\makechar{\Alpha}
-\makechar{\Beta}
-\makechar{\Gamma}
-\makechar{\Delta}
-\makechar{\Epsilon}
-\makechar{\Zeta}
-\makechar{\Eta}
-\makechar{\Theta}
-\makechar{\Iota}
-\makechar{\Kappa}
-\makechar{\Lambda}
-\makechar{\Mu}
-\makechar{\Nu}
-\makechar{\Xi}
-\makechar{\Omicron}
-\makechar{\Pi}
-\makechar{\Rho}
-\makechar{\Sigma}
-\makechar{\Tau}
-\makechar{\Upsilon}
-\makechar{\Phi}
-\makechar{\Chi}
-\makechar{\Psi}
-\makechar{\Omega}
-\makechar{\varTheta}
+\charexample A
+\charexample B
+\charexample C
+\charexample D
+\charexample E
+\charexample F
+\charexample G
+\charexample H
+\charexample I
+\charexample J
+\charexample K
+\charexample L
+\charexample M
+\charexample N
+\charexample O
+\charexample P
+\charexample Q
+\charexample R
+\charexample S
+\charexample T
+\charexample U
+\charexample V
+\charexample W
+\charexample X
+\charexample Y
+\charexample Z
 \end{multicols}
 
-\blockheader{greeklower}{Lower-Case Greek}{Times New Roman}
+\blockheader{diacritics}{Accent}
 
 \begin{multicols}{3}
-\makechar{\alpha}
-\makechar{\beta}
-\makechar{\gamma}
-\makechar{\delta}
-\makechar{\epsilon}
-\makechar{\zeta}
-\makechar{\eta}
-\makechar{\theta}
-\makechar{\iota}
-\makechar{\kappa}
-\makechar{\lambda}
-\makechar{\mu}
-\makechar{\nu}
-\makechar{\xi}
-\makechar{\omicron}
-\makechar{\pi}
-\makechar{\rho}
-\makechar{\sigma}
-\makechar{\tau}
-\makechar{\upsilon}
-\makechar{\phi}
-\makechar{\chi}
-\makechar{\psi}
-\makechar{\omega}
-\makechar{\varbeta}
-\makechar{\varepsilon}
-\makechar{\vartheta}
-\makechar{\varrho}
-\makechar{\varsigma}
-\makechar{\varphi}
+\accentexample\acute
+\accentexample\aacute
+\accentexample\dot
+\accentexample\ddot
+\accentexample\grave
+\accentexample\breve
+\accentexample\hat
+\accentexample\check
+\accentexample\bar
+\accentexample\mathring
+\accentexample\tilde
 \end{multicols}
 
-\blockheader{agreekupper}{Upper-Case Ancient Greek}{Symbola}
+\blockheader{digits}{Arabic Numeral}
 
 \begin{multicols}{3}
-\makechar{\Heta}
-\makechar{\Sampi}
-\makechar{\Digamma}
-\makechar{\Koppa}
-\makechar{\Stigma}
-\makechar{\Sho}
-\makechar{\San}
-\makechar{\varSampi}
-\makechar{\varDigamma}
-\makechar{\varKoppa}
+\charexample0
+\charexample1
+\charexample2
+\charexample3
+\charexample4
+\charexample5
+\charexample6
+\charexample7
+\charexample8
+\charexample9
 \end{multicols}
 
-\blockheader{agreeklower}{Lower-Case Ancient Greek}{Didot Bold}
+\blockheader{greekupper}{Upper-Case Greek}
 
 \begin{multicols}{3}
-\makechar{\heta}
-\makechar{\sampi}
-\makechar{\digamma}
-\makechar{\koppa}
-\makechar{\stigma}
-\makechar{\sho}
-\makechar{\san}
-\makechar{\varsampi}
-\makechar{\vardigamma}
-\makechar{\varkoppa}
+\charexample\Alpha
+\charexample\Beta
+\charexample\Gamma
+\charexample\Delta
+\charexample\Epsilon
+\charexample\Zeta
+\charexample\Eta
+\charexample\Theta
+\charexample\Iota
+\charexample\Kappa
+\charexample\Lambda
+\charexample\Mu
+\charexample\Nu
+\charexample\Xi
+\charexample\Omicron
+\charexample\Pi
+\charexample\Rho
+\charexample\Sigma
+\charexample\Tau
+\charexample\Upsilon
+\charexample\Phi
+\charexample\Chi
+\charexample\Psi
+\charexample\Omega
+\charexample\varTheta
+\charexample\increment
+\charexample\nabla
 \end{multicols}
 
-\blockheader{cyrillicupper}{Upper-Case Cyrillic}{EB Garamond}
+\blockheader{greeklower}{Lower-Case Greek}
 
 \begin{multicols}{3}
-\makechar{\cyrA}
-\makechar{\cyrBe}
-\makechar{\cyrVe}
-\makechar{\cyrGhe}
-\makechar{\cyrDe}
-\makechar{\cyrIe}
-\makechar{\cyrZhe}
-\makechar{\cyrZe}
-\makechar{\cyrI}
-\makechar{\cyrKa}
-\makechar{\cyrEl}
-\makechar{\cyrEm}
-\makechar{\cyrEn}
-\makechar{\cyrO}
-\makechar{\cyrPe}
-\makechar{\cyrEr}
-\makechar{\cyrEs}
-\makechar{\cyrTe}
-\makechar{\cyrU}
-\makechar{\cyrEf}
-\makechar{\cyrHa}
-\makechar{\cyrTse}
-\makechar{\cyrChe}
-\makechar{\cyrSha}
-\makechar{\cyrShcha}
-\makechar{\cyrHard}
-\makechar{\cyrYeru}
-\makechar{\cyrSoft}
-\makechar{\cyrE}
-\makechar{\cyrYu}
-\makechar{\cyrYa}
-\makechar{\cyrvarI}
+\charexample\alpha
+\charexample\beta
+\charexample\gamma
+\charexample\delta
+\charexample\epsilon
+\charexample\zeta
+\charexample\eta
+\charexample\theta
+\charexample\iota
+\charexample\kappa
+\charexample\lambda
+\charexample\mu
+\charexample\nu
+\charexample\xi
+\charexample\omicron
+\charexample\pi
+\charexample\rho
+\charexample\sigma
+\charexample\tau
+\charexample\upsilon
+\charexample\phi
+\charexample\chi
+\charexample\psi
+\charexample\omega
+\charexample\varbeta
+\charexample\varepsilon
+\charexample\varkappa
+\charexample\vartheta
+\charexample\varrho
+\charexample\varsigma
+\charexample\varphi
 \end{multicols}
 
-\blockheader{cyrilliclower}{Lower-Case Cyrillic}{Comic Sans MS%
-  \footnote{Yes, you too can now create beautifully spaced mathematics in Comic Sans!}}
+\blockheader{agreekupper}{Upper-Case Ancient Greek}
 
 \begin{multicols}{3}
-\makechar{\cyra}
-\makechar{\cyrbe}
-\makechar{\cyrve}
-\makechar{\cyrghe}
-\makechar{\cyrde}
-\makechar{\cyrie}
-\makechar{\cyrzhe}
-\makechar{\cyrze}
-\makechar{\cyri}
-\makechar{\cyrka}
-\makechar{\cyrel}
-\makechar{\cyrem}
-\makechar{\cyren}
-\makechar{\cyro}
-\makechar{\cyrpe}
-\makechar{\cyrer}
-\makechar{\cyres}
-\makechar{\cyrte}
-\makechar{\cyru}
-\makechar{\cyref}
-\makechar{\cyrha}
-\makechar{\cyrtse}
-\makechar{\cyrche}
-\makechar{\cyrsha}
-\makechar{\cyrshcha}
-\makechar{\cyrhard}
-\makechar{\cyryeru}
-\makechar{\cyrsoft}
-\makechar{\cyre}
-\makechar{\cyryu}
-\makechar{\cyrya}
-\makechar{\cyrvari}
+\charexample\Heta
+\charexample\Sampi
+\charexample\Digamma
+\charexample\Koppa
+\charexample\Stigma
+\charexample\Sho
+\charexample\San
+\charexample\varSampi
+\charexample\varDigamma
+\charexample\varKoppa
 \end{multicols}
 
-\blockheader{hebrew}{Hebrew}{New Peninim MT}
+\blockheader{agreeklower}{Lower-Case Ancient Greek}
 
 \begin{multicols}{3}
-\makechar{\aleph}
-\makechar{\beth}
-\makechar{\gimel}
-\makechar{\daleth}
-\makechar{\he}
-\makechar{\vav}
-\makechar{\zayin}
-\makechar{\het}
-\makechar{\tet}
-\makechar{\yod}
-\makechar{\kaf}
-\makechar{\lamed}
-\makechar{\mem}
-\makechar{\nun}
-\makechar{\samekh}
-\makechar{\ayin}
-\makechar{\pe}
-\makechar{\tsadi}
-\makechar{\qof}
-\makechar{\resh}
-\makechar{\shin}
-\makechar{\tav}
-\makechar{\varkaf}
-\makechar{\varmem}
-\makechar{\varnun}
-\makechar{\varpe}
-\makechar{\vartsadi}
+\charexample\heta
+\charexample\sampi
+\charexample\digamma
+\charexample\koppa
+\charexample\stigma
+\charexample\sho
+\charexample\san
+\charexample\varsampi
+\charexample\vardigamma
+\charexample\varkoppa
 \end{multicols}
 
-\blockheader{symbols}{Basic Math}{Arial}
+\blockheader{cyrillicupper}{Upper-Case Cyrillic}
 
 \begin{multicols}{3}
-\makechar{.}
-\makechar{@}
-\let\par\relax
-\makechar{\#}\footnote{When it acts on \vrb\#, \vrb\%, and \vrb\&, \textsf{mathfont} redefines them as robust commands that expand to their usual \vrb\char\ definition in horizontal mode and a math symbol in math mode. This prevents any changes to their font outside of math mode and is how other commands such as \vrb\$ or \vrb\P\ function in both math mode and horizontal mode.}\@@par
-\makechar{\$}\footnote{Technically, \textsf{mathfont} doesn't redefine \vrb\$, \vrb\P, \vrb\S, \vrb\pounds, \vrb\dag, or \vrb\ddag. The package recodes the character-command that these macros expand to when in math mode.}\@par
-\makechar{\%}
-\makechar{\&}
-\makechar{\P}
-\makechar{\S}
-\makechar{\pounds}
-\makechar{|}
-\makechar{\neg}
-\makechar{\infty}
-\makechar{\partial}
-\makechar{\mathbackslash}
-\makechar{\degree}
-\makechar{\increment}
-\makechar{\hbar}
-\makechar{'}
-\makechar{"}
-\let\par\relax
-\makechar{\comma}\footnote{In addition to the comma and colon punctuation marks, the package defines \vrb\comma\ and \vrb\colon. The difference lies in the spacing. \TeX\ treats the comma and colon keystrokes as \vrb\mathpunct\ and \vrb\mathrel\ types respectively. The package codes the \vrb\comma\ and \vrb\colon\ control sequences as \vrb\mathord\ and \vrb\mathpunct\ types respectively, so both control sequence result in less space than the corresponding keystroke. I recommend using \vrb\comma\ to typeset commas in large real numbers and \vrb\colon\ to typeset colon punctuation marks, for example following a function or to indicate a subset specification.}\@par
-\makechar{+}
-\makechar{-}
-\makechar{*}
-\makechar{\times}
-\makechar{/}
-\makechar{\div}
-\makechar{\pm}
-\makechar{\bullet}
-\makechar{\dag}
-\makechar{\ddag}
-\makechar{\cdot}
-\makechar{\setminus}
-\makechar{=}
-\makechar{<}
-\makechar{>}
-\makechar{\leq}
-\makechar{\geq}
-\makechar{\sim}
-\makechar{\approx}
-\makechar{\equiv}
-\makechar{\mid}
-\makechar{\parallel}
-\makechar{:}
-\makechar{?}
-\makechar{!}
-\makechar{,}
-\makechar{;}
-\makechar{\colon}
-\makechar{\mathellipsis}
+\charexample\cyrA
+\charexample\cyrBe
+\charexample\cyrVe
+\charexample\cyrGhe
+\charexample\cyrDe
+\charexample\cyrIe
+\charexample\cyrZhe
+\charexample\cyrZe
+\charexample\cyrI
+\charexample\cyrKa
+\charexample\cyrEl
+\charexample\cyrEm
+\charexample\cyrEn
+\charexample\cyrO
+\charexample\cyrPe
+\charexample\cyrEr
+\charexample\cyrEs
+\charexample\cyrTe
+\charexample\cyrU
+\charexample\cyrEf
+\charexample\cyrHa
+\charexample\cyrTse
+\charexample\cyrChe
+\charexample\cyrSha
+\charexample\cyrShcha
+\charexample\cyrHard
+\charexample\cyrYeru
+\charexample\cyrSoft
+\charexample\cyrE
+\charexample\cyrYu
+\charexample\cyrYa
+\charexample\cyrvarI
 \end{multicols}
 
-\blockheader{extsymbols}{Extended Math}{Symbola}
+\blockheader{cyrilliclower}{Lower-Case Cyrillic}
 
 \begin{multicols}{3}
-\makechar{\wp}
-\makechar{\Re}
-\makechar{\Im}
-\makechar{\ell}
-\makechar{\forall}
-\makechar{\exists}
-\makechar{\emptyset}
-\makechar{\nabla}
-\makechar{\in}
-\makechar{\ni}
-\makechar{\mp}
-\makechar{\angle}
-\makechar{\top}
-\makechar{\bot}
-\makechar{\vdash}
-\makechar{\dashv}
-\makechar{\flat}
-\makechar{\natural}
-\makechar{\sharp}
-\makechar{\fflat}
-\makechar{\ssharp}
-\let\par\relax
-\makechar{\bclubsuit}\footnote{Also \vrb\clubsuit.}\@par
-\makechar{\bdiamondsuit}
-\makechar{\bheartsuit}
-\let\par\relax
-\makechar{\bspadesuit}\footnote{Also \vrb\spadesuit.}\@par
-\makechar{\wclubsuit}
-\let\par\relax
-\makechar{\wdiamondsuit}\footnote{Also \vrb\diamondsuit.}\@@par
-\makechar{\wheartsuit}\footnote{Also \vrb\heartsuit.}\@par
-\makechar{\wspadesuit}
-\makechar{\wedge}
-\makechar{\vee}
-\makechar{\cap}
-\makechar{\cup}
-\makechar{\sqcap}
-\makechar{\sqcup}
-\makechar{\amalg}
-\makechar{\wr}
-\makechar{\ast}
-\makechar{\star}
-\makechar{\diamond}
-\makechar{\varcdot}
-\makechar{\varsetminus}
-\makechar{\oplus}
-\makechar{\otimes}
-\makechar{\ominus}
-\makechar{\odiv}
-\makechar{\oslash}
-\makechar{\odot}
-\makechar{\sqplus}
-\makechar{\sqtimes}
-\makechar{\sqminus}
-\makechar{\sqdot}
-\makechar{\in}
-\makechar{\ni}
-\makechar{\subset}
-\makechar{\supset}
-\makechar{\subseteq}
-\makechar{\supseteq}
-\makechar{\sqsubset}
-\makechar{\sqsupset}
-\makechar{\sqsubseteq}
-\makechar{\sqsupseteq}
-\makechar{\triangleleft}
-\makechar{\triangleright}
-\makechar{\trianglelefteq}
-\makechar{\trianglerighteq}
-\makechar{\propto}
-\makechar{\bowtie}
-\makechar{\hourglass}
-\makechar{\therefore}
-\makechar{\because}
-\makechar{\ratio}
-\makechar{\proportion}
-\makechar{\ll}
-\makechar{\gg}
-\makechar{\lll}
-\makechar{\ggg}
-\makechar{\leqq}
-\makechar{\geqq}
-\makechar{\lapprox}
-\makechar{\gapprox}
-\makechar{\simeq}
-\makechar{\eqsim}
-\let\par\relax
-\makechar{\simeqq}\footnote{Also \vrb\cong.}\@par
-\makechar{\approxeq}
-\makechar{\sssim}
-\makechar{\seq}
-\makechar{\doteq}
-\makechar{\coloneq}
-\makechar{\eqcolon}
-\makechar{\ringeq}
-\makechar{\arceq}
-\makechar{\wedgeeq}
-\makechar{\veeeq}
-\makechar{\stareq}
-\makechar{\triangleeq}
-\makechar{\defeq}
-\makechar{\qeq}
-\makechar{\lsim}
-\makechar{\gsim}
-\makechar{\prec}
-\makechar{\succ}
-\makechar{\preceq}
-\makechar{\succeq}
-\makechar{\preceqq}
-\makechar{\succeqq}
-\makechar{\precsim}
-\makechar{\succsim}
-\makechar{\precapprox}
-\makechar{\succapprox}
-\makechar{\precprec}
-\makechar{\succsucc}
-\makechar{\asymp}
-\makechar{\nin}
-\makechar{\nni}
-\makechar{\nsubset}
-\makechar{\nsupset}
-\makechar{\nsubseteq}
-\makechar{\nsupseteq}
-\makechar{\subsetneq}
-\makechar{\supsetneq}
-\makechar{\nsqsubseteq}
-\makechar{\nsqsupseteq}
-\makechar{\sqsubsetneq}
-\makechar{\sqsupsetneq}
-\makechar{\neq}
-\makechar{\nl}
-\makechar{\ng}
-\makechar{\nleq}
-\makechar{\ngeq}
-\makechar{\lneq}
-\makechar{\gneq}
-\makechar{\lneqq}
-\makechar{\gneqq}
-\makechar{\ntriangleleft}
-\makechar{\ntriangleright}
-\makechar{\ntrianglelefteq}
-\makechar{\ntrianglerighteq}
-\makechar{\nsim}
-\makechar{\napprox}
-\makechar{\nsimeq}
-\makechar{\nsimeqq}
-\makechar{\simneqq}
-\makechar{\nlsim}
-\makechar{\ngsim}
-\makechar{\lnsim}
-\makechar{\gnsim}
-\makechar{\lnapprox}
-\makechar{\gnapprox}
-\makechar{\nprec}
-\makechar{\nsucc}
-\makechar{\npreceq}
-\makechar{\nsucceq}
-\makechar{\precneq}
-\makechar{\succneq}
-\makechar{\precneqq}
-\makechar{\succneqq}
-\makechar{\precnsim}
-\makechar{\succnsim}
-\makechar{\precnapprox}
-\makechar{\succnapprox}
-\makechar{\nequiv}
+\charexample\cyra
+\charexample\cyrbe
+\charexample\cyrve
+\charexample\cyrghe
+\charexample\cyrde
+\charexample\cyrie
+\charexample\cyrzhe
+\charexample\cyrze
+\charexample\cyri
+\charexample\cyrka
+\charexample\cyrel
+\charexample\cyrem
+\charexample\cyren
+\charexample\cyro
+\charexample\cyrpe
+\charexample\cyrer
+\charexample\cyres
+\charexample\cyrte
+\charexample\cyru
+\charexample\cyref
+\charexample\cyrha
+\charexample\cyrtse
+\charexample\cyrche
+\charexample\cyrsha
+\charexample\cyrshcha
+\charexample\cyrhard
+\charexample\cyryeru
+\charexample\cyrsoft
+\charexample\cyre
+\charexample\cyryu
+\charexample\cyrya
+\charexample\cyrvari
 \end{multicols}
 
-\blockheader{delimiters}{Delimiter}{Times New Roman}
+\blockheader{hebrew}{Hebrew}
 
 \begin{multicols}{3}
-\makechar{(}
-\makechar{)}
-\makechar{[}
-\makechar{]}
-\makechar{\leftbrace}
-\makechar{\rightbrace}
+\charexample\aleph
+\charexample\beth
+\charexample\gimel
+\charexample\daleth
+\charexample\he
+\charexample\vav
+\charexample\zayin
+\charexample\het
+\charexample\tet
+\charexample\yod
+\charexample\kaf
+\charexample\lamed
+\charexample\mem
+\charexample\nun
+\charexample\samekh
+\charexample\ayin
+\charexample\pe
+\charexample\tsadi
+\charexample\qof
+\charexample\resh
+\charexample\shin
+\charexample\tav
+\charexample\varkaf
+\charexample\varmem
+\charexample\varnun
+\charexample\varpe
+\charexample\vartsadi
 \end{multicols}
 
-\blockheader{arrows}{Arrow}{STIXGeneral}
+\medskip
+\def\temp{; shown in \texttt{\vrb\big}, etc.\ sizes}
+\blockheader{delimiters\aftergroup\temp}{Delimiter}
+\medskip
+\begin{multicols}{3}
+\delimexample(
+\delimexample)
+\delimexample[
+\delimexample]
+\delimexample{\{\ifmmode\else\space(Lua\TeX\ only)\fi}
+\delimexample{\}\ifmmode\else\space(Lua\TeX\ only)\fi}
+\delimexample{|\,\ifmmode\else\space(Lua\TeX\ only)\fi}
+\delimexample\lguil
+\delimexample\rguil
+\delimexample\llguil
+\delimexample\rrguil
+\luadelimexample\fakelangle
+\luadelimexample\fakerangle
+\luadelimexample\fakellangle
+\luadelimexample\fakerrangle
+\hbox to \hsize{\hbox to 0.8in{$\leftbrace$\hfil}\vrb\leftbrace\hfil}
+\hbox to \hsize{\hbox to 0.8in{$\rightbrace$\hfil}\vrb\rightbrace\hfil}
+\end{multicols}
+\medskip
 
+\blockheader{radical}{Square Root}
+\smallskip
 \begin{multicols}{2}
-\let\par\relax
-\makechar{\rightarrow}\footnote{Also \vrb\to.}\@par
-\makechar{\nrightarrow}
-\makechar{\Rightarrow}
-\makechar{\nRightarrow}
-\makechar{\Rrightarrow}
-\makechar{\longrightarrow}
-\makechar{\Longrightarrow}
-\let\par\relax
-\makechar{\rightbararrow}\footnote{Also \vrb\mapsto.}\@par
-\makechar{\Rightbararrow}
-\let\par\relax
-\makechar{\longrightbararrow}\footnote{Also \vrb\longmapsto.}\@par
-\makechar{\Longrightbararrow}
-\makechar{\hookrightarrow}
-\makechar{\rightdasharrow}
-\makechar{\rightharpoonup}
-\makechar{\rightharpoondown}
-\makechar{\rightarrowtail}
-\makechar{\rightoplusarrow}
-\makechar{\rightwavearrow}
-\makechar{\rightsquigarrow}
-\makechar{\longrightsquigarrow}
-\makechar{\looparrowright}
-\makechar{\curvearrowright}
-\makechar{\circlearrowright}
-\makechar{\twoheadrightarrow}
-\makechar{\rightarrowtobar}
-\makechar{\rightwhitearrow}
-\makechar{\rightrightarrows}
-\makechar{\rightrightrightarrows}
-\let\par\relax
-\makechar{\leftarrow}\footnote{Also \vrb\from.}\@par
-\makechar{\nleftarrow}
-\makechar{\Leftarrow}
-\makechar{\nLeftarrow}
-\makechar{\Lleftarrow}
-\makechar{\longleftarrow}
-\makechar{\Longleftarrow}
-\let\par\relax
-\makechar{\leftbararrow}\footnote{Also \vrb\mapsfrom.}\@par
-\makechar{\Leftbararrow}
-\let\par\relax
-\makechar{\longleftbararrow}\footnote{Also \vrb\longmapsfrom.}\@par
-\makechar{\Longleftbararrow}
-\makechar{\hookleftarrow}
-\makechar{\leftdasharrow}
-\makechar{\leftharpoonup}
-\makechar{\leftharpoondown}
-\makechar{\leftarrowtail}
-\makechar{\leftoplusarrow}
-\makechar{\leftwavearrow}
-\makechar{\leftsquigarrow}
-\makechar{\longleftsquigarrow}
-\makechar{\looparrowleft}
-\makechar{\curvearrowleft}
-\makechar{\circlearrowleft}
-\makechar{\twoheadleftarrow}
-\makechar{\leftarrowtobar}
-\makechar{\leftwhitearrow}
-\makechar{\leftleftarrows}
-\makechar{\leftleftleftarrows}
-\makechar{\leftrightarrow}
-\makechar{\Leftrightarrow}
-\makechar{\nLeftrightarrow}
-\makechar{\longleftrightarrow}
-\makechar{\Longleftrightarrow}
-\makechar{\leftrightwavearrow}
-\makechar{\leftrightarrows}
-\makechar{\leftrightharpoons}
-\makechar{\leftrightarrowstobar}
-\makechar{\rightleftarrows}
-\makechar{\rightleftharpoons}
-\makechar{\uparrow}
-\makechar{\Uparrow}
-\makechar{\Uuparrow}
-\makechar{\upbararrow}
-\makechar{\updasharrow}
-\makechar{\upharpoonleft}
-\makechar{\upharpoonright}
-\makechar{\twoheaduparrow}
-\makechar{\uparrowtobar}
-\makechar{\upwhitearrow}
-\makechar{\upwhitebararrow}
-\makechar{\upuparrows}
-\makechar{\downarrow}
-\makechar{\Downarrow}
-\makechar{\Ddownarrow}
-\makechar{\downbararrow}
-\makechar{\downdasharrow}
-\makechar{\zigzagarrow}
-\makechar{\downharpoonleft}
-\makechar{\downharpoonright}
-\makechar{\twoheaddownarrow}
-\makechar{\downarrowtobar}
-\makechar{\downwhitearrow}
-\makechar{\downdownarrows}
-\makechar{\updownarrow}
-\makechar{\Updownarrow}
-\makechar{\updownarrows}
-\makechar{\downuparrows}
-\makechar{\updownharpoons}
-\makechar{\downupharpoons}
-\makechar{\nearrow}
-\makechar{\Nearrow}
-\makechar{\nwarrow}
-\makechar{\Nwarrow}
-\makechar{\searrow}
-\makechar{\Searrow}
-\makechar{\swarrow}
-\makechar{\Swarrow}
-\makechar{\nwsearrow}
-\makechar{\neswarrow}
-\makechar{\lcirclearrow}
-\makechar{\rcirclearrow}
+\charexample\surd
+\def\temp{ (Lua\TeX\ only)\hfill}
+\charexample{\sqrt{\ifmmode\mkern 12mu\vphantom{1}\else\temp\fi}}
 \end{multicols}
 
-\blockheader{bigops}{Big Operator}{Times New Roman}
+\blockheader{bigops}{Big Operator}
+\smallskip
+\begin{multicols}{2}
+\operatorexample\sum
+\operatorexample\prod
+\operatorexample\intop
+\end{multicols}
+\medskip
 
+\blockheader{extbigops}{Extended Big Operators}
+\smallskip
 \begin{multicols}{3}
-\makechar{\sum}
-\makechar{\prod}
-\makechar{\intop}
+\operatorexample\coprod
+\operatorexample\bigvee
+\operatorexample\bigwedge
+\operatorexample\bigcap
+\operatorexample\bigcup
+\operatorexample\bigoplus
+\operatorexample\bigotimes
+\operatorexample\bigodot
+\operatorexample\bigsqcap
+\operatorexample\bigsqcup
+\operatorexample\iint
+\operatorexample\iiint
+\operatorexample\oint
+\operatorexample\oiint
+\operatorexample\oiiint
 \end{multicols}
 
-\blockheader{extbigops}{Extended Big Operators}{STIXGeneral}
+\medskip
 
+\blockheader{symbols}{Basic Math}
 \begin{multicols}{3}
-\makechar{\coprod}
-\makechar{\bigvee}
-\makechar{\bigwedge}
-\makechar{\bigcup}
-\makechar{\bigcap}
-\makechar{\iint}
-\makechar{\iiint}
-\makechar{\oint}
-\makechar{\oiint}
-\makechar{\oiiint}
-\makechar{\bigoplus}
-\makechar{\bigotimes}
-\makechar{\bigodot}
-\makechar{\bigsqcap}
-\makechar{\bigsqcup}
+\charexample.
+\charexample @
+\let\par\relax
+\charexample\#
+\charexample\$
+\charexample\%
+\charexample\&
+\charexample\P
+\charexample\S
+\charexample\pounds
+\charexample|
+\charexample\neg
+\charexample\infty
+\charexample\partial
+\charexample\mathbackslash
+\charexample\degree
+\charexample\increment
+\def\temp{ (Lua\TeX only)}
+\charexample{\nabla\ifmmode\else\temp\fi}
+\charexample'
+\charexample\prime
+\charexample"
+\charexample+
+\charexample-
+\charexample*
+\charexample\times
+\charexample/
+\charexample\fractionslash
+\charexample\div
+\charexample\pm
+\charexample\bullet
+\charexample\dag
+\charexample\ddag
+\charexample\cdot
+\charexample\setminus
+\charexample=
+\charexample<
+\charexample>
+\charexample\leq
+\charexample\geq
+\charexample\sim
+\charexample\approx
+\charexample\simeq
+\charexample\equiv
+\charexample\cong
+\charexample\mid
+\charexample\parallel
+\charexample!
+\charexample?
+\charexample{,\ifmmode\else\phantom{\texttt{comma}} (as \rlap{\vrb\mathpunct)}\fi}
+\charexample{\comma\ifmmode\else\space(as \vrb\mathord)\fi}
+\charexample{:\ifmmode\else\phantom{\texttt{colon}} (as \vrb\mathrel)\fi}
+\charexample{\colon\ifmmode\else\space(as \vrb\mathord)\fi}
+\charexample;
+\charexample\mathellipsis
 \end{multicols}
+\blockheader{symbols}{Lua\TeX-only (!) Operator}
+\begin{multicols}{3}
+\operatorexample\bigat
+\operatorexample\bighash
+\operatorexample\bigdollar
+\operatorexample\bigpercent
+\operatorexample\bigand
+\operatorexample\bigplus
+\operatorexample\bigp
+\operatorexample\bigq
+\operatorexample\bigS
+\operatorexample\bigtimes
+\operatorexample\bigdiv
+\end{multicols}
 
-\blockheader{bb}{Blackboard Bold}{Symbola and Accessed with \vrb\mathbb}
+\blockheader{extsymbols}{Extended Math}
+\begin{multicols}{3}
+\charexample\wp
+\charexample\Re
+\charexample\Im
+\charexample\ell
+\charexample\forall
+\charexample\exists
+\charexample\emptyset
+\charexample{\nabla\ifmmode\else\space(\XeTeX)\fi}
+\charexample\in
+\charexample\ni
+\charexample\mp
+\charexample\angle
+\charexample\top
+\charexample\bot
+\charexample\vdash
+\charexample\dashv
+\charexample\flat
+\charexample\natural
+\charexample\sharp
+\charexample\bclubsuit
+\charexample\clubsuit
+\charexample\bdiamondsuit
+\charexample\bheartsuit
+\charexample\bspadesuit
+\charexample\spadesuit
+\charexample\wclubsuit
+\charexample\wdiamondsuit
+\charexample\diamondsuit
+\charexample\wheartsuit
+\charexample\heartsuit
+\charexample\wspadesuit
+\charexample\wedge
+\charexample\vee
+\charexample\cap
+\charexample\cup
+\charexample\sqcap
+\charexample\sqcup
+\charexample\amalg
+\charexample\wr
+\charexample\ast
+\charexample\star
+\charexample\diamond
+\charexample\varcdot
+\charexample\varsetminus
+\charexample\oplus
+\charexample\otimes
+\charexample\ominus
+\charexample\odiv
+\charexample\oslash
+\charexample\odot
+\charexample\sqplus
+\charexample\sqtimes
+\charexample\sqminus
+\charexample\sqdot
+\charexample\in
+\charexample\ni
+\charexample\subset
+\charexample\supset
+\charexample\subseteq
+\charexample\supseteq
+\charexample\sqsubset
+\charexample\sqsupset
+\charexample\sqsubseteq
+\charexample\sqsupseteq
+\charexample\triangleleft
+\charexample\triangleright
+\charexample\trianglelefteq
+\charexample\trianglerighteq
+\charexample\propto
+\charexample\bowtie
+\charexample\hourglass
+\charexample\therefore
+\charexample\because
+\charexample\ratio
+\charexample\proportion
+\charexample\ll
+\charexample\gg
+\charexample\lll
+\charexample\ggg
+\charexample\leqq
+\charexample\geqq
+\charexample\lapprox
+\charexample\gapprox
+\charexample\simeq
+\charexample\eqsim
+\charexample\simeqq
+\charexample\cong
+\charexample\approxeq
+\charexample\sssim
+\charexample\seq
+\charexample\doteq
+\charexample\coloneq
+\charexample\eqcolon
+\charexample\ringeq
+\charexample\arceq
+\charexample\wedgeeq
+\charexample\veeeq
+\charexample\stareq
+\charexample\triangleeq
+\charexample\defeq
+\charexample\qeq
+\charexample\lsim
+\charexample\gsim
+\charexample\prec
+\charexample\succ
+\charexample\preceq
+\charexample\succeq
+\charexample\preceqq
+\charexample\succeqq
+\charexample\precsim
+\charexample\succsim
+\charexample\precapprox
+\charexample\succapprox
+\charexample\precprec
+\charexample\succsucc
+\charexample\asymp
+\charexample\nin
+\charexample\nni
+\charexample\nsubset
+\charexample\nsupset
+\charexample\nsubseteq
+\charexample\nsupseteq
+\charexample\subsetneq
+\charexample\supsetneq
+\charexample\nsqsubseteq
+\charexample\nsqsupseteq
+\charexample\sqsubsetneq
+\charexample\sqsupsetneq
+\charexample\neq
+\charexample\nl
+\charexample\ng
+\charexample\nleq
+\charexample\ngeq
+\charexample\lneq
+\charexample\gneq
+\charexample\lneqq
+\charexample\gneqq
+\charexample\ntriangleleft
+\charexample\ntriangleright
+\charexample\ntrianglelefteq
+\charexample\ntrianglerighteq
+\charexample\nsim
+\charexample\napprox
+\charexample\nsimeq
+\charexample\nsimeqq
+\charexample\simneqq
+\charexample\nlsim
+\charexample\ngsim
+\charexample\lnsim
+\charexample\gnsim
+\charexample\lnapprox
+\charexample\gnapprox
+\charexample\nprec
+\charexample\nsucc
+\charexample\npreceq
+\charexample\nsucceq
+\charexample\precneq
+\charexample\succneq
+\charexample\precneqq
+\charexample\succneqq
+\charexample\precnsim
+\charexample\succnsim
+\charexample\precnapprox
+\charexample\succnapprox
+\charexample\nequiv
+\end{multicols}
 
+\blockheader{arrows}{Arrow}
+\begin{multicols}{2}
+\charexample\rightarrow
+\charexample\to
+\charexample\nrightarrow
+\charexample\Rightarrow
+\charexample\nRightarrow
+\charexample\Rrightarrow
+\charexample\longrightarrow
+\charexample\Longrightarrow
+\charexample\rightbararrow
+\charexample\mapsto
+\charexample\Rightbararrow
+\charexample\longrightbararrow
+\charexample\longmapsto
+\charexample\Longrightbararrow
+\charexample\hookrightarrow
+\charexample\rightdasharrow
+\charexample\rightharpoonup
+\charexample\rightharpoondown
+\charexample\rightarrowtail
+\charexample\rightoplusarrow
+\charexample\rightwavearrow
+\charexample\rightsquigarrow
+\charexample\longrightsquigarrow
+\charexample\looparrowright
+\charexample\curvearrowright
+\charexample\circlearrowright
+\charexample\twoheadrightarrow
+\charexample\rightarrowtobar
+\charexample\rightwhitearrow
+\charexample\rightrightarrows
+\charexample\rightrightrightarrows
+\charexample\leftarrow
+\charexample\from
+\charexample\nleftarrow
+\charexample\Leftarrow
+\charexample\nLeftarrow
+\charexample\Lleftarrow
+\charexample\longleftarrow
+\charexample\Longleftarrow
+\charexample\leftbararrow
+\charexample\mapsfrom
+\charexample\Leftbararrow
+\charexample\longleftbararrow
+\charexample\longmapsfrom
+\charexample\Longleftbararrow
+\charexample\hookleftarrow
+\charexample\leftdasharrow
+\charexample\leftharpoonup
+\charexample\leftharpoondown
+\charexample\leftarrowtail
+\charexample\leftoplusarrow
+\charexample\leftwavearrow
+\charexample\leftsquigarrow
+\charexample\longleftsquigarrow
+\charexample\looparrowleft
+\charexample\curvearrowleft
+\charexample\circlearrowleft
+\charexample\twoheadleftarrow
+\charexample\leftarrowtobar
+\charexample\leftwhitearrow
+\charexample\leftleftarrows
+\charexample\leftleftleftarrows
+\charexample\leftrightarrow
+\charexample\Leftrightarrow
+\charexample\nLeftrightarrow
+\charexample\longleftrightarrow
+\charexample\Longleftrightarrow
+\charexample\leftrightwavearrow
+\charexample\leftrightarrows
+\charexample\leftrightharpoons
+\charexample\leftrightarrowstobar
+\charexample\rightleftarrows
+\charexample\rightleftharpoons
+\charexample\uparrow
+\charexample\Uparrow
+\charexample\Uuparrow
+\charexample\upbararrow
+\charexample\updasharrow
+\charexample\upharpoonleft
+\charexample\upharpoonright
+\charexample\twoheaduparrow
+\charexample\uparrowtobar
+\charexample\upwhitearrow
+\charexample\upwhitebararrow
+\charexample\upuparrows
+\charexample\downarrow
+\charexample\Downarrow
+\charexample\Ddownarrow
+\charexample\downbararrow
+\charexample\downdasharrow
+\charexample\zigzagarrow
+\charexample\lightningboltarrow
+\charexample\downharpoonleft
+\charexample\downharpoonright
+\charexample\twoheaddownarrow
+\charexample\downarrowtobar
+\charexample\downwhitearrow
+\charexample\downdownarrows
+\charexample\updownarrow
+\charexample\Updownarrow
+\charexample\updownarrows
+\charexample\downuparrows
+\charexample\updownharpoons
+\charexample\downupharpoons
+\charexample\nearrow
+\charexample\Nearrow
+\charexample\nwarrow
+\charexample\Nwarrow
+\charexample\searrow
+\charexample\Searrow
+\charexample\swarrow
+\charexample\Swarrow
+\charexample\nwsearrow
+\charexample\neswarrow
+\charexample\lcirclearrow
+\charexample\rcirclearrow
+\end{multicols}
+
+\blockheader{bb}{Blackboard Bold}
+
 \letterlikechars\mathbb
 \hbox to 10em{\printchars\digits}
 
-\blockheader{cal}{Calligraphic}{Symbola and Accessed with \vrb\mathcal}
+\blockheader{cal}{Caligraphic}
 
 \letterlikechars\mathcal
 
-\blockheader{frak}{Fraktur}{Symbola and Accessed with \vrb\mathfrak}
+\blockheader{frak}{Fraktur}
 
 \letterlikechars\mathfrak
 
-\blockheader{bcal}{Bold Calligraphic}{Symbola and Accessed with \vrb\mathbcal}
+\blockheader{bcal}{Bold Calligraphic}
 
 \letterlikechars\mathbcal
 
-\blockheader{bfrak}{Bold Fraktur}{Symbola and Accessed with \vrb\mathbfrak}
+\blockheader{bfrak}{Bold Fraktur}
 
 \letterlikechars\mathbfrak
 

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	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex	2021-12-29 21:35:30 UTC (rev 61440)
@@ -6,43 +6,49 @@
 %%
 %% mathfont_code.dtx  (with options: `user')
 %% 
-%% This file is file from version 1.6 of the LaTeX package "mathfont,"
-%% to be used in conjunction with the XeTeX or LuaTeX engines.
+%% This file is from version 2.0 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-2019 by Conrad Kosowsky
+%% 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
+%% 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
 %% 
-%%            https://www.latex-project.org/lppl/.
+%%           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 of the
-%% following items:
+%% 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.
 %% 
-%%   (1) the base file mathfont_code.dtx;
+%% 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.
 %% 
-%%   (2) the package code contained in mathfont.sty;
+%% 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.
 %% 
-%%   (3) the derived files mathfont_symbol_list.tex,
-%% mathfont_user_guide.tex, mathfont_heading.tex, and
-%% mathfont_doc_patch.tex;
+%% 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.
 %% 
-%%   (4) the pdf documentation files mathfont_code.pdf,
-%% mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+%% For more information, see the mathfont_code.dtx.
 %% 
-%%   (5) all other files created through the configuration process
-%% such as mathfont.idx and mathfont.ind; and
+%% Happy TeXing!
 %% 
-%%   (6) the associated README.txt file.
-%% 
-%% For more information, see the original mathfont.dtx file. To
-%% install mathfont on your computer, run mathfont_code.dtx through
-%% LaTeX and place the derived file mathfont.sty in a directory
-%% searchable by TeX.
-%% 
 \documentclass[12pt,twoside]{article}
 \makeatletter
 \usepackage[margin=72.27pt]{geometry}
@@ -51,197 +57,230 @@
 \usepackage{booktabs}
 \usepackage{graphicx}
 \usepackage{tabularx}
-\usepackage{shortvrb}
-\skip\footins=7pt
+\usepackage{multirow}
+\usepackage{hyperref}
+\usepackage{enumitem}
+\SetEnumitemKey{special}{topsep=\smallskipamount,
+  itemsep=\smallskipamount,
+  parsep=\z@,partopsep=\z@}
+\setlist{special}
+\usepackage{doc}
 \MakeShortVerb{|}
-\hyphenpenalty=10
-\pretolerance=20
-\hyphenpenalty=10
-\exhyphenpenalty=5
-\brokenpenalty=0
-\clubpenalty=5
-\widowpenalty=5
-\finalhyphendemerits=300
-\doublehyphendemerits=500
-\renewcommand\textfraction{0.4}
+\def\link#1{\href{#1}{\nolinkurl{#1}}}
+\newcount\fig
+\fig=1\relax
+\c at topnumber\@ne
+
+\def\labelfig#1{\immediate\write\@auxout{\string\makelabel{#1}{\the\fig}}}
+\def\makelabel#1#2{\expandafter\gdef\csname fig@#1\endcsname{#2}}
+
 \begin{document}
+\def\ref#1{\csname fig@#1\endcsname}
 
 \def\documentname{User Guide}
+\def\showabstract{1}
 \input mathfont_heading.tex
 
-Handling fonts in \TeX\ and \LaTeX\ is a notoriously difficult task. Donald Knuth originally designed \TeX\ to support fonts created with Metafont, and while subsequent versions of \TeX\ extended this functionality to postscript fonts, Plain \TeX's font-loading capabilities remain limited. Many, if not most, \LaTeX\ users are unfamiliar with the |fd| files that must be used in font declaration, and the minutiae of \TeX's |\font| primitive can be esoteric and confusing. \LaTeXe's New Font Selection System (\textsc{nfss}) implemented a straightforward syntax for loading and managing fonts, but \LaTeX\ macros overlaying a \TeX\ core face the same versatility issues as Plain \TeX\ itself. Fonts in math mode present a double challenge: after loading a font either in Plain \TeX\ or through the \textsc{nfss}, defining math symbols can be unintuitive for users who are unfamiliar with \TeX's |\mathcode| primitive. More recent engines such as Jonathan Kew's \XeTeX\ and Hans Hagen, et al.'s Lua\TeX\ significantly extend the font-loading capabilities of \TeX.\footnote{Information on \XeTeX\ is available at \texttt{https://tug.org/xetex/}, and information on Lua\TeX\ is available at the official website for Lua\TeX: \texttt{http://www.luatex.org/}.} Both support TrueType and OpenType font formats and provide many additional primitives for managing fonts, and the \textsf{fontspec} package by Will Robertson and Khaled Hosny acts as a front-end for the font management built into these two engines.\footnote{Will Robertson and Khaled Hosny, ``\textsf{fontspec}---Advanced font selection in \XeLaTeX\ and Lua\LaTeX,'' \texttt{https://ctan.org/pkg/fontspec}.}
+Handling fonts in \TeX\ and \LaTeX\ is a notoriously difficult task because fonts are complicated objects.\footnote{The last 30 years have seen huge advances in loading fonts with \TeX. Donald Knuth originally designed \TeX\ to load fonts created with Metafont, and only more recent engines such as Jonathan Kew's \XeTeX\ and Hans Hagen, et al.'s Lua\TeX\ have extended \TeX's font-loading capabilities to unicode. \XeTeX\ supports OpenType and TrueType fonts natively, and Lua\TeX\ can load OpenType fonts through the \textsf{luaotfload} package. Information on \XeTeX\ is available at \link{https://tug.org/xetex/}, and information on Lua\TeX\ is available at the official website for Lua\TeX: \link{http://www.luatex.org/}. See also Ulrike Fischer, et al., ``\textsf{luaotfload}---OpenType `loader' for Plain \TeX\ and \LaTeX,'' \link{https://ctan.org/pkg/luaotfload}.} The \textsf{mathfont} package loads TrueType and OpenType fonts for use in math mode, and this document explains the package's user-level commands. For version history and code implementation, see |mathfont_code.pdf|, and for a list of all symbols accessible with \textsf{mathfont}, see |mathfont_symbol_list.pdf|. The \textsf{mathfont} installation also includes four example files, and all \textsf{mathfont} pdf documentation files are available on \textsc{ctan}.
 
-The \textsf{mathfont} package applies \textsf{fontspec}'s advances in font selection to mathematics typesetting, and this document explains the package's user-level commands. Section~1 presents the basic functionality and related packages. Section~2 explains how to use the default font-change commands, and users in a hurry will find the most important information here. Section~3 describes the local font-change commands, and section~4 discusses mathematical symbols and aspects of their implementation. Section~5 addresses error messages. For version history and code implementation, see |mathfont_code.pdf|, and for a list of all symbols accessible with \textsf{mathfont}, see |mathfont_symbol_list.pdf|. Both of these documentation files are included with the \textsf{mathfont} installation and are available on \textsc{ctan}.
+\section{Loading and Basic Functionality}
 
-\section{Basic Functionality}
+Loading fonts for math typesetting is more complicated than for regular text. First, the commands to select fonts for math mode, both in plain \TeX\ and in the \textsc{nfss}, are more complicated than the macros to select text fonts, and second, \TeX\ expects fonts for math to contain extra information that it uses to format equations.\footnote{Specifically, this extra information is a set of large variants, math-specific parameter values associated with individual characters, and a MathConstants table. Also, math fonts often use slightly wider bounding boxes for letters in math mode---the Computer Modern $f$ is a famous example. For this reason, \textsf{mathfont} also provides an interface to enlarge the bounding boxes of Latin letters when they appear in math mode. See section 4 for details.} Broadly speaking, we say that a \textit{math font} contains this extra information, whereas a \textit{text font} does not, and typesetting math with glyphs from one or more text fonts usually results in equations that are less aesthetically pleasing than using a properly prepared math font. The functionality of \textsf{mathfont} then is twofold: (1) provide a wrapper around the \textsc{nfss} commands for math typesetting that serves as a high-level interface; and (2) implement Lua\TeX\ callbacks that artificially convert text fonts into math fonts at loading.\footnote{Values for MathConstants table are different from but inspired by Ulrik Vieth, ``Understanding the \AE sthetics of Math Typesetting,'' (Bacho\TeX\ Conference, 2008) and Ulrik Vieth ``OpenType Math Illuminated,'' \textit{TUGboat} 30 (2009): 22--31. See also Bogus\l aw Jackowski, ``Appendix G Illuminated,'' \textit{TUGboat} 27 (2006): 83--90.} Please note that \textsf{mathfont} tries its best to get your fonts right, but if you run into trouble loading the correct font files, you should declare your font family and shapes in the \textsc{nfss} before setting any fonts with \textsf{mathfont}. Because unicode text fonts greatly outnumber unicode math fon!
 ts, I hope that my package will expand the set of fonts available for typesetting math in \LaTeX.
 
-The \textsf{mathfont} package uses \textsf{fontspec} as a back end to load fonts for use in math mode, and it provides two ways to do this: (1) changing the default font for certain classes of math-mode characters; and (2) defining new commands that change the font locally for the so-called ``math-alphabet'' characters. The package can change the default math-mode font used for Latin, Greek, Cyrillic, and Hebrew letters; Arabic numerals; roughly 300 unicode math symbols; and standard unicode alphanumeric characters. The package accepts any OpenType or TrueType font, and tables~1 and 2 display the specific classes of characters that \textsf{mathfont}'s default font-change command acts on. The default math-alphabet characters are Latin letters, Arabic numerals, upper-case Greek characters, and diacritics. When \textsf{mathfont} sets the default font for any of these four character classes, it preserves their math alphabet status, and when the package sets the default font for lower-case Greek, ancient Greek, Cyrillic, or Hebrew characters, it recodes each symbol in the class as math-alphabet type. At that point, the local font-change commands will act on any characters in those classes.
+You must use one of \XeLaTeX\ or Lua\LaTeX\ to typeset a document with \textsf{mathfont}. You can load \textsf{mathfont} with the standard |\usepackage{mathfont}| syntax, and the package accepts three optional arguments. If you use Lua\TeX, the options |adjust| or |no-adjust| will manually specify whether \textsf{mathfont} should adapt text fonts for math mode, and \textsf{mathfont} selects |adjust| by default. If you use \XeTeX, \textsf{mathfont} cannot adjust any font objects with Lua callbacks, and either of these package options will cause an error.\footnote{In particular, with \XeLaTeX\ \textsf{mathfont} does not add big operators or resizable delimiters. This means you will have to use the Computer Modern defaults, load a separate math font for resizable characters, or end up with a document where large operators and delimiters do not scale like they do normally.} For this reason, using Lua\TeX\ with \textsf{mathfont} is recommended as of version 2.0. If you load \textsf{mathfont} with any other optional argument, the package will interpret it as a font name and call |\setfont| (described in the next section) on your argument. Doing so selects that font for the text of your document and for the character classes in the upper section of Table~1.
 
-The package must be loaded with \XeLaTeX or Lua\LaTeX. It can be loaded with the standard |\usepackage| syntax, and it accepts one optional argument. It treats the argument as a font name and changes all main fonts to that option. Specifically, the package invokes both |\mathfont| and \textsf{fontspec}'s |\setmainfont|, and it defines the four local font-changing commands |\mathrm|, |\mathit|, |\mathbf|, and |\mathbfit| to produce text from the desired font in combinations of upright, italic, and bold styles according to the control sequences' last letters. \XeTeX\ users may run into trouble with fonts whose name contains multiple words because \LaTeX\ eats spaces during package-option parsing. In this case, you will have to load the package and separately declare |\setfont| in your preamble. The package loads \textsf{fontspec} with the |no-math| option if and only if the user has not already loaded \textsf{fontspec}. Users who want \textsf{fontspec} without |no-math| or with other options in place can manually load it before requiring \textsf{mathfont}. Regardless, I strongly recommend that \textsf{fontspec} be loaded with |no-math| because otherwise some font changes may not render properly.
+The \textsf{mathfont} package is closely related to several other \LaTeX\ packages. The functionality is closest to that of \textsf{mathspec} by Andrew Gilbert Moschou, which is compatible with \XeTeX\ only and selects characters from text fonts for math.\footnote{Andrew Gilbert Moschou, ``\textsf{mathspec}---Specify arbitrary fonts for mathematics in \XeTeX,'' \link{https://ctan.org/pkg/mathspec}.} The \textsf{unicode-math} package is the standard \LaTeX\ package for loading actual unicode math fonts, and if you have a unicode font with proper math support, rather than a text font that you want to use for equations, consider using this package instead of \textsf{mathfont}.\footnote{Will Robertson, et al., ``\textsf{unicode-math}---Unicode mathematics support for XeTeX and LuaTeX,'' \link{https://ctan.org/pkg/unicode-math}.} Users who want to a text font for math with pdf\LaTeX\ should consider Jean-Fran\c cois Burnol's \textsf{mathastext} because \textsf{mathfont} is incompatible with pdf\TeX.\footnote{Jean-Fran\c cois Burnol, ``\textsf{mathastext}---Use the text font in maths mode,'' \link{https://ctan.org/pkg/mathastext}. In several previous versions of this documentation, I mischaracterized the approach of \textsf{mathastext} to \TeX's internal mathematics spacing. In fact, \textsf{mathastext} preserves and in some cases extends rules for space between various math-mode characters.} Finally, you will probably be better off using \textsf{fontspec} if your document does not contain any math.\footnote{Will Robertson and Khaled Hosny, ``\textsf{fontspec}---Advanced font selection in \XeLaTeX\ and Lua\LaTeX,'' \link{https://ctan.org/pkg/fontspec}.} The \textsf{fontspec} package is designed to load TrueType and OpenType fonts for text and provides a high-level interface for selecting OpenType font features.
 
-During loading, \textsf{mathfont} redefines three \LaTeX\ internal macros to make symbol declaration compatible with unicode fonts, and default math-font changes work only with the redefinitions in place. Because the internal changes are relatively unobtrusive, \textsf{mathfont}'s adjustments almost certainly do not affect \LaTeX\ packages loaded later, and the package does not restore the commands automatically. Instead, |\restoremathinternals| returns the internal commands to their default definitions, and users who want the previous definitions should reset the kernel manually. The corollary is that |\mathfont| and |\setfont| work before |\restoremathinternals| but not after. As of version~1.6, the package optional arguments |packages|, |operators|, and |no-operators| are depreciated. Instead, \textsf{mathfont} offers |\restoremathinternals| as the only way to interact directly with the kernel.\footnote{To be clear, as of version~1.6, \textsf{mathfont} does not restore the \LaTeX\ kernel when the user loads other packages. Given the scope and nature of the changes, I determined that the convenience factor of being able to use \vrb\mathfont\ anywhere in the preamble outweighs the incredibly small risk of interfering with another package. As far as I can tell, the biggest change is using a different primitive to code math symbols, but even that will probably never affect practical applications. The test \expandafter\vrb\csname if\endcsname\vrb\mathchar\vrb\alpha\ succeeds both before and after calling \vrb\mathfont, even though afterwards \vrb\alpha\ is defined with \vrb\Umathchar\ instead.} For changes to big operators, use the |bigops| keyword in section~2.
+\begin{figure}[t]\labelfig{Keywords}
+\centerline{\bfseries Table \the\fig: Character Classes\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\hsize{lXll}\toprule
+Keyword & Meaning & Default Shape & Alphabetic?\\\midrule
+|upper| & Upper-Case Latin & Italic & Yes\\
+|lower| & Lower-Case Latin & Italic & Yes\\
+|diacritics| & Diacritics & Upright & Yes\\
+|greekupper| & Upper-Case Greek & Upright & Yes\\
+|greeklower| & Lower-Case Greek & Italic & Yes\\
+|digits| & Arabic Numerals & Upright & Yes\\
+|operator| & Operator Font & Upright & Yes\\
+|delimiters| & Delimiter & Upright & No\\
+|radical| & Square Root Symbol & Upright & No\\
+|symbols| & Basic Math Symbols & Upright & No\\
+|bigops| & Big Operators & Upright & No\\\midrule
+|agreekupper| & Upper-Case Ancient Greek & Upright & Yes\\
+|agreeklower| & Lower-Case Ancient Greek & Italic & Yes\\
+|cyrillicupper| & Upper-Case Cyrillic & Upright & Yes\\
+|cyrilliclower| & Lower-Case Cyrillic & Italic & Yes\\
+|hebrew| & Hebrew & Upright & Yes\\
+|extsymbols| & Extended Math Symbols & Upright & No\\
+|arrows| & Arrows & Upright & No\\
+|extbigops| & Extended Big Operators & Upright & No\\
+|bb| & Blackboard Bold (double-struck) & Upright & No\\
+|cal| & Caligraphic & Upright & No\\
+|frak| & Fraktur & Upright & No\\
+|bcal| & Bold Caligraphic & Upright & No\\
+|bfrak| & Bold Fraktur & Upright & No\\
+\bottomrule
+\end{tabularx}
+\end{figure}
 
-The functionality of \textsf{mathfont} is most closely related to that of the \textsf{mathspec} package by Andrew Gilbert Moschou.\footnote{Andrew Gilbert Moschou, ``\textsf{mathspec}---Specify arbitrary fonts for mathematics in \XeTeX,''\hfil\break\texttt{https://ctan.org/pkg/mathspec}.} These two packages incorporate the use of individual unicode characters into math mode, and their symbol declaration process is similar. Both use \textsf{fontspec} as a back end, and both create font-changing commands for math-mode characters. However, the functionality differs in three crucial respects: (1) \textsf{mathfont} is compatible with Lua\LaTeX; (2) it can adjust the font of basic mathematical symbols such as those in the first half of table~2; and (3) \textsf{mathfont} lacks \textsf{mathspec}'s convenient space-adjustment character |"|.% footnote %
-\footnote{Compatibility with Lua\LaTeX\ comes at the expense of \textsf{mathspec}'s space-adjustment character |"|, and spacing-conscientious users can either manually add |\string\kern| or |\string\muskip| to their equations or redefine an active version of |"|. For example, the code
-\begin{code} % footnotes and verbatim really don't play well together
-\begingroup\texttt{\string\catcode`\string\"=\string\active}\par
-\texttt{\string\def"\expandafter\@gobble\string\#1\char"7B\relax
-  \expandafter\string\csname ifmmode\endcsname}\par
-\texttt{\ \ \string\kern}\argtext{dimension}%
-  \texttt{\string\relax\ \expandafter\@gobble\string\#1\string\kern}%
-  \argtext{other dimension}\texttt{\string\relax}\par
-\texttt{\expandafter\string\csname else\endcsname}\par
-\texttt{\ \ \string\char`\string\"\expandafter\@gobble\string\#1\%}\par
-\texttt{\expandafter\string\csname fi\endcsname\char"7D\relax}\endgroup
-\end{code}
-will serve as a hack that very roughly approximates \textsf{mathspec}'s |"|. This code will redefine |"| to typeset a right double quotation mark in horizontal mode, but in math mode, the character will insert \textit{dimension} and \textit{other dimension} of white space on each side respectively of the next character. More advanced users can automate the dimensions by using \TeX's \texttt{\expandafter\string\csname if\endcsname} or \LaTeX's |\string\@ifnextchar| conditionals to test whether the following character needs a particular spacing adjustment.} % end footnote %
-Further, as far as I am aware, this package is the first to provide support for the unicode alphanumeric symbols listed in Table~2, even in the context of fonts without built-in math support. (Please let me know if this is incorrect!) In this way \textsf{mathfont}, like \textsf{mathspec}, is more versatile than the \textsf{unicode-math} package, although potentially less far-reaching.\footnote{Will Robertson, ``\textsf{unicode-math}---Unicode mathematics support for \XeTeX\ and Lua\TeX,''\hfil\break\texttt{https://ctan.org/pkg/unicode-math}.}
-
-Users who want to stick with pdf\LaTeX\ should consider Jean-Fran\c cois Burnol's \textsf{mathastext} as a useful alternative to \textsf{mathfont}.\footnote{Jean-Fran\c cois Burnol, ``\textsf{mathastext}---Use the text font in maths mode,''\hfil\break\texttt{https://ctan.org/pkg/mathastext}. In several previous versions of this documentation, I mistakenly stated that \textsf{mathastext} distorts \TeX's internal mathematics spacing. In fact the opposite is true: \textsf{mathastext} preserves and in some cases extends rules for space between various math-mode characters.} This package allows the user to specify the math-mode font for a large subset of the ASCII characters and is the most closely related package to \textsf{mathfont} among those packages designed specifically for pdf\LaTeX. Whereas \textsf{mathfont} works exclusively in the context of unicode fonts, \textsf{mathastext} was designed for the T1 and related encodings of Plain \TeX\ and \LaTeX. However, the \textsf{mathastext} functionality extends beyond that of \textsf{mathfont} in two notable aspects: (1) \textsf{mathastext} makes use of math versions, extra spacing, and italic corrections; and (2) \textsf{mathastext} allows users to change the font for the twenty-five non-alphanumeric characters supported by that package multiple times. After setting the default font for a class of characters, \textsf{mathfont} allows only the local font changes outlined in section~3.
-
 \section{Setting the Default Font}
 
-The |\mathfont| command sets the default font for certain classes of characters. Its structure is given by
+The |\mathfont| command sets the default font for certain classes of characters when they appear in math mode. It accepts a single mandatory argument, which should be a system font name or a family name already present in the \textsc{nfss}. The macro also accepts an optional argument, which should be a comma-separated list of keywords from Table~\ref{Keywords}, as in
 \begin{code}
-|\mathfont[|\argtext{optional character classes}|]{|\argtext{font name}|}|,
+|\mathfont[|\meta{keywords}|]{|\meta{font name}|}|,
 \end{code}
-where the \textit{optional character classes} can be any set of keywords from Tables~1 and 2 separated by commas, and the \textit{font name} can be any OpenType or TrueType font in a directory searchable by \TeX.\footnote{When specifying the \textit{font name}, users need to input a name that \textsf{fontspec} will recognize and be able to load. Advanced users will note that \vrb\mathfont\ uses \fontspeccommand\ and therefore loads fonts in the same way as \vrb\fontspec\ and related macros from that package.} The command loops through all keywords in the optional argument, and for each keyword, it changes the math-mode font for every character in that class to the \textit{font name}.\footnote{These changes happen through \LaTeX's \vrb\DeclareMathSymbol, and \vrb\mathfont\ is basically a very elaborately wrapped version of this command.} Currently, \textsf{mathfont} does not support OpenType features in math mode. To change both math and text fonts simultaneously, the package provides the command
+and \textsf{mathfont} sets the default font face for every character in those keywords to an upright or italic version of the font from the mandatory argument. See |mathfont_symbol_list.pdf| for a list of symbols corresponding to each keyword. If you do not include an optional argument, |\mathfont| acts on all keywords in the upper section of Table~1 (but not including |delimiters|, |radical|, or |bigops| characters in \XeTeX), so calling |\mathfont| with no optional argument is a fast way to change the font for most common math characters. To change the shape, you should say ``|=upright|'' or ``|=italic|'' immediately after the keyword and before the following comma, and spaces are allowed throughout the optional argument. For example, the command
 \begin{code}
-|\setfont{|\argtext{font name}|}|,
+|\mathfont[lower=upright, upper=upright]{Times New Roman}|
 \end{code}
-which calls both |\mathfont| and \textsf{fontspec}'s |\setmainfont| using the \textit{font name} as arguments. The package's optional argument is equivalent to calling |\setfont| and three local font-change commands from section 3, and most users will find this command sufficient for most applications. Both |\mathfont| and |\setfont| should appear only in the document preamble, i.e.\ before |\begin{document}|.
+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.
 
-The user should specify any optional arguments for |\mathfont| as entries in a comma-separated list. The order is irrelevant, and spaces throughout the optional argument are permitted. The argument should contain no braces! Leaving out the optional argument will cause the command to revert to its default behavior, where it acts on keyword classes |upper|, |lower|, |diacritics|, |greekupper|, |greeklower|, |digits|, |operator|, and |symbols|. For example, if the user writes
-\begin{code}
-|\mathfont{Arial}|,
-\end{code}
-\textsf{mathfont} will change the font of all Latin characters, Greek characters, diacritics, digits, operators such as $\log$ or $\sin$, and |symbols| characters to Arial whenever they come up in math mode. The package provides control sequences to typeset many symbols that \LaTeX\ does not include by default, and users gain access to these commands when they call |\mathfont| or |\setfont| with the appropriate keyword-option. In total, the package is capable of acting on some 800 unicode characters, and for a full list of symbols and control sequences, see |mathfont_symbol_list.pdf|, which is included in the \textsf{mathfont} installation and is available on \textsc{ctan}. Users can feed |\mathfont| a control sequence as its optional argument as long as the macro eventually expands to a comma-separated list of keywords and suboptions without braces.% footnote
-\footnote{Technically, \vrb\mathfont\ expands its optional argument inside an \vrb\edef. When it scans an optional argument, \textsf{mathfont} temporarily converts spaces to catcode~9 and ignores them. However, if you feed \vrb\mathfont\ a macro with spaces in it, \TeX\ has already scanned and tokenized those spaces, so we use \vrb\zap at space\ from the \LaTeX\ kernel instead. Braces will wreck both this process and the \vrb\@for\ loop that comes later.} % end footnote
-Finally, |\mathfont| and |\setfont| will not change the default font for a class of symbols once one of them has already done so.
-
-\begin{figure}[tb]
-\centering
-Table~1: Math Alphabet Characters\par\penalty\@M\smallskip
-\begin{tabularx}\hsize{p{1.8in}Xp{1.3in}}
-\toprule
-Keyword & Meaning & Default shape\\
-\midrule
-|upper| & Capital Latin Letters & Italic\\
-|lower| & Minuscule Latin Letters & Italic\\
-|diacritics| & Diacritics & Upright\\
-|greekupper| & Capital Greek Letters & Upright\\
-|greeklower| & Minuscule Greek Letters & Italic\\
-|agreekupper| & Capital Ancient Greek Letters & Upright\\
-|agreeklower| & Minuscule Ancient Greek Letters & Italic\\
-|cyrillicupper| & Capital Cyrillic Letters & Upright\\
-|cyrilliclower| & Minuscule Cyrillic Letters & Italic\\
-|hebrew| & Hebrew Letters & Upright\\
-|digits| & Arabic Numerals & Upright\\
-|operator| & Operator Font & Upright\\
-\bottomrule
+\begin{figure}[t]
+\labelfig{SetFont}
+\centerline{\bfseries Table \the\fig: Commands Defined by \vrb\setfont\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{XXX}\toprule
+Command & Series & Shape\\\midrule
+|\mathrm| & Medium & Upright\\
+|\mathit| & Medium & Italic\\
+|\mathbf| & Bold & Upright\\
+|\mathbfit| & Bold & Italic\\
+|\mathsc| & Medium & Small Caps\\
+|\mathscit| & Medium & Italic Small Caps\\
+|\mathbfsc| & Bold & Small Caps\\
+|\mathbfscit| & Bold & Italic Small Caps\\\bottomrule
 \end{tabularx}
 \end{figure}
 
-By default, \textsf{mathfont} will use one of an upright or italic shape for every character class, and users can override this setting by writing an |=| next to the keyword and either |roman| or |italic| following that. These two suboptions correspond respectively to an upright shape---normal shape in the language of the \textsc{nfss}---and an italic shape. Table~1 includes the default shape-values for each keyword, and the package declares characters for all keywords in table~2 as upright by default. For example, the command
+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:
 \begin{code}
-|\mathfont[upper=roman,lower=roman]{Times New Roman}|
+|\setfont{|\meta{font name}|}|.
 \end{code}
-changes all math-mode Latin letters to Times New Roman with upright shape.
+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.
 
-\begin{figure}[t]
-\centering
-Table~2: Letter-Like and Other Symbols\par\penalty\@M\smallskip
-\begin{tabularx}\hsize{p{1.8in}X}
-\toprule
-Keyword & Meaning\\
-\midrule
-|symbols| & Basic Symbols\\
-|extsymbols| & Extended Symbols\\
-|delimiters| & Parentheses, Brackets, and Braces\\
-|arrows| & Arrows\\
-|bigops| & ``Big'' Operators (see section 4)\\
-|extbigops| & Extended ``Big'' Operators\\
-|bb| & Blackboard Bold (double-struck)\\
-|cal| & Caligraphic\\
-|frak| & Fraktur\\
-|bcal| & Bold Caligraphic\\
-|bfrak| & Bold Fraktur\\
-\bottomrule
-\end{tabularx}
-\end{figure}
+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.}
 
-The package provides access to several types of letterlike symbols that appear frequently in mathematical writing, and the last five keywords in table~2 constitute these classes. Unlike with other keywords, \textsf{mathfont} doesn't create control sequences to access the symbols directly but rather defines a new command that converts letters into the appropriate style. When the user calls |\mathfont| with any of the last five keywords from table~2, the package both declares the appropriate unicode characters as math symbols and defines the macro
+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}
-|\math|\argtext{keyword}|{|\argtext{argument}|}|
+|\math|\meta{keyword}|{|\meta{text}|}|
 \end{code}
 to typeset them. For example,
 \begin{code}
-|\mathfont[bcal]{STIXGeneral}|
+|\mathfont[bb]{STIXGeneral}|
 \end{code}
-will set STIXGeneral as the font for bold calligraphic characters and define the command |\mathbcal| to access them in math mode. For the |bb| case, the associated command acts on Latin letters and Arabic numerals, and for the other four keywords, the associated command acts just on Latin letters. \TeX\ will ignore and issue a warning in response to any other characters in the \textit{argument}.
+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.
 
 \section{Local Font Changes}
 
-With \textsf{mathfont}, users can locally change the font in math mode by creating and then using a new control sequence for each new font desired.\footnote{The five macros in this section are basically wrapped versions of \LaTeX's \vrb\DeclareMathAlphabet.} The control sequences created this way function analogously to the standard math font macros such as |\mathrm|, |\mathit|, and |\mathnormal| from the \LaTeX\ kernel, and the package provides four basic commands to produce them. Table~3 lists these commands. All four have the same argument structure: a control sequence as the first mandatory argument and a font name as the second. For example, the macro |\newmathrm| looks like
+With \textsf{mathfont}, it is possible to create commands that locally change the font for math alphabet characters, i.e.\ those marked as alphabetic in Table~\ref{Keywords}. The eight commands in Table~\ref{MathAlpha} accept a \meta{control sequence} as their first mandatory argument and a \meta{font name} as the second, and they define the \meta{control sequence} to typeset any math alphabet characters in their argument into the \meta{font name}. For example, the macro |\newmathrm| looks like
 \begin{code}
-|\newmathrm{|\argtext{control sequence}|}{|\argtext{font name}|}|.
+|\newmathrm{|\meta{control sequence}|}{|\meta{font name}|}|.
 \end{code}
 It defines the \textit{control sequence} in its first argument to accept a string of characters that it then converts to the \textit{font name} in the second argument with upright shape and medium weight. Writing
 \begin{code}
 |\newmathrm{\matharial}{Arial}|
 \end{code}
-would create the macro
+creates the macro
 \begin{code}
-|\matharial{|\argtext{argument}|}|,
+|\matharial{|\meta{argument}|}|,
 \end{code}
-which can be used only in math mode and which converts the math alphabet characters in its \textit{argument} into the Arial font with upright shape and medium weight. The other three commands in table~3 function in the same way except that they select different series or shape values for the font in question. Table~3 lists this information. As of version~1.6, |\newmathbold| has been renamed to |\newmathbf| to put it in line with \textsc{nfss} naming conventions.
+which can be used only in math mode and which converts the math alphabet characters in its \meta{argument} into the Arial font with upright shape and medium weight. The other commands in Table~\ref{MathAlpha} function in the same way except that they select different series or shape values. Finally, know that if the user specifies the font for Greek letters using |\mathfont|, macros created with the commands from this section will affect those characters, unlike in traditional \LaTeX. Similarly, the local font-change commands will affect Cyrillic and Hebrew characters after the user calls |\mathfont| for those keywords.
 
 \begin{figure}[t]
-\centering
-Table 3: Font-changing Commands\par\penalty\@M\smallskip
-\begin{tabularx}\hsize{p{1.8in}X}
-\toprule
-Command & Font Characteristics\\
-\midrule
-|\newmathrm| & Upright shape; medium weight\\
-|\newmathit| & Italic shape; medium weight\\
-|\newmathbf| & Upright shape; bold-expanded weight\\
-|\newmathbfit| & Italic shape; bold-expanded weight\\
-\bottomrule
+\labelfig{MathAlpha}
+\centerline{\bfseries Table \the\fig: Macros to Create Local Font-Change Commands\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{XXX}\toprule
+Command & Series & Shape\\\midrule
+|\newmathrm| & Medium & Upright\\
+|\newmathit| & Medium & Italic\\
+|\newmathbf| & Bold & Upright\\
+|\newmathbfit| & Bold & Italic\\
+|\newmathsc| & Medium & Small Caps\\
+|\newmathscit| & Medium & Italic Small Caps\\
+|\newmathbfsc| & Bold & Small Caps\\
+|\newmathbfscit| & Bold & Italic Small Caps\\\bottomrule
 \end{tabularx}
 \end{figure}
 
-Together these four commands will provide users with the tools for almost all desired local font changes, but they inevitably will be insufficient for some particular case. Accordingly, \textsf{mathfont} provides the more general |\newmathfontcommand| macro that functions similarly to the commands from table~3 but allows for more general font characteristics.\footnote{The package defines the four commands from table~3 in terms of \vrb\newmathfontcommand, and it specifies their style characteristics according to the kernel commands \vrb\updefault, \vrb\itdefault, \vrb\mddefault, and \vrb\bfdefault. Changing these macros will implicitly change the characteristics of the commands in table~3.} Its structure is
+Together these eight commands will provide users with tools for most local font changes, but they won't be able to address everything. Accordingly, \textsf{mathfont} provides the more general |\newmathfontcommand| macro. Its structure is
 \begin{code}
-|\newmathfontcommand{|\argtext{control sequence}|}{|\argtext{font name}|}{|\argtext{series}|}{|\argtext{shape}|}|,
+|\newmathfontcommand{|\meta{control sequence}|}{|\meta{font name}|}{|\meta{series}|}{|\meta{shape}|}|,
 \end{code}
-where the control sequence in the first argument again becomes the macro that allows the user to access the specified font. The font name means any OpenType or TrueType font in a directory searchable by \TeX, and the series and shape information refers to the \textsc{nfss} codes for these attributes. Like |\mathfont| and |\setfont|, these commands should appear only in the document preamble.
+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.
 
-Unlike the traditional |\mathrm| and company, \textsf{mathfont}'s local font change commands create macros that can act on Greek characters. If the user specifies the font for Greek letters using |\mathfont|, macros created with the commands from Table~3 will affect those characters; otherwise, they will not.\footnote{\LaTeXe\ defines lower-case Greek letters as \vrb\mathord\ characters, and \textsf{mathfont} changes this classification to \vrb\mathalpha\ type when it declares them as symbols. The local font change commands act only on characters of class \vrb\mathalpha, so these commands will act on lower-case Greek letters if \vrb\mathfont\ redefines them to be \vrb\mathalpha.} Similarly, the local font-change commands will act on Cyrillic and Hebrew characters after the user calls |\mathfont| for those keyword-classes.
+\section{Lua Font Adjustments}
 
-\section{Math Symbols}
+\begin{figure}[b]
+\labelfig{Charm}
+\centerline{\bfseries Table \the\fig: Number of Integers Required in \vrb\CharmLine\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{lX}\toprule
+Type of Character & \hfil Total Number of Entries\\\midrule
+Latin Letters & \hfil5 \\
+Delimiters, Radical Sign (Surd Character), Big Operators & \hfil33\\
+Everything Else & \hfil3\\\bottomrule
+\end{tabularx}
+\end{figure}
 
-Choosing which unicode characters to recode is something of a delicate task because few unicode fonts contain more than the most basic math symbols. In designing this portion of \textsf{mathfont}, I attempted to find the largest set of characters that reliably appears in every or nearly every major unicode font, and I coded those characters in the |symbols| keyword. This keyword contains punctuation and common symbols such as $\pm$, $\div$, and $\infty$, and it will be sufficient for basic math typesetting. That being said, most math relies on a much broader collection of characters and arrows, and in other keywords, I coded every unicode math symbol that I could reasonably see being useful. The extended math symbols keyword |extsymbols| contains quantifiers, set and element relations, just about any binary relation you can imagine, and a few miscellaneous symbols such as |\sharp| and |\flat|. The |arrows| keyword contains a swath of hooked, curved, and bar arrows and even one lightning bolt arrow. Most standard unicode fonts don't contain many of those glyphs, and users who call |\mathfont| for a font without certain characters will see blank spaces in their final output instead of the corresponding symbols from |mathfont_symbol_list.pdf|. If this happens, check the |log| file because it will display any missing characters in your fonts.
+The \textsf{mathfont} package provides six user-level commands to change positioning of characters in math mode. The commands |\CharmLine| and |\CharmFile| affect specific to various characters. (Charm stands for ``character metric.'') The argument of |\CharmLine| should be a list of integers and/or asterisks separated by commas and/or spaces, and Table~\ref{Charm} shows how many integers you need for different types of characters. The first integer from the argument should be a unicode encoding number, and that tells \textsf{mathfont} how to handle the remaining values.
+\begin{itemize}
+\item If the unicode value corresponds to a Latin letter, the next two integers tell Lua\TeX\ how much to stretch the left and right sides of the glyph's bounding box when it appears in math mode. The final two integers determine horizontal placement of top and bottom math accents respectively.
+\item If the unicode value corresponds to a delimiter, the radical (surd) symbol, or a big operator, you will need to specify 16 pairs numbers, for a total of 32 entries. The first 15 pairs are horizontal and vertical scale factors that \textsf{mathfont} uses to create large variants, where successive pairs correspond to the next-larger glyph. The last two integers determine horizontal placement of top and bottom math accents respectively.
+\item If the unicode value corresponds to any other symbol, you should specify two more integers, which will determine the horizontal placement of top and bottom math accents respectively.
+\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.
 
-It's worth emphasizing three aspects of \textsf{mathfont}'s symbol declaration process. First, the package does not provide any symbols in and of itself but rather gives users access to symbols that already exist on their computers. This is why \textsf{mathfont} provides no additional symbols directly at loading and why some package commands can create blank spaces rather than their intended output. Second, \textsf{mathfont}'s functionality currently does not include math symbols of variable sizes.% footnote
-\footnote{Dynamic math-mode character sizing is a surprisingly thorny task. OpenType font designers specifically code certain characters to change size when they design the font, and Lua\TeX's \vrb\Udelimiter\ and \vrb\Umathoperatorsize\ depend on this embedded feature. Because most unicode fonts come without resizing information, \textsf{mathfont} would have to manually add these settings to the Lua\TeX\ font table. I intend to add this functionality in some future update, but I do not know what the timeframe looks like for those changes.} % end footnote
-Recoded delimiters do not respond to |\left| and |\right|, and \LaTeX\ replaces them with their original Latin Modern equivalents before rescaling appropriately. Thus |\mathfont| with the |delimiters| keyword will produce normally sized delimiters in the font of your choice and big delimiters in Latin Modern Roman. Similarly, big operators such as |\sum| and |\prod| appear normally sized instead of larger after setting their font with |\mathfont|. This is undesirable! I have isolated all delimiter and big operator characters in their own keywords, and I hope to address this limitation in future updates. Third, the package provides an extra comma character, similar to \LaTeX's |\colon|.% footnote
-\footnote{Consider $\{x:x\not=0\}$ versus $\{x\colon x\not=0\}$. The first specification uses |:| while the second uses \vrb\colon. As a rule of thumb, use |:| for ratios and \vrb\colon\ as a punctuation mark.} % end footnote
-\TeX\ users have likely noticed the extra space surrounding commas in math mode, e.g.\ $10,000$ versus $10\mathord,000$, and \textsf{mathfont}'s |\comma| addresses this problem. Here the first ten thousand uses a standard~|,|~while the second uses |\comma|. As a rule of thumb, use |,| as a punctuation mark and |\comma| as a character separator.
+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|.
 
-\section{Handling Errors}
+\begin{figure}[tb]
+\labelfig{Factors}
+\centerline{\bfseries Table \the\fig: Commands to Adjust Individual Characters\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{llX}\toprule
+Command & Default Value & What It Does\\\midrule
+|\RuleThicknessFactor| & 1000 & Thickness of fraction rule and radical overbar\\
+|\IntegralItalicFactor| & 400 & Positioning of limits for integrals\\
+|\SurdVerticalFactor| & 1000 & Vertical positioning of radical overbar\\
+|\SurdHorizontalFactor| & 1000 & Horizontal positioning of radical overbar\\\bottomrule
+\end{tabularx}
+\end{figure}
 
-I have tried to make \textsf{mathfont}'s error messages as clear as possible, and the help text will contain instructions for how to resolve the problem. Nevertheless, some of the possible error messages warrant additional explanation.
+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}|
+\end{code}
+doubles the thickness of the fraction rule and radical overbar relative to the default, which varies between fonts. Changing the |\RuleThicknessFactor| is useful for fonts with particularly heavy or light weight, and the |\IntegralItalicFactor| is important for making limits better fit integral signs, and the |\SurdVerticalFactor| and |\SurdHorizontalFactor| commands are essential when the top of the surd glyph differs from the top of its bounding box. The six control sequences from this section should appear in the preamble only.
 
-The most salient errors are the ``Could not find \textsf{fontspec}'' and ``Missing \XeTeX\ or Lua\TeX'' fatal errors. When the user loads \textsf{mathfont}, \TeX\ must be able to find the package file |fontspec.sty|, and \TeX\ must be operating under the \XeTeX\ or Lua\TeX\ engine. If either condition fails, \TeX\ will stop reading in |mathfont.sty|.% footnote
-\footnote{Note that \textsf{mathfont} doesn't actually determine the typesetting engine. Rather, it checks whether the \XeTeX\ and Lua\TeX\ primitives \vrb\Umathcode, \vrb\Umathchardef, and \vrb\Umathaccent\ are defined, so if for some reason these control sequences have definitions when the user loads \textsf{mathfont} with another engine, \textsf{fontspec}'s more robust engine checks will take over and cause \TeX\ to abort. The reasoning here is straightforward: \textsf{mathfont} verifies only that the current typesetting engine provides the commands that it directly needs, so its potential functionality remains as broad as possible. If \textsf{fontspec} becomes compatible with a third engine that also provides (analogues of) these primitives, there is no reason to prevent \textsf{mathfont} from working with that engine as well.} % end footnote
-As of version 1.6, \textsf{mathfont}'s fatal errors prevent \TeX\ from reading in the rest of the |sty| file but do not crash the compilation process, and users who continue past one of \textsf{mathfont}'s fatal error messages will see an ``invalid command'' error if they call a user-level command in their document. I designed these errors to be unobtrusive, and users can safely ignore them. Because of how \textsf{mathfont} performs its engine check, it is theoretically possible that users with very old \XeTeX\ or Lua\TeX\ distributions may see the second fatal error even when running one of these two engines, and the solution is probably to upgrade to a more recent version of the engine in question. Unfortunately, I do not know what the exact cutoff for \XeTeX\ and Lua\TeX\ versions is.\footnote{However, the manual for a beta version of Lua\TeX, v.\ 0.70.1, includes these primitives, so they are at least as old as May 2011. See\hfill\break \texttt{https://osl.ugr.es/CTAN/obsolete/systems/luatex/base/manual/luatexref-t.pdf}}
+\begin{figure}[tb]
+\labelfig{Callbacks}
+\centerline{\bfseries Table \the\fig: Lua Callbacks Created by \textsf{mathfont}\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{lX}\toprule
+Callback Name & What It Does By Default\\\midrule
+|"mathfont.inspect_font"| &  Nothing\\\midrule
+|"mathfont.pre_adjust"| & Nothing\\
+|"mathfont.disable_nomath"| &  Tell Lua\TeX\ that we have a math font\\
+|"mathfont.add_math_constants"| &  Create a MathConstants table\\
+|"mathfont.fix_character_metrics"|&  \raggedright\arraybackslash Adjust bounding boxes, add character-specific math fields, create large variants\\
+|"mathfont.post_adjust"| &  Nothing\\\bottomrule
+\end{tabularx}
+\end{figure}
 
-The \textsf{fontspec} package includes a ``|no-math|'' option, and \textsf{mathfont} expects \textsf{fontspec} to be loaded with this option. As mentioned previously, \textsf{mathfont} loads \textsf{fontspec} by default, but users can load \textsf{fontspec} before \textsf{mathfont} if they want to manually specify the package options. Alternatively, \LaTeX's |\PassOptionsToPackage| may be an even better way to proceed. If \textsf{mathfont} detects that \textsf{fontspec} was loaded without the |no-math| option, it will issue an error message saying so. This error is not paramount in the sense that the document will compile normally if a user ignores it, but \textsf{mathfont} will probably have trouble changing the font of certain math-mode characters in this situation. During development, Arabic numerals posed a particular challenge in this regard.
+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.
 
-The ``internal commands restored'' error arises when the user calls |\mathfont| after the package already restored the small portion of the \LaTeX\ kernel that it adjusts when loaded. Typically this happens when the user calls |\mathfont| after |\restoremathinternals|. The package will ignore any |\mathfont| commands in this situation, so while the error is technically harmless, you may not see some font changes you might have been expecting. Similarly, if the user tries to set the default font multiple times for some character class, the package will ignore any additional attempts, issue a warning, and continue the compilation process.
+\section{Default Math Parameters}
 
-What should you do if you can't resolve an error? First, always, always make sure that you spelled all of your commands correctly and closed all braces and brackets. Then check the \textsf{mathfont} documentation---you may be trying to do something outside the scope of the package, or you may be dealing with a special case. The internet is a great resource, and websites such as the \TeX\ StackExchange, Share\LaTeX, and Wikibooks' \LaTeX\ wiki are often invaluable when dealing with \TeX-related issues. Definitely ask another human as well! At that point you should email the author about your code---you might have identified a bug. I welcome emails about \textsf{mathfont} and will make every effort to write back to correspondence about the package, but I cannot guarantee a timely response.
+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	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx	2021-12-29 21:35:30 UTC (rev 61440)
@@ -1,81 +1,125 @@
-% \iffalse *first meta-comment*; see the second meta-comment
-% for copyright and package information
+% \iffalse     ---!!! FIRST META-COMMENT !!!---
 % 
 % 
-% This file is  mathfont_code.dtx from version 1.6 of the
-% LaTeX2e package "mathfont," to be used in conjunction with
-% the XeTeX or LuaTeX engines. It is used to typeset
-% documentation and files for mathfont, and running LaTeX on
+% This file is mathfont_code.dtx from version 2.0 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:
 % 
-%   (1) the package code mathfont.sty;
+%   (1) the package file mathfont.sty;
 % 
 %   (2) the pdf documentation file mathfont_code.pdf;
 % 
-%   (3) the derived files mathfont_symbol_list.tex and
-% mathfont_user_guide.tex, which can be used to typeset
-% further documentation for mathfont;
+%   (3) 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_heading.tex,
-% mathfont_doc_patch.tex, and mathfont_index_warning,
-% which are used to produce documentation; and
+%   (4) the stand-alone derived files mathfont_doc_patch.tex,
+%       mathfont_equations.tex, and mathfont_heading.tex,
+%       which are used to produce documentation; and
 % 
 %   (5) 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. 
+% TeX.
 % 
 % 
 % \fi
-% \iffalse *preamble and second meta-comment*; see the first
-% meta-comment for information about this file
+% \iffalse     ---!!! SECOND META-COMMENT !!!---
 % 
 % 
-% This file is file from version 1.6 of the LaTeX package "mathfont,"
-% to be used in conjunction with the XeTeX or LuaTeX engines.
+% This file is from version 2.0 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-2019 by Conrad Kosowsky
+% 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
+% 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
 % 
-%            https://www.latex-project.org/lppl/.
+%           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 of the
-% following items:
+% 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 
+% of the following items:
 % 
-%   (1) the base file mathfont_code.dtx;
+%   (1) the base file:
+%         mathfont_code.dtx
 % 
-%   (2) the package code contained in mathfont.sty;
+%   (2) the package file:
+%         mathfont.sty
 % 
-%   (3) the derived files mathfont_symbol_list.tex,
-% mathfont_user_guide.tex, mathfont_heading.tex,
-% mathfont_doc_patch.tex, and mathfont_index_warning.tex;
+%   (3) the derived files:
+%         mathfont_doc_patch.tex
+%         mathfont_equations.tex
+%         mathfont_example_cormorant.tex
+%         mathfont_example_kelvinch.tex
+%         mathfont_example_roboto.tex
+%         mathfont_example_typey.tex
+%         mathfont_heading.tex
+%         mathfont_symbol_list.tex
+%         mathfont_user_guide.tex
 % 
-%   (4) the pdf documentation files mathfont_code.pdf,
-% mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+%   (4) the pdf documentation files:
+%         mathfont_code.pdf,
+%         mathfont_example_cormorant.pdf
+%         mathfont_example_kelvinch.pdf
+%         mathfont_example_roboto.pdf
+%         mathfont_example_typey.pdf
+%         mathfont_symbol_list.pdf
+%         mathfont_user_guide.pdf
 % 
 %   (5) all other files created through the configuration
-% process including mathfont_code.ind; and
+%       process
 % 
-%   (6) the associated README.txt file.
+%   (6) the associated README.txt file
 % 
-% For more information, see the original mathfont.dtx file. To
-% install mathfont on your computer, run mathfont_code.dtx through
-% LaTeX and place the derived file mathfont.sty in a directory
-% searchable by TeX.
+% 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.
 % 
+% 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 
+% 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.
+% 
+% Happy TeXing!
+% 
+% 
 % \fi
 % \iffalse
 % 
-% The installation and driver files are incorporated into mathfont.dtx,
-% so we do not need to generate them separately. The <batchfile> and
-% <driver> tags are for reference.
+% The installation and driver files are incorporated into
+% mathfont_code.dtx, so we do not need to generate them 
+% separately. The <batchfile> and <driver> tags are for 
+% reference.
 % 
 %<*batchfile>
 \begingroup
@@ -84,43 +128,49 @@
 \askforoverwritefalse
 \preamble
 
-This file is file from version 1.6 of the LaTeX package "mathfont,"
-to be used in conjunction with the XeTeX or LuaTeX engines.
+This file is from version 2.0 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-2019 by Conrad Kosowsky
+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
+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
 
-           https://www.latex-project.org/lppl/.
+          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 of the
-following items:
+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.
 
-  (1) the base file mathfont_code.dtx;
+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.
 
-  (2) the package code contained in mathfont.sty;
+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.
 
-  (3) the derived files mathfont_symbol_list.tex,
-mathfont_user_guide.tex, mathfont_heading.tex, and
-mathfont_doc_patch.tex;
+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.
 
-  (4) the pdf documentation files mathfont_code.pdf,
-mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+For more information, see the mathfont_code.dtx.
 
-  (5) all other files created through the configuration process
-such as mathfont.idx and mathfont.ind; and
+Happy TeXing!
 
-  (6) the associated README.txt file.
-
-For more information, see the original mathfont.dtx file. To
-install mathfont on your computer, run mathfont_code.dtx through
-LaTeX and place the derived file mathfont.sty in a directory
-searchable by TeX.
-
 \endpreamble
 \generate{
   \file{mathfont.sty}{\from{mathfont_code.dtx}{package}}
@@ -128,7 +178,11 @@
   \file{mathfont_user_guide.tex}{\from{mathfont_code.dtx}{user}}
   \file{mathfont_heading.tex}{\from{mathfont_code.dtx}{heading}}
   \file{mathfont_doc_patch.tex}{\from{mathfont_code.dtx}{doc}}
-  \file{mathfont_index_warning.tex}{\from{mathfont_code.dtx}{idxwarning}}}
+  \file{mathfont_equations.tex}{\from{mathfont_code.dtx}{equations}}
+  \file{mathfont_example_cormorant.tex}{\from{mathfont_code.dtx}{cormorant}}
+  \file{mathfont_example_kelvinch.tex}{\from{mathfont_code.dtx}{kelvinch}}
+  \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
@@ -135,8 +189,8 @@
 *                                        *^^J
 * To finish the installation, move the   *^^J
 * following file into a directory        *^^J
-* searchable by TeX once mathfont.dtx    *^^J
-* finishes compiling:                    *^^J
+* searchable by TeX once                 *^^J
+* mathfont_code.dtx finishes compiling:  *^^J
 *                                        *^^J
 *              mathfont.sty              *^^J
 *                                        *^^J
@@ -149,38 +203,38 @@
 \usepackage[margin=72.27pt]{geometry}
 \usepackage[factor=700,stretch=14,shrink=14,step=1]{microtype}
 \usepackage{graphicx}
-\pretolerance=20
-\hyphenpenalty=10
-\exhyphenpenalty=5
-\brokenpenalty=0
-\finalhyphendemerits=300
-\doublehyphendemerits=500
+\usepackage{tabularx}
+\usepackage{booktabs}
+\usepackage{multirow}
 \c at IndexColumns=2
+\c at topnumber\@ne
 \columnsep=20pt
 \MacroIndent=1.32em
-\expandafter\newif\csname ifind\endcsname
 \let\index at prologue\relax
 \EnableCrossrefs\CodelineIndex
-\input mathfont_doc_patch.tex
 \begin{document}
-  \def\documentname{Code Implementation}
+  \def\documentname{Implementation}
+  \def\showabstract{1}
+  \input mathfont_doc_patch.tex
   \input mathfont_heading.tex
   \DocInput{mathfont_code.dtx}
   \vfil\eject
-  \section*{Index}
-  \IfFileExists{mathfont_code.ind}\indtrue\indfalse
-  \ifind
-    Entries in italics refer to pages in this document,
-    and non-italic entries refer to lines in the code.
-    Bold indicates a definition.
-    
-    \medskip
-    
-    \input mathfont_code.ind
+  \immediate\closeout\@indexfile
+  \ifx\directlua\@undefined
+    \immediate\write18{makeindex -s gind.ist mathfont_code.idx}
   \else
-    \typeout{INCOMPLETE DOCUMENTATION: No file mathfont_chars.ind.}
-    \input mathfont_index_warning.tex
+    \directlua{os.execute("makeindex -s gind.ist mathfont_code.idx")}
   \fi
+  
+  \section*{Index}
+  
+  Upright entries refer to lines in the code, and italic
+  entries indicate pages in the document. Bold means a
+  definition.
+  
+  \medskip
+  \input mathfont_code.ind
+  
 \end{document}
 %</driver>
 %<*package>
@@ -188,7 +242,7 @@
 % \fi
 % 
 % 
-% \CheckSum{5105}
+% \CheckSum{6965}
 % \init at checksum
 % 
 % 
@@ -210,34 +264,54 @@
 % \makeatletter
 % 
 % 
-% 
 % \DoNotIndex{\NeedsTeXFormat,\ProvidesPackage,\DeclareOption,\ProcessOptions,%
 %   \def,\edef,\global,\let,\csname,\endcsname,\expandafter,\relax,\advance,%
-%   \newcount,\newif,\z@,\@ne,\m at ne,\ifx,\ifcat,\ifnum,\ifmmode,\else,\fi,%
-%   \PackageInfo,\PackageWarning,\PackageError,\message,\@undefined,%
-%   \space,\MessageBreak,\string,\M at count,\count@,\noexpand,\protect,%
-%   \@tempa,\@tempb,\@tempc,\@i,\@j,\@k,\count,\tw@,\@empty,%
-%   \do,\DeclareMathSymbol,\the,\mathalpha,\mathord,\protect,\multiply,%
-%   \M at symbols,\mathop,\mathbin,\mathrel,\mathopen,\mathclose,\mathpunct,%
-%   \M at lower,\M at upper,\M at greeklower,\M at greekupper,\M at digits,%
-%   \M at bb,\M at cal,\M at frak,\M at bcal,\M at bfrak,\mathinner,%
+%   \newcount,\newif,\z@,\@ne,\m at ne,\ifx,\ifcat,\ifnum,\ifeof,\ifmmode,%
+%   \else,\fi,\PackageInfo,\PackageWarning,\PackageError,\message,\@undefined,%
+%   \space,\MessageBreak,\string,\M at count,\count@,\noexpand,\@empty,%
+%   \@tempa,\@tempb,\@tempc,\@temp at opt,\@temp at sub,\@i,\@j,\@k,\count,\tw@,%
+%   \do,\DeclareMathSymbol,\the,\mathalpha,\mathord,\multiply,%
+%   \mathop,\mathbin,\mathrel,\mathopen,\mathclose,\mathpunct,\mathinner,%
 %   \DeclareRobustCommand,\joinrel,\smash,\newtoks,\if,\\,\@nil,\leavevmode,%
 %   \begingroup,\endgroup,\+,\active,\@gobbletwo,\GenericError,\catcode,
-%   \wlog,\typeout,\EasterEggUpdate,\E at sterEggUpdate,\show,\@temperror,%
+%   \wlog,\typeout,\E at sterEggUpd@te,\show,\@temperror,%
 %   \xdef,\@for,\@tfor,\@ifundefined,\@ifpackageloaded,\@nnil,\@onlypreamble,%
 %   \AtBeginDocument,\AtEndOfPackage,\AtVeryVeryEnd,\bgroup,\CurrentOption,%
-%   \egroup,\escapechar,\if at upper,\if at lower,\if at diacritics,%
-%   \if at greekupper,\if at greeklower,\if at agreekupper,%
-%   \if at agreeklower,\if at cyrillicupper,\if at cyrilliclower,%
-%   \if at hebrew,\if at digits,\if at operator,\if at symbols,%
-%   \if at extsymbols,\if at delimiters,\if at arrows,\if at bigops,%
-%   \if at extbigops,\if at bb,\if at cal,\if at frak,\if at bcal,%
-%   \if at bfrak,\if at optionpresent,\if at suboptionpresent,\M at arrows,\M at bigops,%
-%   \M at delimiters,\M at diacritics,\M at extbigops,\M at extsymbols,\M at hebrew,%
+%   \egroup,\escapechar,\ifM at upper,\ifM at lower,\ifM at diacritics,%
+%   \ifM at greekupper,\ifM at greeklower,\ifM at agreekupper,%
+%   \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 bfrak,\if at optionpresent,\if at suboptionpresent,%
 %   \mathgroup,\nolimits,\on at line,\PackageWarningNoLine,\RequirePackage,%
-%   \thr@@,\M at toks,\inputlineno,\M at agreekupper,\M at agreeklower,%
-%   \M at cyrillicupper,\M at cyrilliclower,\mathchar at type,\DeclareMathAccent,%
-%   \ifM at special,\M at specialtrue,\M at specialfalse,\IfFileExists,\M at SpecialHook}
+%   \thr@@,\M at toks,\inputlineno,\mathchar at type,\DeclareMathAccent,%
+%   \ifM at EasterEgg@declare,\M at EasterEgg@declaretrue,\M at EasterEgg@declarefalse,%
+%   \IfFileExists,\E at sterEggHook,\@gobblefour,\@gobbletwo at brackets,%
+%   \protected,\@eha,\@cclv,\new at mathgroup,\new at symbolfont,\@latex at error,%
+%   \ifcase,\or,\thr@@,\gdef,\rmdefault,\openin,\closein,\immediate,%
+%   \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}
+% \DoNotIndex{\cyrA,\cyrBe,\cyrVe,\cyrGhe,\cyrDe,%
+%   \cyrIe,\cyrZhe,\cyrZe,\cyrI,\cyrKa,\cyrEl,%
+%   \cyrEm,\cyrEn,\cyrO,\cyrPe,\cyrEr,\cyrEs,%
+%   \cyrTe,\cyrU,\cyrEf,\cyrHa,\cyrTse,\cyrChe,%
+%   \cyrSha,\cyrShcha,\cyrHard,\cyrYeru,\cyrSoft,%
+%   \cyrE,\cyrYu,\cyrYa,\cyrvarI,\cyra,\cyrbe,%
+%   \cyrve,\cyrghe,\cyrde,\cyrie,\cyrzhe,\cyrze,%
+%   \cyri,\cyrka,\cyrel,\cyrem,\cyren,\cyro,%
+%   \cyrpe,\cyrer,\cyres,\cyrte,\cyru,\cyref,%
+%   \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,%
@@ -310,7 +384,7 @@
 %   \@frakshape,\@bcalshape,\@bfrakshape}
 % 
 % 
-% This file documents the code for the \textsf{mathfont} package. It is fairly technical, and first-time users may prefer to start with the user guide. Section~1 begins with the implementation basics, including package declaration, package-option declaration, and error messages. Section~2 deals with errors and messaging, and section~3 contains the code that adjusts the \LaTeX\ kernel as well as necessary booleans and default font shapes. Section~4 contains the optional-argument parser for |\mathfont|, and section~5 contains the code for the |\mathfont| command itself. In section~6, the package initializes the commands for alphanumeric symbols, and section~7 contains the code for local font changes. Section~8 contains concluding material, and section~9 lists the unicode hex values used in symbol declaration. Version history and code index appear on subsequent pages. For documentation of the user-level commands, see |mathfont_user_guide.pdf|, and for a list of symbols accessible with \textsf{mathfont}, see |mathfont_symbol_list.pdf|. Both documentation files are included with the \textsf{mathfont} installation and are available on \textsc{ctan}.
+% \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.
 % 
 % \section{Implementation Basics}
 % 
@@ -317,252 +391,355 @@
 % First and foremost, the package needs to declare itself.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mathfont}[2019/12/05 v. 1.6 Package mathfont]
-\newif\ifM at font@loaded
-\newif\ifM at special\M at specialtrue
-\newif\ifM at XeTeXLuaTeX
+\ProvidesPackage{mathfont}[2021/12/28 v. 2.0 Package mathfont]
 %    \end{macrocode}
-% We begin by disabling the five user-level commands. If \textsf{mathfont} runs normally, it will override these 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, and the user gets information on why not. We make the ``bad'' definitions gobble their original arguments to avoid a ``missing |\begin{document}|'' error.\indexpage{invalid command error}
+% We specify conditionals that we will use later in handling options and setup.
 %    \begin{macrocode}
-\def\@gobbletwo at brackets[#1]#2{}
+\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?
+\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}
+%    \begin{macrocode}
+\long\def\@gobbletwo at brackets[#1]#2{}
 \def\M at NoMathfontError#1{\PackageError{mathfont}
   {\MessageBreak Invalid command\MessageBreak
   \string#1 on line \the\inputlineno}
   {Your command was ignored. I couldn't\MessageBreak
-  load mathfont successfully, so this\MessageBreak
-  control sequence was never defined.}}
+  load mathfont, so I never defined this\MessageBreak
+  control sequence.}}
 \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}
 %    \end{macrocode}
-% We absolutely must have \textsf{fontspec}. Before anything else, \TeX\ should check for |fontspec.sty| and stop reading in \textsf{mathfont} if it can't find the file. We change |+| to active to force \TeX\ to print the required spaces in the message, and we put the entire production inside a group to make this change local. The |\@gobbletwo| eats the extra period and return that \LaTeX\ adds to the error message. Notice the strategic placement of the |\endgroup|s. We need |\M at NoFontspecError| to both tokenize its definition and then evaluate while |+| has catcode 13. If we evaluate |\M at NoFontspecError| outside the group, \TeX\ will issue an |\inaccessible| error, so we should place the macro inside the group. However, we want |\AtBeginDocument| and |\endinput| outside the group, so we need a separate |\endgroup| for each branch. We put the |\endgroup| in the false branch between the error and the remaining material.\indexpage{fontspec=\textsf{fontspec}}\indexpage{fatal error}\indexpage{catcode changes}\indexpage{could not find fontspec=could not find \textsf{fontspec}}
+% 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}
-\begingroup
-\catcode`\+=\active
-\def+{ }
-\def\M at NoFontspecError{\GenericError{}
-  {\MessageBreak\MessageBreak
-  Package mathfont fatal error:
-  \MessageBreak\MessageBreak
-  +*********************\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*++!!FATAL ERROR!!++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*+++++Could not+++++*\MessageBreak
-  +*+++find+fontspec+++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*********************\MessageBreak\@gobbletwo}
-  {See the mathfont package documentation for explanation.}
-  {Um, I couldn't find the file fontspec.sty.\MessageBreak
-  The mathfont package is useless without\MessageBreak
-  fontspec, so I'm going to stop reading it\MessageBreak
-  in now. (You won't be able to use any\MessageBreak
-  commands from mathfont in your document.)\MessageBreak
-  To make mathfont work correctly, please\MessageBreak
-  install fontspec on your computer.}}
-\IfFileExists{fontspec.sty}{\endgroup}
-  {\M at NoFontspecError\endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line}}
-  \endinput}
+\ifdefined\directlua
+  \M at XeTeXLuaTeXtrue
+\fi
+\ifdefined\XeTeXrevision
+  \M at XeTeXLuaTeXtrue
+\fi
 %    \end{macrocode}
-% We also want a salient error message if the engine doesn't define the required \XeTeX\ or Lua\TeX\ primitives.\indexpage{fatal error}\indexpage{XeTeX=\XeTeX}\indexpage{primitives}\indexpage{LuaTeX=Lua\TeX}\indexpage{catcode changes}\indexpage{missing xetex or luatex=missing \XeTeX\ or Lua\TeX}
+% 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}
-\begingroup
-\catcode`\+=\active
-\def+{ }
-\def\M at XeTeXLuaTeXError{\GenericError{}
-  {\MessageBreak\MessageBreak
-  Package mathfont fatal error:
-  \MessageBreak\MessageBreak
-  +*********************\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*++!!FATAL ERROR!!++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*+++Missing XeTeX+++*\MessageBreak
-  +*+++++or LuaTeX+++++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*********************\MessageBreak\@gobbletwo}
-  {See the mathfont package documentation for explanation.}
-  {I need XeTeX or LuaTeX to make this\MessageBreak
-  package work properly. It looks like the\MessageBreak
-  current engine is something else, so I'm\MessageBreak
-  going to stop reading in the package file\MessageBreak
-  now. (You won't be able to use commands\MessageBreak
-  from mathfont in your document.) To make\MessageBreak
-  mathfont work correctly, please retypeset\MessageBreak
-  this file with one of those two engines.}}
+\ifM at XeTeXLuaTeX\else
+  \begingroup
+    \catcode`\+=\active
+    \def+{ }
+    \def\M at XeTeXLuaTeXError{\GenericError{}
+      {\MessageBreak\MessageBreak
+      Package mathfont error:
+      \MessageBreak\MessageBreak
+      +*************************\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*+++++++UNABLE TO+++++++*\MessageBreak
+      +*+++++LOAD MATHFONT+++++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*+++++Missing XeTeX+++++*\MessageBreak
+      +*+++++++or LuaTeX+++++++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*************************\MessageBreak\@gobbletwo}
+      {See the mathfont package documentation for explanation.}
+      {I need XeTeX or LuaTeX to make mathfont\MessageBreak
+      work properly. It looks like the current\MessageBreak
+      engine is something else, so I'm going to\MessageBreak
+      stop reading in the package file now. (You\MessageBreak
+      won't be able to use commands from mathfont\MessageBreak
+      in your document.) To make mathfont work\MessageBreak
+      correctly, please retypeset your document\MessageBreak
+      with one of those two engines.^^J}}
+    \M at XeTeXLuaTeXError
+  \endgroup
+  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line.}}
+  \expandafter\endinput % we should \endinput with a balanced conditional
+\fi
 %    \end{macrocode}
-% Check that the engine has defined the necessary primitives.\indexpage{engine checks}\indexpage{fatal error}\indexpage{primitives}
+% Now do the same thing in checking for \textsf{luaotfload}. If the engine is Lua\TeX, we tell \textsf{mathfont} to implement Lua-based font adjustments by default. The conditional |\ifM at Noluaotfload| will keep track of whether \TeX\ could find |luaotfload.sty|. If the engine is \XeTeX, issue a warning.
 %    \begin{macrocode}
-\ifx\Umathcode\@undefined
+\ifdefined\directlua
+  \M at adjust@fonttrue % if engine is LuaTeX, adjust font by default
+  \IfFileExists{luaotfload.sty}{\M at Noluaotfloadfalse}{\M at Noluaotfloadtrue}
 \else
-  \ifx\Umathchardef\@undefined
-  \else
-    \ifx\Umathaccent\@undefined
-    \else
-      \M at XeTeXLuaTeXtrue
-    \fi
-  \fi
+  \PackageWarningNoLine{mathfont}{%
+    The current engine is XeTeX, but as\MessageBreak
+    of mathfont version 2.0, LuaTeX is\MessageBreak
+    recommended. Consider compiling with\MessageBreak
+    LuaLaTeX. Certain features will not\MessageBreak
+    work with XeTeX}
 \fi
-\ifM at XeTeXLuaTeX
+%    \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}}
+%    \begin{macrocode}
+\ifM at Noluaotfload % false by default; true if LuaTeX AND no luaotfload.sty
+  \begingroup
+    \catcode`\+=\active
+    \def+{ }
+    \def\M at NoluaotfloadError{\GenericError{}
+      {\MessageBreak\MessageBreak
+      Package mathfont error:
+      \MessageBreak\MessageBreak
+      +*************************\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*+++++++UNABLE TO+++++++*\MessageBreak
+      +*+++++LOAD MATHFONT+++++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*++++Cannot find the++++*\MessageBreak
+      +*++file luaotfload.sty++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*************************\MessageBreak\@gobbletwo}
+      {You are likely seeing this message because you haven't^^J%
+      installed luaotfload. Check your TeX distribution for a^^J%
+      list of the packages on your system. See the mathfont^^J%
+      documentation for further explanation.^^J}
+      {It looks like the current engine is LuaTeX, so I\MessageBreak
+      need the luaotfload package to make mathfont work\MessageBreak
+      correctly. I can't find luaotfload, so I'm going to\MessageBreak
+      stop reading in the mathfont package file now. (You\MessageBreak
+      won't be able to use commands from mathfont in your\MessageBreak
+      document.) To make mathfont work correctly, make\MessageBreak
+      sure luaotfload.sty is installed on your computer\MessageBreak
+      in a directory searchable by TeX or compile with\MessageBreak
+      XeLaTeX.^^J}}
+    \M at NoluaotfloadError
   \endgroup
-\else
-  \M at XeTeXLuaTeXError\endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line}}
-  \expandafter\endinput% we should \endinput with a balanced conditional
+  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line.}}
+  \expandafter\endinput % we should \endinput with a balanced conditional
 \fi
 %    \end{macrocode}
-% Some package options are now depreciated.\indexpage{depreciated}
+% 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.
 %    \begin{macrocode}
-\def\M at OptionDepreciated#1#2{\PackageError{mathfont}
-  {Option "#1" depreciated}
+\def\M at Optiondeprecated#1#2{\PackageError{mathfont}
+  {Option "#1" deprecated}
   {Your option was ignored. Please\MessageBreak
   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}
-% We code the package options, and for font names, |\DeclareOption*| tells \textsf{mathfont} how to handle an unknown option. The package sets |\ifM at font@loaded| to true and stores the font name in |\M at font@load|.
+% Now we code the package options. The deprecated options now cause an error.
 %    \begin{macrocode}
-\IfFileExists{atveryend.sty}
-  {\RequirePackage{atveryend}\let\M at SpecialHook\AtVeryVeryEnd}
-  {\let\M at SpecialHook\AtEndDocument}
-\DeclareOption{packages}{\M at OptionDepreciated{packages}
-  {\string\restoremathinternals}}
-\DeclareOption{operators}{\M at OptionDepreciated{operators}
+\DeclareOption{packages}{%
+  \M at Optiondeprecated{packages}
+  {the macro \string\restoremathinternals}}
+\DeclareOption{operators}{%
+  \M at Optiondeprecated{operators}
   {the bigops keyword with \string\mathfont}}
-\DeclareOption{no-operators}{\M at OptionDepreciated{no-operators}
+\DeclareOption{no-operators}{%
+  \M at Optiondeprecated{no-operators}
   {the bigops keyword with \string\mathfont}}
-\DeclareOption{easter-egg}{\ifM at special\M at specialfalse
-  \def\EasterEggUpdate{\show\E at sterEggUpdate}
-  \def\E at sterEggUpdate{Okay, opening your Easter egg}
-    \EasterEggUpdate
-  \def\E at sterEggUpdate{..}
-    \EasterEggUpdate
-    \EasterEggUpdate
-  \typeout{^^JHm, I think it flew out the^^J%
-    window. Check back here when^^J%
-    everything's done compiling^^J}
-  \def\E at sterEggUpdate{Uh oh}
-    \EasterEggUpdate
-  \def\E at sterEggUpdate{Still wrangling. Try back later}
-  \AtBeginDocument\EasterEggUpdate
-  \M at SpecialHook{%
-    \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 sterEggUpdate{Got it}
-      \EasterEggUpdate}
+%    \end{macrocode}
+% Easter egg!
+%    \begin{macrocode}
+\DeclareOption{easter-egg}{%
+  \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}
+      \EasterEggUpdate
+    \def\E at sterEggUpd@te{..}
+      \EasterEggUpdate
+      \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}
   \fi}% my easter egg :)
 %    \end{macrocode}
-% Interpret an unknown option as a font name and save it to feed to \textsf{fontspec}.\?\ifM at font@loaded\indexpage{optional package argument}
+% 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.
 %    \begin{macrocode}
+\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
+%    \begin{macrocode}
 \DeclareOption*{\M at font@loadedtrue\edef\M at font@load{\CurrentOption}}
 \ProcessOptions*
 %    \end{macrocode}
+% We print an informational message depending on whether the user enabled Lua-based font adjustments. If |\directlua| is defined, that means we are using Lua\TeX, so we print a message depending on |\ifM at adjust@font|.
+%    \begin{macrocode}
+\ifdefined\directlua
+  \ifM at adjust@font
+    \AtEndOfPackage{%
+      \typeout{:: mathfont :: Lua-based font adjustments enabled.}}
+  \else
+    \AtEndOfPackage{%
+      \typeout{:: mathfont :: Lua-based font adjustments disabled.}}
+  \fi
+\else
+%    \end{macrocode}
+% If |\directlua| is undefined, we say that Lua-based font adjustments are disabled, and we issue an error if the user tried to manually enable them.
+%    \begin{macrocode}
+  \AtEndOfPackage{%
+    \typeout{:: mathfont :: Lua-based font adjustments disabled.}}
+  \ifM at adjust@font
+    \AtEndOfPackage{%
+    \PackageError{mathfont}{Option^^J"adjust" ignored with XeTeX}
+    {Your package option "adjust" was ignored.\MessageBreak
+    This option works only with LuaTeX, and it\MessageBreak
+    looks like the current engine is XeTeX. To\MessageBreak
+    enable Lua-based font adjustments, compile\MessageBreak
+    with LuaLaTeX.^^J}}
+    \M at adjust@fontfalse
+  \fi
+\fi
+%    \end{macrocode}
 % 
 % 
 % \section{Errors and Messaging}
 % 
-% Some error and informational messages. We begin with general informational messages.\indexpage{log file=\texttt{log} file}\indexpage{LaTeX kernel=\LaTeX\ kernel}
+% 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}
+% 
+% \begin{figure}[b]
+% \def\vrb#1{\texttt{\string#1}}
+% \centerline{\bfseries Table 1: Different Warnings 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 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 InvalidOptionError & Bad option for \vrb\mathfont\\
+% \vrb\M at InvalidSupoptionError & Bad suboption for \vrb\mathfont\\
+% \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\\
+% \vrb\M at ForbiddenCharmFile & Charm file contains a bad character\\
+% \vrb\M at ForbiddenCharmLine & Charm line contains a bad character\\
+% \vrb\M at NoFontAdjustError & Command called when Lua-based font adjustment was disabled\\
+% \bottomrule
+% \end{tabularx}
+% \end{figure}
+% 
 %    \begin{macrocode}
-\def\M at FontChangeInfo#1#2{\wlog{Package mathfont Info:
-  Changing #1 characters to #2!}}
+\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{\wlog{Package mathfont Info: Creating
-  math alphabet command \noexpand#1 using^^J%
-  #2 font with series #3 and shape #4 on line \the\inputlineno.}}
-\def\M at SetInternalsInfo{\wlog{Package mathfont Info: Setting
-  \string\set at mathchar, \string\set at mathsymbol, \string\set at mathaccent.}}
-\def\M at RestoreInternalsInfo{\wlog{Package mathfont Info: Fixing
-  \string\set at mathchar, \string\set at mathsymbol, \string\set at mathaccent.}}
+\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%
+  Series/Shape Info: #4/#5^^J}}
 \def\M at CharsSetWarning#1{\PackageWarning{mathfont}
-  {Font for #1 chars has already\MessageBreak
-  been set, so I'm ignoring this\MessageBreak
-  keyword}}
+  {I already set the font for\MessageBreak
+  #1 chars, so I'm ignoring\MessageBreak
+  this option for \string\mathfont\space
+  on line \the\inputlineno\@gobble}}
 %    \end{macrocode}
-% Warnings for the |\mathbb|, etc.\ commands.\indexpage{multiple characters warning}\indexpage{nested argument warning}\indexpage{control sequence warning}\indexpage{alphanumeric symbols}
+% 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
-  "#1" that are grouped together in\MessageBreak
-  the argument of your \expandafter\string#2\space command\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
-  "#1" from your \expandafter\string#2\MessageBreak
+  "#2" from your \string#1\MessageBreak
   command}}
-\def\M at ControlSequenceArgWarning#1#2{\PackageWarning{mathfont}
+\def\M at CSArgWarning#1#2{\PackageWarning{mathfont}
   {I'm ignoring the unexpandable control\MessageBreak
-  sequence \expandafter\string#1\space that appears in the\MessageBreak
-  argument of your \expandafter\string#2\space command\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 "#1" in the\MessageBreak
-  argument of your \expandafter\string#2\MessageBreak
+  {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 depreciated commands.\indexpage{depreciated}
+% Warning for deprecated commands.\indexpage{Your command is deprecated}
 %    \begin{macrocode}
-\def\M at DepreciatedWarning#1#2{\PackageWarning{mathfont}
-  {Your \string#1\space command is\MessageBreak
-  depreciated, and I replaced it with\MessageBreak
-  \string#2}}
+\def\M at DeprecatedWarning#1#2{\PackageWarning{mathfont}
+  {Your \string#1\space command on\MessageBreak
+  line \the\inputlineno\space is deprecated, and I\MessageBreak
+  replaced it with \string#2\@gobble}}
 %    \end{macrocode}
-% Error message from loading \textsf{fontspec} without |no-math|.\indexpage{fontspec=\textsf{fontspec}}\indexpage{no-math option=\texttt{no-math} option for \textsf{fontspec}}
+% 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}}
 %    \begin{macrocode}
-\def\M at NoMathError{\PackageError{mathfont}
-  {Package fontspec was loaded\MessageBreak
-  without the "no-math" option}
-  {This isn't really an error--it's fine to load\MessageBreak
-  fontspec without "no-math." However, strange\MessageBreak
-  things could happen, so beware of any sudden\MessageBreak
-  and unexpected font changes. To resolve this\MessageBreak
-  error message, load fontspec with the "no-\MessageBreak
-  math" option. If you haven't loaded fontspec\MessageBreak
-  manually, try loading mathfont earlier in your\MessageBreak
-  preamble.}}
-%    \end{macrocode}
-% Error messages associated with |\mathfont|.\indexpage{default font changes}\indexpage{invalid option or suboption}\indexpage{missing option or suboption}\indexpage{internal commands restored}
-%    \begin{macrocode}
 \def\M at InvalidOptionError#1{\PackageError{mathfont}
-  {Invalid option "#1"\MessageBreak
-  for \string\mathfont\on at line}
-  {Hm. Check that you spelled the\MessageBreak
-  option correctly. Otherwise, I'm\MessageBreak
-  not sure what's wrong. Is this\MessageBreak
-  option listed in the package\MessageBreak
-  documentation? In any event, I'm\MessageBreak
-  going to ignore this option.}}
+  {Invalid^^Joption "#1" for \string\mathfont\on at line}
+  {Hm. You used a keyword that isn't actually an optional\MessageBreak
+  argument for \string\mathfont. Check 
+  that you spelled the keyword\MessageBreak
+  correctly. Otherwise, I'm not sure what's wrong. Is this\MessageBreak
+  option listed in the package documentation? In any event,\MessageBreak
+  I'm going to ignore it.^^J}}
 \def\M at InvalidSuboptionError#1{\PackageError{mathfont}
-  {Invalid suboption "#1"\MessageBreak
-  for \string\mathfont\on at line}
-  {Hm. Check that you spelled the\MessageBreak
-  suboption correctly. Otherwise, I'm\MessageBreak
-  not sure what's wrong. Is this\MessageBreak
-  suboption listed in the package\MessageBreak
-  documentation? In any event, I'm\MessageBreak
-  going to ignore this suboption.}}
+  {Invalid^^Jsuboption "#1" for \string\mathfont\on at line}
+  {Hm. You used a keyword that isn't actually a suboption\MessageBreak
+  for \string\mathfont. Check that you 
+  spelled the keyword correctly.\MessageBreak
+  Otherwise, I'm not sure what's wrong. Is this suboption\MessageBreak
+  listed in the package documentation? In any event, I'm\MessageBreak
+  going to ignore it.^^J}}
 \def\M at MissingOptionError{\PackageError{mathfont}
-  {Missing option for\MessageBreak
-  \string\mathfont\on at line}
+  {Missing^^Joption for \string\mathfont\on at line}
   {It looks like you included a , or = in\MessageBreak
-  the optional argument of \string\mathfont\MessageBreak
-  but didn't put anything before it.}}
+  the optional argument of \string\mathfont\space but\MessageBreak
+  didn't put anything before it.^^J}}
 \def\M at MissingSuboptionError{\PackageError{mathfont}
-  {Missing suboption for\MessageBreak
-  \string\mathfont\on at line}
+  {Missing^^Jsuboption for \string\mathfont\on at line}
   {It looks like you included an = somewhere\MessageBreak
   but didn't put the suboption after it. Either\MessageBreak
   that or you typed == instead of = in the\MessageBreak
-  optional argument of \string\mathfont.}}
+  optional argument of \string\mathfont.^^J}}
 \def\M at InternalsRestoredError{\PackageError{mathfont}
-  {Internal commands restored}
+  {Internal^^Jcommands restored}
   {This package slightly changes two LaTeX\MessageBreak
   internal commands, and you really shouldn't\MessageBreak
   be loading new math fonts without those\MessageBreak
@@ -572,11 +749,35 @@
   tions. Presumably you used \string\mathfont\space after\MessageBreak
   calling the \string\restoremathinternals\space command.\MessageBreak
   I'm going to ignore this call to \string\mathfont.\MessageBreak
-  Try retypesetting this document with all\MessageBreak
+  Try typesetting this document with all\MessageBreak
   \string\mathfont\space commands placed before you call\MessageBreak
-  \string\restoremathinternals.}}
+  \string\restoremathinternals.^^J}}
+\def\M at NoFontspecFamilyError{\PackageError{mathfont}
+  {No previous^^Jfont loaded by fontspec}
+  {You called \string\mathfont\space
+  with the argument "fontspec" \MessageBreak
+  on line \the\inputlineno,
+  and that tells me to use the previous \MessageBreak
+  font loaded by the fontspec package. However, it \MessageBreak
+  looks like you haven't loaded any fonts yet with \MessageBreak
+  fontspec. To resolve this error, try using for \MessageBreak
+  example \string\setmainfont\space
+  before calling \string\mathfont.^^J}}
+\def\M at NoFontspecError{\PackageError{mathfont}
+  {Missing^^Jpackage fontspec}
+  {You called \string\mathfont\space
+  with the argument "fontspec" \MessageBreak
+  on line \the\inputlineno,
+  and that tells me to use the previous \MessageBreak
+  font loaded by the fontspec package. However, you\MessageBreak
+  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}}
 %    \end{macrocode}
-% Error messages for the |\newmathrm|, etc.\ commands.\indexpage{local font changes}\indexpage{missing control sequence}\indexpage{multiple characters error}\indexpage{missing \$=missing \texttt\$ inserted}\index{local font changes}
+% Error messages for the |\newmathrm|, etc.\ commands.
+% \indexpage{Missing control sequence}
+% \indexpage{Multiple characters in argument}
+% \indexpage{Missing \$ inserted=Missing \texttt\$ inserted}
 %    \begin{macrocode}
 \def\M at MissingControlSequenceError#1#2{\PackageError{mathfont}
   {Missing control sequence\MessageBreak
@@ -583,43 +784,88 @@
   for\string#1\MessageBreak on input line \the\inputlineno}
   {Your command was ignored. Right now the\MessageBreak
   first argument of \string#1\space is "#2."\MessageBreak
-  Please use a control sequence instead.}}
+  Please use a control sequence instead.^^J}}
 \def\M at DoubleArgError#1#2{\PackageError{mathfont}
   {Multiple characters in\MessageBreak
-  first argument of \string#2\MessageBreak
+  first argument of \string#1\MessageBreak
   on input line \the\inputlineno}
   {Your command was ignored. Right now the\MessageBreak
-  first argument of \string#2\space is "#1,"\MessageBreak
+  first argument of \string#1\space is "#2,"\MessageBreak
   which is multiple characters. Please use\MessageBreak
-  a single character instead.}}
+  a single character instead.^^J}}
 \def\M at HModeError#1{\PackageError{mathfont}
-  {Missing \$ inserted. The\MessageBreak
-  command \string#1\space must be used in\MessageBreak
-  math mode\on at line}
-  {I generated an error because\MessageBreak
+  {Missing \string$ inserted\MessageBreak
+  inserted\on at line. Command\MessageBreak
+  \string#1\space is for math mode only\MessageBreak}
+  {I generated an error because 
   you used \string#1\space outside of\MessageBreak
-  math mode. I've inserted a \string$\MessageBreak
+  math mode. I've inserted a \string$
   just before your \string#1, so\MessageBreak
-  we should be all good now.}}
+  we should be all good now.^^J}}
 %    \end{macrocode}
+% We need error messages related to Lua-based font adjustments.
+% \indexpage{Forbidden charm info}
+% \indexpage{Your command is invalid without Lua-based}
+% \indexpage{Bad argument for}
+%    \begin{macrocode}
+\def\M at ForbiddenCharmLine#1{\PackageError{mathfont}
+  {Forbidden charm info contains #1}
+  {The argument of your \string\CharmLine\space
+  macro on line \the\inputlineno\MessageBreak
+  contains the character #1, which will mess me up\MessageBreak
+  if I try to read it, so I'm ignoring this call\MessageBreak
+  to \string\CharmLine. To resolve this error, make sure\MessageBreak
+  your charm information contains only integers,\MessageBreak
+  floats, asterisks, commas, and spaces.^^J}}
+\def\M at ForbiddenCharmFile#1{\PackageError{mathfont}
+  {Forbidden charm info contains #1}
+  {One of the lines in your \string\CharmFile\space
+  from line \the\inputlineno\MessageBreak
+  contains the character #1, which will mess me up\MessageBreak
+  if I try to read it, so I'm ignoring this line\MessageBreak
+  from your file. To resolve this error, make sure\MessageBreak
+  your charm information contains only integers,\MessageBreak
+  floats, asterisks, commas, and spaces.^^J}}
+\def\M at NoFontAdjustError#1{\PackageError{mathfont}
+  {Your command \MessageBreak\string#1 is invalid\MessageBreak
+  without Lua-based font adjustments}
+  {You haven't enabled Lua-based font adjustments,\MessageBreak
+  but the macro you called won't do anything without\MessageBreak
+  them. I'm going to ignore your command for now. To\MessageBreak
+  resolve this error, load mathfont with the package\MessageBreak
+  option "adjust" or compile with LuaLaTeX.^^J}}
+\def\M at BadIntegerError#1#2{\PackageError{mathfont}
+  {Bad argument for\MessageBreak\string#1}
+  {Your command was ignored. Please make sure\MessageBreak
+  that your argument of \string#1\space\MessageBreak
+  is a nonnegative integer. Right now it's\MessageBreak
+  "#2".^^J}}
+%    \end{macrocode}
 % 
 % \section{Default Settings}
 % 
-% We load the \textsf{fontspec} package in order to use its main font loading mechanism, and we |\let| the macro |\@newfont| take on this function. We also make sure that \textsf{fontspec} was loaded with the |no-math| option because without it, \textsf{fontspec} may cause trouble with some of the math characters. If |\g__fontspec_math_bool| is equal to 1, \textsf{mathfont} will issue an error message.\indexpage{default font changes}\indexpage{fontspec=\textsf{fontspec}}\indexpage{fontspecsetfamily=\fontspeccommand}\indexpage{no-math option=\texttt{no-math} option for \textsf{fontspec}}
+% 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}
-  {\ifnum\csname g__fontspec_math_bool\endcsname=\@ne
-    \M at NoMathError
-  \fi}{\RequirePackage[no-math]{fontspec}}
-\expandafter\let\expandafter\@newfont
-  \csname fontspec_set_family:Nnn\endcsname
+  {\csname bool_set_false:N\expandafter\endcsname
+    \csname g__fontspec_math_bool\endcsname}
+  {\PassOptionsToPackage{no-math}{fontspec}}
 %    \end{macrocode}
-% We save |\set at mathchar| and |\set at mathsymbol| from the \LaTeX\ kernel so we can change their definitions. We need to adapt these macros for use with unicode fonts, and we replace |\mathcode| and |\mathchardef| respectively with the \XeTeX\ and Lua\TeX\ primitives |\Umathcode| and |\Umathchardef|. The unicode primitives support decimal input using a |+| sign, and we take advantage of that feature to avoid hexadecimal conversions.\indexpage{LaTeX kernel=\LaTeX\ kernel}\indexpage{primitives}
+% 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}
 %    \begin{macrocode}
-\M at SetInternalsInfo
 \let\@@set at mathchar\set at mathchar
 \let\@@set at mathsymbol\set at mathsymbol
 \let\@@set at mathaccent\set at mathaccent
+\let\@@DeclareSymbolFont\DeclareSymbolFont
+\@onlypreamble\@@set at mathchar
+\@onlypreamble\@@set at mathsymbol
+\@onlypreamble\@@set at mathaccent
+\@onlypreamble\@@DeclareSymbolFont
+\wlog{Package mathfont Info: Adapting \noexpand\set at mathchar for unicode.}
+\wlog{Package mathfont Info: Adapting \noexpand\set at mathsymbol for unicode.}
+\wlog{Package mathfont Info: Adapting \noexpand\set at mathaccent for unicode.}
+\wlog{Package mathfont Info: Increasing upper bound on
+  \noexpand\DeclareSymbolFont to 256.}
 %    \end{macrocode}
 % Kernel command to set math characters from keystrokes.
 %    \begin{macrocode}
@@ -633,7 +879,7 @@
 \def\set at mathsymbol#1#2#3#4{%
   \multiply\count\z@ by 16\relax
   \advance\count\z@\count\tw@
-  \global\Umathchardef#2\mathchar at type#3+#1+\count\z@\relax}
+  \global\Umathchardef#2=\mathchar at type#3+#1+\count\z@\relax}
 %    \end{macrocode}
 % Kernel command to set accents.
 %    \begin{macrocode}
@@ -640,273 +886,528 @@
 \def\set at mathaccent#1#2#3#4{%
   \multiply\count\z@ by 16\relax
   \advance\count\z@\count\tw@
-  \xdef#2{\Umathaccent\mathchar at type#3+#1+\the\count\z@\relax}}
+  \protected\xdef#2{%
+    \Umathaccent\mathchar at type#3+\number#1+\the\count\z@\relax}}
 %    \end{macrocode}
-% We need to keep track of the number of times we have loaded a font, and the count |\M at count| fulfills this role. The |\M at toks| object will record a message that displays when the user calls |\mathfont|, and |\M at return| will keep track of when to add a carriage return to |\M at toks|.
+% 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.
 %    \begin{macrocode}
+\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}
+%    \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}}
+%    \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|.
+%    \begin{macrocode}
+\else
+  \begingroup
+  \everyeof{\noexpand}
+  \endlinechar\m at ne
+%    \end{macrocode}
+% The first |\edef| expands |\M at DecSymDef| and defines |\M at retokenize| to be |\scantokens|\penalty0|{|\penalty0|\unexpanded|\penalty0|{|\meta{new definition}|}}|, and the second |\edef| carries out the retokenization. Once we have stored the patched definition in |\M at retokenize|, we expand |\M at retokenize| after the |\endgroup| and redefine |\DeclareSymbolFont| by calling |\@tempa|.
+%    \begin{macrocode}
+  \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}
+\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.
+%    \begin{macrocode}
+\newbox\surdbox
 \newcount\M at count
-\newcount\M at return
+\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
+\newcount\M at surd@horizontal at factor
+\newmuskip\radicandoffset
+\newread\M at Charm
+\newtoks\M at toks
 \M at count\z@
-\newtoks\M at toks
+\M at rule@thickness at factor\@m
+\M at integral@italic at factor=400\relax
+\M at surd@horizontal at factor\@m
+\M at surd@vertical at factor\@m
+\radicandoffset=3mu\relax
 %    \end{macrocode}
-% We create necessary booleans and the default math font shapes.\indexpage{default shapes}
+% We create necessary booleans and the default math font shapes.
 %    \begin{macrocode}
-\newif\if at upper
-\newif\if at lower
-\newif\if at diacritics
-\newif\if at greekupper
-\newif\if at greeklower
-\newif\if at agreekupper
-\newif\if at agreeklower
-\newif\if at cyrillicupper
-\newif\if at cyrilliclower
-\newif\if at hebrew
-\newif\if at digits
-\newif\if at operator
-\newif\if at symbols
-\newif\if at extsymbols
-\newif\if at delimiters
-\newif\if at arrows
-\newif\if at bigops
-\newif\if at extbigops
-\newif\if at bb
-\newif\if at cal
-\newif\if at frak
-\newif\if at bcal
-\newif\if at bfrak
+\newif\ifM at upper
+\newif\ifM at lower
+\newif\ifM at diacritics
+\newif\ifM at greekupper
+\newif\ifM at greeklower
+\newif\ifM at agreekupper
+\newif\ifM at agreeklower
+\newif\ifM at cyrillicupper
+\newif\ifM at cyrilliclower
+\newif\ifM at hebrew
+\newif\ifM at digits
+\newif\ifM at operator
+\newif\ifM at symbols
+\newif\ifM at extsymbols
+\newif\ifM at delimiters
+\newif\ifM at radical
+\newif\ifM at arrows
+\newif\ifM at bigops
+\newif\ifM at extbigops
+\newif\ifM at bb
+\newif\ifM at cal
+\newif\ifM at frak
+\newif\ifM at bcal
+\newif\ifM at bfrak
 \newif\if at optionpresent
 \newif\if at suboptionpresent
-\newif\ifM at mathfont@firstoption
-\newif\ifM at anychars@changed
 \newif\ifM at arg@good
-\def\@uppershape{italic}% latin upper
-\def\@lowershape{italic}% latin lower
-\def\@diacriticsshape{roman}% diacritics
-\def\@greekuppershape{roman}% greek upper
-\def\@greeklowershape{italic}% greek lower
-\def\@agreekuppershape{roman}% ancient greek upper
-\def\@agreeklowershape{italic}% ancient greek lower
-\def\@cyrillicuppershape{roman}% cyrillic upper
-\def\@cyrilliclowershape{italic}% cyrillic lower
-\def\@hebrewshape{roman}% hebrew
-\def\@digitsshape{roman}% numerals
-\def\@operatorshape{roman}% operator font
-\def\@symbolsshape{roman}% basic symbols
-\def\@extsymbolsshape{roman}% extended symbols
-\def\@delimitersshape{roman}% delimiters
-\def\@arrowsshape{roman}% arrows
-\def\@bigopsshape{roman}% big operators
-\def\@extbigopsshape{roman}% extended big operators
-\def\@bbshape{roman}% blackboard bold
-\def\@calshape{roman}% caligraphic
-\def\@frakshape{roman}% fraktur
-\def\@bcalshape{roman}% bold caligraphic
-\def\@bfrakshape{roman}% bold fraktur
-\def\@defaultkeys{upper,lower,diacritics,greekupper,greeklower,%
-  digits,symbols,operator}
-\def\@normalkeys{upper,lower,diacritics,greekupper,greeklower,agreekupper,%
-  agreeklower,cyrillicupper,cyrilliclower,hebrew,digits,operator,symbols,%
-  extsymbols,delimiters,arrows,bigops,extbigops}
-\def\@alphanumkeys{bb,cal,frak,bcal,bfrak}
+\newif\ifM at Decl@reF at mily
+\newif\ifM at fromCharmFile
 %    \end{macrocode}
+% Default shapes.
+% \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
+%    \begin{macrocode}
+\def\M at uppershape{italic} % latin upper
+\def\M at lowershape{italic} % latin lower
+\def\M at diacriticsshape{upright} % diacritics
+\def\M at greekuppershape{upright} % greek upper
+\def\M at greeklowershape{italic} % greek lower
+\def\M at agreekuppershape{upright} % ancient greek upper
+\def\M at agreeklowershape{italic} % ancient greek lower
+\def\M at cyrillicuppershape{upright} % cyrillic upper
+\def\M at cyrilliclowershape{italic} % cyrillic lower
+\def\M at hebrewshape{upright} % hebrew
+\def\M at digitsshape{upright} % numerals
+\def\M at operatorshape{upright} % operator font
+\def\M at delimitersshape{upright} % delimiters
+\def\M at radicalshape{upright} % surd
+\def\M at bigopsshape{upright} % big operators
+\def\M at extbigopsshape{upright} % extended big operators
+\def\M at symbolsshape{upright} % basic symbols
+\def\M at extsymbolsshape{upright} % extended symbols
+\def\M at arrowsshape{upright} % arrows
+\def\M at bbshape{upright} % blackboard bold
+\def\M at calshape{upright} % caligraphic
+\def\M at frakshape{upright} % fraktur
+\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.
+% \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
+%    \begin{macrocode}
+\def\M at defaultkeys{upper,lower,diacritics,greekupper,%
+  greeklower,digits,operator,symbols}
+%    \end{macrocode}
+%  If the user enabled Lua-based font adjustments, the |\M at defaultkeys| list also includes delimiters, surd, and big operator symbols.
+%    \begin{macrocode}
+\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.
+%    \begin{macrocode}
+\def\M at default@otf at 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;%
+  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{Parse Input}
 % 
-% The command |\M at check@option at valid| confirms that a user's keyword option is legitimate. The macro defines |\@temperror| to be an invalid option error and loops through all possible options. If the command argument matches one of the correct possibilities, the package changes |\@temperror| to |\relax|. The macro ends this process with a call to |\@temperror|, so the package issues an error if and only if the specified option is invalid. We switch the |\if at optionpresent| and |\if at suboptionpresent| booleans to true in these macros when the respective |\@for| loops match the prospective option or suboption to a valid choice. We have to initialize the blackboard, calligraphic, and fraktur commands separately because they don't use the same encoding-alphabet system as the regular letters and digits, and the |\define@|\argtext{keyword} macro does this.\indexpage{keyword option=keyword options for \texttt{\string\string\string\mathfont}}\indexpage{invalid option or suboption}\indexpage{missing option or suboption}
+% 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}}
 %    \begin{macrocode}
 \def\M at check@option at valid#1{%
-  \def\@temperror{\M at InvalidOptionError{#1}}
-  \@for\@j:=\@normalkeys\do{%
+  \let\@temperror\M at InvalidOptionError % error by default
+  \@for\@j:=\M at normalkeys\do{%
     \ifx\@j#1
-      \let\@temperror\relax
-      \@optionpresenttrue% set switch to true if option is valid
-      \advance\M at return\@ne
+      \let\@temperror\@gobble % eliminate error
+      \@optionpresenttrue % set switch to true
     \fi}
 %    \end{macrocode}
-% We have to initialize alphanumeric symbols separately.\indexpage{alphanumeric symbols}
-%    \begin{macrocode}
-  \@for\@j:=\@alphanumkeys\do{%
+% 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
-      \let\@temperror\relax
-      \expandafter\M at CommandInitializeInfo\csname math\@j\endcsname
-      \csname define@\@j\endcsname% initialize
-      \@optionpresenttrue% set switch to true if option is valid
-      \advance\M at return\@ne
+      \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}
+    \@temperror{#1}}
 %    \end{macrocode}
 % Do the same thing for the suboption.
 % \indexpage{suboption roman=suboption \texttt{roman}}%
+% \indexpage{suboption upright=suboption \texttt{upright}}%
 % \indexpage{suboption italic=suboption \texttt{italic}}%
 %    \begin{macrocode}
 \def\M at check@suboption at valid#1{%
-  \def\@temperror{\M at InvalidSuboptionError{#1}}
-  \@for\@j:=roman,italic\do{%
+  \let\@temperror\M at InvalidSuboptionError % error by default
+  \@for\@j:=roman,upright,italic\do{%
     \ifx\@j#1
-      \let\@temperror\relax
-      \@suboptionpresenttrue% set switch to true if suboption is valid
-      \advance\M at return\@ne
+      \let\@temperror\@gobble % eliminate error
+      \@suboptionpresenttrue % set switch to true
     \fi}
-  \@temperror}
+  \@temperror{#1}}
 %    \end{macrocode}
-% We want to allow the user to specify options using an \textsf{xkeyval}-type syntax. However, we do not need the full package; a slim 22 lines of code will suffice. When |\mathfont| reads one segment of \textit{text} from its comma-delimited optional argument, it calls |\M at parse@option|\argtext{text}|=\@nil|. The |\M at parse@option| macro splits the option and suboption by looking for the first |=|. It puts its |#1| argument in |\@tempa| and |#2| in |\@tempb| and then checks whether option and suboption are present and valid. If the user specifies a suboption, their \textit{text} will contain an |=|, so the option ends up in |\@tempa| while |\@tempb| contains \argtext{suboption}|=|. Calling |\M at strip@equals| extracts the suboption. If the user does not specify a suboption, the user's \textit{text} will not contain an |=|, and |\@tempb| will end up empty. We check for errors by determining whether (1) |\@tempa| is empty, meaning the user did not specify an option; (2) |@tempb| is |=|, meaning the user did not specify a suboption; and (3) the contents of |\@tempa| and |\@tempb| correspond to valid options and suboptions. The macros |\M at check@option at valid| and |\M at check@suboption at valid| handle the last step.
+% Now we have to actually parse the optional argument. We want to allow the user to specify options using an \textsf{xkeyval}-type syntax. However, we do not need the full package; a slim 30 lines of code will suffice. When |\mathfont| reads one segment of \textit{text} from its optional argument, it calls |\M at parse@option|\meta{text}|=\@nil|. The |\M at parse@option| macro splits the option and suboption by looking for the first |=|. It puts its |#1| argument (hopefully the keyword-option) in |\@temp at opt| and puts |#2| (hopefully the keyword-suboption) in |\@temp at sub|. If the user specifies a suboption, |\@tempb| contains \meta{suboption}|=|, and we use |\M at strip@equals| to get rid of the extra |=|. If the user does not specify a suboption, |\@tempb| will be empty.
 % \indexpage{parse mathfont arguments=parse \texttt{\char`\\mathfont} arguments}
 %   \begin{macrocode}
 \def\M at strip@equals#1={#1}
 \def\M at parse@option#1=#2\@nil{%
-  \@optionpresentfalse% set switch to false by default
-  \@suboptionpresentfalse% set switch to false by default
-  \def\@tempa{#1}
-  \def\@tempb{#2}
-  \ifx\@tempa\@empty
+  \@optionpresentfalse % set switch to false by default
+  \@suboptionpresentfalse % set switch to false by default
+  \def\@temp at opt{#1} % store option
+  \def\@temp at sub{#2} % store suboption
+%    \end{macrocode}
+% After storing the option in |\@temp at opt| and suboption in |\@temp at sub|, check for errors. We check for errors by determining if (1) |\@tempa| is empty, meaning the user did not specify an option; or (2) |@tempb| is |=|, meaning the user typed |=| but did not follow it with a suboption.
+%    \begin{macrocode}
+  \ifx\@temp at opt\@empty
     \M at MissingOptionError
   \else
-    \M at check@option at valid\@tempa
-    \def\@tempc{=}
-    \ifx\@tempb\@tempc
+%    \end{macrocode}
+% Check that the user specified a valid option. We redefine |\@tempa| inside a group to keep the change local, and we end the group as quickly as possible after the comparison, which means separate |\egroup|s in both branches of |\ifx|.
+%    \begin{macrocode}
+    \M at check@option at valid\@temp at opt
+    \bgroup\def\@tempa{=}
+    \ifx\@temp at sub\@tempa
+      \egroup % first branch \egroup
       \M at MissingSuboptionError
     \else
-      \ifx\@tempb\@empty
+      \egroup % second branch \egroup
+%    \end{macrocode}
+% If |\@temp at sub| is nonempty, strip the final |=| and check that it contains a valid suboption.
+%    \begin{macrocode} 
+      \ifx\@temp at sub\@empty
       \else
-        \edef\@tempb{\expandafter\M at strip@equals\@tempb}
-        \M at check@suboption at valid\@tempb
+        \edef\@temp at sub{\expandafter\M at strip@equals\@temp at sub}
+        \M at check@suboption at valid\@temp at sub % check that suboption is valid
       \fi
     \fi
+%    \end{macrocode}
+% If the user specified suboption |roman|, we accept it for backwards compatibility and convert it to |upright|. Again, we redefine |\@tempa| inside a group to keep the change local.
+%    \begin{macrocode}
+    \bgroup\def\@tempa{roman}
+    \ifx\@temp at sub\@tempa
+      \egroup % first branch \egroup
+      \def\@temp at sub{upright}
+    \else
+      \egroup % second branch \egroup
+    \fi
   \fi}
 %    \end{macrocode}
-% Define a variant of |\zap at space| that will work with control sequences. Used for removing spaces from the optional argument of |\mathfont|.\indexpage{parse spaces}
+% We code a general-purpose definition macro that defines its first argument to be the second argument fully expanded and with spaces removed.
 %    \begin{macrocode}
-\def\M at eat@spaces#1{\expandafter\zap at space#1 \@empty}
+\long\def\edef at nospace#1#2{%
+  \edef#1{#2}%
+  \edef#1{\expandafter\zap at space#1 \@empty}}
 %    \end{macrocode}
-% We end this section by coding a macro used later in error checking. Here |#1| is an argument that we expect to be a single token or set of tokens inside braces, so we check whether |#2| is empty. The parameters |#3| and |#4| correspond to an error and to the original command respectively.\indexpage{error checking}
+% 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 check@arglength#1#2\@nil#3#4{%
-  \ifx\@nnil#2\@nnil
+\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
-    #3{#1#2}{#4}%
-    \M at arg@goodfalse
+    \@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}
 % 
-% \section{Default Font Changes}\indexpage{default font changes}
-% 
-% The user-level command |\mathfont| functions as the main font-changing command. It takes no argument directly but rather checks for an optional argument and passes keyword information to the internal command |\@mathfont|. It scans next nonspace token using |\@ifnextchar| and determines whether it is a |[|. If yes, the user specified an optional argument, and the package converts the space character to catcode 9 before scanning the optional argument with |\m at thf@nt|. If no, the package calls |\@mathfont| directly with the default list of keywords stored in |\@defaultkeys|. The |\m at thf@nt| macro scans a single argument delimited by brackets, resets the catcode of spaces, and calls |\@mathfont| with the user's scanned and de-spaced argument. We put the catcode change inside a group to make it local.
-% 
-% The internal |\@mathfont| accepts two arguments: a list of keywords and suboptions |#1| and a font name |#2|. The macro proceeds in several steps: (1) it checks if |\set at mathchar| has been reset, and if so, the current call to |\mathfont| does nothing; (2) the macro loads the user's font with |\@newfont| and stores the internal name in |\M at font|\argtext{number}; (3) it expands the optional argument with an |\edef| and stores it in |\@tempa|; and (5) it calls |\M at eat@spaces|, which is a wrapped version of |\zap at space|, on the contents of |\@tempa| to remove any spaces that remain after scanning with |\m at thf@nt|. At this point, the package is ready to parse the optional argument. It loops through the segments of |#1| with |\@for| and calls |\M at parse@option|\argtext{text}|=\@nil| on each piece of text. If they exist, the argument keyword ends up in |\@tempa|, and the suboption goes into |\@tempb|. The macro punctuates |\M at toks| accordingly and then defines symbol fonts with the information from |\@tempa|, |\@tempb|, and the argument |#2|. Finally, the package calls |\M@|\argtext{keyword}|@set| to set the default font and changes the corresponding boolean from false to true.
-% 
-% The package stores each new font in a macro of the form |\M at font|\argtext{number}, where \textit{number} is given by the  current value of |\M at count|. The name of the corresponding symbol fonts is |M|\argtext{shape}\argtext{number}, where \textit{shape} is either \texttt{roman} or \texttt{italic} and \textit{number} is again the value of |\M at count|. For each package keyword, the package defined |\@|\argtext{keyword}|shape| as the default shape in section~3, and if the user specifies a suboption for any keyword in the optional argument of |\mathfont|, the package overrides the default shape by redefining |\@|\argtext{keyword}|shape|. For example, if the user writes
-% \begin{code}
-% |\mathfont[upper=roman]{Zapfino}|
-% \end{code}
-% immediately after loading \textsf{mathfont}, the package will define |\M at font0| to be the internal name of Zapfino, and the corresponding symbol font names will be |Mroman0| and |Mitalic0|. Because the user specified a suboption, |\@mathfont| redefines |\@uppershape| to the token string \texttt{roman}, and \textsf{mathfont} uses |\@uppershape| later to specify the  symbol font for capital Latin characters. This happens inside |\@mathfont| when the package calls |\M at upper@set| and defines |\M at upper| as the expansion of |M\@uppershape\the\M at count|.\?\mathfont\indexpage{parse spaces}\indexpage{catcode 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}
-\def\mathfont{\@ifnextchar[% next line is the two possible branches
-  {\bgroup\catcode`\ =9\relax\m at thf@nt}{\@mathfont[\@defaultkeys]}}
-\def\m at thf@nt[#1]{\egroup\@mathfont[#1]}
+\protected\def\mathfont{\@ifnextchar[{\m at thf@nt}{\@mathfont[\M at defaultkeys]}}
+\def\m at thf@nt[#1]{\@mathfont[#1]}
 %    \end{macrocode}
-% The internal default-font-changing command.\?\M at font\indexpage{internal commands restored}
+% The internal default-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.
+% 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.
 %    \begin{macrocode}
   \else
-    \M at return\thr@@
     \M at toks{}
-    \M at mathfont@firstoptiontrue
 %    \end{macrocode}
-% Use |\@newfont| to load the user's font.\indexpage{log file=\texttt{log} file}
+% 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.
+% \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
 %    \begin{macrocode}
-    \wlog{Package mathfont Info: Loading font #2 with package fontspec.}
-    \expandafter\@newfont\csname M at font\the\M at count\endcsname{}{#2}
+    \M at newfont{#2}
+    \expandafter\edef\csname M at fontfamily@#2\endcsname{\M at f@ntn at me}
+    \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}
+      \advance\M at count\@ne
+    \fi
+    \edef\@tempa{\csname M at fontid@\M at f@ntn at me\endcsname}
 %    \end{macrocode}
 % Expand, zap spaces from, and store the optional argument in |\@tempa|, and then perform the loop. We store the current keyword-suboption pair in |\@i| and then feed it to |\M at parse@option|. We need two |\edef|s here because |\zap at space| appears before |\@tempa| in |\M at eat@spaces|. We expand the argument with the first |\edef| and remove the spaces with the second.
-% \indexpage{parse \texttt{\char`\\mathfont} arguments}\indexpage{parse spaces}
 %    \begin{macrocode}
-    \edef\@tempa{#1}
-    \edef\@tempa{\M at eat@spaces\@tempa}
-    \@for\@i:=\@tempa\do{\expandafter\M at parse@option\@i=\@nil
+    \edef at nospace\@tempb{#1}
+    \@for\@i:=\@tempb\do{\expandafter\M at parse@option\@i=\@nil
       \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{keyword option=keyword options for \texttt{\string\string\string\mathfont}}\indexpage{parse conditionals}
+% 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{if-parser}
+% \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
 %    \begin{macrocode}
-        \expandafter\ifx% next line is two cs to be compared
-              \csname if@\@tempa\expandafter\endcsname\csname iftrue\endcsname
-          \M at CharsSetWarning{\@tempa}
-%    \end{macrocode}
-% The case where the keyword-option has not already been set. This will be (almost) all situations. We begin by punctuating the toks. The |\ifM at mathfont@firstoption| boolean is a bookkeeping variable that determines whether to add a |,| to the list of keywords in |\M at toks|, and |\M at return| counts how many keywords we have added to |\M at toks|. When this number gets high enough, we start a new line.
-%    \begin{macrocode}
+        \expandafter\ifx % next line is two cs to be compared
+          \csname ifM@\@temp at opt\expandafter\endcsname\csname iftrue\endcsname
+          \M at CharsSetWarning{\@temp at opt}
         \else
-          \ifM at mathfont@firstoption
-            \M at mathfont@firstoptionfalse
-          \else
-            \ifnum\M at return>5\relax
-              \expandafter\M at toks\expandafter{\the\M at toks,^^J}
-              \M at return\z@
-            \else
-              \expandafter\M at toks\expandafter{\the\M at toks, }
-            \fi
-          \fi
 %    \end{macrocode}
-% Add the keyword-option to the toks.
+% The case where the current option has not had its math font set. We add the keyword-option to the |\toks|.
 %    \begin{macrocode}
-          \edef\@tempc{\the\M at toks\@tempa}
-          \expandafter\M at toks\expandafter{\@tempc}
+          \edef\@tempc{\the\M at toks^^J\@temp at opt}
+          \M at toks\expandafter{\@tempc}
 %    \end{macrocode}
-% Handle the case with a suboption.
+% If it's present, store the suboption in |\@|\meta{option}|shape| and overwrite the default definition from earlier. Then add the shape information to the toks and store it in |\@tempc|. When it actually sets the font by calling |\M@|\meta{keyword}|@set|, \textsf{mathfont} will determine shape information for the current character class by calling the same |\@|\meta{option}|shape| macro that we store in |\@tempc|.
 %    \begin{macrocode}
           \if at suboptionpresent
-            \expandafter\edef\csname @\@tempa shape\endcsname{\@tempb}
-            \edef\@tempc{\the\M at toks\space(\@tempb)}
-            \expandafter\M at toks\expandafter{\@tempc}
+            \expandafter\edef\csname M@\@temp at opt shape\endcsname{\@temp at sub}
           \fi
-%    \end{macrocode}\indexpage{suboption roman=suboption \texttt{roman}}
+          \edef\@tempc{\the\M at toks\space
+            (\csname M@\@temp at opt shape\endcsname)}
+          \M at toks\expandafter{\@tempc}
+          \edef\@tempc{\csname M@\@temp at opt shape\endcsname}
+%    \end{macrocode}
+% \indexpage{suboption roman=suboption \texttt{roman}}
 % \indexpage{suboption italic=suboption \texttt{italic}}
-% For either possible suboption, check whether the package has already declared that version of the current font for use in math mode using |\@ifundefined|. If not, do so.
+% We store the font shape information in |\@tempb|, specifically |\@tempb| will be the default \textsc{nfss} shape code corresponding to the current suboption. At this point, |\@tempc| is either ``upright'' or ``italic,'' so we temporarily let |\@tempb| be the string ``upright'' and check if it equals |\@tempc|. We redefine |\@tempb| depending on the results.
 %    \begin{macrocode}
-          \def\@tempb{roman}
-          \expandafter\ifx\csname @\@tempa shape\endcsname\@tempb
-            \@ifundefined{symMroman\the\M at count}
-              {\DeclareSymbolFont{Mroman\the\M at count}{TU}
-                {\csname M at font\the\M at count\endcsname}{m}{n}}{}
+          \def\@tempb{upright}
+          \ifx\@tempb\@tempc
+            \let\@tempb\shapedefault
+          \else
+            \let\@tempb\itdefault
           \fi
-          \def\@tempb{italic}
-          \expandafter\ifx\csname @\@tempa shape\endcsname\@tempb
-            \@ifundefined{symMitalic\the\M at count}
-              {\DeclareSymbolFont{Mitalic\the\M at count}{TU}
-                {\csname M at font\the\M at count\endcsname}{m}{it}}{}
+%    \end{macrocode}
+% 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
+            \DeclareSymbolFont
+              {M\@tempc\@tempa}{TU}{\M at f@ntn at me}{\mddefault}{\@tempb}
           \fi
 %    \end{macrocode}
-% Store the new font information so we can write it to the |log| file |\AtBeginDocument|.\indexpage{log file=\texttt{log} file}
+% 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}
 %    \begin{macrocode}
-          \expandafter\edef\csname M@\@tempa @fontinfo\endcsname{#2}
-          \M at anychars@changedtrue
+          \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}
 %    \end{macrocode}
-% And now the magic happens.\indexpage{default font changes}\indexpage{M at keyword@set=\texttt{\char`\\M@}\string\argtext{keyword}\texttt{@set}}
+% And now the magic happens!
+% \indexpage{keyword options=keyword options for \texttt{\char`\\mathfont}}
+% \?\M at upper@set
+% \?\M at lower@set
+% \?\M at diacritics@set
+% \?\M at greekupper@set
+% \?\M at greeklower@set
+% \?\M at agreekupper@set
+% \?\M at agreeklower@set
+% \?\M at cyrillicupper@set
+% \?\M at cyrilliclower@set
+% \?\M at hebrew@set
+% \?\M at digits@set
+% \?\M at operator@set
+% \?\M at delimiters@set
+% \?\M at radical@set
+% \?\M at bigops@set
+% \?\M at extbigops@set
+% \?\M at symbols@set
+% \?\M at extsymbols@set
+% \?\M at arrows@set
+% \?\M at bb@set
+% \?\M at cal@set
+% \?\M at frak@set
+% \?\M at bcal@set
+% \?\M at bfrak@set
 %    \begin{macrocode}
-          \M at FontChangeInfo{\@tempa}{#2}
-          \csname M@\@tempa @set\endcsname% set default font
-          \csname @\@tempa true\endcsname% set switch to true
+          \csname M@\@temp at opt @set\endcsname % set default font
+          \csname M@\@temp at opt true\endcsname % set switch to true
         \fi
       \fi}
 %    \end{macrocode}
-% Finally, advance |\M at count| and display messages for the user.\indexpage{log file=\texttt{log} file}
+% Display concluding messages for the user.
+% \indexpage{log file=\texttt{log} file}
+% \indexpage{terminal}
 %    \begin{macrocode}
-    \advance\M at count\@ne
     \edef\@tempa{\the\M at toks}
     \ifx\@tempa\@empty
       \wlog{The \string\mathfont\space command on line \the\inputlineno\space
         did not change the font for any characters!}
     \else
-      \typeout{:: mathfont :: Math font set to #2\space
+      \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^^J}
     \fi
   \fi}
 \@onlypreamble\mathfont
@@ -913,17 +1414,61 @@
 \@onlypreamble\m at thf@nt
 \@onlypreamble\@mathfont
 %    \end{macrocode}
-% We end the section by coding |\setfont|.\indexpage{optional package argument}
+% The |\setfont| command will call |\mathfont| and set the text font.
 %    \begin{macrocode}
-\def\setfont#1{\setmainfont[Ligatures=TeX]{#1}\mathfont{#1}}
+\protected\def\setfont#1{%
+  \mathfont{#1}
+  \mathconstantsfont{#1}
+  \setmathfontcommands{#1}
+  \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.
+%    \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}
+    \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}
+%    \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}
+      \fi
+%    \end{macrocode}
+% After initializing |\M at SetMathConstants| if necessary, we store the \textsc{nfss} family name in |\m at th@const at nts@font|.
+%    \begin{macrocode}
+      \let\m at th@const at nts@font\@tempa
+    \fi}
+  \let\M at SetMathConstants\relax
+  \def\math at fonts{\aftergroup\M at SetMathConstants}
+  \@onlypreamble\mathconstantsfont
+\fi
+%    \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{Alphanumeric Symbols}
+% \section{Letterlike Symbols}
 % 
-% Each |\define@|\argtext{keyword} macro redefines one of the standard |\math|\argtext{keyword} commands. The new versions first check if they are in math mode using |\M at check@mode| and then scan all tokens of their argument using |\@tfor|. For each token, the macro calls  |\M@|\argtext{keyword}|@|\argtext{token}, which evaluates to a |\mathord| symbol in the desired style.\indexpage{alphanumeric 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%
@@ -931,8 +1476,8 @@
     \expandafter\@tempa
   \else
 %    \end{macrocode}
-% Temporarily change the escape character code to $-1$ so we can gobble the |@| in |@math|\argtext{keyword} without worrying about the escape character. We need to do this for error messaging purposes because |\M at HModeError| displays the user-level command that caused the error. Finally, the package adds a missing |$| in order to enter math mode.
-% \indexpage{missing \$=missing \texttt\$ inserted}\indexpage{error checking}
+% 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
@@ -939,47 +1484,48 @@
       \expandafter
     \egroup
     \expandafter\M at HModeError\csname\expandafter\@gobble\string#1\endcsname
-    \leavevmode\expandafter$\expandafter\@tempa
+    \expandafter$\expandafter\@tempa
   \fi}
 %    \end{macrocode}
-% The |\M at process@tokens| macro turns the letters into alphanumeric symbols. This macro loops through the argument of the original |\math|\argtext{keyword} macro with |\@tfor| and calls |\M at check@token| on each |\@k| to validate the input. If the \textit{token} is valid, \TeX\ calls the corresponding |\M@|\argtext{keyword}|@|\argtext{token} math character command, and if not, |\M at check@token| will issue an error.
+% 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}{#2}%
+    \expandafter\M at check@token\expandafter{\@k}%
 %    \end{macrocode}
-% And typeset the character. Error checking has set |\ifM at arg@good| to either true or false depending on whether |\@k| is a valid input or not.
+% Now that |\M at check@token| has set |\M at errcode|, we either typeset |\@k| or raise an error.
 %    \begin{macrocode}
-  \ifM at arg@good
-    \csname M@#2@\@k\endcsname
-  \fi}}
+    \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 argument |#2| is a keyword that goes into warning messages. 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} switches |\ifM at arg@good| from true to false and skips the remaining steps.\indexpage{multiple characters warning}\indexpage{error checking}
+% 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#2{%
-  \M at arg@goodtrue
-  \M at check@arglength#1\@nil\M at DoubleArgWarning{\csname math#2\endcsname}%
-  \ifM at arg@good% good
+\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 NestedArgWarning{#1}{\csname math#2\endcsname}%
-      \M at arg@goodfalse
+      \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 ControlSequenceArgWarning{#1}{\csname math#2\endcsname}%
-      \M at arg@goodfalse
+        \M at errcode\tw@
       \else
 %    \end{macrocode}
 % Check that |#1| is a letter.
 %    \begin{macrocode}
-        \ifcat a#1% good
+        \ifnum\catcode`#1=11\relax% good
         \else
 %    \end{macrocode}
 % Finally, check that |#1| is a digit.
@@ -1004,12 +1550,7 @@
                           \else
                             \if 9#1% good
                             \else
-%    \end{macrocode}
-% If all checks fail, issue a warning and switch |\ifM at arg@good| to false.
-%    \begin{macrocode}
-                              \M at CharacterArgWarning
-                                {#1}{\csname math#2\endcsname}%
-                              \M at arg@goodfalse
+                              \M at errcode\thr@@
                             \fi
                           \fi
                         \fi
@@ -1023,141 +1564,259 @@
         \fi
       \fi
     \fi
+  \else% matches the original \ifx\@nnil, etc.
+    \M at errcode=4\relax
   \fi}
 %    \end{macrocode}
-% Now initialize the five commands. We start with the blackboard-bold font-changing command.\indexpage{keywordbb=keyword \texttt{bb}}
+% 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{%
-  \def\mathbb{\M at check@mode\@mathbb}%
+  \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{%
-  \def\mathcal{\M at check@mode\@mathcal}%
+  \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{%
-  \def\mathfrak{\M at check@mode\@mathfrak}%
+  \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{%
-  \def\mathbcal{\M at check@mode\@mathbcal}%
+  \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{%
-  \def\mathbfrak{\M at check@mode\@mathbfrak}%
+  \protected\def\mathbfrak{\M at check@mode\@mathbfrak}%
   \def\@mathbfrak##1{\M at process@tokens{##1}{bfrak}}}
 %    \end{macrocode}
 % 
-% \break\section{Local Font Changes}\indexpage{local font changes}
+% \section{Local Font Changes}\indexpage{local font changes}
 % 
-% The general |\newmathfontcommand| macro creates commands that locally change the math font. This macro creates a new math alphabet, and it stores that alphabet in the user-provided control sequence. The way |\M at check@csarg| scans the following tokens is a bit tricky. For error messaging purposes, its first argument should be the control sequence that called it. Error checking happens in two stages: (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, the macro passes it to |\@newmathfontcommand|, which behaves like |\DeclareMathAlphabet|, and if the error checking is unsuccessful, the command gobbles the next two arguments in the input stream.\?\M at check@csarg\indexpage{log file=\texttt{log} file}\indexpage{multiple characters error}\indexpage{missing control sequence}\indexpage{error checking}
+% 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#3{%
-  \M at arg@goodtrue
-  \M at check@arglength#2\@nil\M at DoubleArgError{#1}
-  \ifM at arg@good% good
+\def\M at check@csarg#1#2{%
+  \expandafter\ifx\expandafter\@nnil\@gobble#2\@nnil% good
     \ifcat\relax\noexpand#2% good
+      \M at arg@goodtrue
     \else
-      \M at MissingControlSequenceError{#1}{#2}
+      \M at MissingControlSequenceError#1{#2}
       \M at arg@goodfalse
     \fi
-  \fi
-  \ifM at arg@good
-    \def\@tempa{#2}
-    \wlog{Package mathfont Info: Loading font #3 with package fontspec.}
-    \@newfont\@tempb{}{#3}
-    \expandafter\@newmathfontcommand
   \else
-    \expandafter\@gobbletwo
+    \M at DoubleArgError#1{#2}
+    \M at arg@goodfalse
   \fi}
-\@onlypreamble\M at check@csarg
 %    \end{macrocode}
-% Now declare the math alphabet. This macro has just two parameters because we call it inside |\M at check@csarg| when |\@tempa| and |\@tempb| already have definitions.\?\newmathfontcommand
+% Now declare the math alphabet. This macro first checks that its |#1| argument is a control sequence using |\M at check@csarg|. If yes, we feed the |#2| argument to |\M at newfont| for loading, print a message in the |log| file, and call |\DeclareMathAlphabet|.
 %    \begin{macrocode}
-\def\@newmathfontcommand#1#2{%
-  \expandafter\M at NewFontCommandInfo\expandafter
-    {\@tempa}{\@tempb}{#1}{#2}
-  \expandafter\DeclareMathAlphabet\expandafter
-    {\@tempa}{TU}{\@tempb}{#1}{#2}}
-\def\newmathfontcommand{\M at check@csarg\newmathfontcommand}
-\@onlypreamble\@newmathfontcommand
+\protected\def\newmathfontcommand#1#2#3#4{%
+  \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}
+  \fi}
 \@onlypreamble\newmathfontcommand
 %    \end{macrocode}
-% Then provide the four default versions.\indexpage{default local font-change commands}\?\newmathrm\?\newmathit\?\newmathbf\?\newmathbfit
+% Then define macros that create local font-changing commands with default series and shape information. Because they're all so similar, we metacode them. We define the commands themselves with |\define at newmath@cmd|. The argument structure is: |#1|---|\newmath|\meta{key} macro name; |#2|---font series; |#3|---font shape; |##1|---the control sequence that the user will specify; and |##2|---the user's font information. We feed |##1|, |##2|, |#2|, and |#3| to |\newmathfontcommand|, and we load |##2| with |\M at newfont|. Each |\newmath|\meta{key} macro will check its first argument using |\M at check@csarg| and then call |\newmathfontcommand| on both of its two arguments. We store the list of |\newmath|\meta{key} commands that we want to define with their series and shape information in |\M at default@newmath at cmds|, and we loop through it with |\@for|.
 %    \begin{macrocode}
-\def\newmathrm#1#2{\M at check@csarg\newmathrm{#1}{#2}
-  {\mddefault}{\updefault}}
-\def\newmathit#1#2{\M at check@csarg\newmathit{#1}{#2}
-  {\mddefault}{\itdefault}}
-\def\newmathbf#1#2{\M at check@csarg\newmathbf{#1}{#2}
-  {\bfdefault}{\updefault}}
-\def\newmathbfit#1#2{\M at check@csarg\newmathbfit{#1}{#2}
-  {\bfdefault}{\itdefault}}
+\def\M at define@newmath at cmd#1#2#3{%
+  \protected\def#1##1##2{%
+    \M at check@csarg{#1}{##1}
+    \newmathfontcommand{##1}{##2}{#2}{#3}}}
+\def\M at default@newmath at cmds{%
+  \newmathrm{\mddefault}{\shapedefault},%
+  \newmathit{\mddefault}{\itdefault},%
+  \newmathbf{\bfdefault}{\shapedefault},%
+  \newmathbfit{\bfdefault}{\itdefault},%
+  \newmathsc{\mddefault}{\scdefault},%
+  \newmathscit{\mddefault}{\scdefault\itdefault},%
+  \newmathbfsc{\bfdefault}{\scdefault},%
+  \newmathbfscit{\bfdefault}{\scdefault\itdefault}}
+\@for\@i:=\M at default@newmath at cmds\do{\expandafter\M at define@newmath at cmd\@i}
 \@onlypreamble\newmathrm
 \@onlypreamble\newmathit
 \@onlypreamble\newmathbf
 \@onlypreamble\newmathbfit
+\@onlypreamble\newmathsc
+\@onlypreamble\newmathscit
+\@onlypreamble\newmathbfsc
+\@onlypreamble\newmathbfscit
+\@onlypreamble\M at define@newmath at cmd
+\let\M at default@newmath at cmds\relax
 %    \end{macrocode}
-% We provide |\newmathbold| and |\newmathboldit| for backwards compatibility but issue a warning.\indexpage{depreciated}
+% The command |\setmathfontcommands| sets all the default local font-change commands at once.
 %    \begin{macrocode}
-\def\newmathbold{%
-  \M at DepreciatedWarning\newmathbold\newmathbf
+\protected\def\setmathfontcommands#1{%
+  \newmathrm\mathrm{#1}
+  \newmathit\mathit{#1}
+  \newmathbf\mathbf{#1}
+  \newmathbfit\mathbfit{#1}
+  \newmathsc\mathsc{#1}
+  \newmathscit\mathscit{#1}
+  \newmathbfsc\mathbfsc{#1}
+  \newmathbfscit\mathbfscit{#1}}
+\@onlypreamble\setmathfontcommands
+%    \end{macrocode}
+% We provide |\newmathbold| and |\newmathboldit| for backwards compatibility but issue a warning.
+%    \begin{macrocode}
+\protected\def\newmathbold{%
+  \M at DeprecatedWarning\newmathbold\newmathbf
   \newmathbf}
-\def\newmathboldit{%
-  \M at DepreciatedWarning\newmathboldit\newmathbfit
+\protected\def\newmathboldit{%
+  \M at DeprecatedWarning\newmathboldit\newmathbfit
   \newmathbfit}
 %    \end{macrocode}
 % 
-% \section{Concluding Material}
+% \section{Miscellaneous Material}
 % 
-% Provide the command to reset macros.\indexpage{LaTeX kernel=\LaTeX\ kernel}\indexpage{internal commands restored}
+% 
+% 
+% We begin this section with the user-level macros that provide information for Lua-based font adjustments. If font adjustments are allowed, we begin with a macro |\M at check@int| that passes the user's argument to Lua and determines whether it is an integer. We check whether the argument contains a backslash or quote mark similar to error checking later in |\CharmLine|. Depending on the result, \textsf{mathfont} sets |\ifM at arg@good| to true or false.
 %    \begin{macrocode}
-\def\restoremathinternals{%
-  \ifx\set at mathchar\@@set at mathchar
-  \else
-    \M at RestoreInternalsInfo
-  \fi
-  \let\set at mathchar\@@set at mathchar
-  \let\set at mathsymbol\@@set at mathsymbol
-  \let\set at mathaccent\@@set at mathaccent}
+\ifM at adjust@font
+  \def\M at check@int#1{%
+  \M at arg@goodfalse
+  \begingroup
+  \edef\@tempa{\number0#1}
+  \edef\@tempa{\detokenize\expandafter{\@tempa}}
+  \@expandtwoargs\in@{"}{\@tempa}
 %    \end{macrocode}
-% We write to the |log| file |\AtBeginDocument| all font changes carried out by \textsf{mathfont}.\indexpage{log file=\texttt{log} file}\indexpage{parse conditionals}
+% If |#1| contains a |"| or backslash, we set |\M at arg@good| to false and stop parsing the argument.
 %    \begin{macrocode}
-\def\keyword at info@begindocument#1{%
-  \expandafter\ifx% next line is two cs to be compared
-        \csname if@#1\expandafter\endcsname\csname iftrue\endcsname
-    \wlog{Keyword #1: Set to \csname M@#1 at fontinfo\endcsname\space with
-      \csname @#1shape\endcsname\space shape.}
+  \ifin@ % is " in #1?
+    \endgroup % first branch \endgroup
   \else
-    \wlog{Keyword #1: No change.}
+    \@expandtwoargs\in@{\@backslashchar}{\@tempa}
+    \ifin@ % is \ in #1?
+      \endgroup % second branch \endgroup
+    \else
+      \directlua{
+      local num = tonumber("\@tempa")
+      if num then % if number?
+        if num == num - (num \@percentchar 1) then % if integer?
+          if num >= 0 then % if nonnegative?
+            tex.print("\@backslashchar\@backslashchar endgroup%
+              \@backslashchar\@backslashchar M at arg@goodtrue")
+          end
+        end
+      end}
+    \fi
   \fi}
-\AtBeginDocument{%
-  \ifM at anychars@changed
-    \edef\@tempa{\@normalkeys,\@alphanumkeys}
-    \wlog{^^J:: mathfont :: List of fonts changed by mathfont:}
-    \@for\@i:=\@tempa\do{%
-      \expandafter\keyword at info@begindocument\expandafter{\@i}}
-    \wlog{}
+%    \end{macrocode}
+% Define |\RuleThicknessFactor|.
+%    \begin{macrocode}
+  \def\RuleThicknessFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at rule@thickness at factor=#1\relax
+    \else
+      \M at BadIntegerError\RuleThicknessFactor{#1}
+    \fi}
+%    \end{macrocode}
+% Define |\IntegralItalicFactor|.
+%    \begin{macrocode}
+  \def\IntegralItalicFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at integral@italic at factor=#1\relax
+    \else
+      \M at BadIntegerError\IntegralItalicFactor{#1}
+    \fi}
+%    \end{macrocode}
+% Define |\SurdHorizontalFactor|.
+%    \begin{macrocode}
+  \def\SurdHorizontalFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at surd@horizontal at factor=#1\relax
+    \else
+      \M at BadIntegerError\SurdHorizontalFactor{#1}
+    \fi}
+%    \end{macrocode}
+% Define |\SurdVerticalFactor|.
+%    \begin{macrocode}
+  \def\SurdVerticalFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at surd@vertical at factor=#1\relax
+    \else
+      \M at BadIntegerError\SurdVerticalFactor{#1}
+    \fi}
+%    \end{macrocode}
+% If automatic font adjustments are disabled, we should also disable the related user-level commands. In this case, each of the font-adjustment macros expands to raise an |\M at NoFontAdjustError| and gobble its argument.
+%    \begin{macrocode}
+\else
+  \@tfor\@i:=\RuleThicknessFactor\IntegralItalicFactor\SurdHorizontalFactor
+    \SurdVerticalFactor\CharmLine\CharmFile\mathconstantsfont
+      \do{%
+        \expandafter\edef\@i{\noexpand\M at NoFontAdjustError
+          \expandafter\noexpand\@i
+          \noexpand\@gobble}}
+\fi
+%    \end{macrocode}
+% These commands should appear in the preamble only.
+%    \begin{macrocode}
+\@onlypreamble\RuleThicknessFactor
+\@onlypreamble\IntegralItalicFactor
+\@onlypreamble\SurdHorizontalFactor
+\@onlypreamble\SurdVerticalFactor
+\@onlypreamble\CharmLine
+\@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.
+%    \begin{macrocode}
+\def\restoremathinternals{%
+  \ifx\set at mathchar\@@set at mathchar
   \else
-    \wlog{^^J:: mathfont :: No fonts were changed by mathfont.^^J}
+    \wlog{Package mathfont Info: Restoring \string\set at mathchar.}
+    \wlog{Package mathfont Info: Restoring \string\set at mathsymbol.}
+    \wlog{Package mathfont Info: Restoring \string\set at mathaccent.}
+    \wlog{Package mathfont Info: Restoring \string\DeclareSymbolFont.}
+    \let\set at mathchar\@@set at mathchar
+    \let\set at mathsymbol\@@set at mathsymbol
+    \let\set at mathaccent\@@set at mathaccent
+    \let\DeclareSymbolFont\@@DeclareSymbolFont
   \fi}
 %    \end{macrocode}
-% Some fonts do not contain characters that \textsf{mathfont} can declare as math symbols. We want to make sure that if this happens, \TeX\ prints a message in the |log| file.\indexpage{log file=\texttt{log} file}
+% Three macros used in defining |\simeq| and |\cong|. The construction is clunky and needs the intermediate macro |\st at ck@fl at trel| because |\mathchoice| is a bit of an odd macro. Instead of expanding to different replacement text depending on the math style, it fully typesets each of its four arguments and then takes the one corresponding to the correct style. A cleaner implementation would use |\mathstyle| from Lua\TeX---perhaps in a future version. 
 %    \begin{macrocode}
-\tracinglostchars=1
+  \protected\gdef\clap#1{\hb at xt@\z@{\hss#1\hss}}
+  \protected\def\stack at flatrel#1#2{\expandafter
+    \st at ck@fl at trel\expandafter#1\@firstofone#2}
+  \protected\gdef\st at ck@fl at trel#1#2#3{%
+    {\setbox0\hbox{$\m at th#1#2$}% contains \mathrel symbol
+    \setbox1\hbox{$\m at th#1#3$}% gets raised over \box0
+    \if\wd0>\wd1\relax
+      \hb at xt@\wd0{%
+        \hfil
+        \clap{\raise0.7\ht0\box1}%
+        \clap{\box0}\hfil}%
+    \else
+      \hb at xt@\wd1{%
+        \hfil
+        \clap{\raise0.7\ht0\box1}%
+        \clap{\box0}\hfil}%
+    \fi}}
 %    \end{macrocode}
-% Warn the user about possible problems with a multi-word optional argument in \XeTeX.\indexpage{XeTeX=\XeTeX}
+% Some fonts do not contain characters that \textsf{mathfont} can declare as math symbols. We want to make sure that if this happens, \TeX\ prints a message in the |log| file and terminal.\indexpage{log file=\texttt{log} file}\indexpage{terminal}
 %    \begin{macrocode}
-\ifx\XeTeXrevision\@undefined
-\else
+\ifnum\tracinglostchars<\tw@
+  \tracinglostchars\tw@
+\fi
+%    \end{macrocode}
+% Warn the user about possible problems with a multi-word optional package argument in \XeTeX.
+%    \begin{macrocode}
+\ifdefined\XeTeXrevision
   \ifM at font@loaded
     \AtEndOfPackage{%
     \PackageWarningNoLine{mathfont}
@@ -1166,56 +1825,85 @@
     mathfont. If you run into problems\MessageBreak
     with a font whose name is multiple\MessageBreak
     words, try compiling with LuaLaTeX\MessageBreak
-    instead or call \string\setfont\space
-    or \string\mathfont\MessageBreak manually}}
+    or call \string\setfont\space or \string\mathfont\MessageBreak
+    manually}}
   \fi
 \fi
 %    \end{macrocode}
-% If the user passed a font name to \textsf{mathfont}, we set it as the default |\AtEndOfPackage|.\indexpage{optional package argument}\indexpage{default font changes}
+% 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}}
 %    \begin{macrocode}
-\ifM at font@loaded
-  \AtEndOfPackage{%
-  \setfont\M at font@load
-  \newmathrm\mathrm\M at font@load
-  \newmathit\mathit\M at font@load
-  \newmathbf\mathbf\M at font@load
-  \newmathbfit\mathbfit\M at font@load}
-\fi
-%    \end{macrocode}
-% Warn the user about possible cosmetic issues arising from a clash with the |align| environment from the \textsf{amsmath} package.\indexpage{amsmath=\textsf{amsmath}}
-%    \begin{macrocode}
 \AtBeginDocument{%
-  \if at bb
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathbb\space may be duplicated\MessageBreak
-    inside the align environment}}{}
+  \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
-  \if at cal
+  \expandafter\egroup\if at tempswa
     \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathcal\space may be duplicated\MessageBreak
-    inside the align environment}}{}
-  \fi
-  \if at frak
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathfrak\space may be duplicated\MessageBreak
-    inside the align environment}}{}
-  \fi
-  \if at bcal
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathbcal\space may be duplicated\MessageBreak
-    inside the align environment}}{}
-  \fi
-  \if at bfrak
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathbfrak\space may be duplicated\MessageBreak
-    inside the align environment}}{}
+    {\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
+    \wlog{#1:#2\@spaces Set to
+      \csname M@#1 at fontinfo\endcsname,
+      \csname M@#1shape\endcsname\space shape.}
+  \else
+    \wlog{#1:#2\@spaces No change.}
+  \fi}
+%    \end{macrocode}
+% Now print the messages.
+%    \begin{macrocode}
+\AtBeginDocument{%
+  \def\@tempa{%    <---- everything should be 13 characters long plus :
+    upper:\@spaces\@spaces,%
+    lower:\@spaces\@spaces,%
+    diacritics:\space\space\space,%
+    greekupper:\space\space\space,%
+    greeklower:\space\space\space,%
+    agreekupper:\space\space,%
+    agreeklower:\space\space,%
+    cyrillicupper:,%
+    cyrilliclower:,%
+    hebrew:\@spaces\space\space\space,%
+    digits:\@spaces\space\space\space,%
+    operator:\@spaces\space,%
+    delimiters:\space\space\space,%
+    radical:\@spaces\space\space,%
+    bigops:\@spaces\space\space\space,%
+    extbigops:\@spaces,%
+    symbols:\@spaces\space\space,%
+    extsymbols:\space\space\space,%
+    arrows:\@spaces\space\space\space,%
+    bb:\@spaces\@spaces\space\space\space,%
+    cal:\@spaces\@spaces\space\space,%
+    frak:\@spaces\@spaces\space,%
+    bcal:\@spaces\@spaces\space,%
+    bfrak:\@spaces\@spaces}
+  \wlog{^^JPackage mathfont Info: List of changes made in the preamble---}
+  \@for\@i:=\@tempa\do{%
+    \expandafter\keyword at info@begindocument\@i\@nil}
+  \wlog{}}
+%    \end{macrocode}
+% If the user passed a font name to \textsf{mathfont}, we set it as the default |\AtEndOfPackage|.
+%    \begin{macrocode}
+\ifM at font@loaded
+  \AtEndOfPackage{\setfont\M at font@load}
+\fi
+%    \end{macrocode}
 % Finally, make all character-setting commands inaccessible outside the preamble.
 %    \begin{macrocode}
 \@onlypreamble\M at upper@set
@@ -1243,388 +1931,2106 @@
 \@onlypreamble\M at bfrak@set
 %    \end{macrocode}
 %
+% 
+% 
+% 
+% 
+% 
+% \section{Adjust Fonts: Setup}
+% 
+% 
+% 
+% 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:
+% \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.
+% \item Write functions that accept a fontdata object and (a) change top-level math specs to indicate that we have a math function; (b) alter characters according to our Lua table of new metric information; and (c) populate a MathConstants table for the font.
+% \item Create callbacks that call these functions. Insert them into |luaotfload.patch_font|.
+% \end{enumerate}
+% Step 2 happens on the \TeX\ side of things and is documented next, and everything else happens inside |\directlua|. On the Lua side of things, we store all the functions and character metric information in the table |mathfont|. Every entry in mathfont is a function or is a subtable indexed within |mathfont| by an \meta{integer}. The \textit{integer} is a unicode encoding number and tells which unicode character the subtable keeps track of. See tables~2 and 3 for a list of the functions in |mathfont| and the fields in character subtables. See section 11 for discussion of the callbacks for editing fontdata objects.
+% 
+% 
+% \begin{figure}[t]
+% \centerline{\bfseries Table 2: Fields of Character Subtables in |mathfont|\strut}
+% \begin{tabularx}\textwidth{lllllX}\toprule
+% Field & Data Type & In |a|? & In |e|? & In |u|? & Used For\\\midrule
+% |type| & string & Yes & Yes & Yes & Tells if type |a|, |e|, |u|\\
+% |next| & depends & Yes & Yes & No & Unicode index of next-larger character(s);
+%                                     integer for type |a|, table for type |u|\\
+% |left_stretch| & numeric & Yes & No & No & Stretch bounding box left\\
+% |right_stretch| & numeric & Yes & No & No & Stretch bounding box right\\
+% |top_accent_stretch| & numeric & Yes & Yes & Yes & Position top accent\\
+% |bot_accent_stretch| & numeric & Yes & Yes & Yes & Position bottom accent\\
+% |total_variants| & integer & No & Yes & No & Number of large variants\\
+% |smash| & integer & No & Yes & No & Unicode index for storing a smashed version\\
+% |data| & table & No & Yes & No & Scale factors\\\bottomrule
+% \end{tabularx}
+% \end{figure}
+% 
+% 
+% \begin{figure}[t]
+% \centerline{\bfseries Table 3: Functions in |mathfont|\strut}
+% \begin{tabularx}\textwidth{llX}\toprule
+% Function & Argument(s) & Used For\\\midrule
+% |new_type_a| & |index|, |next|, data & Add type |a| entry to |mathfont|\\
+% |new_type_e| & |index|, |smash|, |next|, data & Add type |e| entry to |mathfont|\\
+% |new_type_u| & |index|, |smash|, |next|, data & Add type |u| entry to |mathfont|\\\midrule
+% |add_to_charm| & string of new charm info & Add new charm into to |mathfont|\\
+% |parse_charm| & string of new charm info & Split the string, validate inputs\\\midrule
+% |empty| & none & Does nothing\\
+% |glyph_info| & character subtable & Return height, width, depth, italic\\
+% |make_a_commands| & |index|, offset & Return virtual font commands\\
+% |make_a_table| & |index|, charm data, fontdata & Make new character table for type |a|\\
+% |make_e_commands| & |index|, scale factors & Return virtual font commands\\
+% |make_e_table| & |index|, charm data, fontdata & Make new character table for type |e|\\
+% |make_hex_value| & integer & Return hexadecimal string\\
+% |make_u_commands| & |index|, offset & Return virtual font commands\\
+% |make_u_table| & |index|, charm data, fontdata & Make new character table for type |u|\\
+% |modify_e_base| & |index|, offset & Modify base glyph for type |e|\\
+% |smash_glyph| & |index|, fontdata & Return table for smashed character\\\midrule
+% |adjust_font| & fontdata & Call callbacks\\
+% |apply_charm_info| & fontdata & Change character metrics in fontdata\\
+% |get_font_name| & fontdata & Return font name\\
+% |info| & string & Writes a message in the |log| file\\
+% |math_constants| & fontdata & Creates a MathConstants table\\
+% |set_nomath_true| & fontdata & Set top-level font specs for math\\\bottomrule
+% \end{tabularx}
+% \end{figure}
+% 
+% Changing top-level flags in a font object is straightforward. Creating a MathConstants table is complicated but largely self-contained. We take a few parameters that the user has set, define traditional \TeX\ math parameters based on the essential parameters of the font, and assign their values to corresponding entries in a MathConstants table. However, editing character metrics is convoluted with many moving parts. For every glyph that we want modify when \TeX\ loads a text font, we store character metric information about that glyph as a subtable in |mathfont|. The entries of the subtable describe how to stretch the glyph bounds, scale the glyph itself, or determine math accent placement. For characters of type |u|, we only specify accent placement. For characters of type |a|, which is the upper and lower-case Latin letters, we stretch the bounding box of the glyph horizontally to widen the letters slightly. When we load a text font, we create 52 virtual characters in the Unicode Supplementary Private Use Area-A that typeset the Latin letter glyphs in elongated bounding boxes, and later in \textsf{mathfont}, we set the mathcodes of Latin letters to be these virtual characters. For type |e|, we do the same thing except that for each character, we create an ensamble of scaled versions, which we use as a family of large variants.
+% 
+% Here's how to think about the dynamics of our approach. We use character metric information at three different times: pre-processing, interim processing, and post-processing. In pre-processing, which we implement in this section, we assemble initial character metric information into entries in |mathfont|. In other words, pre-processing means creating the initial |mathfont| subtables and happens during package loading. Interim processing means the user altering entries in |mathfont| and happens through |\CharmLine| and |\CharmFile|. This can occur at any point in the pramble. In post-processing, which we implement in the next section, \textsf{mathfont} extracts information from the current state of the |mathfont| table and uses it to alter a fontdata object. Post-processing happens through the |luaotfload.patch_font| callback and occurs once at the point when \TeX\ loads the font file. As a rule, \LaTeX\ does not like to load fonts before it uses them, so post-processing typically happens |\AtBeginDocument| in the case of the main text font or whenever the user calls a |\text|\meta{font keyword} command or enters math mode, whichever happens first. This is also why you cannot adjust fonts that \TeX\ loaded before \textsf{mathfont}.
+% 
+% 
+% We set |mathnolimitsmode| to 4 to make integral signs look nice. Or at least nicer than they would otherwise.
+%    \begin{macrocode}
+\ifM at adjust@font
+\mathnolimitsmode=4\relax
+%    \end{macrocode}
+% We need some error messages. We change the catcode of \expandafter|\textbackslash| to 12 in order to use it freely as a Lua escape character. We change |~| to catcode 0 to define the macros.
+%    \begin{macrocode}
+\bgroup
+  \catcode`\~=0
+  ~catcode`~\=12
+  ~@firstofone{
+~egroup
+~def~M at number@ssert{"\n%
+  Package mathfont error: Nonnumeric charm value.\n\n%
+  I'm having trouble with a character metric.\n%
+  Your \\CharmLine or \\CharmFile contains \""..temp_string.."\"\n%
+  which is not a number. Make sure that your\n%
+  charm information is all integers, floats,\n%
+  or asterisks separated by commas or spaces.\n"}
+~def~M at index@ssert{"\n%
+  Package mathfont error: Invalid unicode index.\n\n%
+  The unicode index \""..split_string[1].."\" is invalid. Make sure\n%
+  that the first number in your \\CharmLine and in each\n%
+  line of your \\CharmFile is an integer between 0 and\n%
+  1,114,111.\n"}
+~def~M at entries@ssert{"\n%
+  Package mathfont error: Charm values too short.\n\n%
+  Your charm information for U+"..index.." needs more\n%
+  entries. Right now you have "..number_of_entries.." entries, and\n%
+  you need at least "..entries_needed..". If you aren't sure what\n%
+  to do, try adding asterisks to your \\CharmLine\n%
+  or line in your \\CharmFile.\n"}}
+%    \end{macrocode}
+% The user inputs charm information at the \TeX\ level. We define the macros |\CharmLine| that interfaces with |mathfont:add_to_charm| directly and |\CharmFile| that reads lines from a file and individually feeds them to |\CharmLine|. For |\CharmLine|, we check that the argument contains no |"| or \expandafter|\textbackslash| symbols because that could mess up the Lua parsing.
+%    \begin{macrocode}
+\protected\def\CharmLine#1{%
+  \begingroup
+  \edef\@tempa{#1}
+  \edef\@tempa{\detokenize\expandafter{\@tempa}}
+  \@expandtwoargs\in@{"}{\@tempa}
+%    \end{macrocode}
+% If |#1| contains a |"|, we issue an error. The error help message is different depending on whether the |\CharmLine| came from a call to |\CharmFile| or not, which we check with |\ifM at fromCharmFile|.
+%    \begin{macrocode}
+  \ifin@ % is " in #1?
+    \ifM at fromCharmFile
+      \M at ForbiddenCharmFile{"}
+    \else
+      \M at ForbiddenCharmLine{"}
+    \fi
+  \else
+    \@expandtwoargs\in@{\@backslashchar}{\@tempa}
+    \ifin@ % is \ in #1?
+      \ifM at fromCharmFile
+        \M at ForbiddenCharmFile{\@backslashchar}
+      \else
+        \M at ForbiddenCharmLine{\@backslashchar}
+      \fi
+    \else
+%    \end{macrocode}
+% If |#1| does not contain a quotation mark or escape char, we feed it to |mathfont:add_to_charm| as a string.
+%    \begin{macrocode}
+      \directlua{mathfont:add_to_charm("\@tempa")}
+    \fi
+  \fi
+  \endgroup}
+%    \end{macrocode}
+% The argument of |\CharmFile| should be a valid filename, and we open it in |\M at Charm|. The |\M at fromCharmFiletrue| command sets the boolean for an open charm file to true. This command and the corresponding false command are global because of how the kernel defines |\newif|. We can't check |\ifeof\M at Charm| because during processing of the last line from |\M at Charm|, we are at the end of the file even though it is still open.
+%    \begin{macrocode}
+\protected\def\CharmFile#1{%
+  \begingroup
+  \M at fromCharmFiletrue
+  \immediate\openin\M at Charm{#1}
+%    \end{macrocode}
+% The macro |\@next| will read a line in |#1|, feed it to |\CharmLine|, and call itself if the file has more lines.
+%    \begin{macrocode}
+  \def\@next{%
+    \read\M at Charm to \@tempa
+    \CharmLine\@tempa
+    \ifeof\M at Charm\else % if file has more lines?
+      \expandafter\@next
+    \fi}
+%    \end{macrocode}
+% Call |\@next|, close the file, and end the group.
+%    \begin{macrocode}
+  \@next
+  \immediate\closein\M at Charm
+  \M at fromCharmFilefalse
+  \endgroup}
+%    \end{macrocode}
+% This concludes the \TeX-based portion of font adjustments. The rest of this and the next two sections is the Lua script that adapts a text font for math mode. First, we create the |mathfont| table.
+%    \begin{macrocode}
+\directlua{
+mathfont = {}
+%    \end{macrocode}
+% Each character whose metrics we want to change will have one of three types: |a| for alphabet, |e| for extensible, and |u| for (other) unicode. (We don't really create extensibles---type |e| means any character that we need artificially larger sizes for.) We begin with type |a|. The |index| is the base-10 unicode value of the character that we will later modify, and |next| is the base-10 unicode value of the slot we will use to store the modified glyph. The |data| variable is a table with 4 entries that stores sizing information and information regarding accent placement. We divide the information by 1000 as is standard in \TeX.
+%    \begin{macrocode}
+function mathfont:new_type_a(index, next, data)
+  self[index] = {}
+  self[index].type = "a"
+  self[index].next = next
+  self[index].left_stretch = data[1] / 1000
+  self[index].right_stretch = data[2] / 1000
+  self[index].top_accent_stretch = data[3] / 1000
+  self[index].bot_accent_stretch = data[4] / 1000
+end
+%    \end{macrocode}
+% Initializing type |e| characters is more complicated. The |index| argument is the base-10 unicode value of the caracter we will modify. The |smash| value is a unicode slot where we will store a smashed version of the glyph with no height, depth, or width, which we need to scale the glyph correctly. We use |next| and |data| to add large variants of characters to the font. Specifically, |next| is a table of unicode slots where we will add larger versions of the character with unicode value |index|, and |data| stores the sizing information.
+%    \begin{macrocode}
+function mathfont:new_type_e(index, smash, next, data)
+%    \end{macrocode}
+% We determine the number of larger variants |v| from the length of |next|, and we store that number in |total_variants|.
+%    \begin{macrocode}
+  local v = \string# next
+  self[index] = {}
+  self[index].type = "e"
+  self[index].smash = smash
+  self[index].next = next
+  self[index].total_variants = v
+  self[index].data = {}
+%    \end{macrocode}
+% We expect |data| to have $2|v|+2$ entries, which we consider in pairs. The $i$th pair (i.e.\ entries $i$ and $i+1$ of |data|) encodes the horizontal and vertical scale factors for the $i$th large variant, and the final two entries determine top and bottom accent placement. We store each pair as a two-element table in the larger table |mathfont[index].data|, and we use |x| and |y| as the keys for the horizontal and vertical stretch. Again we divide both scale factors by 1000.
+%    \begin{macrocode}
+  for i = 1, v, 1 do
+    self[index].data[i] = {}
+    self[index].data[i].x = data[2*i-1] / 1000
+    self[index].data[i].y = data[2*i] / 1000
+  end
+  self[index].top_accent_stretch = data[2*v+1] / 1000
+  self[index].bot_accent_stretch = data[2*v+2] / 1000
+end
+%    \end{macrocode}
+% The type |u| characters are simplest. We need to specify the unicode index in the first argument. The second function argument is a table with two entries that stores accent information.
+%    \begin{macrocode}
+function mathfont:new_type_u(index, data)
+  self[index] = {}
+  self[index].type = "u"
+  self[index].top_accent_stretch = data[1] / 1000
+  self[index].bot_accent_stretch = data[2] / 1000
+end
+%    \end{macrocode}
+% Interim processing. We provide a way for the user to edit resizing and accent information for the characters in |mathfont|. The function |mathfont.parse_charm| parses and validates the user's input, and the function |mathfont:add_to_charm| incorporates the user's information into the tables already in |mathfont|. The |mathfont:add_to_charm| function expects a single string of integers, floats, or asterisks separated by spaces or commas and immediately passes it to |parse_charm|. Our first task is to split the string into components, and we store the results in |split_string|. The dummy variable |i| keeps track of the number of entries currently in |split_string|.
+%    \begin{macrocode}
+function mathfont.parse_charm(charm_input)
+  local split_string = {}
+  local charm_string = charm_input
+  local temp_string = ""
+  local i = 1
+%    \end{macrocode}
+% We loop through |charm_string| as long as it contains a comma or space. At each iteration, we remove the portion of |charm_string| preceeding the first comma or space and append it to |split_string| as a separate entry.
+%    \begin{macrocode}
+  while string.find(charm_string, " ") or string.find(charm_string, ",") do
+    local length = string.len(charm_string)
+    local first_space = string.find(charm_string, " ") or length
+    local first_comma = string.find(charm_string, ",") or length
+%    \end{macrocode}
+% We store the location of the first comma or space in |sep|.
+%    \begin{macrocode}
+    local sep = first_space
+    if first_comma < first_space then
+      sep = first_comma
+    end
+%    \end{macrocode}
+% Now split |charm_string| at |sep|. We store the portion before |sep| in |temp_string|, and the portion after |sep| becomes the new |charm_string|.
+%    \begin{macrocode}
+    temp_string = string.sub(charm_string, 1, sep-1)
+    charm_string = string.sub(charm_string, sep+1)
+%    \end{macrocode}
+% If |temp_string| is not empty, we store it in position |i| in |split_string|, then increment |i| by 1. If |temp_string| does not contain a number or asterisk, we raise an error.
+%    \begin{macrocode}
+    if temp_string \noexpand~= "" then
+      if tonumber(temp_string) then % if a number, append number
+        split_string[i] = tonumber(temp_string)
+        i = i+1
+      elseif temp_string == "*" then % if asterisk, append asterisk
+        split_string[i] = temp_string
+        i = i+1
+      else % if neither, raise error
+        error(\M at number@ssert)
+      end
+    end
+  end
+%    \end{macrocode}
+% After we iterate the splitting procedure, we have a final portion of |charm_string| with no commas or spaces, and we perform the same check as on |temp_string| above. 
+%    \begin{macrocode}
+  temp_string = charm_string
+  if temp_string \noexpand~= "" then
+    if tonumber(temp_string) then % if a number, append number
+      split_string[i] = tonumber(temp_string)
+    elseif temp_string == "*" then % if asterisk, append asterisk
+      split_string[i] = temp_string
+    else % if neither, raise error
+      error(\M at number@ssert)
+    end
+  end
+%    \end{macrocode}
+% The last step is to make sure that the first entry of |split_string| is a valid unicode index. We know that the first entry is either an asterisk or a number, and we make sure it is not an asterisk.
+%    \begin{macrocode}
+  local index = split_string[1]
+  if index == "*" then
+    error(\M at index@ssert)
+  end
+%    \end{macrocode}
+% The last check is to make sure the entry is (1) an integer and not a float; (2) nonnegative; and (3) less than 1,114,111, the maximum unicode entry. We round the entry down by subtracting the decimal portion, and the result will be equal to the original entry if and only if we begn with an integer. We perform the three checks inside an |assert| and issue an error if any of them fail, and if |split_string| is valid, we return it to |mathfont:add_to_charm|.
+%    \begin{macrocode}
+  local rounded = index - (index \@percentchar 1) % subtract decimal portion
+  local max = 1114111
+  assert(index == rounded and index >= 0 and index <= max, \M at index@ssert)
+  return split_string
+end
+%    \end{macrocode}
+% We feed the user's charm information directly to |mathfont:add_to_charm|, which first calls |parse_charm| to parse the input and then modifies |mathfont| accordingly. After being parsed, we store the user's input in |charm_metrics|. The |index| is the base-10 unicode value of the character whose information we want to modify, and the |number_of_entries| is the length of |charm_metrics|.
+%    \begin{macrocode}
+function mathfont:add_to_charm(charm_string)
+  local charm_metrics = self.parse_charm(charm_string)
+  local index = charm_metrics[1]
+  local number_of_entries = \string# charm_metrics
+%    \end{macrocode}
+% If |mathfont| does not already have an entry for the unicode character |index|, we create an entry with type |u|.
+%    \begin{macrocode}
+  if not self[index] then
+    self:new_type_u(index, {0, 0})
+  end
+%    \end{macrocode}
+% Handling the user's input depends on the type of entry |index|. The basic procedure is to first check that the input has enough entries and, if yes, to overwrite the numbers stored in |mathfont|'s corresponding subtable with the new information. If the user included an asterisk, we do nothing to that metric value. For type |a|, we need four entries besides the |index|. The first two wll overwrite the left and right offset, and the last two overwrite accent placement.
+%    \begin{macrocode}
+  if self[index].type == "a" then
+    local entries_needed = 5
+    assert(number_of_entries >= entries_needed, \M at entries@ssert)
+    if charm_metrics[2] \noexpand~= "*" then
+      self[index].left_stretch = charm_metrics[2] / 1000
+    end
+    if charm_metrics[3] \noexpand~= "*" then
+      self[index].right_stretch = charm_metrics[3] / 1000
+    end
+    if charm_metrics[4] \noexpand~= "*" then
+      self[index].top_accent_stretch = charm_metrics[4] / 1000
+    end
+    if charm_metrics[5] \noexpand~= "*" then
+      self[index].bot_accent_stretch = charm_metrics[5] / 1000
+    end
+%    \end{macrocode}
+% Type |e| is more complicated. The number of entries in the |charm_metrics| must be at least $2*|total_variants|+3$. We loop through the information and, for each $i$th pair of charm values, set those numbers to be the horizontal and vertical stretch information for the $i$th variant. We handle type |r| in the same way.
+%    \begin{macrocode}
+  elseif self[index].type == "e" then
+    local tot_variants = self[index].total_variants
+    local entries_needed = 2 * tot_variants + 3
+    assert(number_of_entries >= entries_needed, \M at entries@ssert)
+    for i = 1, tot_variants, 1 do
+      if charm_metrics[2*i] \noexpand~= "*" then
+        self[index].data[i].x = charm_metrics[2*i] / 1000
+      end
+      if charm_metrics[2*i+1] \noexpand~= "*" then
+        self[index].data[i].y = charm_metrics[2*i+1] / 1000
+      end
+    end
+%    \end{macrocode}
+% The final two entries for type |e| or |r| are the accent information.
+%    \begin{macrocode}
+    if charm_metrics[2*tot_variants+2] \noexpand~= "*" then
+      self[index].top_accent_stretch = charm_metrics[2*tot_variants+2] / 1000
+    end
+    if charm_metrics[2*tot_variants+3] \noexpand~= "*" then
+      self[index].bot_accent_stretch = charm_metrics[2*tot_variants+3] / 1000
+    end
+%    \end{macrocode}
+% Again the information for type |u| is the simplest. We need two values besides the |index|, one for the top accent and one for the bottom accent.
+%    \begin{macrocode}
+  elseif self[index].type == "u" then
+    local entries_needed = 3
+    assert(number_of_entries >= entries_needed, \M at entries@ssert)
+    if charm_metrics[2] \noexpand~= "*" then
+      self[index].top_accent_stretch = charm_metrics[2] / 1000
+    end
+    if charm_metrics[3] \noexpand~= "*" then
+      self[index].bot_accent_stretch = charm_metrics[3] / 1000
+    end
+  end
+end
+%    \end{macrocode}
+% We end this section with three general-purpose Lua functions. The |make_hex_value| function accepts a nonnegative integer and returns its hexadecimal representation as a string. The result will go in the variable |hex_string|. We handle the cases of 0 and 1 manually.
+%    \begin{macrocode}
+function mathfont.make_hex_value(integer)
+  if integer == 0 then
+    return "0000"
+  end
+  if integer == 1 then
+    return "0001"
+  end
+  local hex_digits = "0123456789ABCDEF" % for reference
+  local hex_string = ""
+  local curr_val = integer
+  local remainder = 0
+%    \end{macrocode}
+% Otherwise, we find the number of hexadecimal digits that we will need to represent the |integer|. We loop through the integers and stop when we reach the first power of 16 that is greater than |integer|.
+%    \begin{macrocode}
+  local i = 0
+  while 16^i <= curr_val do
+    i = i+1
+  end
+%    \end{macrocode}
+% Once we know how many hex digits we will need, we subtract off successively smaller powers of 16. Our dummy variable |j| starts as the greatest power of 16 less than or equal to |integer|, and we divide by $16^{\hbox{\texttt{\footnotesize j}}}$. The quotient becomes the first hexadecimal digit, and we repeat the process with the remainder and a smaller value of |j|. The final result is the hexadecimal representation of our original |integer|.
+%    \begin{macrocode}
+  for j = i-1, 0, -1 do
+    remainder = curr_val \@percentchar (16^j)
+    curr_val = (curr_val - remainder) / (16^j)
+    hex_string = hex_string .. string.sub(hex_digits, curr_val+1, curr_val+1)
+    curr_val = remainder
+  end
+%    \end{macrocode}
+% If |hex_string| has fewer than 4 digits, we add enough leading 0's to bring it to 4 digits.
+%    \begin{macrocode}
+  if \string# hex_string < 4 then
+    for i = \string# hex_string, 4, 1 do
+      hex_string = "0" .. hex_string
+    end
+  end
+  return hex_string
+end
+%    \end{macrocode}
+% The |glyph_info| function does exactly what it sounds like. It accepts a character table from a font and returns the width, height, depth, and italic correction values.
+%    \begin{macrocode}
+function mathfont.glyph_info(char)
+  local glyph_width = char.width or 0
+  local glyph_height = char.height or 0
+  local glyph_depth = char.depth or 0
+  local glyph_italic = char.italic or 0
+  return glyph_width, glyph_height, glyph_depth, glyph_italic
+end
+%    \end{macrocode}
+% The |:smash_glyph| function returns a character table that will produce a smashed version of the unicode character with value |index|. The character has no width, height, or depth and typesets the glyph virtually using a |char| font command.
+%    \begin{macrocode}
+function mathfont:smash_glyph(index, fontdata)
+  local smash_table = {}
+  smash_table.width = 0
+  smash_table.height = 0
+  smash_table.depth = 0
+  smash_table.commands = {{"char", index}}
+  return smash_table
+end
+%    \end{macrocode}
+% An empty function that does nothing. Used later for creating callbacks.
+%    \begin{macrocode}
+function mathfont.empty(arg)
+end
+%    \end{macrocode}
+% 
+% 
+% \section{Adjust Fonts: Changes}
+%
+%
+% \begin{figure}[t]
+% \centerline{\bfseries Table 3: Callbacks Created by \textsf{mathfont}\strut}
+% \begin{tabularx}\textwidth{lXl}\toprule
+% Callback Name & Called? & Default Behavior\\\midrule
+% |"mathfont.inspect_font"| & Always & none\\\midrule
+% |"mathfont.pre_adjust"| & 
+%   \multirow{5}{*}{\vbox{\hbox{If |nomath|}\hbox{in |fontdata|}\hbox{is set to true}}} & none\\
+% |"mathfont.disable_nomath"| &  & |mathfont.set_nomath_true|\\
+% |"mathfont.add_math_constants"| & & |mathfont.math_constants|\\
+% |"mathfont.fix_character_metrics"|& & |mathfont.apply_charm_info|\\
+% |"mathfont.post_adjust"| & & none\\\bottomrule
+% \end{tabularx}
+% \end{figure}
+%
+%
+%
+% 
+% 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. 
+% 
+% 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.
+% 
+% We will incorporate five categories of information into our new character tables: glyph dimensions, unicode values, accent placement dimensions, virtual font commands, and math kerning. For type |a|, we increase the original horizontal glyph dimensions based on charm information, and for type |e|, we increase the width by horizontal scale factors and the height and depth by vertical scale factors. Accent placement dimensions come from charm information. For types |a| and |e|, we return a character table that will become a virtual character in the font, and we need to include commands to typeset certain base characters. For type |e|, we also create the large variants through |pdf| commands that stretch the base glyphs.
+%  
+% The type |a| commands include one command to move to the right by some offset and one command to typeset the base glyph.
+%    \begin{macrocode}
+function mathfont.make_a_commands(index, offset)
+  local c_1 = {"right", offset}
+  local c_2 = {"char", index}
+  return {c_1, c_2}
+end
+%    \end{macrocode}
+% The |:make_a_table| returns a character table for type |a| characters. We store the information to return in the variable |a_table| and the character subtable in |char|. The |slant| is the font's |slant| parameter and is used for calculating accent placement.
+%    \begin{macrocode}
+function mathfont:make_a_table(index, charm_data, fontdata)
+  local a_table = {}
+  local char = fontdata.characters[index] or {}
+  local slant = fontdata.parameters.slant / 65536 or 0
+%    \end{macrocode}
+% The |left_stretch| and |right_stretch| values come from charm data and tell us how much extra space to add to the left and right sides of the character. Importantly, these values are additive. 
+%    \begin{macrocode}
+  local left_stretch = charm_data.left_stretch
+  local right_stretch = charm_data.right_stretch
+  local width, height, depth, italic = self.glyph_info(char)
+%    \end{macrocode}
+% Incorporate the italic correction into the character width.
+%    \begin{macrocode}
+  width = width + italic
+%    \end{macrocode}
+% The new width is $1+|left_stretch|+|right_stretch|$ times the original width. The horizontal offset that appears in the commands is the |left_stretch| portion of the new width.
+%    \begin{macrocode}
+  local offset = width * left_stretch
+  a_table.width = width * (1 + left_stretch + right_stretch)
+  a_table.height = height
+  a_table.depth = depth
+  a_table.italic = italic
+  a_table.unicode = index
+%    \end{macrocode}
+% The |tounicode| entry is a hexadecimal string that encodes the unicode value of the base character.
+%    \begin{macrocode}
+  a_table.tounicode = self.make_hex_value(index)
+%    \end{macrocode}
+% We specify accent placement information by including |top_accent| and |bot_accent| entries in the |a_table|. We determine placement by setting the |top_accent| to be a base value plus a distance determined by the charm data and similarly for |bot_accent|. We imagine dividing up the character's bounding box as follows: (1)~some rectangular portion of the left and right areas of the bounding box is empty space added according to |left_stretch| and |right_stretch|; (2)~accordingly, the glyph occupies some rectangular area in the middle of the bounding box; (3)~if the font is slanted, that rectangle will actually be a parallogram where the rectangle overhangs both slanted edges of the parallogram in two triangles; and (4)~we can determine the size of these triangles according to the |slant| font parameter. We want the base measurement for the top accent to be located in the middle of the parallogram from step~(3) previously, and we end up with
+% \[
+% \hbox{base measurement}={|left_stretch|}*{|width|}+0.5*({|width|}-\sigma_1*{|height|})+\sigma_1*{|height|},
+% \]
+% where $\sigma_1$ is the |slant| parameter and |width| and |height| refer to the character in question. This equation simplifies to 
+% \[
+% (0.5 + {|left_stretch|}) * {|width|} + 0.5 \sigma_1 * {|height|},
+% \]
+% which is the formula we use for the base value of the top accent. We determine the base value of the bottom accent similarly. For the shift amount, we take the corresponding factor from the charm information and multiply it by the width of the character. Note that in all these cases, we use the |width|, not the |new_width| as our unit of measurement. This keeps the scaling of the accent placement independent of the |left_stretch| and |right_stretch| values.
+%    \begin{macrocode}
+  local top_base = (0.5 + left_stretch) * width + 0.5 * slant * height
+  local bot_base = (0.5 + left_stretch) * width - 0.5 * slant * height
+  local top_accent_shift = charm_data.top_accent_stretch * width
+  local bot_accent_shift = charm_data.bot_accent_stretch * width
+  a_table.top_accent = top_base + top_accent_shift
+  a_table.bot_accent = bot_base + bot_accent_shift
+%    \end{macrocode}
+% Add the commands to the table.
+%    \begin{macrocode}
+  a_table.commands = self.make_a_commands(index, offset)
+%    \end{macrocode}
+% Because we are keeping the character's italic correction, we have superscripts and subscripts that are too far from the glyph if we leave things as is. The reason is that Lua\TeX\ adds italic correction of the nucleus to the horizontal position of superscripts when it formats exponents. Accordingly we want to move both superscript and subscript left by the italic correction of the nucleus, so we add a mathkern table to the character. A mathkern table contains up to four subtables, one for each corner of the character. Within each subtable, we store pairs of |height| and |kern| values, where |height| means to apply |kern| to exponents at that height. In this case, we have a |kern| value of minus italic correction in the upper and lower right corners.
+%    \begin{macrocode}
+  a_table.mathkern = {}
+  a_table.mathkern.top_right = {{height = 0, kern = -italic}}
+  a_table.mathkern.bottom_right = {{height = 0, kern = -italic}}
+  a_table.mathkern.top_left = {{height = 0, kern = 0}}
+  a_table.mathkern.bottom_left = {{height = 0, kern = 0}}
+  return a_table
+end
+%    \end{macrocode}
+% For type |e| characters, we need a function to modify the base glyph. We incorporate the italic correction into the width and add extra italic correction in the case of the integral symbol.
+%    \begin{macrocode}
+function mathfont:modify_e_base(index, fontdata)
+  local char = fontdata.characters[index] or {}
+  local width, height, depth, italic = self.glyph_info(char)
+  char.width = width + italic
+%    \end{macrocode}
+% We trim the bounding box on the surd if the user requests it. Some text fonts extend the bounding box of the surd past the edge of the glyph, and we trim the edge of the box according to the values of |\M at surd@horizontal at factor| and |\M at surd@vertical at factor|.
+%    \begin{macrocode}
+  if index == 8730 then
+%    \end{macrocode}
+% Now get the scale factors from the \TeX\ side of things and scale down (or up) the height and with of the surd.
+%    \begin{macrocode}
+    local horizontal_scale = tex.getcount("M at surd@horizontal at factor") / 1000
+    local vertical_scale = tex.getcount("M at surd@vertical at factor") / 1000
+    char.width = horizontal_scale * char.width
+    char.height = vertical_scale * height
+  end
+%    \end{macrocode}
+% For the integral symbol, get the scale factor add the appropriate italic correction.
+%    \begin{macrocode}
+  if index == 8747 then
+    local scale_factor = tex.getcount("M at integral@italic at factor") / 1000
+    char.italic = scale_factor * width
+  end
+end
+%    \end{macrocode}
+% For the |e| commands, we not only typeset a certain glyph but also instruct the |pdf| backend to scale by a horizontal and vertical factor before doing so. In this way, we artificially add larger variants of a particular base glyph. The |pdf| command sends code directly to the pdf backend that handles the transformation. The |q| command indicates a linear transformation of the output, and the following string contains the transformation coordinates. The |Q| command restores the original coordinate system, and because it occurs between the transformation commands, the typeset glyph from the |char| command will be enlarged according to the transformation matrix.
+%    \begin{macrocode}
+function mathfont.make_e_commands(index, h_stretch, v_stretch)
+  local c_1 = {"pdf", "origin", string.format(
+    "q \@percentchar s 0 0 \@percentchar s 0 0 cm", h_stretch, v_stretch)}
+  local c_2 = {"char", index}
+  local c_3 = {"pdf", "origin", "Q"}
+  return {c_1, c_2, c_3}
+end
+%    \end{macrocode}
+% The function for type |e| characters returns a table with different structure because we need to create multiple characters at once. Specifically, the function returns a table with one entry for each larger variant that we want to add to the font. Many of the variables are the same as in |:make_type_a|. We store the base character subtable in |char| and the font's |slant| parameter in |slant|. The |tounicode| stores the hexadecimal unicode value of the base character for reference later, and |smash_index| is the index of the unicode slot that we are using to hold the smashed version of the base character.
+%    \begin{macrocode}
+function mathfont:make_e_table(index, charm_data, fontdata)
+  local e_table = {}
+  local char = fontdata.characters[index] or {}
+  local slant = fontdata.parameters.slant / 65536
+  local tounicode = self.make_hex_value(index)
+  local smash_index = charm_data.smash
+  local width, height, depth, italic = self.glyph_info(char)
+%    \end{macrocode}
+% We will create a number of entries in |e_table| equal to the number of variants we want, which is stored in |charm_data.total_variants|. We iteratively assemble the |e_table|, and we begin the iteration by extracting the |i|th horizontal and vertical scale factors from |charm_data|. The width, height, and depth of the |i|th new character will be scalings of these values from the original character.
+%    \begin{macrocode}
+  for i = 1, charm_data.total_variants, 1 do
+    local h_stretch = charm_data.data[i].x
+    local v_stretch = charm_data.data[i].y
+    local new_width = width * h_stretch
+    local new_height = height * v_stretch
+    local new_depth = depth * v_stretch
+    local new_italic = italic * h_stretch
+%    \end{macrocode}
+% We add new character bounds to the |i|th entry of |e_table|.
+%    \begin{macrocode}
+    e_table[i] = {}
+    e_table[i].width = new_width
+    e_table[i].height = new_height
+    e_table[i].depth = new_depth
+    e_table[i].italic = new_italic
+%    \end{macrocode}
+% Add the unicode information.
+%    \begin{macrocode}
+    e_table[i].unicode = index
+    e_table[i].tounicode = tounicode
+%    \end{macrocode}
+% We handle accent placement the same way as with type |a| characters.
+%    \begin{macrocode}
+    local base_top_accent = 0.5 * new_width + 0.5 * slant * new_height
+    local base_bot_accent = 0.5 * new_width - 0.5 * slant * new_height
+    local top_accent_shift = charm_data.top_accent_stretch * new_width
+    local bot_accent_shift = charm_data.bot_accent_stretch * new_width
+    e_table[i].top_accent = base_top_accent + top_accent_shift
+    e_table[i].bot_accent = base_bot_accent + bot_accent_shift
+%    \end{macrocode}
+% Add the commands.
+%    \begin{macrocode}
+    e_table[i].commands = 
+      self.make_e_commands(smash_index, h_stretch, v_stretch)
+%    \end{macrocode}
+% If we aren't dealing with the last entry in the table, we need to add the character's |next| fields. The next larger variant after the |i|th character will the the ${|i|}+1$st character, and we can extract the index from the |charm_information|.
+%    \begin{macrocode}
+    if i < charm_data.total_variants then
+      e_table[i].next = charm_data.next[i+1]
+    end
+  end
+  return e_table
+end
+%    \end{macrocode}
+% Making the |u| table is the easiest. We take the character subtable from |fontdata| as our starting point rather than assembling a new character subtable from scratch. The structure here is very similar to type |a| without the extra space from the |left_stretch| and |right_stretch|. Again, we incorporate the italic correction into the bounding box and add a negative mathkern to compensate.
+%    \begin{macrocode}
+function mathfont:make_u_table(index, charm_data, fontdata)
+  local u_table = fontdata.characters[index] or {}
+  local slant = fontdata.parameters.slant / 65536 or 0
+  local width, height, depth, italic = self.glyph_info(u_table)
+  local new_width = width + italic
+  u_table.width = new_width
+%    \end{macrocode}
+% We handle accents in the same way as with the other types.
+%    \begin{macrocode}
+  local base_top_accent = 0.5 * new_width + 0.5 * slant * height
+  local base_bot_accent = 0.5 * new_width - 0.5 * slant * height
+  local top_accent_shift = charm_data.top_accent_stretch * new_width
+  local bot_accent_shift = charm_data.bot_accent_stretch * new_width
+  u_table.top_accent = base_top_accent + top_accent_shift
+  u_table.bot_accent = base_bot_accent + bot_accent_shift
+%    \end{macrocode}
+% Add a mathkern table as in the case of type |a| characters.
+%    \begin{macrocode}
+  u_table.mathkern = {}
+  u_table.mathkern.top_right = {{height = 0, kern = -italic}}
+  u_table.mathkern.bottom_right = {{height = 0, kern = -italic}}
+  u_table.mathkern.top_left = {{height = 0, kern = 0}}
+  u_table.mathkern.bottom_left = {{height = 0, kern = 0}}
+  return u_table
+end
+%    \end{macrocode}
+% Before we get to the main font-changing functions, we code |make_fake_angle|, which returns a character table for the fake angle brackets. The function accepts the index of the smashed character as |index| and the index of the smashed gillement as |smash|. We form the fake angle bracket by using only the top 90\% of the original glyph, and we scale it to have the same height and depth as the left parenthesis. 
+%    \begin{macrocode}
+function mathfont.make_fake_angle(index, smash, fontdata)
+  local temp = {}
+  local lparen = fontdata.characters[40] or {}
+  local lparen_height = lparen.height or 0
+  local lparen_depth = lparen.depth or 0
+  local glyph = fontdata.characters[index] or {}
+  local glyph_height = glyph.height or 0
+  local base_height = 0.9 * glyph_height
+  local factor = 0
+  if glyph_height \noexpand~= 0 then
+    factor = (lparen_height + lparen_depth) / base_height
+  end
+  local shift = 0.1 * glyph_height * factor + lparen_depth
+  temp.height = lparen_height
+  temp.depth = lparen_depth
+  temp.width = glyph.width or 0
+  temp.italic = glyph.italic or 0
+  temp.top_accent = glyph.top_accent or 0.5 * temp.width
+  temp.bot_accent = glyph.bot_accent or 0.5 * temp.width
+  temp.commands = {
+    {"down", shift},
+    {"pdf", "origin", string.format("q 1 0 0 \@percentchar s 0 0 cm", factor)},
+    {"char", smash},
+    {"pdf", "origin", "Q"},
+    {"down", -shift}}
+  return temp
+end
+%    \end{macrocode}
+% We come to the main functions that modify the font. We need to accomplish three tasks, and we define separate functions for each one. First, we set the font's |nomath| entry to |false|. Second, we incorporate the modifications based on charm information into the font, i.e.\ set the font's character subtables using the previous functions from this section. Third, we need to add a MathConstants table. The first task is very easy.
+%    \begin{macrocode}
+function mathfont.set_nomath_true(fontdata)
+  fontdata.nomath = false
+  fontdata.oldmath = false
+end
+%    \end{macrocode}
+% The second task is more involved. The basic idea is to loop through |mathfont|, and whenever we find an entry that is a subtable, we treat it as charm information that we use to modify the font object. We begin by storing the character information from the font in |chars| for easier reference later.
+%    \begin{macrocode}
+function mathfont.apply_charm_info(fontdata)
+  local chars = fontdata.characters or {}
+%    \end{macrocode}
+% Before we loop through the charm data, we need to add fake angle brackets and |\nabla| to the font. We begin with the angle brackets.
+%    \begin{macrocode}
+  chars[1044538] = mathfont:smash_glyph(8249, fontdata) % \lguil
+  chars[1044539] = mathfont:smash_glyph(8250, fontdata) % \rguil
+  chars[1044540] = mathfont:smash_glyph(171, fontdata) % \llguil
+  chars[1044541] = mathfont:smash_glyph(187, fontdata) % \rrguil
+%    \end{macrocode}
+% Now add the characters to the font.
+%    \begin{macrocode}
+  chars[1044508] = mathfont.make_fake_angle(8249, 1044538, fontdata)
+  chars[1044509] = mathfont.make_fake_angle(8250, 1044539, fontdata)
+  chars[1044510] = mathfont.make_fake_angle(171, 1044540, fontdata)
+  chars[1044511] = mathfont.make_fake_angle(187, 1044541, fontdata)
+%    \end{macrocode}
+% Add the nabla (inverted Delta) character to the font if it is missing.
+%    \begin{macrocode}
+  if not chars[8711] then
+    chars[8710] = chars[8710] or {}
+    chars[1044508] = mathfont:smash_glyph(8710, fontdata)
+    chars[8711] = {}
+    chars[8711].width = chars[8710].width or 0
+    chars[8711].height = chars[8710].height or 0
+    chars[8711].depth = chars[8710].depth or 0
+    chars[8711].italic = chars[8710].italic or 0
+    chars[8711].top_accent = chars[8710].top_accent or 0.5 * chars[8711].width
+    chars[8711].bot_accent = chars[8710].bot_accent or 0.5 * chars[8711].width
+    chars[8711].unicode = 8711
+    chars[8711].tounicode = mathfont.make_hex_value(8711)
+    chars[8711].commands = {
+      {"down", -chars[8711].height},
+      {"pdf", "origin", "q 1 0 0 -1 0 0 cm"},
+      {"char", 1044508},
+      {"pdf", "origin", "Q"},
+      {"down", chars[8711].height}}
+  end
+%    \end{macrocode}
+% Perform the loop. We care about entries |info| whose type is a table.
+%    \begin{macrocode}
+  for index, info in pairs(mathfont) do
+    if type(info) == "table" then
+%    \end{macrocode}
+% If the character's type is |a|, all we need to do is replace the character subtable in the font with our version.
+%    \begin{macrocode}
+      if info.type == "a" then
+        chars[info.next] = mathfont:make_a_table(index, info, fontdata)
+%    \end{macrocode}
+% Again, type |e| is more complicated. This time we need to insert multiple character subtables into the font, one for the smashed version of the base glyph and others corresponding to the large variants that we create using the |:make_e_table| function from above. We also need to add |next| entries to the caracters in the font linking all the variants together.
+%    \begin{macrocode}
+      elseif info.type == "e" then
+        local smash = info.smash
+        chars[index] = chars[index] or {}
+%    \end{macrocode}
+% Set the |next| entry on the current character, modify the character's dimensions to incorporate italic correction into the width, and add a smashed version of the glyph into the font.
+%    \begin{macrocode}
+        chars[index].next = info.next[1]
+        mathfont:modify_e_base(index, fontdata)
+        chars[smash] = mathfont:smash_glyph(index, fontdata)
+%    \end{macrocode}
+% The function that creates the character table for type |e| produces one character subtable for each larger variant that we want to add, so we loop through the resulting table and add the contents to the font one at time. Each subtable goes in unicode slots that we take from the charm information, specifically the |next| table from |info|.
+%    \begin{macrocode}
+        local variants_table = mathfont:make_e_table(index, info, fontdata)
+        for i = 1, info.total_variants, 1 do
+          chars[info.next[i]] = variants_table[i]
+        end
+%    \end{macrocode}
+% We deal with type |u| in the same way as we do type |a|.
+%    \begin{macrocode}
+      elseif info.type == "u" then
+        chars[index] = mathfont:make_u_table(index, info, fontdata)
+      end
+    end
+  end
+end
+%    \end{macrocode}
+% The |populate_math_constants| function is even more complicated because we need to add a full MathConstants table to the font object, which has some fifty parameters that we need to set. To keep things simple, we set the font parameters in terms of traditional \TeX\ |\fontdimen| parameters. Besides the eight essential parameters found in all fonts, \TeX\  traditionally uses some fifteen extra parameters to typeset math formulas. To preserve whatever structure may already exist in the font object, we do not override any MathConstants that the font already contains.
+%    \begin{macrocode}
+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.
+%    \begin{macrocode}
+  local size = fontdata.size or 0
+  local ex = fontdata.parameters.x_height or 0
+  local em = fontdata.parameters.quad or 0
+  local A_height = 0
+  local y_depth = 0
+  if fontdata.characters[65] then
+    A_height = fontdata.characters[65].height or 0 % A
+  end
+  if fontdata.characters[121] then
+    y_depth = fontdata.characters[121].depth or 0 % y
+  end
+%    \end{macrocode}
+% We begin by setting the axis height and default rule thickness. We need to start with these parameters because we will use them to calculate other constants. We set both values to 0 initially and then change them.
+%    \begin{macrocode}
+  local axis = 0
+  local rule_thickness = 0
+%    \end{macrocode}
+% Set the default rule thickness. If the font already has a value set for the parameter |FractionRuleThickness|, we take that as the default rule thickness, and otherwise we set it to be 1/18 of the font size times the adjustment factor from |\M at rule@thickness at factor|, which is the value of that |\count| divided by 1000. 
+%    \begin{macrocode}
+  local dim = "FractionRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    local scale_factor = tex.getcount("M at rule@thickness at factor") / 1000
+    rule_thickness = (size / 18) * scale_factor
+    fontdata.MathConstants[dim] = rule_thickness
+  else
+    rule_thickness = fontdata.MathConstants[dim]
+  end
+%    \end{macrocode}
+% If the font does not have |AxisHeight| already set, we set the axis to be the height of a minus sign (character 45). As a fallback, we set the axis to 0.8ex if the font does not have a character in unicode slot 45. If the font has an |AxisHeight|, we take that value as the |axis|.
+%    \begin{macrocode}
+  local dim = "AxisHeight"
+  if fontdata.MathConstants[dim] then
+    axis = fontdata.MathConstants[dim]
+  else
+    if fontdata.characters[45] then
+      axis = fontdata.characters[45].height - 0.5 * rule_thickness
+    else
+      axis = 0.8 * ex
+    end
+    fontdata.MathConstants[dim] = axis
+  end
+%    \end{macrocode}
+% Apart from the axis height and rule thickness, we can group the traditional mathematics |\fontdimen| parameters into three categories: four for large operators, five for fractions, and six for superscripts and subscripts. (OpenType math does not use the fifth large-operator parameter $\xi_{13}$ and the seventh script parameter $\sigma_{14}$.) We define variables with the same names as their traditional references from Appendix G in the \textit{\TeX Book}. I have taken the design approach of using twice the rule height as a standard minimum clearance, and I am assuming that script styles are roughly 70\% as large as text and display styles. We begin with the parameters for large operators.
+% 
+% The parameter $\xi_9$ is the minimum clearance between the top of a large operator and the limit above it, and we set it to be twice the rule thickness. Before ensuring that the bottom of the upper limit is at least $\xi_9$ away from the operator character, \TeX\ attempts to position the baseline of the limit at $\xi_{10}$ distance above the operator character, and we set $\xi_{10}$ to be slightly larger than $\xi_9$. If the upper limit has no decender, \TeX\ will raise its baseline by $\xi_{10}$, and if it has a descener, \TeX\ will position the bottom of the descender to be $\xi_9$ above the operator, which in practice means it will be higher than limits without descenders. This approach balances the desire for consistency in whitespace with the desire for consistency in baseline height. Similarly, we set the minimum clearance $\xi_{11}$ for the lower limit to be equal to the attempted clearance for the upper limit, and the attempted clearance $\xi_{12}$ for the lower limit will be the minimum clearance plus the average of the |\scriptfont| x-height and |\scriptfont| A-height.
+%    \begin{macrocode}
+  local xi_9 = 2 * rule_thickness              % upper limit minimum clearance
+  local xi_10 = xi_9 + 0.35 * y_depth          % upper limit attempt placement
+  local xi_11 = xi_10                          % lower limit minimum clearance
+  local xi_12 = xi_10 + 0.35 * (A_height + ex) % lower limit attempt placement
+%    \end{macrocode}
+% Our general approach for |\displaystyle| fractions is to place the baseline of the numerator numerator at a distance above the fraction rule of 1.5 times the rule height plus descender depth plus a small extra space. The minimum clearance will be the rule height, so we expect the numerator to strictly exceed the minimum clearance in most situations. Doing so produces consistent baselines of numerators and gives our value for $\sigma_8$, the attempted height of the numerator in |\displaystyle| fractions. For smaller styles, we use a single rule height as clearance, so we add $0.5*|rule_thickness|+|y_depth|$ scaled down by 0.7 to the rule thickness. The minimum clearance for numerator and denominator are separate OpenType parameters, and we set them later. The extra 0.1 A-height in the attempted clearance relative to the minimum clearance appears because we measure attempted clearance from the axis, whereas we measure minimum clearance from the top or bottom of the fraction rule.
+%    \begin{macrocode}
+  local sigma_8 = axis + 1.5 * rule_thickness + y_depth + 0.1 * A_height
+  local sigma_9 = (axis + 1.35 * rule_thickness + 0.7 * y_depth +
+    0.07 * A_height)
+  local sigma_10 = sigma_9
+%    \end{macrocode}
+% Our approach in the denominators is the same except that we add half the descender depth to the minimum clearance. This creates extra space below the fraction rule so that the typographical color above the rule matches that below the rule when the numerator contains descenders.
+%    \begin{macrocode}
+  local sigma_11 = (-axis + 1.5  * rule_thickness + 0.5 * y_depth + 
+    1.1 * A_height)
+  local sigma_12 = (-axis + 1.35 * rule_thickness + 0.35 * y_depth +
+    0.77 * A_height)
+%    \end{macrocode}
+% For superscripts we think in terms of the top of the superscript. We raise the baseline of the superscript by the desired height of the superscript top minus the |\scriptfont| A-height. Choosing $1.3*|A_height|$ for regular styles and $1.2*|A_height|$ for cramped styles was a design choice that worked well. The attempted drop for subscripts is one-fifth the A-height or slightly more than the y-depth, whichever is greater. This way the subscript baseline is slightly lower than any descenders, and for fonts without descenders, we still clearly lower the subscript. Setting $\sigma_{18}$ and $\sigma_{19}$ was another design choice that worked well.
+%    \begin{macrocode}
+  local sigma_13 = 0.6 * A_height     % attempted superscript height
+  local sigma_15 = 0.5 * A_height     % attempted superscript for \cramped
+  local sigma_16 = 1.1 * y_depth      % attempted subscript lower
+  if sigma_16 < 0.2 * A_height then
+    sigma_16 = 0.2 * A_height
+  end
+  local sigma_17 = sigma_16           % sigma_16 when superscript present
+  local sigma_18 = 0.5 * A_height     % superscript lower for boxed subformula
+  local sigma_19 = 0.1 * A_height     % subscript lower for boxed subformula
+%    \end{macrocode}
+% The MathConstants themselves come from the unicode equivalents of the traditional \TeX\ |\fontdimen| parameters where appropriate. Where not appropriate, I made design choices as indicated. Setting the next three parameters was purely a design choice. 
+%    \begin{macrocode}
+  local dim = "DisplayOperatorMinHeight"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 1.8 * A_height
+  end
+  local dim = "FractionDelimiterDisplayStyleSize"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * size
+  end
+  local dim = "FractionDelimiterSize"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 1.3 * size
+  end
+  local dim = "FractionDenominatorDisplayStyleShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_11
+  end
+  local dim = "FractionDenominatorShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_12
+  end
+%    \end{macrocode}
+% We set the minium clearance for the numerator to be twice the rule height in |\displaystyle| and the rule height in other styles. Our approach in setting the attempted height of the numerator ($\sigma_8$ and $\sigma_9$) was to add the minimum clearance plus the descender depth plus a small extra space, so in general, we do not expect the numerator to run into the minimum clearance. For the denominator, we do the same thing except add half the descender depth to the clearance, which balances the amount of color above and below the fraction rule and is similar to what we did for the lower limits on big operators when we set $\xi_{11}$ larger than $\xi_9$.
+%    \begin{macrocode}
+  local dim = "FractionDenominatorDisplayStyleGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness + 0.5 * y_depth
+  end
+  local dim = "FractionDenominatorGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness + 0.35 * y_depth
+  end
+  local dim = "FractionNumeratorDisplayStyleShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_8
+  end
+  local dim = "FractionNumeratorShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_9
+  end
+  local dim = "FractionNumeratorDisplayStyleGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "FractionNumeratorGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+%    \end{macrocode}
+% The |SkewedFractionHorizontalGap| and |SkewedFractionVerticalGap| take the values that Lua\TeX would set for a traditional \TeX\ font.
+%    \begin{macrocode}
+  local dim = "SkewedFractionHorizontalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0.5 * em
+  end
+  local dim = "SkewedFractionVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = ex
+  end
+%    \end{macrocode}
+% The |UpperLimit| and |LowerLimit| dimensions correspond exactly to traditional \TeX\ math |\fontdimen| parameters.
+%    \begin{macrocode}
+  local dim = "UpperLimitBaselineRiseMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_11
+  end
+  local dim = "UpperLimitGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_9
+  end
+  local dim = "LowerLimitBaselineDropMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_12
+  end
+  local dim = "LowerLimitGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_10
+  end
+%    \end{macrocode}
+% Traditional \TeX\ doesn't have stack objects, but they are meant to be similar to large operators, so we set the same parameters.
+%    \begin{macrocode}
+  local dim = "StretchStackGapBelowMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_10
+  end
+  local dim = "StretchStackTopShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_11
+  end
+  local dim = "StretchStackGapAboveMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_9
+  end
+  local dim = "StretchStackBottomShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_12
+  end
+%    \end{macrocode}
+% For the three |Overbar| parameters, we take the approach that the bar itself should be as thick as the rule height. The gap will be twice the rule height, and the extra clearance will be a single rule height.
+%    \begin{macrocode}
+  local dim = "OverbarExtraAscender"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "OverbarRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "OverbarVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * rule_thickness
+  end
+%    \end{macrocode}
+% For the radical sign, we take the same approach as with the |Overbar| parameters. We insert one rule thickness of extra space above the radical symbol and two rule thickness of extra space under it. For |\textstyle| and smaller, we reduce the space to a single rule height.
+%    \begin{macrocode}
+  local dim = "RadicalExtraAscender"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "RadicalRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "RadicalDisplayStyleVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * rule_thickness
+  end
+  local dim = "RadicalVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+%    \end{macrocode}
+% The final three |Radical| parameters aren't used if we handle degree placement at the macro level rather than at the font level. We set them to the default values that Lua\TeX\ uses for traditional tfm fonts.
+%    \begin{macrocode}
+  local dim = "RadicalKernBeforeDegree"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = (5/18) * em
+  end
+  local dim = "RadicalKernAfterDegree"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = (10/18) * em
+  end
+  local dim = "RadicalDegreeBottomRaisePercent"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 60
+  end
+%    \end{macrocode}
+% The |SpaceAfterShift| is a design choice. Somewhat arbitrary.
+%    \begin{macrocode}
+  local dim = "SpaceAfterScript"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0.1 * em
+  end
+%    \end{macrocode}
+% The |Stack| parameters come from their traditional |\fontdimen| analogues.
+%    \begin{macrocode}
+  local dim = "StackBottomDisplayStyleShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_11
+  end
+  local dim = "StackBottomShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_12
+  end
+  local dim = "StackTopDisplayStyleShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_8
+  end
+  local dim = "StackTopShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_10
+  end
+%    \end{macrocode}
+% Traditionally \TeX\ uses an internal method rather than a parameter to determine the minimum distance between two boxes in an |\atop| stack. We set the minimum distance to be one rule thickness plus the combined minimum clearance for numerators and denominators in fractions. For |\displaystyle|, that gives us 
+% \[
+% |rule_thickness|+(2*|rule_thickness|)+(2*|rule_thickness|+0.5*|y_depth|)
+% \]
+% For smaller styles, we use single rule height values and scale down the |y_depth| by 0.7.
+%    \begin{macrocode}
+  local dim = "StackDisplayStyleGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 5 * rule_thickness + 0.5 * y_depth
+  end
+  local dim = "StackGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 3 * rule_thickness + 0.35 * y_depth
+  end
+%    \end{macrocode}
+% With three exceptions, superscript and subscript parameters come from traditional \TeX\ dimensions.
+%    \begin{macrocode}
+  local dim = "SubscriptShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_16
+  end
+  local dim = "SubscriptBaselineDropMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_19
+  end
+  local dim = "SubscriptShiftDownWithSuperscript"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_17
+  end
+%    \end{macrocode}
+% The top of a subscript should be less than half the A-height. This is a somewhat arbitrary design choice.
+%    \begin{macrocode}
+  local dim = "SubscriptTopMax"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0.5 * A_height
+  end
+%    \end{macrocode}
+% The minimum gap between superscripts and subscripts will be the height of the rule. This is less space than \TeX\ traditionally allocates.
+%    \begin{macrocode}
+  local dim = "SubSuperscriptGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+%    \end{macrocode}
+% We set the minimum height for the bottom of a subscript to be the height of a superscript in cramped styles minus the depth of a possible descender. Theoretically this is the lowest that any portion of a superscript should ever be if it contains only text.
+%    \begin{macrocode}
+  local dim = "SuperscriptBottomMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_15 - 0.7 * y_depth
+  end
+  local dim = "SuperscriptBaselineDropMax"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_18
+  end
+  local dim = "SuperscriptShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_13
+  end
+  local dim = "SuperscriptShiftUpCramped"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_15
+  end
+%    \end{macrocode}
+% If the superscript and subscript overlap, we choose the new position such that the baselines of subscripts are roughly consistent across subformulas. In this case, the bottom of the superscript box will rise at most to the point such that a subscript containing only text at 70\% of the next-larger style will align with all similar subscripts. The top of the subscript will have approximate height $-\sigma_{16}+0.7*|A_height|$ above the baseline, so to find our desired position for the bottom of the superscript, we add the minimum clearance of a single rule thickness. Putting this parameter in terms of the subscript sizing is necessary because we don't know how large the descender will be in a given subscript.
+%    \begin{macrocode}
+  local dim = "SuperscriptBottomMaxWithSubscript"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = -sigma_16 + 0.7 * A_height + rule_thickness
+  end
+%    \end{macrocode}
+% As with the |Overbar| parameters, we set the extra clearance to be the rule height and the gap to be twice the rule height.
+%    \begin{macrocode}
+  local dim = "UnderbarExtraDescender"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "UnderbarRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "UnderbarVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * rule_thickness
+  end
+%    \end{macrocode}
+% No reason not to set |MinConnectorOverlap| to 0. It doesn't matter for our purposes because \textsf{mathfont} doesn't use extensibles.
+%    \begin{macrocode}
+  local dim = "MinConnectorOverlap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0
+  end
+end
+%    \end{macrocode}
+% Time for callbacks! We create six of them.
+%    \begin{macrocode}
+luatexbase.create_callback("mathfont.inspect_font", "simple", mathfont.empty)
+luatexbase.create_callback("mathfont.pre_adjust", "simple", mathfont.empty)
+luatexbase.create_callback("mathfont.disable_nomath", "simple",
+  mathfont.set_nomath_true)
+luatexbase.create_callback("mathfont.add_math_constants", "simple",
+  mathfont.math_constants)
+luatexbase.create_callback("mathfont.fix_character_metrics", "simple",
+  mathfont.apply_charm_info)
+luatexbase.create_callback("mathfont.post_adjust", "simple", mathfont.empty)
+%    \end{macrocode}
+% The functions |mathfont.info| and |mathfont.get_font_name| are used for informational messaging. The first prints a message in the |log| file, and the second returns a font name.
+%    \begin{macrocode}
+function mathfont.info(msg)
+  texio.write_nl("log", "Package mathfont Info: " .. msg)
+end
+function mathfont.get_font_name(fontdata)
+  return fontdata.fullname or fontdata.psname or fontdata.name or "<??>"
+end
+%    \end{macrocode}
+% The |adjust_font| function is what we will actually be adding to |luaotfload.patch_font|. This function calls the six callbacks at appropriate times and writes informational messages in the |log| file.
+%    \begin{macrocode}
+function mathfont.adjust_font(fontdata)
+  luatexbase.call_callback("mathfont.inspect_font", fontdata)
+  if fontdata.nomath then
+    mathfont.info("Adjusting font " .. mathfont.get_font_name(fontdata) .. ".")
+    luatexbase.call_callback("mathfont.pre_adjust", fontdata)
+    luatexbase.call_callback("mathfont.disable_nomath", fontdata)
+    luatexbase.call_callback("mathfont.add_math_constants", fontdata)
+    luatexbase.call_callback("mathfont.fix_character_metrics", fontdata)
+    luatexbase.call_callback("mathfont.post_adjust", fontdata)
+  else
+    mathfont.info("No changes made to " .. 
+      mathfont.get_font_name(fontdata) .. ".")
+  end
+end
+%    \end{macrocode}
+% Finally, add the processing function to \textsf{luaotfload}'s |patch_font| callback.
+%    \begin{macrocode}
+luatexbase.add_to_callback("luaotfload.patch_font", mathfont.adjust_font,
+  "mathfont.adjust_font")
+%    \end{macrocode}
+% 
+% 
+% \section{Adjust Fonts: Metrics}
+% 
+% 
+% 
+% 
+% This section contains the default charm information for the characters that \textsf{mathfont} adjusts upon loading a font. We will make new variants in the private use area of the font. Lower-case Latin letters will fill unicode slots U+FF000 through U+FF021, which are located in the Supplemental Private Use Area-A portion of the unicode table.
+%    \begin{macrocode}
+mathfont:new_type_a(97, 1044480, {50, 50, -50, 0}) % a
+mathfont:new_type_a(98, 1044481, {50, 50, -50, 0}) % b
+mathfont:new_type_a(99, 1044482, {50, 50, 0, 0}) % c
+mathfont:new_type_a(100, 1044483, {50, -50, -50, 0}) % d
+mathfont:new_type_a(101, 1044484, {50, 50, 0, 0}) % e
+mathfont:new_type_a(102, 1044485, {200, 0, 0, 0}) % f
+mathfont:new_type_a(103, 1044486, {100, 50, -50, 0}) % g
+mathfont:new_type_a(104, 1044487, {50, 0, -50, 0}) % h
+mathfont:new_type_a(105, 1044488, {50, 100, -100, 0}) % i
+mathfont:new_type_a(106, 1044489, {400, 50, -50, 0}) % j
+mathfont:new_type_a(107, 1044490, {50, 50, -100, 0}) % k
+mathfont:new_type_a(108, 1044491, {100, 150, -100, 0}) % l
+mathfont:new_type_a(109, 1044492, {50, 0, 0, 0}) % m
+mathfont:new_type_a(110, 1044493, {50, 0, 0, 0}) % n
+mathfont:new_type_a(111, 1044494, {50, 0, 0, 0}) % o
+mathfont:new_type_a(112, 1044495, {200, 50, -50, 0}) % p
+mathfont:new_type_a(113, 1044496, {50, 0, -50, 0}) % q
+mathfont:new_type_a(114, 1044497, {100, 100, -50, 0}) % r
+mathfont:new_type_a(115, 1044498, {50, 50, -50, 0}) % s
+mathfont:new_type_a(116, 1044499, {50, 50, -50, 0}) % t
+mathfont:new_type_a(117, 1044500, {0, 50, 0, 0}) % u
+mathfont:new_type_a(118, 1044501, {0, 50, -50, 0}) % v
+mathfont:new_type_a(119, 1044502, {0, 50, 0, 0}) % w
+mathfont:new_type_a(120, 1044503, {50, 0, -50, 0}) % x
+mathfont:new_type_a(121, 1044504, {150, 50, -50, 0}) % y
+mathfont:new_type_a(122, 1044505, {100, 50, -100, 0}) % z
+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.
+%    \begin{macrocode}
+mathfont:new_type_a(65, 1044512, {50, 0, 150, 0}) % A
+mathfont:new_type_a(66, 1044513, {50, 0, 0, 0}) % B
+mathfont:new_type_a(67, 1044514, {0, 0, 0, 0}) % C
+mathfont:new_type_a(68, 1044515, {50, 0, -50, 0}) % D
+mathfont:new_type_a(69, 1044516, {50, 0, 0, 0}) % E
+mathfont:new_type_a(70, 1044517, {50, 0, 0, 0}) % F
+mathfont:new_type_a(71, 1044518, {0, 0, 0, 0}) % G
+mathfont:new_type_a(72, 1044519, {50, 0, -50, 0}) % H
+mathfont:new_type_a(73, 1044520, {100, 0, 0, 0}) % I
+mathfont:new_type_a(74, 1044521, {50, 0, 100, 0}) % J
+mathfont:new_type_a(75, 1044522, {50, 0, 0, 0}) % K
+mathfont:new_type_a(76, 1044523, {50, 0, -180, 0}) % L
+mathfont:new_type_a(77, 1044524, {50, 0, -50, 0}) % M
+mathfont:new_type_a(78, 1044525, {50, 0, -50, 0}) % N
+mathfont:new_type_a(79, 1044526, {0, 0, 0, 0}) % O
+mathfont:new_type_a(80, 1044527, {0, 0, -50, 0}) % P
+mathfont:new_type_a(81, 1044528, {0, 50, 0, 0}) % Q
+mathfont:new_type_a(82, 1044529, {50, 0, -50, 0}) % R
+mathfont:new_type_a(83, 1044530, {0, 0, -50, 0}) % S
+mathfont:new_type_a(84, 1044531, {0, 0, -50, 0}) % T
+mathfont:new_type_a(85, 1044532, {0, 0, -50, 0}) % U
+mathfont:new_type_a(86, 1044533, {0, 50, 0, 0}) % V
+mathfont:new_type_a(87, 1044534, {0, 50, -50, 0}) % W
+mathfont:new_type_a(88, 1044535, {50, 0, 0, 0}) % X
+mathfont:new_type_a(89, 1044536, {0, 0, -50, 0}) % Y
+mathfont:new_type_a(90, 1044537, {50, 0, -50, 0}) % Z
+%    \end{macrocode}
+% The Greek characters will be type |u|, so we don't need extra unicode slots for them. In future editions of \textsf{mathfont}, they may becoeme type |a| with adjusted bounding boxes, but I don't have immediate plans for such a change.
+%    \begin{macrocode}
+mathfont:new_type_u(945, {0, 0}) % \alpha
+mathfont:new_type_u(946, {0, 0}) % \beta
+mathfont:new_type_u(947, {-50, 0}) % \gamma
+mathfont:new_type_u(948, {0, 0}) % \delta
+mathfont:new_type_u(1013, {50, 0}) % \epsilon
+mathfont:new_type_u(950, {0, 0}) % \zeta
+mathfont:new_type_u(951, {-50, 0}) % \eta
+mathfont:new_type_u(952, {0, 0}) % \theta
+mathfont:new_type_u(953, {-50, 0}) % \iota
+mathfont:new_type_u(954, {0, 0}) % \kappa
+mathfont:new_type_u(955, {-150, 0}) % lambda
+mathfont:new_type_u(956, {0, 0}) % \mu
+mathfont:new_type_u(957, {-50, 0}) % \nu
+mathfont:new_type_u(958, {0, 0}) % \xi
+mathfont:new_type_u(959, {0, 0}) % \omicron
+mathfont:new_type_u(960, {-100, 0}) % \pi
+mathfont:new_type_u(961, {-50, 0}) % \rho
+mathfont:new_type_u(963, {-100, 0}) % \sigma
+mathfont:new_type_u(964, {-100, 0}) % \tau
+mathfont:new_type_u(965, {-50, 0}) % \upsilon
+mathfont:new_type_u(981, {0, 0}) % \phi
+mathfont:new_type_u(967, {-50, 0}) % \chi
+mathfont:new_type_u(968, {-50, 0}) % \psi
+mathfont:new_type_u(969, {0, 0}) % \omega
+mathfont:new_type_u(976, {0, 0}) % \varbeta
+mathfont:new_type_u(949, {-50, 0}) % \varepsilon
+mathfont:new_type_u(977, {50, 0}) % \vartheta
+mathfont:new_type_u(1009, {-50, 0}) % \varrho
+mathfont:new_type_u(962, {-50, 0}) % \varsigma
+mathfont:new_type_u(966, {0, 0}) % \varphi
+%    \end{macrocode}
+% Capital Greek characters. Same as previously.
+%    \begin{macrocode}
+mathfont:new_type_u(913, {0, 0}) % \Alpha
+mathfont:new_type_u(914, {0, 0}) % \Beta
+mathfont:new_type_u(915, {0, 0}) % \Gamma
+mathfont:new_type_u(916, {0, 0}) % \Delta
+mathfont:new_type_u(917, {0, 0}) % \Epsilon
+mathfont:new_type_u(918, {0, 0}) % \Zeta
+mathfont:new_type_u(919, {0, 0}) % \Eta
+mathfont:new_type_u(920, {0, 0}) % \Theta
+mathfont:new_type_u(921, {0, 0}) % \Iota
+mathfont:new_type_u(922, {0, 0}) % \Kappa
+mathfont:new_type_u(923, {0, 0}) % \Lambda
+mathfont:new_type_u(924, {0, 0}) % \Mu
+mathfont:new_type_u(925, {0, 0}) % \Nu
+mathfont:new_type_u(926, {0, 0}) % \Xi
+mathfont:new_type_u(927, {0, 0}) % \Omicron
+mathfont:new_type_u(928, {0, 0}) % \Pi
+mathfont:new_type_u(929, {0, 0}) % \Rho
+mathfont:new_type_u(931, {0, 0}) % \Sigma
+mathfont:new_type_u(932, {0, 0}) % \Tau
+mathfont:new_type_u(933, {0, 0}) % \Upsilon
+mathfont:new_type_u(934, {0, 0}) % \Phi
+mathfont:new_type_u(935, {0, 0}) % \Chi
+mathfont:new_type_u(936, {0, 0}) % \Psi
+mathfont:new_type_u(937, {0, 0}) % \Omega
+mathfont:new_type_u(1012, {0, 0}) % \varTheta
+%    \end{macrocode}
+% We add the charm information for delimiters and other resizable characters. We divide the characters into four categories depending on how we want to magnify the base glyph to create large variants: delimiters, big operators, vertical characters, and the integral sign. We automate the process by putting charm information for each category of character into a separate table and feeding the whole thing to a wrapper around |:new_type_e|.
+%    \begin{macrocode}
+local delim_glyphs = {40, % (
+  41, % )
+  47, % /
+  91, % [
+  92, % \
+  93, % ]
+  123, % {
+  125, % }
+  8249, % \lguil
+  8250, % \rguil
+  171, % \llguil
+  187, % \rrguil
+  1044508, % \fakelangle
+  1044509, % \fakerangle
+  1044510, % \fakellangle
+  1044511} % \fakerrangle
+local big_op_glyphs = {33, % !
+  35, % #
+  36, % $
+  37, % %
+  38, % &
+  43, % +
+  63, % ?
+  64, % @
+  167, % \S
+  215, % \times
+  247, % \div
+  8719, % \prod
+  8721, % \sum
+  8720, % \coprod
+  8897, % \bigvee
+  8896, % \bigwedge
+  8899, % \bigcup
+  8898, % \bigcap
+  10753, % \bigoplus
+  10754, % \bigotimes
+  10752, % \bigodot
+  10757, % \bigsqcap
+  10758} % \bigsqcup
+local vert_glyphs = {124, 8730} % | and \surd
+local int_glyphs = {8747, % \intop
+  8748, % \iint
+  8749, % \iiint
+  8750, % \oint
+  8751, % \oiint
+  8752} % \oiiint
+%    \end{macrocode}
+% The variable |smash| will keep track of the unicode index used to store the smashed version of the character. 
+%    \begin{macrocode}
+local smash = 1044544
+%    \end{macrocode}
+% Each category of type |e| character will have its own table of charm information with different magnification values. each table is initially empty.
+%    \begin{macrocode}
+local delim_scale = {}
+local big_op_scale = {}
+local vert_scale = {}
+local int_scale = {}
+%    \end{macrocode}
+% Populate each table with magnification information. For every type |e| character we will create fifteen larger variants in the font. Delimiters stretch mostly vertically and some horzontally. Vertical characters stretch vertically only, so their horizontal scale factors are all constant. Big operators stretch the same in vertical and horizoontal directions.
+%    \begin{macrocode}
+for i = 1, 15, 1 do
+  delim_scale[2*i-1] = 1000 + 100*i % horizontal - delimiters
+  delim_scale[2*i] = 1000 + 500*i   % vertical - delimiters
+  vert_scale[2*i-1] = 1000
+  vert_scale[2*i] = 1000 + 500*i    % vertical - vertically scaled chars
+  big_op_scale[2*i-1] = 1000 + 100*i   % horizontal - big operators
+  big_op_scale[2*i] = 1000 + 100*i     % vertical - big operators
+%    \end{macrocode}
+% The integral sign is particular. Visually, we would like an integral symbol that is larger than the large operators, which means that the integral sign should have no variants between the font's value of |\Umathoperatorsize| and the desired larger size. Accordingly, I decided it would be easiest to have large variants of the integral sign jump by large enough scale factors that the smallest variant larger than the regular size is already significantly larger than the |\Umathoperatorsize| setting in |populate_math_constants|. Effectively this means that the user should take the size of the integral operator as fixed and should set |\Umathoperatorsize| to make all other big operators the desired size.
+%    \begin{macrocode}
+  int_scale[2*i-1] = 1000 + 500*i     % horizontal - integral sign
+  int_scale[2*i] = 1000 + 1500*i      % vertical - integral sign
+end
+%    \end{macrocode}
+% We do not modify accent placement.
+%    \begin{macrocode} 
+delim_scale[31] = 0
+delim_scale[32] = 0
+big_op_scale[31] = 0
+big_op_scale[32] = 0
+vert_scale[31] = 0
+vert_scale[32] = 0
+int_scale[31] = 0
+int_scale[32] = 0
+%    \end{macrocode}
+% The wrapper for |:new_type_e|. We feed it the index to use for the smashed base character, a list of characters to create charm information for, and a table of scaling information.
+%    \begin{macrocode}
+function mathfont:add_extensible_variants(first_smash, glyph_list, scale_list)
+  local variants = (\string# scale_list - 2) / 2
+  local curr_smash = first_smash
+  for i = 1, \string# glyph_list, 1 do
+    local curr_char = glyph_list[i]
+%    \end{macrocode}
+% The |curr_slots| list will hold the base-10 unicode index values of each larger variant of the base character. We will take a number of unicode slots following the smashed character equal to the number of large variants we want to create, which we stored in |variants|.
+%    \begin{macrocode}
+    local curr_slots = {}
+    for j = 1, variants, 1 do
+      curr_slots[j] = curr_smash + j
+    end
+%    \end{macrocode}
+% Add the charm information and increment |smash|.
+%    \begin{macrocode}
+    self:new_type_e(curr_char, curr_smash, curr_slots, scale_list)
+    smash = smash + variants + 1
+    curr_smash = smash
+  end
+end
+%    \end{macrocode}
+% Add the charm information for the type |e| characters.
+%    \begin{macrocode}
+mathfont:add_extensible_variants(smash, delim_glyphs, delim_scale)
+mathfont:add_extensible_variants(smash, big_op_glyphs, big_op_scale)
+mathfont:add_extensible_variants(smash, vert_glyphs, vert_scale)
+mathfont:add_extensible_variants(smash, int_glyphs, int_scale)
+%    \end{macrocode}
+% Finally, end the call to |\directlua| and balance the preceeding conditional.
+%    \begin{macrocode}
+}
+\fi % matches previous \ifM at adjust@font
+%    \end{macrocode}
+% 
+% 
+% 
 % \section{Unicode Hex Values}
 % 
 % 
 % 
-% Set capital Latin characters. We use an |\edef| for |\M at upper| because
+% Set upper-case Latin characters. We use an |\edef| for |\M at upper@font| because
 % every expansion now will save \LaTeX\ twenty-six expansions later when it 
-% evaluates each |\DeclareMathSymbol|.\?\M at upper\indexpage{keywordupper=keyword \texttt{upper}}%
+% evaluates each |\DeclareMathSymbol|. If the user has enabled Lua font adjustments, we set the math codes to be the large values from the Supplemental Private Use Area-A.\indexpage{keywordupper=keyword \texttt{upper}}%
 %    \begin{macrocode}
-\def\M at upper@set{%
-  \edef\M at upper{M\@uppershape\the\M at count}
-  \DeclareMathSymbol{A}{\mathalpha}{\M at upper}{`A}
-  \DeclareMathSymbol{B}{\mathalpha}{\M at upper}{`B}
-  \DeclareMathSymbol{C}{\mathalpha}{\M at upper}{`C}
-  \DeclareMathSymbol{D}{\mathalpha}{\M at upper}{`D}
-  \DeclareMathSymbol{E}{\mathalpha}{\M at upper}{`E}
-  \DeclareMathSymbol{F}{\mathalpha}{\M at upper}{`F}
-  \DeclareMathSymbol{G}{\mathalpha}{\M at upper}{`G}
-  \DeclareMathSymbol{H}{\mathalpha}{\M at upper}{`H}
-  \DeclareMathSymbol{I}{\mathalpha}{\M at upper}{`I}
-  \DeclareMathSymbol{J}{\mathalpha}{\M at upper}{`J}
-  \DeclareMathSymbol{K}{\mathalpha}{\M at upper}{`K}
-  \DeclareMathSymbol{L}{\mathalpha}{\M at upper}{`L}
-  \DeclareMathSymbol{M}{\mathalpha}{\M at upper}{`M}
-  \DeclareMathSymbol{N}{\mathalpha}{\M at upper}{`N}
-  \DeclareMathSymbol{O}{\mathalpha}{\M at upper}{`O}
-  \DeclareMathSymbol{P}{\mathalpha}{\M at upper}{`P}
-  \DeclareMathSymbol{Q}{\mathalpha}{\M at upper}{`Q}
-  \DeclareMathSymbol{R}{\mathalpha}{\M at upper}{`R}
-  \DeclareMathSymbol{S}{\mathalpha}{\M at upper}{`S}
-  \DeclareMathSymbol{T}{\mathalpha}{\M at upper}{`T}
-  \DeclareMathSymbol{U}{\mathalpha}{\M at upper}{`U}
-  \DeclareMathSymbol{V}{\mathalpha}{\M at upper}{`V}
-  \DeclareMathSymbol{W}{\mathalpha}{\M at upper}{`W}
-  \DeclareMathSymbol{X}{\mathalpha}{\M at upper}{`X}
-  \DeclareMathSymbol{Y}{\mathalpha}{\M at upper}{`Y}
-  \DeclareMathSymbol{Z}{\mathalpha}{\M at upper}{`Z}}
+\ifM at adjust@font
+  \def\M at upper@set{%
+    \edef\M at upper@font{M\M at uppershape\@tempa}
+    \DeclareMathSymbol{A}{\mathalpha}{\M at upper@font}{1044512}
+    \DeclareMathSymbol{B}{\mathalpha}{\M at upper@font}{1044513}
+    \DeclareMathSymbol{C}{\mathalpha}{\M at upper@font}{1044514}
+    \DeclareMathSymbol{D}{\mathalpha}{\M at upper@font}{1044515}
+    \DeclareMathSymbol{E}{\mathalpha}{\M at upper@font}{1044516}
+    \DeclareMathSymbol{F}{\mathalpha}{\M at upper@font}{1044517}
+    \DeclareMathSymbol{G}{\mathalpha}{\M at upper@font}{1044518}
+    \DeclareMathSymbol{H}{\mathalpha}{\M at upper@font}{1044519}
+    \DeclareMathSymbol{I}{\mathalpha}{\M at upper@font}{1044520}
+    \DeclareMathSymbol{J}{\mathalpha}{\M at upper@font}{1044521}
+    \DeclareMathSymbol{K}{\mathalpha}{\M at upper@font}{1044522}
+    \DeclareMathSymbol{L}{\mathalpha}{\M at upper@font}{1044523}
+    \DeclareMathSymbol{M}{\mathalpha}{\M at upper@font}{1044524}
+    \DeclareMathSymbol{N}{\mathalpha}{\M at upper@font}{1044525}
+    \DeclareMathSymbol{O}{\mathalpha}{\M at upper@font}{1044526}
+    \DeclareMathSymbol{P}{\mathalpha}{\M at upper@font}{1044527}
+    \DeclareMathSymbol{Q}{\mathalpha}{\M at upper@font}{1044528}
+    \DeclareMathSymbol{R}{\mathalpha}{\M at upper@font}{1044529}
+    \DeclareMathSymbol{S}{\mathalpha}{\M at upper@font}{1044530}
+    \DeclareMathSymbol{T}{\mathalpha}{\M at upper@font}{1044531}
+    \DeclareMathSymbol{U}{\mathalpha}{\M at upper@font}{1044532}
+    \DeclareMathSymbol{V}{\mathalpha}{\M at upper@font}{1044533}
+    \DeclareMathSymbol{W}{\mathalpha}{\M at upper@font}{1044534}
+    \DeclareMathSymbol{X}{\mathalpha}{\M at upper@font}{1044535}
+    \DeclareMathSymbol{Y}{\mathalpha}{\M at upper@font}{1044536}
+    \DeclareMathSymbol{Z}{\mathalpha}{\M at upper@font}{1044537}}
+\else
+  \def\M at upper@set{%
+    \edef\M at upper@font{M\M at uppershape\@tempa}
+    \DeclareMathSymbol{A}{\mathalpha}{\M at upper@font}{`A}
+    \DeclareMathSymbol{B}{\mathalpha}{\M at upper@font}{`B}
+    \DeclareMathSymbol{C}{\mathalpha}{\M at upper@font}{`C}
+    \DeclareMathSymbol{D}{\mathalpha}{\M at upper@font}{`D}
+    \DeclareMathSymbol{E}{\mathalpha}{\M at upper@font}{`E}
+    \DeclareMathSymbol{F}{\mathalpha}{\M at upper@font}{`F}
+    \DeclareMathSymbol{G}{\mathalpha}{\M at upper@font}{`G}
+    \DeclareMathSymbol{H}{\mathalpha}{\M at upper@font}{`H}
+    \DeclareMathSymbol{I}{\mathalpha}{\M at upper@font}{`I}
+    \DeclareMathSymbol{J}{\mathalpha}{\M at upper@font}{`J}
+    \DeclareMathSymbol{K}{\mathalpha}{\M at upper@font}{`K}
+    \DeclareMathSymbol{L}{\mathalpha}{\M at upper@font}{`L}
+    \DeclareMathSymbol{M}{\mathalpha}{\M at upper@font}{`M}
+    \DeclareMathSymbol{N}{\mathalpha}{\M at upper@font}{`N}
+    \DeclareMathSymbol{O}{\mathalpha}{\M at upper@font}{`O}
+    \DeclareMathSymbol{P}{\mathalpha}{\M at upper@font}{`P}
+    \DeclareMathSymbol{Q}{\mathalpha}{\M at upper@font}{`Q}
+    \DeclareMathSymbol{R}{\mathalpha}{\M at upper@font}{`R}
+    \DeclareMathSymbol{S}{\mathalpha}{\M at upper@font}{`S}
+    \DeclareMathSymbol{T}{\mathalpha}{\M at upper@font}{`T}
+    \DeclareMathSymbol{U}{\mathalpha}{\M at upper@font}{`U}
+    \DeclareMathSymbol{V}{\mathalpha}{\M at upper@font}{`V}
+    \DeclareMathSymbol{W}{\mathalpha}{\M at upper@font}{`W}
+    \DeclareMathSymbol{X}{\mathalpha}{\M at upper@font}{`X}
+    \DeclareMathSymbol{Y}{\mathalpha}{\M at upper@font}{`Y}
+    \DeclareMathSymbol{Z}{\mathalpha}{\M at upper@font}{`Z}}
+\fi
 %    \end{macrocode}
-% Set minuscule Latin characters.
-% \?\M at lower\indexpage{keywordlower=keyword \texttt{lower}}
+% Set lower-case Latin characters.\indexpage{keywordlower=keyword \texttt{lower}}
 %    \begin{macrocode}
-\def\M at lower@set{%
-  \edef\M at lower{M\@lowershape\the\M at count}
-  \DeclareMathSymbol{a}{\mathalpha}{\M at lower}{`a}
-  \DeclareMathSymbol{b}{\mathalpha}{\M at lower}{`b}
-  \DeclareMathSymbol{c}{\mathalpha}{\M at lower}{`c}
-  \DeclareMathSymbol{d}{\mathalpha}{\M at lower}{`d}
-  \DeclareMathSymbol{e}{\mathalpha}{\M at lower}{`e}
-  \DeclareMathSymbol{f}{\mathalpha}{\M at lower}{`f}
-  \DeclareMathSymbol{g}{\mathalpha}{\M at lower}{`g}
-  \DeclareMathSymbol{h}{\mathalpha}{\M at lower}{`h}
-  \DeclareMathSymbol{i}{\mathalpha}{\M at lower}{`i}
-  \DeclareMathSymbol{\imath}{\mathalpha}{\M at lower}{"131}
-  \DeclareMathSymbol{j}{\mathalpha}{\M at lower}{`j}
-  \DeclareMathSymbol{\jmath}{\mathalpha}{\M at lower}{"237}
-  \DeclareMathSymbol{k}{\mathalpha}{\M at lower}{`k}
-  \DeclareMathSymbol{l}{\mathalpha}{\M at lower}{`l}
-  \DeclareMathSymbol{m}{\mathalpha}{\M at lower}{`m}
-  \DeclareMathSymbol{n}{\mathalpha}{\M at lower}{`n}
-  \DeclareMathSymbol{o}{\mathalpha}{\M at lower}{`o}
-  \DeclareMathSymbol{p}{\mathalpha}{\M at lower}{`p}
-  \DeclareMathSymbol{q}{\mathalpha}{\M at lower}{`q}
-  \DeclareMathSymbol{r}{\mathalpha}{\M at lower}{`r}
-  \DeclareMathSymbol{s}{\mathalpha}{\M at lower}{`s}
-  \DeclareMathSymbol{t}{\mathalpha}{\M at lower}{`t}
-  \DeclareMathSymbol{u}{\mathalpha}{\M at lower}{`u}
-  \DeclareMathSymbol{v}{\mathalpha}{\M at lower}{`v}
-  \DeclareMathSymbol{w}{\mathalpha}{\M at lower}{`w}
-  \DeclareMathSymbol{x}{\mathalpha}{\M at lower}{`x}
-  \DeclareMathSymbol{y}{\mathalpha}{\M at lower}{`y}
-  \DeclareMathSymbol{z}{\mathalpha}{\M at lower}{`z}}
+\ifM at adjust@font
+  \def\M at lower@set{%
+    \edef\M at lower@font{M\M at lowershape\@tempa}
+    \DeclareMathSymbol{a}{\mathalpha}{\M at lower@font}{1044480}
+    \DeclareMathSymbol{b}{\mathalpha}{\M at lower@font}{1044481}
+    \DeclareMathSymbol{c}{\mathalpha}{\M at lower@font}{1044482}
+    \DeclareMathSymbol{d}{\mathalpha}{\M at lower@font}{1044483}
+    \DeclareMathSymbol{e}{\mathalpha}{\M at lower@font}{1044484}
+    \DeclareMathSymbol{f}{\mathalpha}{\M at lower@font}{1044485}
+    \DeclareMathSymbol{g}{\mathalpha}{\M at lower@font}{1044486}
+    \DeclareMathSymbol{h}{\mathalpha}{\M at lower@font}{1044487}
+    \DeclareMathSymbol{i}{\mathalpha}{\M at lower@font}{1044488}
+    \DeclareMathSymbol{j}{\mathalpha}{\M at lower@font}{1044489}
+    \DeclareMathSymbol{k}{\mathalpha}{\M at lower@font}{1044490}
+    \DeclareMathSymbol{l}{\mathalpha}{\M at lower@font}{1044491}
+    \DeclareMathSymbol{m}{\mathalpha}{\M at lower@font}{1044492}
+    \DeclareMathSymbol{n}{\mathalpha}{\M at lower@font}{1044493}
+    \DeclareMathSymbol{o}{\mathalpha}{\M at lower@font}{1044494}
+    \DeclareMathSymbol{p}{\mathalpha}{\M at lower@font}{1044495}
+    \DeclareMathSymbol{q}{\mathalpha}{\M at lower@font}{1044496}
+    \DeclareMathSymbol{r}{\mathalpha}{\M at lower@font}{1044497}
+    \DeclareMathSymbol{s}{\mathalpha}{\M at lower@font}{1044498}
+    \DeclareMathSymbol{t}{\mathalpha}{\M at lower@font}{1044499}
+    \DeclareMathSymbol{u}{\mathalpha}{\M at lower@font}{1044500}
+    \DeclareMathSymbol{v}{\mathalpha}{\M at lower@font}{1044501}
+    \DeclareMathSymbol{w}{\mathalpha}{\M at lower@font}{1044502}
+    \DeclareMathSymbol{x}{\mathalpha}{\M at lower@font}{1044503}
+    \DeclareMathSymbol{y}{\mathalpha}{\M at lower@font}{1044504}
+    \DeclareMathSymbol{z}{\mathalpha}{\M at lower@font}{1044505}
+    \DeclareMathSymbol{\imath}{\mathalpha}{\M at lower@font}{1044506}
+    \DeclareMathSymbol{\jmath}{\mathalpha}{\M at lower@font}{1044507}
+    \DeclareMathSymbol{\hbar}{\mathord}{\M at lower@font}{"127}}
+\else
+  \def\M at lower@set{%
+    \edef\M at lower@font{M\M at lowershape\@tempa}
+    \DeclareMathSymbol{a}{\mathalpha}{\M at lower@font}{`a}
+    \DeclareMathSymbol{b}{\mathalpha}{\M at lower@font}{`b}
+    \DeclareMathSymbol{c}{\mathalpha}{\M at lower@font}{`c}
+    \DeclareMathSymbol{d}{\mathalpha}{\M at lower@font}{`d}
+    \DeclareMathSymbol{e}{\mathalpha}{\M at lower@font}{`e}
+    \DeclareMathSymbol{f}{\mathalpha}{\M at lower@font}{`f}
+    \DeclareMathSymbol{g}{\mathalpha}{\M at lower@font}{`g}
+    \DeclareMathSymbol{h}{\mathalpha}{\M at lower@font}{`h}
+    \DeclareMathSymbol{i}{\mathalpha}{\M at lower@font}{`i}
+    \DeclareMathSymbol{j}{\mathalpha}{\M at lower@font}{`j}
+    \DeclareMathSymbol{k}{\mathalpha}{\M at lower@font}{`k}
+    \DeclareMathSymbol{l}{\mathalpha}{\M at lower@font}{`l}
+    \DeclareMathSymbol{m}{\mathalpha}{\M at lower@font}{`m}
+    \DeclareMathSymbol{n}{\mathalpha}{\M at lower@font}{`n}
+    \DeclareMathSymbol{o}{\mathalpha}{\M at lower@font}{`o}
+    \DeclareMathSymbol{p}{\mathalpha}{\M at lower@font}{`p}
+    \DeclareMathSymbol{q}{\mathalpha}{\M at lower@font}{`q}
+    \DeclareMathSymbol{r}{\mathalpha}{\M at lower@font}{`r}
+    \DeclareMathSymbol{s}{\mathalpha}{\M at lower@font}{`s}
+    \DeclareMathSymbol{t}{\mathalpha}{\M at lower@font}{`t}
+    \DeclareMathSymbol{u}{\mathalpha}{\M at lower@font}{`u}
+    \DeclareMathSymbol{v}{\mathalpha}{\M at lower@font}{`v}
+    \DeclareMathSymbol{w}{\mathalpha}{\M at lower@font}{`w}
+    \DeclareMathSymbol{x}{\mathalpha}{\M at lower@font}{`x}
+    \DeclareMathSymbol{y}{\mathalpha}{\M at lower@font}{`y}
+    \DeclareMathSymbol{z}{\mathalpha}{\M at lower@font}{`z}
+    \DeclareMathSymbol{\imath}{\mathalpha}{\M at lower@font}{"131}
+    \DeclareMathSymbol{\jmath}{\mathalpha}{\M at lower@font}{"237}
+    \DeclareMathSymbol{\hbar}{\mathord}{\M at lower@font}{"127}}
+\fi
 %    \end{macrocode}
-% Set diacritics.\?\M at diacritics\indexpage{keyworddiacritics=keyword \texttt{diacritics}}
+% Set diacritics.\indexpage{keyworddiacritics=keyword \texttt{diacritics}}
 %    \begin{macrocode}
 \def\M at diacritics@set{%
-  \edef\M at diacritics{M\@diacriticsshape\the\M at count}
-  \DeclareMathAccent{\acute}{\mathalpha}{\M at diacritics}{"B4}
-  \DeclareMathAccent{\aacute}{\mathalpha}{\M at diacritics}{"2DD}
-  \DeclareMathAccent{\dot}{\mathalpha}{\M at diacritics}{"2D9}
-  \DeclareMathAccent{\ddot}{\mathalpha}{\M at diacritics}{"A8}
-  \DeclareMathAccent{\grave}{\mathalpha}{\M at diacritics}{"60}
-  \DeclareMathAccent{\breve}{\mathalpha}{\M at diacritics}{"2D8}
-  \DeclareMathAccent{\hat}{\mathalpha}{\M at diacritics}{"2C6}
-  \DeclareMathAccent{\check}{\mathalpha}{\M at diacritics}{"2C7}
-  \DeclareMathAccent{\bar}{\mathalpha}{\M at diacritics}{"AF}
-  \DeclareMathAccent{\mathring}{\mathalpha}{\M at diacritics}{"2DA}
-  \DeclareMathAccent{\tilde}{\mathalpha}{\M at diacritics}{"2DC}}
+  \edef\M at diacritics@font{M\M at diacriticsshape\@tempa}
+  \DeclareMathAccent{\acute}{\mathalpha}{\M at diacritics@font}{"B4}
+  \DeclareMathAccent{\aacute}{\mathalpha}{\M at diacritics@font}{"2DD}
+  \DeclareMathAccent{\dot}{\mathalpha}{\M at diacritics@font}{"2D9}
+  \DeclareMathAccent{\ddot}{\mathalpha}{\M at diacritics@font}{"A8}
+  \DeclareMathAccent{\grave}{\mathalpha}{\M at diacritics@font}{"60}
+  \DeclareMathAccent{\breve}{\mathalpha}{\M at diacritics@font}{"2D8}
+  \DeclareMathAccent{\hat}{\mathalpha}{\M at diacritics@font}{"2C6}
+  \DeclareMathAccent{\check}{\mathalpha}{\M at diacritics@font}{"2C7}
+  \DeclareMathAccent{\bar}{\mathalpha}{\M at diacritics@font}{"2C9}
+  \DeclareMathAccent{\mathring}{\mathalpha}{\M at diacritics@font}{"2DA}
+  \DeclareMathAccent{\tilde}{\mathalpha}{\M at diacritics@font}{"2DC}}
 %    \end{macrocode}
-% Set capital Greek characters.\?{\M at greekupper}\indexpage{keywordgreeklower=keyword \texttt{greekupper}}
+% Set capital Greek characters.\indexpage{keywordgreeklower=keyword \texttt{greekupper}}
 %    \begin{macrocode}
 \def\M at greekupper@set{%
-  \edef\M at greekupper{M\@greekuppershape\the\M at count}
-  \DeclareMathSymbol{\Alpha}{\mathalpha}{\M at greekupper}{"391}
-  \DeclareMathSymbol{\Beta}{\mathalpha}{\M at greekupper}{"392}
-  \DeclareMathSymbol{\Gamma}{\mathalpha}{\M at greekupper}{"393}
-  \DeclareMathSymbol{\Delta}{\mathalpha}{\M at greekupper}{"394}
-  \DeclareMathSymbol{\Epsilon}{\mathalpha}{\M at greekupper}{"395}
-  \DeclareMathSymbol{\Zeta}{\mathalpha}{\M at greekupper}{"396}
-  \DeclareMathSymbol{\Eta}{\mathalpha}{\M at greekupper}{"397}
-  \DeclareMathSymbol{\Theta}{\mathalpha}{\M at greekupper}{"398}
-  \DeclareMathSymbol{\Iota}{\mathalpha}{\M at greekupper}{"399}
-  \DeclareMathSymbol{\Kappa}{\mathalpha}{\M at greekupper}{"39A}
-  \DeclareMathSymbol{\Lambda}{\mathalpha}{\M at greekupper}{"39B}
-  \DeclareMathSymbol{\Mu}{\mathalpha}{\M at greekupper}{"39C}
-  \DeclareMathSymbol{\Nu}{\mathalpha}{\M at greekupper}{"39D}
-  \DeclareMathSymbol{\Xi}{\mathalpha}{\M at greekupper}{"39E}
-  \DeclareMathSymbol{\Omicron}{\mathalpha}{\M at greekupper}{"39F}
-  \DeclareMathSymbol{\Pi}{\mathalpha}{\M at greekupper}{"3A0}
-  \DeclareMathSymbol{\Rho}{\mathalpha}{\M at greekupper}{"3A1}
-  \DeclareMathSymbol{\Sigma}{\mathalpha}{\M at greekupper}{"3A3}
-  \DeclareMathSymbol{\Tau}{\mathalpha}{\M at greekupper}{"3A4}
-  \DeclareMathSymbol{\Upsilon}{\mathalpha}{\M at greekupper}{"3A5}
-  \DeclareMathSymbol{\Phi}{\mathalpha}{\M at greekupper}{"3A6}
-  \DeclareMathSymbol{\Chi}{\mathalpha}{\M at greekupper}{"3A7}
-  \DeclareMathSymbol{\Psi}{\mathalpha}{\M at greekupper}{"3A8}
-  \DeclareMathSymbol{\Omega}{\mathalpha}{\M at greekupper}{"3A9}
-  \DeclareMathSymbol{\varTheta}{\mathalpha}{\M at greekupper}{"3F4}}
+  \edef\M at greekupper@font{M\M at greekuppershape\@tempa}
+  \DeclareMathSymbol{\Alpha}{\mathalpha}{\M at greekupper@font}{"391}
+  \DeclareMathSymbol{\Beta}{\mathalpha}{\M at greekupper@font}{"392}
+  \DeclareMathSymbol{\Gamma}{\mathalpha}{\M at greekupper@font}{"393}
+  \DeclareMathSymbol{\Delta}{\mathalpha}{\M at greekupper@font}{"394}
+  \DeclareMathSymbol{\Epsilon}{\mathalpha}{\M at greekupper@font}{"395}
+  \DeclareMathSymbol{\Zeta}{\mathalpha}{\M at greekupper@font}{"396}
+  \DeclareMathSymbol{\Eta}{\mathalpha}{\M at greekupper@font}{"397}
+  \DeclareMathSymbol{\Theta}{\mathalpha}{\M at greekupper@font}{"398}
+  \DeclareMathSymbol{\Iota}{\mathalpha}{\M at greekupper@font}{"399}
+  \DeclareMathSymbol{\Kappa}{\mathalpha}{\M at greekupper@font}{"39A}
+  \DeclareMathSymbol{\Lambda}{\mathalpha}{\M at greekupper@font}{"39B}
+  \DeclareMathSymbol{\Mu}{\mathalpha}{\M at greekupper@font}{"39C}
+  \DeclareMathSymbol{\Nu}{\mathalpha}{\M at greekupper@font}{"39D}
+  \DeclareMathSymbol{\Xi}{\mathalpha}{\M at greekupper@font}{"39E}
+  \DeclareMathSymbol{\Omicron}{\mathalpha}{\M at greekupper@font}{"39F}
+  \DeclareMathSymbol{\Pi}{\mathalpha}{\M at greekupper@font}{"3A0}
+  \DeclareMathSymbol{\Rho}{\mathalpha}{\M at greekupper@font}{"3A1}
+  \DeclareMathSymbol{\Sigma}{\mathalpha}{\M at greekupper@font}{"3A3}
+  \DeclareMathSymbol{\Tau}{\mathalpha}{\M at greekupper@font}{"3A4}
+  \DeclareMathSymbol{\Upsilon}{\mathalpha}{\M at greekupper@font}{"3A5}
+  \DeclareMathSymbol{\Phi}{\mathalpha}{\M at greekupper@font}{"3A6}
+  \DeclareMathSymbol{\Chi}{\mathalpha}{\M at greekupper@font}{"3A7}
+  \DeclareMathSymbol{\Psi}{\mathalpha}{\M at greekupper@font}{"3A8}
+  \DeclareMathSymbol{\Omega}{\mathalpha}{\M at greekupper@font}{"3A9}
+  \DeclareMathSymbol{\varTheta}{\mathalpha}{\M at greekupper@font}{"3F4}
 %    \end{macrocode}
-% Set minuscule Greek characters.\?\M at greeklower\indexpage{keywordgreeklower=keyword \texttt{greeklower}}
+% Declare |\increment| and |\nabla| if they haven't already been declared in the |symbols| or |extsymbols| fonts.
 %    \begin{macrocode}
+  \ifM at adjust@font
+    \ifM at symbols\else
+      \DeclareMathSymbol{\increment}{\mathord}{\M at greekupper@font}{"2206}
+      \DeclareMathSymbol{\nabla}{\mathord}{\M at greekupper@font}{"2207}
+    \fi
+  \else
+    \ifM at symbols\else
+      \DeclareMathSymbol{\increment}{\mathord}{\M at greekupper@font}{"2206}
+    \fi
+    \ifM at extsymbols\else
+      \DeclareMathSymbol{\nabla}{\mathord}{\M at greekupper@font}{"2207}
+    \fi
+  \fi}
+%    \end{macrocode}
+% Set minuscule Greek characters.\indexpage{keywordgreeklower=keyword \texttt{greeklower}}
+%    \begin{macrocode}
 \def\M at greeklower@set{%
-  \edef\M at greeklower{M\@greeklowershape\the\M at count}
-  \DeclareMathSymbol{\alpha}{\mathalpha}{\M at greeklower}{"3B1}
-  \DeclareMathSymbol{\beta}{\mathalpha}{\M at greeklower}{"3B2}
-  \DeclareMathSymbol{\gamma}{\mathalpha}{\M at greeklower}{"3B3}
-  \DeclareMathSymbol{\delta}{\mathalpha}{\M at greeklower}{"3B4}
-  \DeclareMathSymbol{\epsilon}{\mathalpha}{\M at greeklower}{"3F5}
-  \DeclareMathSymbol{\zeta}{\mathalpha}{\M at greeklower}{"3B6}
-  \DeclareMathSymbol{\eta}{\mathalpha}{\M at greeklower}{"3B7}
-  \DeclareMathSymbol{\theta}{\mathalpha}{\M at greeklower}{"3B8}
-  \DeclareMathSymbol{\iota}{\mathalpha}{\M at greeklower}{"3B9}
-  \DeclareMathSymbol{\kappa}{\mathalpha}{\M at greeklower}{"3BA}
-  \DeclareMathSymbol{\lambda}{\mathalpha}{\M at greeklower}{"3BB}
-  \DeclareMathSymbol{\mu}{\mathalpha}{\M at greeklower}{"3BC}
-  \DeclareMathSymbol{\nu}{\mathalpha}{\M at greeklower}{"3BD}
-  \DeclareMathSymbol{\xi}{\mathalpha}{\M at greeklower}{"3BE}
-  \DeclareMathSymbol{\omicron}{\mathalpha}{\M at greeklower}{"3BF}
-  \DeclareMathSymbol{\pi}{\mathalpha}{\M at greeklower}{"3C0}
-  \DeclareMathSymbol{\rho}{\mathalpha}{\M at greeklower}{"3C1}
-  \DeclareMathSymbol{\sigma}{\mathalpha}{\M at greeklower}{"3C3}
-  \DeclareMathSymbol{\tau}{\mathalpha}{\M at greeklower}{"3C4}
-  \DeclareMathSymbol{\upsilon}{\mathalpha}{\M at greeklower}{"3C5}
-  \DeclareMathSymbol{\phi}{\mathalpha}{\M at greeklower}{"3D5}
-  \DeclareMathSymbol{\chi}{\mathalpha}{\M at greeklower}{"3C7}
-  \DeclareMathSymbol{\psi}{\mathalpha}{\M at greeklower}{"3C8}
-  \DeclareMathSymbol{\omega}{\mathalpha}{\M at greeklower}{"3C9}
-  \DeclareMathSymbol{\varbeta}{\mathalpha}{\M at greeklower}{"3D0}
-  \DeclareMathSymbol{\varepsilon}{\mathalpha}{\M at greeklower}{"3B5}
-  \DeclareMathSymbol{\vartheta}{\mathalpha}{\M at greeklower}{"3D1}
-  \DeclareMathSymbol{\varrho}{\mathalpha}{\M at greeklower}{"3F1}
-  \DeclareMathSymbol{\varsigma}{\mathalpha}{\M at greeklower}{"3C2}
-  \DeclareMathSymbol{\varphi}{\mathalpha}{\M at greeklower}{"3C6}}
+  \edef\M at greeklower@font{M\M at greeklowershape\@tempa}
+  \DeclareMathSymbol{\alpha}{\mathalpha}{\M at greeklower@font}{"3B1}
+  \DeclareMathSymbol{\beta}{\mathalpha}{\M at greeklower@font}{"3B2}
+  \DeclareMathSymbol{\gamma}{\mathalpha}{\M at greeklower@font}{"3B3}
+  \DeclareMathSymbol{\delta}{\mathalpha}{\M at greeklower@font}{"3B4}
+  \DeclareMathSymbol{\epsilon}{\mathalpha}{\M at greeklower@font}{"3B5}
+  \DeclareMathSymbol{\zeta}{\mathalpha}{\M at greeklower@font}{"3B6}
+  \DeclareMathSymbol{\eta}{\mathalpha}{\M at greeklower@font}{"3B7}
+  \DeclareMathSymbol{\theta}{\mathalpha}{\M at greeklower@font}{"3B8}
+  \DeclareMathSymbol{\iota}{\mathalpha}{\M at greeklower@font}{"3B9}
+  \DeclareMathSymbol{\kappa}{\mathalpha}{\M at greeklower@font}{"3BA}
+  \DeclareMathSymbol{\lambda}{\mathalpha}{\M at greeklower@font}{"3BB}
+  \DeclareMathSymbol{\mu}{\mathalpha}{\M at greeklower@font}{"3BC}
+  \DeclareMathSymbol{\nu}{\mathalpha}{\M at greeklower@font}{"3BD}
+  \DeclareMathSymbol{\xi}{\mathalpha}{\M at greeklower@font}{"3BE}
+  \DeclareMathSymbol{\omicron}{\mathalpha}{\M at greeklower@font}{"3BF}
+  \DeclareMathSymbol{\pi}{\mathalpha}{\M at greeklower@font}{"3C0}
+  \DeclareMathSymbol{\rho}{\mathalpha}{\M at greeklower@font}{"3C1}
+  \DeclareMathSymbol{\sigma}{\mathalpha}{\M at greeklower@font}{"3C3}
+  \DeclareMathSymbol{\tau}{\mathalpha}{\M at greeklower@font}{"3C4}
+  \DeclareMathSymbol{\upsilon}{\mathalpha}{\M at greeklower@font}{"3C5}
+  \DeclareMathSymbol{\phi}{\mathalpha}{\M at greeklower@font}{"3C6}
+  \DeclareMathSymbol{\chi}{\mathalpha}{\M at greeklower@font}{"3C7}
+  \DeclareMathSymbol{\psi}{\mathalpha}{\M at greeklower@font}{"3C8}
+  \DeclareMathSymbol{\omega}{\mathalpha}{\M at greeklower@font}{"3C9}
+  \DeclareMathSymbol{\varbeta}{\mathalpha}{\M at greeklower@font}{"3D0}
+  \DeclareMathSymbol{\varepsilon}{\mathalpha}{\M at greeklower@font}{"3F5}
+  \DeclareMathSymbol{\varkappa}{\mathalpha}{\M at greeklower@font}{"3F0}
+  \DeclareMathSymbol{\vartheta}{\mathalpha}{\M at greeklower@font}{"3D1}
+  \DeclareMathSymbol{\varrho}{\mathalpha}{\M at greeklower@font}{"3F1}
+  \DeclareMathSymbol{\varsigma}{\mathalpha}{\M at greeklower@font}{"3C2}
+  \DeclareMathSymbol{\varphi}{\mathalpha}{\M at greeklower@font}{"3D5}}
 %    \end{macrocode}
-% Set capital ancient Greek characters.\?\M at agreekupper\indexpage{keywordagreekupper=keyword \texttt{agreekupper}}
+% Set capital ancient Greek characters.\indexpage{keywordagreekupper=keyword \texttt{agreekupper}}
 %    \begin{macrocode}
 \def\M at agreekupper@set{%
-  \edef\M at agreekupper{M\@agreekuppershape\the\M at count}
-  \DeclareMathSymbol{\Heta}{\mathalpha}{\M at agreekupper}{"370}
-  \DeclareMathSymbol{\Sampi}{\mathalpha}{\M at agreekupper}{"3E0}
-  \DeclareMathSymbol{\Digamma}{\mathalpha}{\M at agreekupper}{"3DC}
-  \DeclareMathSymbol{\Koppa}{\mathalpha}{\M at agreekupper}{"3D8}
-  \DeclareMathSymbol{\Stigma}{\mathalpha}{\M at agreekupper}{"3DA}
-  \DeclareMathSymbol{\Sho}{\mathalpha}{\M at agreekupper}{"3F7}
-  \DeclareMathSymbol{\San}{\mathalpha}{\M at agreekupper}{"3FA}
-  \DeclareMathSymbol{\varSampi}{\mathalpha}{\M at agreekupper}{"372}
-  \DeclareMathSymbol{\varDigamma}{\mathalpha}{\M at agreekupper}{"376}
-  \DeclareMathSymbol{\varKoppa}{\mathalpha}{\M at agreekupper}{"3DE}}
+  \edef\M at agreekupper@font{M\M at agreekuppershape\@tempa}
+  \DeclareMathSymbol{\Heta}{\mathalpha}{\M at agreekupper@font}{"370}
+  \DeclareMathSymbol{\Sampi}{\mathalpha}{\M at agreekupper@font}{"3E0}
+  \DeclareMathSymbol{\Digamma}{\mathalpha}{\M at agreekupper@font}{"3DC}
+  \DeclareMathSymbol{\Koppa}{\mathalpha}{\M at agreekupper@font}{"3D8}
+  \DeclareMathSymbol{\Stigma}{\mathalpha}{\M at agreekupper@font}{"3DA}
+  \DeclareMathSymbol{\Sho}{\mathalpha}{\M at agreekupper@font}{"3F7}
+  \DeclareMathSymbol{\San}{\mathalpha}{\M at agreekupper@font}{"3FA}
+  \DeclareMathSymbol{\varSampi}{\mathalpha}{\M at agreekupper@font}{"372}
+  \DeclareMathSymbol{\varDigamma}{\mathalpha}{\M at agreekupper@font}{"376}
+  \DeclareMathSymbol{\varKoppa}{\mathalpha}{\M at agreekupper@font}{"3DE}}
 %    \end{macrocode}
-% Set minuscule ancient Greek characters.\?\M at agreeklower\indexpage{keywordagreeklower=keyword \texttt{agreeklower}}
+% Set minuscule ancient Greek characters.\indexpage{keywordagreeklower=keyword \texttt{agreeklower}}
 %    \begin{macrocode}
 \def\M at agreeklower@set{%
-  \edef\M at agreeklower{M\@agreeklowershape\the\M at count}
-  \DeclareMathSymbol{\heta}{\mathalpha}{\M at agreeklower}{"371}
-  \DeclareMathSymbol{\sampi}{\mathalpha}{\M at agreeklower}{"3E1}
-  \DeclareMathSymbol{\digamma}{\mathalpha}{\M at agreeklower}{"3DD}
-  \DeclareMathSymbol{\koppa}{\mathalpha}{\M at agreeklower}{"3D9}
-  \DeclareMathSymbol{\stigma}{\mathalpha}{\M at agreeklower}{"3DB}
-  \DeclareMathSymbol{\sho}{\mathalpha}{\M at agreeklower}{"3F8}
-  \DeclareMathSymbol{\san}{\mathalpha}{\M at agreeklower}{"3FB}
-  \DeclareMathSymbol{\varsampi}{\mathalpha}{\M at agreeklower}{"373}
-  \DeclareMathSymbol{\vardigamma}{\mathalpha}{\M at agreeklower}{"377}
-  \DeclareMathSymbol{\varkoppa}{\mathalpha}{\M at agreeklower}{"3DF}}
+  \edef\M at agreeklower@font{M\M at agreeklowershape\@tempa}
+  \DeclareMathSymbol{\heta}{\mathalpha}{\M at agreeklower@font}{"371}
+  \DeclareMathSymbol{\sampi}{\mathalpha}{\M at agreeklower@font}{"3E1}
+  \DeclareMathSymbol{\digamma}{\mathalpha}{\M at agreeklower@font}{"3DD}
+  \DeclareMathSymbol{\koppa}{\mathalpha}{\M at agreeklower@font}{"3D9}
+  \DeclareMathSymbol{\stigma}{\mathalpha}{\M at agreeklower@font}{"3DB}
+  \DeclareMathSymbol{\sho}{\mathalpha}{\M at agreeklower@font}{"3F8}
+  \DeclareMathSymbol{\san}{\mathalpha}{\M at agreeklower@font}{"3FB}
+  \DeclareMathSymbol{\varsampi}{\mathalpha}{\M at agreeklower@font}{"373}
+  \DeclareMathSymbol{\vardigamma}{\mathalpha}{\M at agreeklower@font}{"377}
+  \DeclareMathSymbol{\varkoppa}{\mathalpha}{\M at agreeklower@font}{"3DF}}
 %    \end{macrocode}
-% Set capital Cyrillic characters.\?\M at cyrillicupper\indexpage{keywordcyrillicupper=keyword \texttt{cyrillicupper}}
+% Set capital Cyrillic characters.\indexpage{keywordcyrillicupper=keyword \texttt{cyrillicupper}}
 %    \begin{macrocode}
 \def\M at cyrillicupper@set{%
-  \edef\M at cyrillicupper{M\@cyrillicuppershape\the\M at count}
-  \DeclareMathSymbol{\cyrA}{\mathalpha}{\M at cyrillicupper}{"410}
-  \DeclareMathSymbol{\cyrBe}{\mathalpha}{\M at cyrillicupper}{"411}
-  \DeclareMathSymbol{\cyrVe}{\mathalpha}{\M at cyrillicupper}{"412}
-  \DeclareMathSymbol{\cyrGhe}{\mathalpha}{\M at cyrillicupper}{"413}
-  \DeclareMathSymbol{\cyrDe}{\mathalpha}{\M at cyrillicupper}{"414}
-  \DeclareMathSymbol{\cyrIe}{\mathalpha}{\M at cyrillicupper}{"415}
-  \DeclareMathSymbol{\cyrZhe}{\mathalpha}{\M at cyrillicupper}{"416}
-  \DeclareMathSymbol{\cyrZe}{\mathalpha}{\M at cyrillicupper}{"417}
-  \DeclareMathSymbol{\cyrI}{\mathalpha}{\M at cyrillicupper}{"418}
-  \DeclareMathSymbol{\cyrKa}{\mathalpha}{\M at cyrillicupper}{"41A}
-  \DeclareMathSymbol{\cyrEl}{\mathalpha}{\M at cyrillicupper}{"41B}
-  \DeclareMathSymbol{\cyrEm}{\mathalpha}{\M at cyrillicupper}{"41C}
-  \DeclareMathSymbol{\cyrEn}{\mathalpha}{\M at cyrillicupper}{"41D}
-  \DeclareMathSymbol{\cyrO}{\mathalpha}{\M at cyrillicupper}{"41E}
-  \DeclareMathSymbol{\cyrPe}{\mathalpha}{\M at cyrillicupper}{"41F}
-  \DeclareMathSymbol{\cyrEr}{\mathalpha}{\M at cyrillicupper}{"420}
-  \DeclareMathSymbol{\cyrEs}{\mathalpha}{\M at cyrillicupper}{"421}
-  \DeclareMathSymbol{\cyrTe}{\mathalpha}{\M at cyrillicupper}{"422}
-  \DeclareMathSymbol{\cyrU}{\mathalpha}{\M at cyrillicupper}{"423}
-  \DeclareMathSymbol{\cyrEf}{\mathalpha}{\M at cyrillicupper}{"424}
-  \DeclareMathSymbol{\cyrHa}{\mathalpha}{\M at cyrillicupper}{"425}
-  \DeclareMathSymbol{\cyrTse}{\mathalpha}{\M at cyrillicupper}{"426}
-  \DeclareMathSymbol{\cyrChe}{\mathalpha}{\M at cyrillicupper}{"427}
-  \DeclareMathSymbol{\cyrSha}{\mathalpha}{\M at cyrillicupper}{"428}
-  \DeclareMathSymbol{\cyrShcha}{\mathalpha}{\M at cyrillicupper}{"429}
-  \DeclareMathSymbol{\cyrHard}{\mathalpha}{\M at cyrillicupper}{"42A}
-  \DeclareMathSymbol{\cyrYeru}{\mathalpha}{\M at cyrillicupper}{"42B}
-  \DeclareMathSymbol{\cyrSoft}{\mathalpha}{\M at cyrillicupper}{"42C}
-  \DeclareMathSymbol{\cyrE}{\mathalpha}{\M at cyrillicupper}{"42D}
-  \DeclareMathSymbol{\cyrYu}{\mathalpha}{\M at cyrillicupper}{"42E}
-  \DeclareMathSymbol{\cyrYa}{\mathalpha}{\M at cyrillicupper}{"42F}
-  \DeclareMathSymbol{\cyrvarI}{\mathalpha}{\M at cyrillicupper}{"419}}
+  \edef\M at cyrillicupper@font{M\M at cyrillicuppershape\@tempa}
+  \DeclareMathSymbol{\cyrA}{\mathalpha}{\M at cyrillicupper@font}{"410}
+  \DeclareMathSymbol{\cyrBe}{\mathalpha}{\M at cyrillicupper@font}{"411}
+  \DeclareMathSymbol{\cyrVe}{\mathalpha}{\M at cyrillicupper@font}{"412}
+  \DeclareMathSymbol{\cyrGhe}{\mathalpha}{\M at cyrillicupper@font}{"413}
+  \DeclareMathSymbol{\cyrDe}{\mathalpha}{\M at cyrillicupper@font}{"414}
+  \DeclareMathSymbol{\cyrIe}{\mathalpha}{\M at cyrillicupper@font}{"415}
+  \DeclareMathSymbol{\cyrZhe}{\mathalpha}{\M at cyrillicupper@font}{"416}
+  \DeclareMathSymbol{\cyrZe}{\mathalpha}{\M at cyrillicupper@font}{"417}
+  \DeclareMathSymbol{\cyrI}{\mathalpha}{\M at cyrillicupper@font}{"418}
+  \DeclareMathSymbol{\cyrKa}{\mathalpha}{\M at cyrillicupper@font}{"41A}
+  \DeclareMathSymbol{\cyrEl}{\mathalpha}{\M at cyrillicupper@font}{"41B}
+  \DeclareMathSymbol{\cyrEm}{\mathalpha}{\M at cyrillicupper@font}{"41C}
+  \DeclareMathSymbol{\cyrEn}{\mathalpha}{\M at cyrillicupper@font}{"41D}
+  \DeclareMathSymbol{\cyrO}{\mathalpha}{\M at cyrillicupper@font}{"41E}
+  \DeclareMathSymbol{\cyrPe}{\mathalpha}{\M at cyrillicupper@font}{"41F}
+  \DeclareMathSymbol{\cyrEr}{\mathalpha}{\M at cyrillicupper@font}{"420}
+  \DeclareMathSymbol{\cyrEs}{\mathalpha}{\M at cyrillicupper@font}{"421}
+  \DeclareMathSymbol{\cyrTe}{\mathalpha}{\M at cyrillicupper@font}{"422}
+  \DeclareMathSymbol{\cyrU}{\mathalpha}{\M at cyrillicupper@font}{"423}
+  \DeclareMathSymbol{\cyrEf}{\mathalpha}{\M at cyrillicupper@font}{"424}
+  \DeclareMathSymbol{\cyrHa}{\mathalpha}{\M at cyrillicupper@font}{"425}
+  \DeclareMathSymbol{\cyrTse}{\mathalpha}{\M at cyrillicupper@font}{"426}
+  \DeclareMathSymbol{\cyrChe}{\mathalpha}{\M at cyrillicupper@font}{"427}
+  \DeclareMathSymbol{\cyrSha}{\mathalpha}{\M at cyrillicupper@font}{"428}
+  \DeclareMathSymbol{\cyrShcha}{\mathalpha}{\M at cyrillicupper@font}{"429}
+  \DeclareMathSymbol{\cyrHard}{\mathalpha}{\M at cyrillicupper@font}{"42A}
+  \DeclareMathSymbol{\cyrYeru}{\mathalpha}{\M at cyrillicupper@font}{"42B}
+  \DeclareMathSymbol{\cyrSoft}{\mathalpha}{\M at cyrillicupper@font}{"42C}
+  \DeclareMathSymbol{\cyrE}{\mathalpha}{\M at cyrillicupper@font}{"42D}
+  \DeclareMathSymbol{\cyrYu}{\mathalpha}{\M at cyrillicupper@font}{"42E}
+  \DeclareMathSymbol{\cyrYa}{\mathalpha}{\M at cyrillicupper@font}{"42F}
+  \DeclareMathSymbol{\cyrvarI}{\mathalpha}{\M at cyrillicupper@font}{"419}}
 %    \end{macrocode}
-% Set minuscule Cyrillic characters.\?\M at cyrilliclower\indexpage{keywordcyrilliclower=keyword \texttt{cyrilliclower}}
+% Set minuscule Cyrillic characters.\indexpage{keywordcyrilliclower=keyword \texttt{cyrilliclower}}
 %    \begin{macrocode}
 \def\M at cyrilliclower@set{%
-  \edef\M at cyrilliclower{M\@cyrilliclowershape\the\M at count}
-  \DeclareMathSymbol{\cyra}{\mathalpha}{\M at cyrilliclower}{"430}
-  \DeclareMathSymbol{\cyrbe}{\mathalpha}{\M at cyrilliclower}{"431}
-  \DeclareMathSymbol{\cyrve}{\mathalpha}{\M at cyrilliclower}{"432}
-  \DeclareMathSymbol{\cyrghe}{\mathalpha}{\M at cyrilliclower}{"433}
-  \DeclareMathSymbol{\cyrde}{\mathalpha}{\M at cyrilliclower}{"434}
-  \DeclareMathSymbol{\cyrie}{\mathalpha}{\M at cyrilliclower}{"435}
-  \DeclareMathSymbol{\cyrzhe}{\mathalpha}{\M at cyrilliclower}{"436}
-  \DeclareMathSymbol{\cyrze}{\mathalpha}{\M at cyrilliclower}{"437}
-  \DeclareMathSymbol{\cyri}{\mathalpha}{\M at cyrilliclower}{"438}
-  \DeclareMathSymbol{\cyrka}{\mathalpha}{\M at cyrilliclower}{"43A}
-  \DeclareMathSymbol{\cyrel}{\mathalpha}{\M at cyrilliclower}{"43B}
-  \DeclareMathSymbol{\cyrem}{\mathalpha}{\M at cyrilliclower}{"43C}
-  \DeclareMathSymbol{\cyren}{\mathalpha}{\M at cyrilliclower}{"43D}
-  \DeclareMathSymbol{\cyro}{\mathalpha}{\M at cyrilliclower}{"43E}
-  \DeclareMathSymbol{\cyrpe}{\mathalpha}{\M at cyrilliclower}{"43F}
-  \DeclareMathSymbol{\cyrer}{\mathalpha}{\M at cyrilliclower}{"440}
-  \DeclareMathSymbol{\cyres}{\mathalpha}{\M at cyrilliclower}{"441}
-  \DeclareMathSymbol{\cyrte}{\mathalpha}{\M at cyrilliclower}{"442}
-  \DeclareMathSymbol{\cyru}{\mathalpha}{\M at cyrilliclower}{"443}
-  \DeclareMathSymbol{\cyref}{\mathalpha}{\M at cyrilliclower}{"444}
-  \DeclareMathSymbol{\cyrha}{\mathalpha}{\M at cyrilliclower}{"445}
-  \DeclareMathSymbol{\cyrtse}{\mathalpha}{\M at cyrilliclower}{"446}
-  \DeclareMathSymbol{\cyrche}{\mathalpha}{\M at cyrilliclower}{"447}
-  \DeclareMathSymbol{\cyrsha}{\mathalpha}{\M at cyrilliclower}{"448}
-  \DeclareMathSymbol{\cyrshcha}{\mathalpha}{\M at cyrilliclower}{"449}
-  \DeclareMathSymbol{\cyrhard}{\mathalpha}{\M at cyrilliclower}{"44A}
-  \DeclareMathSymbol{\cyryeru}{\mathalpha}{\M at cyrilliclower}{"44B}
-  \DeclareMathSymbol{\cyrsoft}{\mathalpha}{\M at cyrilliclower}{"44C}
-  \DeclareMathSymbol{\cyre}{\mathalpha}{\M at cyrilliclower}{"44D}
-  \DeclareMathSymbol{\cyryu}{\mathalpha}{\M at cyrilliclower}{"44E}
-  \DeclareMathSymbol{\cyrya}{\mathalpha}{\M at cyrilliclower}{"44F}
-  \DeclareMathSymbol{\cyrvari}{\mathalpha}{\M at cyrilliclower}{"439}}
+  \edef\M at cyrilliclower@font{M\M at cyrilliclowershape\@tempa}
+  \DeclareMathSymbol{\cyra}{\mathalpha}{\M at cyrilliclower@font}{"430}
+  \DeclareMathSymbol{\cyrbe}{\mathalpha}{\M at cyrilliclower@font}{"431}
+  \DeclareMathSymbol{\cyrve}{\mathalpha}{\M at cyrilliclower@font}{"432}
+  \DeclareMathSymbol{\cyrghe}{\mathalpha}{\M at cyrilliclower@font}{"433}
+  \DeclareMathSymbol{\cyrde}{\mathalpha}{\M at cyrilliclower@font}{"434}
+  \DeclareMathSymbol{\cyrie}{\mathalpha}{\M at cyrilliclower@font}{"435}
+  \DeclareMathSymbol{\cyrzhe}{\mathalpha}{\M at cyrilliclower@font}{"436}
+  \DeclareMathSymbol{\cyrze}{\mathalpha}{\M at cyrilliclower@font}{"437}
+  \DeclareMathSymbol{\cyri}{\mathalpha}{\M at cyrilliclower@font}{"438}
+  \DeclareMathSymbol{\cyrka}{\mathalpha}{\M at cyrilliclower@font}{"43A}
+  \DeclareMathSymbol{\cyrel}{\mathalpha}{\M at cyrilliclower@font}{"43B}
+  \DeclareMathSymbol{\cyrem}{\mathalpha}{\M at cyrilliclower@font}{"43C}
+  \DeclareMathSymbol{\cyren}{\mathalpha}{\M at cyrilliclower@font}{"43D}
+  \DeclareMathSymbol{\cyro}{\mathalpha}{\M at cyrilliclower@font}{"43E}
+  \DeclareMathSymbol{\cyrpe}{\mathalpha}{\M at cyrilliclower@font}{"43F}
+  \DeclareMathSymbol{\cyrer}{\mathalpha}{\M at cyrilliclower@font}{"440}
+  \DeclareMathSymbol{\cyres}{\mathalpha}{\M at cyrilliclower@font}{"441}
+  \DeclareMathSymbol{\cyrte}{\mathalpha}{\M at cyrilliclower@font}{"442}
+  \DeclareMathSymbol{\cyru}{\mathalpha}{\M at cyrilliclower@font}{"443}
+  \DeclareMathSymbol{\cyref}{\mathalpha}{\M at cyrilliclower@font}{"444}
+  \DeclareMathSymbol{\cyrha}{\mathalpha}{\M at cyrilliclower@font}{"445}
+  \DeclareMathSymbol{\cyrtse}{\mathalpha}{\M at cyrilliclower@font}{"446}
+  \DeclareMathSymbol{\cyrche}{\mathalpha}{\M at cyrilliclower@font}{"447}
+  \DeclareMathSymbol{\cyrsha}{\mathalpha}{\M at cyrilliclower@font}{"448}
+  \DeclareMathSymbol{\cyrshcha}{\mathalpha}{\M at cyrilliclower@font}{"449}
+  \DeclareMathSymbol{\cyrhard}{\mathalpha}{\M at cyrilliclower@font}{"44A}
+  \DeclareMathSymbol{\cyryeru}{\mathalpha}{\M at cyrilliclower@font}{"44B}
+  \DeclareMathSymbol{\cyrsoft}{\mathalpha}{\M at cyrilliclower@font}{"44C}
+  \DeclareMathSymbol{\cyre}{\mathalpha}{\M at cyrilliclower@font}{"44D}
+  \DeclareMathSymbol{\cyryu}{\mathalpha}{\M at cyrilliclower@font}{"44E}
+  \DeclareMathSymbol{\cyrya}{\mathalpha}{\M at cyrilliclower@font}{"44F}
+  \DeclareMathSymbol{\cyrvari}{\mathalpha}{\M at cyrilliclower@font}{"439}}
 %    \end{macrocode}
-% Set Hebrew characters.\?\M at hebrew\indexpage{keywordhebrew=keyword \texttt{hebrew}}
+% Set Hebrew characters.\indexpage{keywordhebrew=keyword \texttt{hebrew}}
 %    \begin{macrocode}
 \def\M at hebrew@set{%
-  \edef\M at hebrew{M\@hebrewshape\the\M at count}
-  \DeclareMathSymbol{\aleph}{\mathalpha}{\M at hebrew}{"5D0}
-  \DeclareMathSymbol{\beth}{\mathalpha}{\M at hebrew}{"5D1}
-  \DeclareMathSymbol{\gimel}{\mathalpha}{\M at hebrew}{"5D2}
-  \DeclareMathSymbol{\daleth}{\mathalpha}{\M at hebrew}{"5D3}
-  \DeclareMathSymbol{\he}{\mathalpha}{\M at hebrew}{"5D4}
-  \DeclareMathSymbol{\vav}{\mathalpha}{\M at hebrew}{"5D5}
-  \DeclareMathSymbol{\zayin}{\mathalpha}{\M at hebrew}{"5D6}
-  \DeclareMathSymbol{\het}{\mathalpha}{\M at hebrew}{"5D7}
-  \DeclareMathSymbol{\tet}{\mathalpha}{\M at hebrew}{"5D8}
-  \DeclareMathSymbol{\yod}{\mathalpha}{\M at hebrew}{"5D9}
-  \DeclareMathSymbol{\kaf}{\mathalpha}{\M at hebrew}{"5DB}
-  \DeclareMathSymbol{\lamed}{\mathalpha}{\M at hebrew}{"5DC}
-  \DeclareMathSymbol{\mem}{\mathalpha}{\M at hebrew}{"5DE}
-  \DeclareMathSymbol{\nun}{\mathalpha}{\M at hebrew}{"5E0}
-  \DeclareMathSymbol{\samekh}{\mathalpha}{\M at hebrew}{"5E1}
-  \DeclareMathSymbol{\ayin}{\mathalpha}{\M at hebrew}{"5E2}
-  \DeclareMathSymbol{\pe}{\mathalpha}{\M at hebrew}{"5E4}
-  \DeclareMathSymbol{\tsadi}{\mathalpha}{\M at hebrew}{"5E6}
-  \DeclareMathSymbol{\qof}{\mathalpha}{\M at hebrew}{"5E7}
-  \DeclareMathSymbol{\resh}{\mathalpha}{\M at hebrew}{"5E8}
-  \DeclareMathSymbol{\shin}{\mathalpha}{\M at hebrew}{"5E9}
-  \DeclareMathSymbol{\tav}{\mathalpha}{\M at hebrew}{"5EA}
-  \DeclareMathSymbol{\varkaf}{\mathalpha}{\M at hebrew}{"5DA}
-  \DeclareMathSymbol{\varmem}{\mathalpha}{\M at hebrew}{"5DD}
-  \DeclareMathSymbol{\varnun}{\mathalpha}{\M at hebrew}{"5DF}
-  \DeclareMathSymbol{\varpe}{\mathalpha}{\M at hebrew}{"5E3}
-  \DeclareMathSymbol{\vartsadi}{\mathalpha}{\M at hebrew}{"5E5}}
+  \edef\M at hebrew@font{M\M at hebrewshape\@tempa}
+  \DeclareMathSymbol{\aleph}{\mathalpha}{\M at hebrew@font}{"5D0}
+  \DeclareMathSymbol{\beth}{\mathalpha}{\M at hebrew@font}{"5D1}
+  \DeclareMathSymbol{\gimel}{\mathalpha}{\M at hebrew@font}{"5D2}
+  \DeclareMathSymbol{\daleth}{\mathalpha}{\M at hebrew@font}{"5D3}
+  \DeclareMathSymbol{\he}{\mathalpha}{\M at hebrew@font}{"5D4}
+  \DeclareMathSymbol{\vav}{\mathalpha}{\M at hebrew@font}{"5D5}
+  \DeclareMathSymbol{\zayin}{\mathalpha}{\M at hebrew@font}{"5D6}
+  \DeclareMathSymbol{\het}{\mathalpha}{\M at hebrew@font}{"5D7}
+  \DeclareMathSymbol{\tet}{\mathalpha}{\M at hebrew@font}{"5D8}
+  \DeclareMathSymbol{\yod}{\mathalpha}{\M at hebrew@font}{"5D9}
+  \DeclareMathSymbol{\kaf}{\mathalpha}{\M at hebrew@font}{"5DB}
+  \DeclareMathSymbol{\lamed}{\mathalpha}{\M at hebrew@font}{"5DC}
+  \DeclareMathSymbol{\mem}{\mathalpha}{\M at hebrew@font}{"5DE}
+  \DeclareMathSymbol{\nun}{\mathalpha}{\M at hebrew@font}{"5E0}
+  \DeclareMathSymbol{\samekh}{\mathalpha}{\M at hebrew@font}{"5E1}
+  \DeclareMathSymbol{\ayin}{\mathalpha}{\M at hebrew@font}{"5E2}
+  \DeclareMathSymbol{\pe}{\mathalpha}{\M at hebrew@font}{"5E4}
+  \DeclareMathSymbol{\tsadi}{\mathalpha}{\M at hebrew@font}{"5E6}
+  \DeclareMathSymbol{\qof}{\mathalpha}{\M at hebrew@font}{"5E7}
+  \DeclareMathSymbol{\resh}{\mathalpha}{\M at hebrew@font}{"5E8}
+  \DeclareMathSymbol{\shin}{\mathalpha}{\M at hebrew@font}{"5E9}
+  \DeclareMathSymbol{\tav}{\mathalpha}{\M at hebrew@font}{"5EA}
+  \DeclareMathSymbol{\varkaf}{\mathalpha}{\M at hebrew@font}{"5DA}
+  \DeclareMathSymbol{\varmem}{\mathalpha}{\M at hebrew@font}{"5DD}
+  \DeclareMathSymbol{\varnun}{\mathalpha}{\M at hebrew@font}{"5DF}
+  \DeclareMathSymbol{\varpe}{\mathalpha}{\M at hebrew@font}{"5E3}
+  \DeclareMathSymbol{\vartsadi}{\mathalpha}{\M at hebrew@font}{"5E5}}
 %    \end{macrocode}
-% Set digits.\?\M at digits\indexpage{keyworddigits=keyword \texttt{digits}}
+% Set digits.\indexpage{keyworddigits=keyword \texttt{digits}}
 %    \begin{macrocode}
 \def\M at digits@set{%
-  \edef\M at digits{M\@digitsshape\the\M at count}
-  \DeclareMathSymbol{0}{\mathalpha}{\M at digits}{`0}
-  \DeclareMathSymbol{1}{\mathalpha}{\M at digits}{`1}
-  \DeclareMathSymbol{2}{\mathalpha}{\M at digits}{`2}
-  \DeclareMathSymbol{3}{\mathalpha}{\M at digits}{`3}
-  \DeclareMathSymbol{4}{\mathalpha}{\M at digits}{`4}
-  \DeclareMathSymbol{5}{\mathalpha}{\M at digits}{`5}
-  \DeclareMathSymbol{6}{\mathalpha}{\M at digits}{`6}
-  \DeclareMathSymbol{7}{\mathalpha}{\M at digits}{`7}
-  \DeclareMathSymbol{8}{\mathalpha}{\M at digits}{`8}
-  \DeclareMathSymbol{9}{\mathalpha}{\M at digits}{`9}}
+  \edef\M at digits@font{M\M at digitsshape\@tempa}
+  \DeclareMathSymbol{0}{\mathalpha}{\M at digits@font}{`0}
+  \DeclareMathSymbol{1}{\mathalpha}{\M at digits@font}{`1}
+  \DeclareMathSymbol{2}{\mathalpha}{\M at digits@font}{`2}
+  \DeclareMathSymbol{3}{\mathalpha}{\M at digits@font}{`3}
+  \DeclareMathSymbol{4}{\mathalpha}{\M at digits@font}{`4}
+  \DeclareMathSymbol{5}{\mathalpha}{\M at digits@font}{`5}
+  \DeclareMathSymbol{6}{\mathalpha}{\M at digits@font}{`6}
+  \DeclareMathSymbol{7}{\mathalpha}{\M at digits@font}{`7}
+  \DeclareMathSymbol{8}{\mathalpha}{\M at digits@font}{`8}
+  \DeclareMathSymbol{9}{\mathalpha}{\M at digits@font}{`9}}
 %    \end{macrocode}
 % Set new operator font.\indexpage{keywordoperator=keyword \texttt{operator}}
+% If \textsf{mathfont} is set to adjust fonts, we will have a problem when typesetting operators because the |\operator at font| will pull modified (lengthened) letters from the operator font. Traditional \TeX\ addressed this problem by storing the Latin letters for math in the same endoding slots but in a different font from Computer Modern Roman and switching to Computer Modern Roman. Here we want to use the same font but different encoding slots. The macro |\M at default@latin| changes all |\Umathcode|s of Latin letters from their big (lengthened) values to their original values. Because |\operator at font| is always called inside a group, we don't have to worry about messing up any other math.
 %    \begin{macrocode}
 \def\M at operator@set{%
-  \edef\operator at font{\noexpand\mathgroup
-    \expandafter\noexpand\csname symM\@operatorshape\the\M at count\endcsname}}
+  \ifM at adjust@font
+    \edef\M at operator@num{\number\csname symM\M at operatorshape\@tempa\endcsname}
+    \def\M at default@latin at operator{%
+      \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
+      \Umathcode`D=7+\M at operator@num+`D\relax
+      \Umathcode`E=7+\M at operator@num+`E\relax
+      \Umathcode`F=7+\M at operator@num+`F\relax
+      \Umathcode`G=7+\M at operator@num+`G\relax
+      \Umathcode`H=7+\M at operator@num+`H\relax
+      \Umathcode`I=7+\M at operator@num+`I\relax
+      \Umathcode`J=7+\M at operator@num+`J\relax
+      \Umathcode`K=7+\M at operator@num+`K\relax
+      \Umathcode`L=7+\M at operator@num+`L\relax
+      \Umathcode`M=7+\M at operator@num+`M\relax
+      \Umathcode`N=7+\M at operator@num+`N\relax
+      \Umathcode`O=7+\M at operator@num+`O\relax
+      \Umathcode`P=7+\M at operator@num+`P\relax
+      \Umathcode`Q=7+\M at operator@num+`Q\relax
+      \Umathcode`R=7+\M at operator@num+`R\relax
+      \Umathcode`S=7+\M at operator@num+`S\relax
+      \Umathcode`T=7+\M at operator@num+`T\relax
+      \Umathcode`U=7+\M at operator@num+`U\relax
+      \Umathcode`V=7+\M at operator@num+`V\relax
+      \Umathcode`W=7+\M at operator@num+`W\relax
+      \Umathcode`X=7+\M at operator@num+`X\relax
+      \Umathcode`Y=7+\M at operator@num+`Y\relax
+      \Umathcode`Z=7+\M at operator@num+`Z\relax
+      \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
+      \Umathcode`d=7+\M at operator@num+`d\relax
+      \Umathcode`e=7+\M at operator@num+`e\relax
+      \Umathcode`f=7+\M at operator@num+`f\relax
+      \Umathcode`g=7+\M at operator@num+`g\relax
+      \Umathcode`h=7+\M at operator@num+`h\relax
+      \Umathcode`i=7+\M at operator@num+`i\relax
+      \Umathcode`j=7+\M at operator@num+`j\relax
+      \Umathcode`k=7+\M at operator@num+`k\relax
+      \Umathcode`l=7+\M at operator@num+`l\relax
+      \Umathcode`m=7+\M at operator@num+`m\relax
+      \Umathcode`n=7+\M at operator@num+`n\relax
+      \Umathcode`o=7+\M at operator@num+`o\relax
+      \Umathcode`p=7+\M at operator@num+`p\relax
+      \Umathcode`q=7+\M at operator@num+`q\relax
+      \Umathcode`r=7+\M at operator@num+`r\relax
+      \Umathcode`s=7+\M at operator@num+`s\relax
+      \Umathcode`t=7+\M at operator@num+`t\relax
+      \Umathcode`u=7+\M at operator@num+`u\relax
+      \Umathcode`v=7+\M at operator@num+`v\relax
+      \Umathcode`w=7+\M at operator@num+`w\relax
+      \Umathcode`x=7+\M at operator@num+`x\relax
+      \Umathcode`y=7+\M at operator@num+`y\relax
+      \Umathcode`z=7+\M at operator@num+`z\relax
+      \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
+  \fi
 %    \end{macrocode}
-% Set symbols.\?\M at symbols\indexpage{keywordsymbols=keyword \texttt{symbols}}
+% 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}}
+%    \end{macrocode}
+% Set delimiters.\indexpage{keyworddelimiters=keyword \texttt{delimiters}}
+%    \begin{macrocode}
+\ifM at adjust@font
+  \def\M at delimiters@set{%
+    \edef\M at delimiters@font{M\M at delimitersshape\@tempa}
+    \DeclareMathSymbol{(}{\mathopen}{\M at delimiters@font}{"28}
+    \DeclareMathSymbol{)}{\mathclose}{\M at delimiters@font}{"29}
+    \DeclareMathSymbol{[}{\mathopen}{\M at delimiters@font}{"5B}
+    \DeclareMathSymbol{]}{\mathclose}{\M at delimiters@font}{"5D}
+    \ifM at symbols\else
+      \DeclareMathSymbol{|}{\mathord}{\M at delimiters@font}{"7C}
+    \fi
+    \DeclareMathSymbol{\leftbrace}{\mathopen}{\M at delimiters@font}{"7B}
+    \DeclareMathSymbol{\rightbrace}{\mathclose}{\M at delimiters@font}{"7D}
+    \global\Udelcode40=+\csname sym\M at delimiters@font\endcsname+40\relax % (
+    \global\Udelcode41=+\csname sym\M at delimiters@font\endcsname+41\relax % )
+    \global\Udelcode47=+\csname sym\M at delimiters@font\endcsname+47\relax % /
+    \global\Udelcode91=+\csname sym\M at delimiters@font\endcsname+91\relax % [
+    \global\Udelcode93=+\csname sym\M at delimiters@font\endcsname+93\relax % ]
+    \global\Udelcode124=+\csname sym\M at delimiters@font\endcsname+124\relax % |
+    \global\let\vert=|
+    \protected\gdef\backslash{\ifmmode\mathbackslash\else\textbackslash\fi}
+    \protected\xdef\mathbackslash{%
+      \Udelimiter+2+\number\csname sym\M at delimiters@font\endcsname
+        +92\relax} % \
+    \protected\xdef\lbrace{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +123\relax} % {
+    \protected\xdef\rbrace{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +125\relax} % }
+    \protected\xdef\lguil{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +8249\relax} % single left guilement
+    \protected\xdef\rguil{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +8250\relax} % single right guilement
+    \protected\xdef\llguil{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +171\relax} % double left guilement
+    \protected\xdef\rrguil{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +187\relax} % double right guilement
+    \protected\xdef\fakelangle{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +1044508\relax} % fake left angle
+    \protected\xdef\fakerangle{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +1044509\relax} % fake right angle
+    \protected\xdef\fakellangle{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +1044510\relax} % fake double left angle
+    \protected\xdef\fakerrangle{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +1044511\relax} % fake double right angle
+    }
+\else
+  \def\M at delimiters@set{%
+    \edef\M at delimiters@font{M\M at delimitersshape\@tempa}
+    \DeclareMathSymbol{(}{\mathopen}{\M at delimiters@font}{"28}
+    \DeclareMathSymbol{)}{\mathclose}{\M at delimiters@font}{"29}
+    \DeclareMathSymbol{[}{\mathopen}{\M at delimiters@font}{"5B}
+    \DeclareMathSymbol{]}{\mathclose}{\M at delimiters@font}{"5D}
+    \DeclareMathSymbol{\lguil}{\mathopen}{\M at delimiters@font}{"2039}
+    \DeclareMathSymbol{\rguil}{\mathclose}{\M at delimiters@font}{"203A}
+    \DeclareMathSymbol{\llguil}{\mathopen}{\M at delimiters@font}{"AB}
+    \DeclareMathSymbol{\rrguil}{\mathclose}{\M at delimiters@font}{"BB}
+    \DeclareMathSymbol{\leftbrace}{\mathopen}{\M at delimiters@font}{"7B}
+    \DeclareMathSymbol{\rightbrace}{\mathclose}{\M at delimiters@font}{"7D}}
+\fi
+%    \end{macrocode}
+% Radicals.\indexpage{keywordradical=keyword \texttt{radical}}
+%    \begin{macrocode}
+\ifM at adjust@font
+  \def\M at radical@set{%
+    \edef\M at radical@font{M\M at radicalshape\@tempa}
+    \DeclareMathSymbol{\surd}{\mathord}{\M at radical@font}{"221A}
+    \xdef\@sqrts at gn##1{%
+      \Uradical+\number\csname sym\M at radical@font\endcsname+8730\relax{##1}}
+%    \end{macrocode}
+% We redefine |\r@@t|, which typesets the degree symbol on an $n$th root. We set the placement so that right side of the box containing the degree lies 60\% of the horizontal distance across the surd symbol, and the baseline of the degree symbol is 60\% of the vertical distance up the surd.
+% \indexpage{LaTeX kernel=\LaTeX\ kernel}
+%    \begin{macrocode}
+    \gdef\r@@t##1##2{%
+      \setbox\z@\hbox{$\m at th##1\sqrtsign{##2}$}%
+      \setbox\surdbox\hbox{$\m at th##1\@sqrts at gn{%
+        \hbox{\vphantom{$\m at th##1##2$}}}$}
+      \dimen@\ht\surdbox
+      \advance\dimen@\dp\surdbox
+      \dimen@=0.6\dimen@
+      \advance\dimen at -\dp\surdbox
+      \ifdim\wd\rootbox<0.6\wd\surdbox
+        \kern0.6\wd\surdbox
+      \else
+        \kern\wd\rootbox
+      \fi
+      \raise\dimen@\hbox{\llap{\copy\rootbox}}
+      \kern-0.6\wd\surdbox
+      \box\z@}
+    \gdef\sqrtsign##1{\@sqrts at gn{\mkern\radicandoffset##1}}}
+\else
+  \def\M at radical@set{%
+    \edef\M at radical@font{M\@radicalshape\@tempa}
+    \DeclareMathSymbol{\surd}{\mathord}{\M at radical@font}{"221A}}
+\fi
+%    \end{macrocode}
+% Big operators.\indexpage{keywordbigops=keyword \texttt{bigops}}
+%    \begin{macrocode}
+\def\M at bigops@set{%
+  \edef\M at bigops@font{M\M at bigopsshape\@tempa}
+  \let\sum\@undefined
+  \let\prod\@undefined
+  \DeclareMathSymbol{\sum}{\mathop}{\M at bigops@font}{"2211}
+  \DeclareMathSymbol{\prod}{\mathop}{\M at bigops@font}{"220F}
+  \DeclareMathSymbol{\intop}{\mathop}{\M at bigops@font}{"222B}}
+%    \end{macrocode}
+% Extended big operators.\indexpage{keywordextbigops=keyword \texttt{extbigops}}
+%    \begin{macrocode}
+\def\M at extbigops@set{%
+  \edef\M at extbigops@font{M\M at extbigopsshape\@tempa}
+  \let\coprod\@undefined
+  \let\bigvee\@undefined
+  \let\bigwedge\@undefined
+  \let\bigcup\@undefined
+  \let\bigcap\@undefined
+  \let\bigoplus\@undefined
+  \let\bigotimes\@undefined
+  \let\bigodot\@undefined
+  \let\bigsqcup\@undefined
+  \DeclareMathSymbol{\coprod}{\mathop}{\M at extbigops@font}{"2210}
+  \DeclareMathSymbol{\bigvee}{\mathop}{\M at extbigops@font}{"22C1}
+  \DeclareMathSymbol{\bigwedge}{\mathop}{\M at extbigops@font}{"22C0}
+  \DeclareMathSymbol{\bigcup}{\mathop}{\M at extbigops@font}{"22C3}
+  \DeclareMathSymbol{\bigcap}{\mathop}{\M at extbigops@font}{"22C2}
+  \DeclareMathSymbol{\iintop}{\mathop}{\M at extbigops@font}{"222C}
+    \protected\gdef\iint{\iintop\nolimits}
+  \DeclareMathSymbol{\iiintop}{\mathop}{\M at extbigops@font}{"222D}
+    \protected\gdef\iiint{\iiintop\nolimits}
+  \DeclareMathSymbol{\ointop}{\mathop}{\M at extbigops@font}{"222E}
+    \protected\gdef\oint{\ointop\nolimits}
+  \DeclareMathSymbol{\oiintop}{\mathop}{\M at extbigops@font}{"222F}
+    \protected\gdef\oiint{\oiintop\nolimits}
+  \DeclareMathSymbol{\oiiintop}{\mathop}{\M at extbigops@font}{"2230}
+    \protected\gdef\oiiint{\oiiintop\nolimits}
+  \DeclareMathSymbol{\bigoplus}{\mathop}{\M at extbigops@font}{"2A01}
+  \DeclareMathSymbol{\bigotimes}{\mathop}{\M at extbigops@font}{"2A02}
+  \DeclareMathSymbol{\bigodot}{\mathop}{\M at extbigops@font}{"2A00}
+  \DeclareMathSymbol{\bigsqcap}{\mathop}{\M at extbigops@font}{"2A05}
+  \DeclareMathSymbol{\bigsqcup}{\mathop}{\M at extbigops@font}{"2A06}}
+%    \end{macrocode}
+% Set symbols.\indexpage{keywordsymbols=keyword \texttt{symbols}}
+%    \begin{macrocode}
 \def\M at symbols@set{%
-  \edef\M at symbols{M\@symbolsshape\the\M at count}
+  \edef\M at symbols@font{M\M at symbolsshape\@tempa}
   \let\colon\@undefined
   \let\mathellipsis\@undefined
-  \DeclareMathSymbol{.}{\mathord}{\M at symbols}{"2E}
-  \DeclareMathSymbol{@}{\mathord}{\M at symbols}{"40}
-  \DeclareMathSymbol{\mathhash}{\mathord}{\M at symbols}{"23}
-  \DeclareMathSymbol{\mathdollar}{\mathord}{\M at symbols}{"24}
-  \DeclareMathSymbol{\mathpercent}{\mathord}{\M at symbols}{"25}
-  \DeclareMathSymbol{\mathand}{\mathord}{\M at symbols}{"26}
-  \DeclareMathSymbol{\mathparagraph}{\mathord}{\M at symbols}{"B6}
-  \DeclareMathSymbol{\mathsection}{\mathord}{\M at symbols}{"A7}
-  \DeclareMathSymbol{\mathsterling}{\mathord}{\M at symbols}{"A3}
-  \DeclareMathSymbol{|}{\mathord}{\M at symbols}{"7C}
-  \DeclareMathSymbol{\neg}{\mathord}{\M at symbols}{"AC}
-  \DeclareMathSymbol{\infty}{\mathord}{\M at symbols}{"221E}
-  \DeclareMathSymbol{\partial}{\mathord}{\M at symbols}{"2202}
-  \DeclareMathSymbol{\mathbackslash}{\mathord}{\M at symbols}{"5C}
-  \DeclareMathSymbol{\degree}{\mathord}{\M at symbols}{"B0}
-  \DeclareMathSymbol{\increment}{\mathord}{\M at symbols}{"2206}
-  \DeclareMathSymbol{\hbar}{\mathord}{\M at symbols}{"127}
-  \DeclareMathSymbol{'}{\mathord}{\M at symbols}{"2032}
-  \DeclareMathSymbol{"}{\mathord}{\M at symbols}{"2033}
-  \DeclareMathSymbol{\comma}{\mathord}{\M at symbols}{"2C}
-  \DeclareMathSymbol{+}{\mathbin}{\M at symbols}{"2B}
-  \DeclareMathSymbol{-}{\mathbin}{\M at symbols}{"2212}
-  \DeclareMathSymbol{*}{\mathbin}{\M at symbols}{"2A}
-  \DeclareMathSymbol{\times}{\mathbin}{\M at symbols}{"D7}
-  \DeclareMathSymbol{/}{\mathbin}{\M at symbols}{"2215}
-  \DeclareMathSymbol{\div}{\mathbin}{\M at symbols}{"F7}
-  \DeclareMathSymbol{\pm}{\mathbin}{\M at symbols}{"B1}
-  \DeclareMathSymbol{\bullet}{\mathbin}{\M at symbols}{"2022}
-  \DeclareMathSymbol{\dagger}{\mathbin}{\M at symbols}{"2020}
-  \DeclareMathSymbol{\ddagger}{\mathbin}{\M at symbols}{"2021}
-  \DeclareMathSymbol{\cdot}{\mathbin}{\M at symbols}{"2219}
-  \DeclareMathSymbol{\setminus}{\mathbin}{\M at symbols}{"5C}
-  \DeclareMathSymbol{=}{\mathrel}{\M at symbols}{"3D}
-  \DeclareMathSymbol{<}{\mathrel}{\M at symbols}{"3C}
-  \DeclareMathSymbol{>}{\mathrel}{\M at symbols}{"3E}
-  \DeclareMathSymbol{\leq}{\mathrel}{\M at symbols}{"2264}
-  \DeclareMathSymbol{\geq}{\mathrel}{\M at symbols}{"2265}
-  \DeclareMathSymbol{\sim}{\mathrel}{\M at symbols}{"7E}
-  \DeclareMathSymbol{\approx}{\mathrel}{\M at symbols}{"2248}
-  \DeclareMathSymbol{\equiv}{\mathrel}{\M at symbols}{"2261}
-  \DeclareMathSymbol{\mid}{\mathrel}{\M at symbols}{"7C}
-  \DeclareMathSymbol{\parallel}{\mathrel}{\M at symbols}{"2016}
-  \DeclareMathSymbol{:}{\mathrel}{\M at symbols}{"3A}
-  \DeclareMathSymbol{?}{\mathclose}{\M at symbols}{"3F}
-  \DeclareMathSymbol{!}{\mathclose}{\M at symbols}{"21}
-  \DeclareMathSymbol{,}{\mathpunct}{\M at symbols}{"2C}
-  \DeclareMathSymbol{;}{\mathpunct}{\M at symbols}{"3B}
-  \DeclareMathSymbol{\colon}{\mathpunct}{\M at symbols}{"3A}
-  \DeclareMathSymbol{\mathellipsis}{\mathinner}{\M at symbols}{"2026}
+  \DeclareMathSymbol{.}{\mathord}{\M at symbols@font}{"2E}
+  \DeclareMathSymbol{@}{\mathord}{\M at symbols@font}{"40}
+  \DeclareMathSymbol{'}{\mathord}{\M at symbols@font}{"2032}
+  \DeclareMathSymbol{\prime}{\mathord}{\M at symbols@font}{"2032}
+  \DeclareMathSymbol{"}{\mathord}{\M at symbols@font}{"2033}
+  \DeclareMathSymbol{\mathhash}{\mathord}{\M at symbols@font}{"23}
+  \DeclareMathSymbol{\mathdollar}{\mathord}{\M at symbols@font}{"24}
+  \DeclareMathSymbol{\mathpercent}{\mathord}{\M at symbols@font}{"25}
+  \DeclareMathSymbol{\mathand}{\mathord}{\M at symbols@font}{"26}
+  \DeclareMathSymbol{\mathparagraph}{\mathord}{\M at symbols@font}{"B6}
+  \DeclareMathSymbol{\mathsection}{\mathord}{\M at symbols@font}{"A7}
+  \DeclareMathSymbol{\mathsterling}{\mathord}{\M at symbols@font}{"A3}
+  \DeclareMathSymbol{\neg}{\mathord}{\M at symbols@font}{"AC}
+  \DeclareMathSymbol{|}{\mathord}{\M at symbols@font}{"7C}
+  \DeclareMathSymbol{\infty}{\mathord}{\M at symbols@font}{"221E}
+  \DeclareMathSymbol{\partial}{\mathord}{\M at symbols@font}{"2202}
+  \DeclareMathSymbol{\degree}{\mathord}{\M at symbols@font}{"B0}
+  \DeclareMathSymbol{\increment}{\mathord}{\M at symbols@font}{"2206}
+  \DeclareMathSymbol{\comma}{\mathord}{\M at symbols@font}{"2C}
+  \DeclareMathSymbol{+}{\mathbin}{\M at symbols@font}{"2B}
+  \DeclareMathSymbol{-}{\mathbin}{\M at symbols@font}{"2212}
+  \DeclareMathSymbol{*}{\mathbin}{\M at symbols@font}{"2A}
+  \DeclareMathSymbol{\times}{\mathbin}{\M at symbols@font}{"D7}
+  \DeclareMathSymbol{/}{\mathbin}{\M at symbols@font}{"2F}
+  \DeclareMathSymbol{\fractionslash}{\mathbin}{\M at symbols@font}{"2215}
+  \DeclareMathSymbol{\div}{\mathbin}{\M at symbols@font}{"F7}
+  \DeclareMathSymbol{\pm}{\mathbin}{\M at symbols@font}{"B1}
+  \DeclareMathSymbol{\bullet}{\mathbin}{\M at symbols@font}{"2022}
+  \DeclareMathSymbol{\dagger}{\mathbin}{\M at symbols@font}{"2020}
+  \DeclareMathSymbol{\ddagger}{\mathbin}{\M at symbols@font}{"2021}
+  \DeclareMathSymbol{\cdot}{\mathbin}{\M at symbols@font}{"2219}
+  \DeclareMathSymbol{\setminus}{\mathbin}{\M at symbols@font}{"5C}
+  \DeclareMathSymbol{=}{\mathrel}{\M at symbols@font}{"3D}
+  \DeclareMathSymbol{<}{\mathrel}{\M at symbols@font}{"3C}
+  \DeclareMathSymbol{>}{\mathrel}{\M at symbols@font}{"3E}
+  \DeclareMathSymbol{\leq}{\mathrel}{\M at symbols@font}{"2264}
+  \DeclareMathSymbol{\geq}{\mathrel}{\M at symbols@font}{"2265}
+  \DeclareMathSymbol{\sim}{\mathrel}{\M at symbols@font}{"7E}
+  \DeclareMathSymbol{\approx}{\mathrel}{\M at symbols@font}{"2248}
+  \DeclareMathSymbol{\equiv}{\mathrel}{\M at symbols@font}{"2261}
+  \DeclareMathSymbol{\mid}{\mathrel}{\M at symbols@font}{"7C}
+  \DeclareMathSymbol{\parallel}{\mathrel}{\M at symbols@font}{"2016}
+  \DeclareMathSymbol{:}{\mathrel}{\M at symbols@font}{"3A}
+  \DeclareMathSymbol{?}{\mathclose}{\M at symbols@font}{"3F}
+  \DeclareMathSymbol{!}{\mathclose}{\M at symbols@font}{"21}
+  \DeclareMathSymbol{,}{\mathpunct}{\M at symbols@font}{"2C}
+  \DeclareMathSymbol{;}{\mathpunct}{\M at symbols@font}{"3B}
+  \DeclareMathSymbol{\colon}{\mathord}{\M at symbols@font}{"3A}
+  \DeclareMathSymbol{\mathellipsis}{\mathinner}{\M at symbols@font}{"2026}
 %    \end{macrocode}
-% Finally a bit of housekeeping. We redefine |\#|, |\%|, and |\&| as robust commands that expand to previously declared |\mathhash|, etc.\ commands in math mode and retain their standard |\char| definitions otherwise. Other commands that function in both math and horizontal modes such as |\S| or |\dag| also use this technique. The last three commands defined here preserve the Computer Modern font for charcters used in several math-mode symbols.\indexpage{robust commands}
+% Now a bit of housekeeping. We redefine |\#|, |\%|, and |\&| as robust commands that expand to previously declared |\mathhash|, etc.\ commands in math mode and retain their standard |\char| definitions otherwise. Other commands that function in both math and horizontal modes such as |\S| or |\dag| also use this technique. Then we define macros |\cong| and |\simeq|. The last three commands defined here preserve the Computer Modern font for charcters used in several math-mode symbols.\indexpage{robust commands}
 %    \begin{macrocode}
-  \DeclareRobustCommand\#{\ifmmode\mathhash\else\char"23\relax\fi}
-  \DeclareRobustCommand\%{\ifmmode\mathpercent\else\char"25\relax\fi}
-  \DeclareRobustCommand\&{\ifmmode\mathand\else\char"26\relax\fi}
+  \protected\gdef\#{\ifmmode\mathhash\else\char"23\relax\fi}
+  \protected\gdef\%{\ifmmode\mathpercent\else\char"25\relax\fi}
+  \protected\gdef\&{\ifmmode\mathand\else\char"26\relax\fi}
   \DeclareMathSymbol{\@relbar}{\mathbin}{symbols}{"00}
   \DeclareMathSymbol{\@Relbar}{\mathrel}{operators}{"3D}
   \DeclareMathSymbol{\@verticalbar}{\mathord}{symbols}{"6A}
-  \DeclareRobustCommand\relbar{\mathrel{\smash\@relbar}}
-  \DeclareRobustCommand\Relbar{\mathrel{\@Relbar}}
-  \DeclareRobustCommand\models{\mathrel{\@verticalbar}\joinrel\Relbar}}
+  \ifM at extsymbols\else
+    \protected\gdef\simeq{\mathrel{\mathpalette\stack at flatrel{{-}{\sim}}}}
+    \protected\gdef\cong{\mathrel{\mathpalette\stack at flatrel{{=}{\sim}}}}
+  \fi
+  \protected\gdef\relbar{\mathrel{\smash\@relbar}}
+  \protected\gdef\Relbar{\mathrel{\@Relbar}}
+  \protected\gdef\models{\mathrel{\@verticalbar}\joinrel\Relbar}
 %    \end{macrocode}
-% Set extended symbols.\?\M at extsymbols\indexpage{keywordextsymbols=keyword \texttt{extsymbols}}
+% If the user enabled Lua-based font asjustments, we declare a few more big operators for fun. For brevity, we put the |adjust at font| conditional here rather than redefining |\M at symbols@set|.
 %    \begin{macrocode}
+  \ifM at adjust@font
+    \DeclareMathSymbol{\bigat}{\mathop}{\M at symbols@font}{"40}
+    \DeclareMathSymbol{\bighash}{\mathop}{\M at symbols@font}{"23}
+    \DeclareMathSymbol{\bigdollar}{\mathop}{\M at symbols@font}{"24}
+    \DeclareMathSymbol{\bigpercent}{\mathop}{\M at symbols@font}{"25}
+    \DeclareMathSymbol{\bigand}{\mathop}{\M at symbols@font}{"26}
+    \DeclareMathSymbol{\bigplus}{\mathop}{\M at symbols@font}{"2B}
+    \DeclareMathSymbol{\bigp}{\mathop}{\M at symbols@font}{"21}
+    \DeclareMathSymbol{\bigq}{\mathop}{\M at symbols@font}{"3F}
+    \DeclareMathSymbol{\bigS}{\mathop}{\M at symbols@font}{"A7}
+    \DeclareMathSymbol{\bigtimes}{\mathop}{\M at symbols@font}{"D7}
+    \DeclareMathSymbol{\bigdiv}{\mathop}{\M at symbols@font}{"F7}
+%    \end{macrocode}
+% Define |\nabla| if we're adjusting the font. If not, this declaration will go in |extsymbols|.
+%    \begin{macrocode}
+    \DeclareMathSymbol{\nabla}{\mathord}{\M at symbols@font}{"2207}
+  \fi}
+%    \end{macrocode}
+% Set extended symbols.\indexpage{keywordextsymbols=keyword \texttt{extsymbols}}
+%    \begin{macrocode}
 \def\M at extsymbols@set{%
-  \edef\M at extsymbols{M\@extsymbolsshape\the\M at count}
+  \edef\M at extsymbols@font{M\M at extsymbolsshape\@tempa}
   \let\angle\@undefined
+  \let\simeq\@undefined
   \let\sqsubset\@undefined
   \let\sqsupset\@undefined
   \let\bowtie\@undefined
@@ -1631,189 +4037,183 @@
   \let\doteq\@undefined
   \let\neq\@undefined
   \let\ng\@undefined
-  \DeclareMathSymbol{\wp}{\mathord}{\M at extsymbols}{"2118}
-  \DeclareMathSymbol{\Re}{\mathord}{\M at extsymbols}{"211C}
-  \DeclareMathSymbol{\Im}{\mathord}{\M at extsymbols}{"2111}
-  \DeclareMathSymbol{\ell}{\mathord}{\M at extsymbols}{"2113}
-  \DeclareMathSymbol{\forall}{\mathord}{\M at extsymbols}{"2200}
-  \DeclareMathSymbol{\exists}{\mathord}{\M at extsymbols}{"2203}
-  \DeclareMathSymbol{\emptyset}{\mathord}{\M at extsymbols}{"2205}
-  \DeclareMathSymbol{\nabla}{\mathord}{\M at extsymbols}{"2207}
-  \DeclareMathSymbol{\in}{\mathord}{\M at extsymbols}{"2208}
-  \DeclareMathSymbol{\ni}{\mathord}{\M at extsymbols}{"220B}
-  \DeclareMathSymbol{\mp}{\mathord}{\M at extsymbols}{"2213}
-  \DeclareMathSymbol{\angle}{\mathord}{\M at extsymbols}{"2220}
-  \DeclareMathSymbol{\top}{\mathord}{\M at extsymbols}{"22A4}
-  \DeclareMathSymbol{\bot}{\mathord}{\M at extsymbols}{"22A5}
-  \DeclareMathSymbol{\vdash}{\mathord}{\M at extsymbols}{"22A2}
-  \DeclareMathSymbol{\dashv}{\mathord}{\M at extsymbols}{"22A3}
-  \DeclareMathSymbol{\flat}{\mathord}{\M at extsymbols}{"266D}
-  \DeclareMathSymbol{\natural}{\mathord}{\M at extsymbols}{"266E}
-  \DeclareMathSymbol{\sharp}{\mathord}{\M at extsymbols}{"266F}
-  \DeclareMathSymbol{\fflat}{\mathord}{\M at extsymbols}{"1D12B}
-  \DeclareMathSymbol{\ssharp}{\mathord}{\M at extsymbols}{"1D12A}
-  \DeclareMathSymbol{\bclubsuit}{\mathord}{\M at extsymbols}{"2663}
-    \let\clubsuit\bclubsuit
-  \DeclareMathSymbol{\bdiamondsuit}{\mathord}{\M at extsymbols}{"2666}
-  \DeclareMathSymbol{\bheartsuit}{\mathord}{\M at extsymbols}{"2665}
-  \DeclareMathSymbol{\bspadesuit}{\mathord}{\M at extsymbols}{"2660}
-    \let\spadesuit\bspadesuit
-  \DeclareMathSymbol{\wclubsuit}{\mathord}{\M at extsymbols}{"2667}
-  \DeclareMathSymbol{\wdiamondsuit}{\mathord}{\M at extsymbols}{"2662}
-    \let\diamondsuit\wdiamondsuit
-  \DeclareMathSymbol{\wheartsuit}{\mathord}{\M at extsymbols}{"2661}
-    \let\heartsuit\wheartsuit
-  \DeclareMathSymbol{\wspadesuit}{\mathord}{\M at extsymbols}{"2664}
-  \DeclareMathSymbol{\wedge}{\mathbin}{\M at extsymbols}{"2227}
-  \DeclareMathSymbol{\vee}{\mathbin}{\M at extsymbols}{"2228}
-  \DeclareMathSymbol{\cap}{\mathord}{\M at extsymbols}{"2229}
-  \DeclareMathSymbol{\cup}{\mathbin}{\M at extsymbols}{"222A}
-  \DeclareMathSymbol{\sqcap}{\mathbin}{\M at extsymbols}{"2293}
-  \DeclareMathSymbol{\sqcup}{\mathbin}{\M at extsymbols}{"2294}
-  \DeclareMathSymbol{\amalg}{\mathbin}{\M at extsymbols}{"2A3F}
-  \DeclareMathSymbol{\wr}{\mathbin}{\M at extsymbols}{"2240}
-  \DeclareMathSymbol{\ast}{\mathbin}{\M at extsymbols}{"2217}
-  \DeclareMathSymbol{\star}{\mathbin}{\M at extsymbols}{"22C6}
-  \DeclareMathSymbol{\diamond}{\mathbin}{\M at extsymbols}{"22C4}
-  \DeclareMathSymbol{\varcdot}{\mathbin}{\M at extsymbols}{"22C5}
-  \DeclareMathSymbol{\varsetminus}{\mathbin}{\M at extsymbols}{"2216}
-  \DeclareMathSymbol{\oplus}{\mathbin}{\M at extsymbols}{"2295}
-  \DeclareMathSymbol{\otimes}{\mathbin}{\M at extsymbols}{"2297}
-  \DeclareMathSymbol{\ominus}{\mathbin}{\M at extsymbols}{"2296}
-  \DeclareMathSymbol{\odiv}{\mathbin}{\M at extsymbols}{"2A38}
-  \DeclareMathSymbol{\oslash}{\mathbin}{\M at extsymbols}{"2298}
-  \DeclareMathSymbol{\odot}{\mathbin}{\M at extsymbols}{"2299}
-  \DeclareMathSymbol{\sqplus}{\mathbin}{\M at extsymbols}{"229E}
-  \DeclareMathSymbol{\sqtimes}{\mathbin}{\M at extsymbols}{"22A0}
-  \DeclareMathSymbol{\sqminus}{\mathbin}{\M at extsymbols}{"229F}
-  \DeclareMathSymbol{\sqdot}{\mathbin}{\M at extsymbols}{"22A1}  
-  \DeclareMathSymbol{\in}{\mathrel}{\M at extsymbols}{"2208}
-  \DeclareMathSymbol{\ni}{\mathrel}{\M at extsymbols}{"220B}
-  \DeclareMathSymbol{\subset}{\mathrel}{\M at extsymbols}{"2282}
-  \DeclareMathSymbol{\supset}{\mathrel}{\M at extsymbols}{"2283}
-  \DeclareMathSymbol{\subseteq}{\mathrel}{\M at extsymbols}{"2286}
-  \DeclareMathSymbol{\supseteq}{\mathrel}{\M at extsymbols}{"2287}
-  \DeclareMathSymbol{\sqsubset}{\mathrel}{\M at extsymbols}{"228F}
-  \DeclareMathSymbol{\sqsupset}{\mathrel}{\M at extsymbols}{"2290}
-  \DeclareMathSymbol{\sqsubseteq}{\mathrel}{\M at extsymbols}{"2291}
-  \DeclareMathSymbol{\sqsupseteq}{\mathrel}{\M at extsymbols}{"2292}
-  \DeclareMathSymbol{\triangleleft}{\mathrel}{\M at extsymbols}{"22B2}
-  \DeclareMathSymbol{\triangleright}{\mathrel}{\M at extsymbols}{"22B3}
-  \DeclareMathSymbol{\trianglelefteq}{\mathrel}{\M at extsymbols}{"22B4}
-  \DeclareMathSymbol{\trianglerighteq}{\mathrel}{\M at extsymbols}{"22B5}
-  \DeclareMathSymbol{\propto}{\mathrel}{\M at extsymbols}{"221D}
-  \DeclareMathSymbol{\bowtie}{\mathrel}{\M at extsymbols}{"22C8}
-  \DeclareMathSymbol{\hourglass}{\mathrel}{\M at extsymbols}{"29D6}
-  \DeclareMathSymbol{\therefore}{\mathrel}{\M at extsymbols}{"2234}
-  \DeclareMathSymbol{\because}{\mathrel}{\M at extsymbols}{"2235}
-  \DeclareMathSymbol{\ratio}{\mathrel}{\M at extsymbols}{"2236}
-  \DeclareMathSymbol{\proportion}{\mathrel}{\M at extsymbols}{"2237}
-  \DeclareMathSymbol{\ll}{\mathrel}{\M at extsymbols}{"226A}
-  \DeclareMathSymbol{\gg}{\mathrel}{\M at extsymbols}{"226B}
-  \DeclareMathSymbol{\lll}{\mathrel}{\M at extsymbols}{"22D8}
-  \DeclareMathSymbol{\ggg}{\mathrel}{\M at extsymbols}{"22D9}
-  \DeclareMathSymbol{\leqq}{\mathrel}{\M at extsymbols}{"2266}
-  \DeclareMathSymbol{\geqq}{\mathrel}{\M at extsymbols}{"2267}
-  \DeclareMathSymbol{\lapprox}{\mathrel}{\M at extsymbols}{"2A85}
-  \DeclareMathSymbol{\gapprox}{\mathrel}{\M at extsymbols}{"2A86}
-  \DeclareMathSymbol{\simeq}{\mathrel}{\M at extsymbols}{"2243}
-  \DeclareMathSymbol{\eqsim}{\mathrel}{\M at extsymbols}{"2242}
-  \DeclareMathSymbol{\simeqq}{\mathrel}{\M at extsymbols}{"2245}
-    \let\cong\simeqq
-  \DeclareMathSymbol{\approxeq}{\mathrel}{\M at extsymbols}{"224A}
-  \DeclareMathSymbol{\sssim}{\mathrel}{\M at extsymbols}{"224B}
-  \DeclareMathSymbol{\seq}{\mathrel}{\M at extsymbols}{"224C}
-  \DeclareMathSymbol{\doteq}{\mathrel}{\M at extsymbols}{"2250}
-  \DeclareMathSymbol{\coloneq}{\mathrel}{\M at extsymbols}{"2254}
-  \DeclareMathSymbol{\eqcolon}{\mathrel}{\M at extsymbols}{"2255}
-  \DeclareMathSymbol{\ringeq}{\mathrel}{\M at extsymbols}{"2257}
-  \DeclareMathSymbol{\arceq}{\mathrel}{\M at extsymbols}{"2258}
-  \DeclareMathSymbol{\wedgeeq}{\mathrel}{\M at extsymbols}{"2259}
-  \DeclareMathSymbol{\veeeq}{\mathrel}{\M at extsymbols}{"225A}
-  \DeclareMathSymbol{\stareq}{\mathrel}{\M at extsymbols}{"225B}
-  \DeclareMathSymbol{\triangleeq}{\mathrel}{\M at extsymbols}{"225C}
-  \DeclareMathSymbol{\defeq}{\mathrel}{\M at extsymbols}{"225D}
-  \DeclareMathSymbol{\qeq}{\mathrel}{\M at extsymbols}{"225F}
-  \DeclareMathSymbol{\lsim}{\mathrel}{\M at extsymbols}{"2272}
-  \DeclareMathSymbol{\gsim}{\mathrel}{\M at extsymbols}{"2273}
-  \DeclareMathSymbol{\prec}{\mathrel}{\M at extsymbols}{"227A}
-  \DeclareMathSymbol{\succ}{\mathrel}{\M at extsymbols}{"227B}
-  \DeclareMathSymbol{\preceq}{\mathrel}{\M at extsymbols}{"227C}
-  \DeclareMathSymbol{\succeq}{\mathrel}{\M at extsymbols}{"227D}
-  \DeclareMathSymbol{\preceqq}{\mathrel}{\M at extsymbols}{"2AB3}
-  \DeclareMathSymbol{\succeqq}{\mathrel}{\M at extsymbols}{"2AB4}
-  \DeclareMathSymbol{\precsim}{\mathrel}{\M at extsymbols}{"227E}
-  \DeclareMathSymbol{\succsim}{\mathrel}{\M at extsymbols}{"227F}
-  \DeclareMathSymbol{\precapprox}{\mathrel}{\M at extsymbols}{"2AB7}
-  \DeclareMathSymbol{\succapprox}{\mathrel}{\M at extsymbols}{"2AB8}
-  \DeclareMathSymbol{\precprec}{\mathrel}{\M at extsymbols}{"2ABB}
-  \DeclareMathSymbol{\succsucc}{\mathrel}{\M at extsymbols}{"2ABC}
-  \DeclareMathSymbol{\asymp}{\mathrel}{\M at extsymbols}{"224D}
-  \DeclareMathSymbol{\nin}{\mathrel}{\M at extsymbols}{"2209}
-  \DeclareMathSymbol{\nni}{\mathrel}{\M at extsymbols}{"220C}
-  \DeclareMathSymbol{\nsubset}{\mathrel}{\M at extsymbols}{"2284}
-  \DeclareMathSymbol{\nsupset}{\mathrel}{\M at extsymbols}{"2285}
-  \DeclareMathSymbol{\nsubseteq}{\mathrel}{\M at extsymbols}{"2288}
-  \DeclareMathSymbol{\nsupseteq}{\mathrel}{\M at extsymbols}{"2289}
-  \DeclareMathSymbol{\subsetneq}{\mathrel}{\M at extsymbols}{"228A}
-  \DeclareMathSymbol{\supsetneq}{\mathrel}{\M at extsymbols}{"228B}
-  \DeclareMathSymbol{\nsqsubseteq}{\mathrel}{\M at extsymbols}{"22E2}
-  \DeclareMathSymbol{\nsqsupseteq}{\mathrel}{\M at extsymbols}{"22E3}
-  \DeclareMathSymbol{\sqsubsetneq}{\mathrel}{\M at extsymbols}{"22E4}
-  \DeclareMathSymbol{\sqsupsetneq}{\mathrel}{\M at extsymbols}{"22E5}
-  \DeclareMathSymbol{\neq}{\mathrel}{\M at extsymbols}{"2260}
-  \DeclareMathSymbol{\nl}{\mathrel}{\M at extsymbols}{"226E}
-  \DeclareMathSymbol{\ng}{\mathrel}{\M at extsymbols}{"226F}
-  \DeclareMathSymbol{\nleq}{\mathrel}{\M at extsymbols}{"2270}
-  \DeclareMathSymbol{\ngeq}{\mathrel}{\M at extsymbols}{"2271}
-  \DeclareMathSymbol{\lneq}{\mathrel}{\M at extsymbols}{"2A87}
-  \DeclareMathSymbol{\gneq}{\mathrel}{\M at extsymbols}{"2A88}
-  \DeclareMathSymbol{\lneqq}{\mathrel}{\M at extsymbols}{"2268}
-  \DeclareMathSymbol{\gneqq}{\mathrel}{\M at extsymbols}{"2269}
-  \DeclareMathSymbol{\ntriangleleft}{\mathrel}{\M at extsymbols}{"22EA}
-  \DeclareMathSymbol{\ntriangleright}{\mathrel}{\M at extsymbols}{"22EB}
-  \DeclareMathSymbol{\ntrianglelefteq}{\mathrel}{\M at extsymbols}{"22EC}
-  \DeclareMathSymbol{\ntrianglerighteq}{\mathrel}{\M at extsymbols}{"22ED}
-  \DeclareMathSymbol{\nsim}{\mathrel}{\M at extsymbols}{"2241}
-  \DeclareMathSymbol{\napprox}{\mathrel}{\M at extsymbols}{"2249}
-  \DeclareMathSymbol{\nsimeq}{\mathrel}{\M at extsymbols}{"2244}
-  \DeclareMathSymbol{\nsimeqq}{\mathrel}{\M at extsymbols}{"2247}
-  \DeclareMathSymbol{\simneqq}{\mathrel}{\M at extsymbols}{"2246}
-  \DeclareMathSymbol{\nlsim}{\mathrel}{\M at extsymbols}{"2274}
-  \DeclareMathSymbol{\ngsim}{\mathrel}{\M at extsymbols}{"2275}
-  \DeclareMathSymbol{\lnsim}{\mathrel}{\M at extsymbols}{"22E6}
-  \DeclareMathSymbol{\gnsim}{\mathrel}{\M at extsymbols}{"22E7}
-  \DeclareMathSymbol{\lnapprox}{\mathrel}{\M at extsymbols}{"2A89}
-  \DeclareMathSymbol{\gnapprox}{\mathrel}{\M at extsymbols}{"2A8A}
-  \DeclareMathSymbol{\nprec}{\mathrel}{\M at extsymbols}{"2280}
-  \DeclareMathSymbol{\nsucc}{\mathrel}{\M at extsymbols}{"2281}
-  \DeclareMathSymbol{\npreceq}{\mathrel}{\M at extsymbols}{"22E0}
-  \DeclareMathSymbol{\nsucceq}{\mathrel}{\M at extsymbols}{"22E1}
-  \DeclareMathSymbol{\precneq}{\mathrel}{\M at extsymbols}{"2AB1}
-  \DeclareMathSymbol{\succneq}{\mathrel}{\M at extsymbols}{"2AB2}
-  \DeclareMathSymbol{\precneqq}{\mathrel}{\M at extsymbols}{"2AB5}
-  \DeclareMathSymbol{\succneqq}{\mathrel}{\M at extsymbols}{"2AB6}
-  \DeclareMathSymbol{\precnsim}{\mathrel}{\M at extsymbols}{"22E8}
-  \DeclareMathSymbol{\succnsim}{\mathrel}{\M at extsymbols}{"22E9}
-  \DeclareMathSymbol{\precnapprox}{\mathrel}{\M at extsymbols}{"2AB9}
-  \DeclareMathSymbol{\succnapprox}{\mathrel}{\M at extsymbols}{"2ABA}
-  \DeclareMathSymbol{\nequiv}{\mathrel}{\M at extsymbols}{"2262}}
+  \DeclareMathSymbol{\wp}{\mathord}{\M at extsymbols@font}{"2118}
+  \DeclareMathSymbol{\Re}{\mathord}{\M at extsymbols@font}{"211C}
+  \DeclareMathSymbol{\Im}{\mathord}{\M at extsymbols@font}{"2111}
+  \DeclareMathSymbol{\ell}{\mathord}{\M at extsymbols@font}{"2113}
+  \DeclareMathSymbol{\forall}{\mathord}{\M at extsymbols@font}{"2200}
+  \DeclareMathSymbol{\exists}{\mathord}{\M at extsymbols@font}{"2203}
+  \DeclareMathSymbol{\emptyset}{\mathord}{\M at extsymbols@font}{"2205}
+  \DeclareMathSymbol{\in}{\mathord}{\M at extsymbols@font}{"2208}
+  \DeclareMathSymbol{\ni}{\mathord}{\M at extsymbols@font}{"220B}
+  \DeclareMathSymbol{\mp}{\mathord}{\M at extsymbols@font}{"2213}
+  \DeclareMathSymbol{\angle}{\mathord}{\M at extsymbols@font}{"2220}
+  \DeclareMathSymbol{\top}{\mathord}{\M at extsymbols@font}{"22A4}
+  \DeclareMathSymbol{\bot}{\mathord}{\M at extsymbols@font}{"22A5}
+  \DeclareMathSymbol{\vdash}{\mathord}{\M at extsymbols@font}{"22A2}
+  \DeclareMathSymbol{\dashv}{\mathord}{\M at extsymbols@font}{"22A3}
+  \DeclareMathSymbol{\flat}{\mathord}{\M at extsymbols@font}{"266D}
+  \DeclareMathSymbol{\natural}{\mathord}{\M at extsymbols@font}{"266E}
+  \DeclareMathSymbol{\sharp}{\mathord}{\M at extsymbols@font}{"266F}
+  \DeclareMathSymbol{\fflat}{\mathord}{\M at extsymbols@font}{"1D12B}
+  \DeclareMathSymbol{\ssharp}{\mathord}{\M at extsymbols@font}{"1D12A}
+  \DeclareMathSymbol{\bclubsuit}{\mathord}{\M at extsymbols@font}{"2663}
+  \DeclareMathSymbol{\bdiamondsuit}{\mathord}{\M at extsymbols@font}{"2666}
+  \DeclareMathSymbol{\bheartsuit}{\mathord}{\M at extsymbols@font}{"2665}
+  \DeclareMathSymbol{\bspadesuit}{\mathord}{\M at extsymbols@font}{"2660}
+  \DeclareMathSymbol{\wclubsuit}{\mathord}{\M at extsymbols@font}{"2667}
+  \DeclareMathSymbol{\wdiamondsuit}{\mathord}{\M at extsymbols@font}{"2662}
+  \DeclareMathSymbol{\wheartsuit}{\mathord}{\M at extsymbols@font}{"2661}
+  \DeclareMathSymbol{\wspadesuit}{\mathord}{\M at extsymbols@font}{"2664}
+    \global\let\spadesuit\bspadesuit
+    \global\let\heartsuit\wheartsuit
+    \global\let\diamondsuit\wdiamondsuit
+    \global\let\clubsuit\bclubsuit
+  \DeclareMathSymbol{\wedge}{\mathbin}{\M at extsymbols@font}{"2227}
+  \DeclareMathSymbol{\vee}{\mathbin}{\M at extsymbols@font}{"2228}
+  \DeclareMathSymbol{\cap}{\mathord}{\M at extsymbols@font}{"2229}
+  \DeclareMathSymbol{\cup}{\mathbin}{\M at extsymbols@font}{"222A}
+  \DeclareMathSymbol{\sqcap}{\mathbin}{\M at extsymbols@font}{"2293}
+  \DeclareMathSymbol{\sqcup}{\mathbin}{\M at extsymbols@font}{"2294}
+  \DeclareMathSymbol{\amalg}{\mathbin}{\M at extsymbols@font}{"2A3F}
+  \DeclareMathSymbol{\wr}{\mathbin}{\M at extsymbols@font}{"2240}
+  \DeclareMathSymbol{\ast}{\mathbin}{\M at extsymbols@font}{"2217}
+  \DeclareMathSymbol{\star}{\mathbin}{\M at extsymbols@font}{"22C6}
+  \DeclareMathSymbol{\diamond}{\mathbin}{\M at extsymbols@font}{"22C4}
+  \DeclareMathSymbol{\varcdot}{\mathbin}{\M at extsymbols@font}{"22C5}
+  \DeclareMathSymbol{\varsetminus}{\mathbin}{\M at extsymbols@font}{"2216}
+  \DeclareMathSymbol{\oplus}{\mathbin}{\M at extsymbols@font}{"2295}
+  \DeclareMathSymbol{\otimes}{\mathbin}{\M at extsymbols@font}{"2297}
+  \DeclareMathSymbol{\ominus}{\mathbin}{\M at extsymbols@font}{"2296}
+  \DeclareMathSymbol{\odiv}{\mathbin}{\M at extsymbols@font}{"2A38}
+  \DeclareMathSymbol{\oslash}{\mathbin}{\M at extsymbols@font}{"2298}
+  \DeclareMathSymbol{\odot}{\mathbin}{\M at extsymbols@font}{"2299}
+  \DeclareMathSymbol{\sqplus}{\mathbin}{\M at extsymbols@font}{"229E}
+  \DeclareMathSymbol{\sqtimes}{\mathbin}{\M at extsymbols@font}{"22A0}
+  \DeclareMathSymbol{\sqminus}{\mathbin}{\M at extsymbols@font}{"229F}
+  \DeclareMathSymbol{\sqdot}{\mathbin}{\M at extsymbols@font}{"22A1}  
+  \DeclareMathSymbol{\in}{\mathrel}{\M at extsymbols@font}{"2208}
+  \DeclareMathSymbol{\ni}{\mathrel}{\M at extsymbols@font}{"220B}
+  \DeclareMathSymbol{\subset}{\mathrel}{\M at extsymbols@font}{"2282}
+  \DeclareMathSymbol{\supset}{\mathrel}{\M at extsymbols@font}{"2283}
+  \DeclareMathSymbol{\subseteq}{\mathrel}{\M at extsymbols@font}{"2286}
+  \DeclareMathSymbol{\supseteq}{\mathrel}{\M at extsymbols@font}{"2287}
+  \DeclareMathSymbol{\sqsubset}{\mathrel}{\M at extsymbols@font}{"228F}
+  \DeclareMathSymbol{\sqsupset}{\mathrel}{\M at extsymbols@font}{"2290}
+  \DeclareMathSymbol{\sqsubseteq}{\mathrel}{\M at extsymbols@font}{"2291}
+  \DeclareMathSymbol{\sqsupseteq}{\mathrel}{\M at extsymbols@font}{"2292}
+  \DeclareMathSymbol{\triangleleft}{\mathrel}{\M at extsymbols@font}{"22B2}
+  \DeclareMathSymbol{\triangleright}{\mathrel}{\M at extsymbols@font}{"22B3}
+  \DeclareMathSymbol{\trianglelefteq}{\mathrel}{\M at extsymbols@font}{"22B4}
+  \DeclareMathSymbol{\trianglerighteq}{\mathrel}{\M at extsymbols@font}{"22B5}
+  \DeclareMathSymbol{\propto}{\mathrel}{\M at extsymbols@font}{"221D}
+  \DeclareMathSymbol{\bowtie}{\mathrel}{\M at extsymbols@font}{"22C8}
+  \DeclareMathSymbol{\hourglass}{\mathrel}{\M at extsymbols@font}{"29D6}
+  \DeclareMathSymbol{\therefore}{\mathrel}{\M at extsymbols@font}{"2234}
+  \DeclareMathSymbol{\because}{\mathrel}{\M at extsymbols@font}{"2235}
+  \DeclareMathSymbol{\ratio}{\mathrel}{\M at extsymbols@font}{"2236}
+  \DeclareMathSymbol{\proportion}{\mathrel}{\M at extsymbols@font}{"2237}
+  \DeclareMathSymbol{\ll}{\mathrel}{\M at extsymbols@font}{"226A}
+  \DeclareMathSymbol{\gg}{\mathrel}{\M at extsymbols@font}{"226B}
+  \DeclareMathSymbol{\lll}{\mathrel}{\M at extsymbols@font}{"22D8}
+  \DeclareMathSymbol{\ggg}{\mathrel}{\M at extsymbols@font}{"22D9}
+  \DeclareMathSymbol{\leqq}{\mathrel}{\M at extsymbols@font}{"2266}
+  \DeclareMathSymbol{\geqq}{\mathrel}{\M at extsymbols@font}{"2267}
+  \DeclareMathSymbol{\lapprox}{\mathrel}{\M at extsymbols@font}{"2A85}
+  \DeclareMathSymbol{\gapprox}{\mathrel}{\M at extsymbols@font}{"2A86}
+  \DeclareMathSymbol{\simeq}{\mathrel}{\M at extsymbols@font}{"2243}
+  \DeclareMathSymbol{\eqsim}{\mathrel}{\M at extsymbols@font}{"2242}
+  \DeclareMathSymbol{\simeqq}{\mathrel}{\M at extsymbols@font}{"2245}
+    \global\let\cong\simeqq
+  \DeclareMathSymbol{\approxeq}{\mathrel}{\M at extsymbols@font}{"224A}
+  \DeclareMathSymbol{\sssim}{\mathrel}{\M at extsymbols@font}{"224B}
+  \DeclareMathSymbol{\seq}{\mathrel}{\M at extsymbols@font}{"224C}
+  \DeclareMathSymbol{\doteq}{\mathrel}{\M at extsymbols@font}{"2250}
+  \DeclareMathSymbol{\coloneq}{\mathrel}{\M at extsymbols@font}{"2254}
+  \DeclareMathSymbol{\eqcolon}{\mathrel}{\M at extsymbols@font}{"2255}
+  \DeclareMathSymbol{\ringeq}{\mathrel}{\M at extsymbols@font}{"2257}
+  \DeclareMathSymbol{\arceq}{\mathrel}{\M at extsymbols@font}{"2258}
+  \DeclareMathSymbol{\wedgeeq}{\mathrel}{\M at extsymbols@font}{"2259}
+  \DeclareMathSymbol{\veeeq}{\mathrel}{\M at extsymbols@font}{"225A}
+  \DeclareMathSymbol{\stareq}{\mathrel}{\M at extsymbols@font}{"225B}
+  \DeclareMathSymbol{\triangleeq}{\mathrel}{\M at extsymbols@font}{"225C}
+  \DeclareMathSymbol{\defeq}{\mathrel}{\M at extsymbols@font}{"225D}
+  \DeclareMathSymbol{\qeq}{\mathrel}{\M at extsymbols@font}{"225F}
+  \DeclareMathSymbol{\lsim}{\mathrel}{\M at extsymbols@font}{"2272}
+  \DeclareMathSymbol{\gsim}{\mathrel}{\M at extsymbols@font}{"2273}
+  \DeclareMathSymbol{\prec}{\mathrel}{\M at extsymbols@font}{"227A}
+  \DeclareMathSymbol{\succ}{\mathrel}{\M at extsymbols@font}{"227B}
+  \DeclareMathSymbol{\preceq}{\mathrel}{\M at extsymbols@font}{"227C}
+  \DeclareMathSymbol{\succeq}{\mathrel}{\M at extsymbols@font}{"227D}
+  \DeclareMathSymbol{\preceqq}{\mathrel}{\M at extsymbols@font}{"2AB3}
+  \DeclareMathSymbol{\succeqq}{\mathrel}{\M at extsymbols@font}{"2AB4}
+  \DeclareMathSymbol{\precsim}{\mathrel}{\M at extsymbols@font}{"227E}
+  \DeclareMathSymbol{\succsim}{\mathrel}{\M at extsymbols@font}{"227F}
+  \DeclareMathSymbol{\precapprox}{\mathrel}{\M at extsymbols@font}{"2AB7}
+  \DeclareMathSymbol{\succapprox}{\mathrel}{\M at extsymbols@font}{"2AB8}
+  \DeclareMathSymbol{\precprec}{\mathrel}{\M at extsymbols@font}{"2ABB}
+  \DeclareMathSymbol{\succsucc}{\mathrel}{\M at extsymbols@font}{"2ABC}
+  \DeclareMathSymbol{\asymp}{\mathrel}{\M at extsymbols@font}{"224D}
+  \DeclareMathSymbol{\nin}{\mathrel}{\M at extsymbols@font}{"2209}
+  \DeclareMathSymbol{\nni}{\mathrel}{\M at extsymbols@font}{"220C}
+  \DeclareMathSymbol{\nsubset}{\mathrel}{\M at extsymbols@font}{"2284}
+  \DeclareMathSymbol{\nsupset}{\mathrel}{\M at extsymbols@font}{"2285}
+  \DeclareMathSymbol{\nsubseteq}{\mathrel}{\M at extsymbols@font}{"2288}
+  \DeclareMathSymbol{\nsupseteq}{\mathrel}{\M at extsymbols@font}{"2289}
+  \DeclareMathSymbol{\subsetneq}{\mathrel}{\M at extsymbols@font}{"228A}
+  \DeclareMathSymbol{\supsetneq}{\mathrel}{\M at extsymbols@font}{"228B}
+  \DeclareMathSymbol{\nsqsubseteq}{\mathrel}{\M at extsymbols@font}{"22E2}
+  \DeclareMathSymbol{\nsqsupseteq}{\mathrel}{\M at extsymbols@font}{"22E3}
+  \DeclareMathSymbol{\sqsubsetneq}{\mathrel}{\M at extsymbols@font}{"22E4}
+  \DeclareMathSymbol{\sqsupsetneq}{\mathrel}{\M at extsymbols@font}{"22E5}
+  \DeclareMathSymbol{\neq}{\mathrel}{\M at extsymbols@font}{"2260}
+  \DeclareMathSymbol{\nl}{\mathrel}{\M at extsymbols@font}{"226E}
+  \DeclareMathSymbol{\ng}{\mathrel}{\M at extsymbols@font}{"226F}
+  \DeclareMathSymbol{\nleq}{\mathrel}{\M at extsymbols@font}{"2270}
+  \DeclareMathSymbol{\ngeq}{\mathrel}{\M at extsymbols@font}{"2271}
+  \DeclareMathSymbol{\lneq}{\mathrel}{\M at extsymbols@font}{"2A87}
+  \DeclareMathSymbol{\gneq}{\mathrel}{\M at extsymbols@font}{"2A88}
+  \DeclareMathSymbol{\lneqq}{\mathrel}{\M at extsymbols@font}{"2268}
+  \DeclareMathSymbol{\gneqq}{\mathrel}{\M at extsymbols@font}{"2269}
+  \DeclareMathSymbol{\ntriangleleft}{\mathrel}{\M at extsymbols@font}{"22EA}
+  \DeclareMathSymbol{\ntriangleright}{\mathrel}{\M at extsymbols@font}{"22EB}
+  \DeclareMathSymbol{\ntrianglelefteq}{\mathrel}{\M at extsymbols@font}{"22EC}
+  \DeclareMathSymbol{\ntrianglerighteq}{\mathrel}{\M at extsymbols@font}{"22ED}
+  \DeclareMathSymbol{\nsim}{\mathrel}{\M at extsymbols@font}{"2241}
+  \DeclareMathSymbol{\napprox}{\mathrel}{\M at extsymbols@font}{"2249}
+  \DeclareMathSymbol{\nsimeq}{\mathrel}{\M at extsymbols@font}{"2244}
+  \DeclareMathSymbol{\nsimeqq}{\mathrel}{\M at extsymbols@font}{"2247}
+  \DeclareMathSymbol{\simneqq}{\mathrel}{\M at extsymbols@font}{"2246}
+  \DeclareMathSymbol{\nlsim}{\mathrel}{\M at extsymbols@font}{"2274}
+  \DeclareMathSymbol{\ngsim}{\mathrel}{\M at extsymbols@font}{"2275}
+  \DeclareMathSymbol{\lnsim}{\mathrel}{\M at extsymbols@font}{"22E6}
+  \DeclareMathSymbol{\gnsim}{\mathrel}{\M at extsymbols@font}{"22E7}
+  \DeclareMathSymbol{\lnapprox}{\mathrel}{\M at extsymbols@font}{"2A89}
+  \DeclareMathSymbol{\gnapprox}{\mathrel}{\M at extsymbols@font}{"2A8A}
+  \DeclareMathSymbol{\nprec}{\mathrel}{\M at extsymbols@font}{"2280}
+  \DeclareMathSymbol{\nsucc}{\mathrel}{\M at extsymbols@font}{"2281}
+  \DeclareMathSymbol{\npreceq}{\mathrel}{\M at extsymbols@font}{"22E0}
+  \DeclareMathSymbol{\nsucceq}{\mathrel}{\M at extsymbols@font}{"22E1}
+  \DeclareMathSymbol{\precneq}{\mathrel}{\M at extsymbols@font}{"2AB1}
+  \DeclareMathSymbol{\succneq}{\mathrel}{\M at extsymbols@font}{"2AB2}
+  \DeclareMathSymbol{\precneqq}{\mathrel}{\M at extsymbols@font}{"2AB5}
+  \DeclareMathSymbol{\succneqq}{\mathrel}{\M at extsymbols@font}{"2AB6}
+  \DeclareMathSymbol{\precnsim}{\mathrel}{\M at extsymbols@font}{"22E8}
+  \DeclareMathSymbol{\succnsim}{\mathrel}{\M at extsymbols@font}{"22E9}
+  \DeclareMathSymbol{\precnapprox}{\mathrel}{\M at extsymbols@font}{"2AB9}
+  \DeclareMathSymbol{\succnapprox}{\mathrel}{\M at extsymbols@font}{"2ABA}
+  \DeclareMathSymbol{\nequiv}{\mathrel}{\M at extsymbols@font}{"2262}
 %    \end{macrocode}
-% Set delimiters.\?\M at delimiters\indexpage{keyworddelimiters=keyword \texttt{delimiters}}
+% If we're not adjusting the font, we need to declare |\nabla| here.
 %    \begin{macrocode}
-\def\M at delimiters@set{%
-  \edef\M at delimiters{M\@delimitersshape\the\M at count}
-  \DeclareMathSymbol{(}{\mathopen}{\M at delimiters}{"28}
-  \DeclareMathSymbol{)}{\mathclose}{\M at delimiters}{"29}
-  \DeclareMathSymbol{[}{\mathopen}{\M at delimiters}{"5B}
-  \DeclareMathSymbol{]}{\mathclose}{\M at delimiters}{"5D}
-  \DeclareMathSymbol{\leftbrace}{\mathopen}{\M at delimiters}{"7B}
-  \DeclareMathSymbol{\rightbrace}{\mathclose}{\M at delimiters}{"7D}}
+  \ifM at adjust@font\else
+    \DeclareMathSymbol{\nabla}{\mathord}{\M at extsymbols@font}{"2207}
+  \fi}
 %    \end{macrocode}
-% Set arrows.\?{\M at arrows}\indexpage{keywordarrows=keyword \texttt{arrows}}
+% Set arrows.\indexpage{keywordarrows=keyword \texttt{arrows}}
 %    \begin{macrocode}
 \def\M at arrows@set{%
-  \edef\M at arrows{M\@arrowsshape\the\M at count}
+  \edef\M at arrows@font{M\M at arrowsshape\@tempa}
   \let\uparrow\@undefined
   \let\Uparrow\@undefined
   \let\downarrow\@undefined
@@ -1829,471 +4229,427 @@
   \let\Longleftarrow\@undefined
   \let\Longleftrightarrow\@undefined
   \let\rightleftharpoons\@undefined
-  \DeclareMathSymbol{\rightarrow}{\mathrel}{\M at arrows}{"2192}
-    \let\to\rightarrow
-  \DeclareMathSymbol{\nrightarrow}{\mathrel}{\M at arrows}{"219B}
-  \DeclareMathSymbol{\Rightarrow}{\mathrel}{\M at arrows}{"21D2}
-  \DeclareMathSymbol{\nRightarrow}{\mathrel}{\M at arrows}{"21CF}
-  \DeclareMathSymbol{\Rrightarrow}{\mathrel}{\M at arrows}{"21DB}
-  \DeclareMathSymbol{\longrightarrow}{\mathrel}{\M at arrows}{"27F6}
-  \DeclareMathSymbol{\Longrightarrow}{\mathrel}{\M at arrows}{"27F9}
-  \DeclareMathSymbol{\rightbararrow}{\mathrel}{\M at arrows}{"21A6}
-    \let\mapsto\rightbararrow
-  \DeclareMathSymbol{\Rightbararrow}{\mathrel}{\M at arrows}{"2907}
-  \DeclareMathSymbol{\longrightbararrow}{\mathrel}{\M at arrows}{"27FC}
-    \let\longmapsto\longrightbararrow
-  \DeclareMathSymbol{\Longrightbararrow}{\mathrel}{\M at arrows}{"27FE}
-  \DeclareMathSymbol{\hookrightarrow}{\mathrel}{\M at arrows}{"21AA}
-  \DeclareMathSymbol{\rightdasharrow}{\mathrel}{\M at arrows}{"21E2}
-  \DeclareMathSymbol{\rightharpoonup}{\mathrel}{\M at arrows}{"21C0}
-  \DeclareMathSymbol{\rightharpoondown}{\mathrel}{\M at arrows}{"21C1}
-  \DeclareMathSymbol{\rightarrowtail}{\mathrel}{\M at arrows}{"21A3}
-  \DeclareMathSymbol{\rightoplusarrow}{\mathrel}{\M at arrows}{"27F4}
-  \DeclareMathSymbol{\rightwavearrow}{\mathrel}{\M at arrows}{"219D}
-  \DeclareMathSymbol{\rightsquigarrow}{\mathrel}{\M at arrows}{"21DD}
-  \DeclareMathSymbol{\longrightsquigarrow}{\mathrel}{\M at arrows}{"27FF}
-  \DeclareMathSymbol{\looparrowright}{\mathrel}{\M at arrows}{"21AC}
-  \DeclareMathSymbol{\curvearrowright}{\mathrel}{\M at arrows}{"293B}
-  \DeclareMathSymbol{\circlearrowright}{\mathrel}{\M at arrows}{"21BB}
-  \DeclareMathSymbol{\twoheadrightarrow}{\mathrel}{\M at arrows}{"21A0}
-  \DeclareMathSymbol{\rightarrowtobar}{\mathrel}{\M at arrows}{"21E5}
-  \DeclareMathSymbol{\rightwhitearrow}{\mathrel}{\M at arrows}{"21E8}
-  \DeclareMathSymbol{\rightrightarrows}{\mathrel}{\M at arrows}{"21C9}
-  \DeclareMathSymbol{\rightrightrightarrows}{\mathrel}{\M at arrows}{"21F6}
-  \DeclareMathSymbol{\leftarrow}{\mathrel}{\M at arrows}{"2190}
-    \let\from\leftarrow
-  \DeclareMathSymbol{\nleftarrow}{\mathrel}{\M at arrows}{"219A}
-  \DeclareMathSymbol{\Leftarrow}{\mathrel}{\M at arrows}{"21D0}
-  \DeclareMathSymbol{\nLeftarrow}{\mathrel}{\M at arrows}{"21CD}
-  \DeclareMathSymbol{\Lleftarrow}{\mathrel}{\M at arrows}{"21DA}
-  \DeclareMathSymbol{\longleftarrow}{\mathrel}{\M at arrows}{"27F5}
-  \DeclareMathSymbol{\Longleftarrow}{\mathrel}{\M at arrows}{"27F8}
-  \DeclareMathSymbol{\leftbararrow}{\mathrel}{\M at arrows}{"21A4}
-    \let\mapsfrom\leftbararrow
-  \DeclareMathSymbol{\Leftbararrow}{\mathrel}{\M at arrows}{"2906}
-  \DeclareMathSymbol{\longleftbararrow}{\mathrel}{\M at arrows}{"27FB}
-    \let\longmapsfrom\longleftbararrow
-  \DeclareMathSymbol{\Longleftbararrow}{\mathrel}{\M at arrows}{"27FD}
-  \DeclareMathSymbol{\hookleftarrow}{\mathrel}{\M at arrows}{"21A9}
-  \DeclareMathSymbol{\leftdasharrow}{\mathrel}{\M at arrows}{"21E0}
-  \DeclareMathSymbol{\leftharpoonup}{\mathrel}{\M at arrows}{"21C0}
-  \DeclareMathSymbol{\leftharpoondown}{\mathrel}{\M at arrows}{"21C1}
-  \DeclareMathSymbol{\leftarrowtail}{\mathrel}{\M at arrows}{"21A2}
-  \DeclareMathSymbol{\leftoplusarrow}{\mathrel}{\M at arrows}{"2B32}
-  \DeclareMathSymbol{\leftwavearrow}{\mathrel}{\M at arrows}{"219C}
-  \DeclareMathSymbol{\leftsquigarrow}{\mathrel}{\M at arrows}{"21DC}
-  \DeclareMathSymbol{\longleftsquigarrow}{\mathrel}{\M at arrows}{"2B33}
-  \DeclareMathSymbol{\looparrowleft}{\mathrel}{\M at arrows}{"21AB}
-  \DeclareMathSymbol{\curvearrowleft}{\mathrel}{\M at arrows}{"293A}
-  \DeclareMathSymbol{\circlearrowleft}{\mathrel}{\M at arrows}{"21BA}
-  \DeclareMathSymbol{\twoheadleftarrow}{\mathrel}{\M at arrows}{"219E}
-  \DeclareMathSymbol{\leftarrowtobar}{\mathrel}{\M at arrows}{"21E4}
-  \DeclareMathSymbol{\leftwhitearrow}{\mathrel}{\M at arrows}{"21E6}
-  \DeclareMathSymbol{\leftleftarrows}{\mathrel}{\M at arrows}{"21C7}
-  \DeclareMathSymbol{\leftleftleftarrows}{\mathrel}{\M at arrows}{"2B31}
-  \DeclareMathSymbol{\leftrightarrow}{\mathrel}{\M at arrows}{"2194}
-  \DeclareMathSymbol{\Leftrightarrow}{\mathrel}{\M at arrows}{"21D4}
-  \DeclareMathSymbol{\nLeftrightarrow}{\mathrel}{\M at arrows}{"21CE}
-  \DeclareMathSymbol{\longleftrightarrow}{\mathrel}{\M at arrows}{"27F7}
-  \DeclareMathSymbol{\Longleftrightarrow}{\mathrel}{\M at arrows}{"27FA}
-  \DeclareMathSymbol{\leftrightwavearrow}{\mathrel}{\M at arrows}{"21AD}
-  \DeclareMathSymbol{\leftrightarrows}{\mathrel}{\M at arrows}{"21C6}
-  \DeclareMathSymbol{\leftrightharpoons}{\mathrel}{\M at arrows}{"21CB}
-  \DeclareMathSymbol{\leftrightarrowstobar}{\mathrel}{\M at arrows}{"21B9}
-  \DeclareMathSymbol{\rightleftarrows}{\mathrel}{\M at arrows}{"21C4}
-  \DeclareMathSymbol{\rightleftharpoons}{\mathrel}{\M at arrows}{"21CC}
-  \DeclareMathSymbol{\uparrow}{\mathrel}{\M at arrows}{"2191}
-  \DeclareMathSymbol{\Uparrow}{\mathrel}{\M at arrows}{"21D1}
-  \DeclareMathSymbol{\Uuparrow}{\mathrel}{\M at arrows}{"290A}
-  \DeclareMathSymbol{\upbararrow}{\mathrel}{\M at arrows}{"21A5}
-  \DeclareMathSymbol{\updasharrow}{\mathrel}{\M at arrows}{"21E1}
-  \DeclareMathSymbol{\upharpoonleft}{\mathrel}{\M at arrows}{"21BF}
-  \DeclareMathSymbol{\upharpoonright}{\mathrel}{\M at arrows}{"21BE}
-  \DeclareMathSymbol{\twoheaduparrow}{\mathrel}{\M at arrows}{"219F}
-  \DeclareMathSymbol{\uparrowtobar}{\mathrel}{\M at arrows}{"2912}
-  \DeclareMathSymbol{\upwhitearrow}{\mathrel}{\M at arrows}{"21E7}
-  \DeclareMathSymbol{\upwhitebararrow}{\mathrel}{\M at arrows}{"21EA}
-  \DeclareMathSymbol{\upuparrows}{\mathrel}{\M at arrows}{"21C8}
-  \DeclareMathSymbol{\downarrow}{\mathrel}{\M at arrows}{"2193}
-  \DeclareMathSymbol{\Downarrow}{\mathrel}{\M at arrows}{"21D3}
-  \DeclareMathSymbol{\Ddownarrow}{\mathrel}{\M at arrows}{"290B}
-  \DeclareMathSymbol{\downbararrow}{\mathrel}{\M at arrows}{"21A7}
-  \DeclareMathSymbol{\downdasharrow}{\mathrel}{\M at arrows}{"21E3}
-  \DeclareMathSymbol{\zigzagarrow}{\mathrel}{\M at arrows}{"21AF}
-    \let\lightningboltarrow\zigzagarrow
-  \DeclareMathSymbol{\downharpoonleft}{\mathrel}{\M at arrows}{"21C3}
-  \DeclareMathSymbol{\downharpoonright}{\mathrel}{\M at arrows}{"21C2}
-  \DeclareMathSymbol{\twoheaddownarrow}{\mathrel}{\M at arrows}{"21A1}
-  \DeclareMathSymbol{\downarrowtobar}{\mathrel}{\M at arrows}{"2913}
-  \DeclareMathSymbol{\downwhitearrow}{\mathrel}{\M at arrows}{"21E9}
-  \DeclareMathSymbol{\downdownarrows}{\mathrel}{\M at arrows}{"21CA}
-  \DeclareMathSymbol{\updownarrow}{\mathrel}{\M at arrows}{"2195}
-  \DeclareMathSymbol{\Updownarrow}{\mathrel}{\M at arrows}{"21D5}
-  \DeclareMathSymbol{\updownarrows}{\mathrel}{\M at arrows}{"21C5}
-  \DeclareMathSymbol{\downuparrows}{\mathrel}{\M at arrows}{"21F5}
-  \DeclareMathSymbol{\updownharpoons}{\mathrel}{\M at arrows}{"296E}
-  \DeclareMathSymbol{\downupharpoons}{\mathrel}{\M at arrows}{"296F}
-  \DeclareMathSymbol{\nearrow}{\mathrel}{\M at arrows}{"2197}
-  \DeclareMathSymbol{\Nearrow}{\mathrel}{\M at arrows}{"21D7}
-  \DeclareMathSymbol{\nwarrow}{\mathrel}{\M at arrows}{"2196}
-  \DeclareMathSymbol{\Nwarrow}{\mathrel}{\M at arrows}{"21D6}
-  \DeclareMathSymbol{\searrow}{\mathrel}{\M at arrows}{"2198}
-  \DeclareMathSymbol{\Searrow}{\mathrel}{\M at arrows}{"21D8}
-  \DeclareMathSymbol{\swarrow}{\mathrel}{\M at arrows}{"2199}
-  \DeclareMathSymbol{\Swarrow}{\mathrel}{\M at arrows}{"21D9}
-  \DeclareMathSymbol{\nwsearrow}{\mathrel}{\M at arrows}{"2921}
-  \DeclareMathSymbol{\neswarrow}{\mathrel}{\M at arrows}{"2922}
-  \DeclareMathSymbol{\lcirclearrow}{\mathrel}{\M at arrows}{"27F2}
-  \DeclareMathSymbol{\rcirclearrow}{\mathrel}{\M at arrows}{"27F3}}
+  \DeclareMathSymbol{\rightarrow}{\mathrel}{\M at arrows@font}{"2192}
+    \global\let\to\rightarrow
+  \DeclareMathSymbol{\nrightarrow}{\mathrel}{\M at arrows@font}{"219B}
+  \DeclareMathSymbol{\Rightarrow}{\mathrel}{\M at arrows@font}{"21D2}
+  \DeclareMathSymbol{\nRightarrow}{\mathrel}{\M at arrows@font}{"21CF}
+  \DeclareMathSymbol{\Rrightarrow}{\mathrel}{\M at arrows@font}{"21DB}
+  \DeclareMathSymbol{\longrightarrow}{\mathrel}{\M at arrows@font}{"27F6}
+  \DeclareMathSymbol{\Longrightarrow}{\mathrel}{\M at arrows@font}{"27F9}
+  \DeclareMathSymbol{\rightbararrow}{\mathrel}{\M at arrows@font}{"21A6}
+    \global\let\mapsto\rightbararrow
+  \DeclareMathSymbol{\Rightbararrow}{\mathrel}{\M at arrows@font}{"2907}
+  \DeclareMathSymbol{\longrightbararrow}{\mathrel}{\M at arrows@font}{"27FC}
+    \global\let\longmapsto\longrightbararrow
+  \DeclareMathSymbol{\Longrightbararrow}{\mathrel}{\M at arrows@font}{"27FE}
+  \DeclareMathSymbol{\hookrightarrow}{\mathrel}{\M at arrows@font}{"21AA}
+  \DeclareMathSymbol{\rightdasharrow}{\mathrel}{\M at arrows@font}{"21E2}
+  \DeclareMathSymbol{\rightharpoonup}{\mathrel}{\M at arrows@font}{"21C0}
+  \DeclareMathSymbol{\rightharpoondown}{\mathrel}{\M at arrows@font}{"21C1}
+  \DeclareMathSymbol{\rightarrowtail}{\mathrel}{\M at arrows@font}{"21A3}
+  \DeclareMathSymbol{\rightoplusarrow}{\mathrel}{\M at arrows@font}{"27F4}
+  \DeclareMathSymbol{\rightwavearrow}{\mathrel}{\M at arrows@font}{"219D}
+  \DeclareMathSymbol{\rightsquigarrow}{\mathrel}{\M at arrows@font}{"21DD}
+  \DeclareMathSymbol{\longrightsquigarrow}{\mathrel}{\M at arrows@font}{"27FF}
+  \DeclareMathSymbol{\looparrowright}{\mathrel}{\M at arrows@font}{"21AC}
+  \DeclareMathSymbol{\curvearrowright}{\mathrel}{\M at arrows@font}{"293B}
+  \DeclareMathSymbol{\circlearrowright}{\mathrel}{\M at arrows@font}{"21BB}
+  \DeclareMathSymbol{\twoheadrightarrow}{\mathrel}{\M at arrows@font}{"21A0}
+  \DeclareMathSymbol{\rightarrowtobar}{\mathrel}{\M at arrows@font}{"21E5}
+  \DeclareMathSymbol{\rightwhitearrow}{\mathrel}{\M at arrows@font}{"21E8}
+  \DeclareMathSymbol{\rightrightarrows}{\mathrel}{\M at arrows@font}{"21C9}
+  \DeclareMathSymbol{\rightrightrightarrows}{\mathrel}{\M at arrows@font}{"21F6}
+  \DeclareMathSymbol{\leftarrow}{\mathrel}{\M at arrows@font}{"2190}
+    \global\let\from\leftarrow
+  \DeclareMathSymbol{\nleftarrow}{\mathrel}{\M at arrows@font}{"219A}
+  \DeclareMathSymbol{\Leftarrow}{\mathrel}{\M at arrows@font}{"21D0}
+  \DeclareMathSymbol{\nLeftarrow}{\mathrel}{\M at arrows@font}{"21CD}
+  \DeclareMathSymbol{\Lleftarrow}{\mathrel}{\M at arrows@font}{"21DA}
+  \DeclareMathSymbol{\longleftarrow}{\mathrel}{\M at arrows@font}{"27F5}
+  \DeclareMathSymbol{\Longleftarrow}{\mathrel}{\M at arrows@font}{"27F8}
+  \DeclareMathSymbol{\leftbararrow}{\mathrel}{\M at arrows@font}{"21A4}
+    \global\let\mapsfrom\leftbararrow
+  \DeclareMathSymbol{\Leftbararrow}{\mathrel}{\M at arrows@font}{"2906}
+  \DeclareMathSymbol{\longleftbararrow}{\mathrel}{\M at arrows@font}{"27FB}
+    \global\let\longmapsfrom\longleftbararrow
+  \DeclareMathSymbol{\Longleftbararrow}{\mathrel}{\M at arrows@font}{"27FD}
+  \DeclareMathSymbol{\hookleftarrow}{\mathrel}{\M at arrows@font}{"21A9}
+  \DeclareMathSymbol{\leftdasharrow}{\mathrel}{\M at arrows@font}{"21E0}
+  \DeclareMathSymbol{\leftharpoonup}{\mathrel}{\M at arrows@font}{"21BC}
+  \DeclareMathSymbol{\leftharpoondown}{\mathrel}{\M at arrows@font}{"21BD}
+  \DeclareMathSymbol{\leftarrowtail}{\mathrel}{\M at arrows@font}{"21A2}
+  \DeclareMathSymbol{\leftoplusarrow}{\mathrel}{\M at arrows@font}{"2B32}
+  \DeclareMathSymbol{\leftwavearrow}{\mathrel}{\M at arrows@font}{"219C}
+  \DeclareMathSymbol{\leftsquigarrow}{\mathrel}{\M at arrows@font}{"21DC}
+  \DeclareMathSymbol{\longleftsquigarrow}{\mathrel}{\M at arrows@font}{"2B33}
+  \DeclareMathSymbol{\looparrowleft}{\mathrel}{\M at arrows@font}{"21AB}
+  \DeclareMathSymbol{\curvearrowleft}{\mathrel}{\M at arrows@font}{"293A}
+  \DeclareMathSymbol{\circlearrowleft}{\mathrel}{\M at arrows@font}{"21BA}
+  \DeclareMathSymbol{\twoheadleftarrow}{\mathrel}{\M at arrows@font}{"219E}
+  \DeclareMathSymbol{\leftarrowtobar}{\mathrel}{\M at arrows@font}{"21E4}
+  \DeclareMathSymbol{\leftwhitearrow}{\mathrel}{\M at arrows@font}{"21E6}
+  \DeclareMathSymbol{\leftleftarrows}{\mathrel}{\M at arrows@font}{"21C7}
+  \DeclareMathSymbol{\leftleftleftarrows}{\mathrel}{\M at arrows@font}{"2B31}
+  \DeclareMathSymbol{\leftrightarrow}{\mathrel}{\M at arrows@font}{"2194}
+  \DeclareMathSymbol{\Leftrightarrow}{\mathrel}{\M at arrows@font}{"21D4}
+  \DeclareMathSymbol{\nLeftrightarrow}{\mathrel}{\M at arrows@font}{"21CE}
+  \DeclareMathSymbol{\longleftrightarrow}{\mathrel}{\M at arrows@font}{"27F7}
+  \DeclareMathSymbol{\Longleftrightarrow}{\mathrel}{\M at arrows@font}{"27FA}
+  \DeclareMathSymbol{\leftrightwavearrow}{\mathrel}{\M at arrows@font}{"21AD}
+  \DeclareMathSymbol{\leftrightarrows}{\mathrel}{\M at arrows@font}{"21C6}
+  \DeclareMathSymbol{\leftrightharpoons}{\mathrel}{\M at arrows@font}{"21CB}
+  \DeclareMathSymbol{\leftrightarrowstobar}{\mathrel}{\M at arrows@font}{"21B9}
+  \DeclareMathSymbol{\rightleftarrows}{\mathrel}{\M at arrows@font}{"21C4}
+  \DeclareMathSymbol{\rightleftharpoons}{\mathrel}{\M at arrows@font}{"21CC}
+  \DeclareMathSymbol{\uparrow}{\mathrel}{\M at arrows@font}{"2191}
+  \DeclareMathSymbol{\Uparrow}{\mathrel}{\M at arrows@font}{"21D1}
+  \DeclareMathSymbol{\Uuparrow}{\mathrel}{\M at arrows@font}{"290A}
+  \DeclareMathSymbol{\upbararrow}{\mathrel}{\M at arrows@font}{"21A5}
+  \DeclareMathSymbol{\updasharrow}{\mathrel}{\M at arrows@font}{"21E1}
+  \DeclareMathSymbol{\upharpoonleft}{\mathrel}{\M at arrows@font}{"21BF}
+  \DeclareMathSymbol{\upharpoonright}{\mathrel}{\M at arrows@font}{"21BE}
+  \DeclareMathSymbol{\twoheaduparrow}{\mathrel}{\M at arrows@font}{"219F}
+  \DeclareMathSymbol{\uparrowtobar}{\mathrel}{\M at arrows@font}{"2912}
+  \DeclareMathSymbol{\upwhitearrow}{\mathrel}{\M at arrows@font}{"21E7}
+  \DeclareMathSymbol{\upwhitebararrow}{\mathrel}{\M at arrows@font}{"21EA}
+  \DeclareMathSymbol{\upuparrows}{\mathrel}{\M at arrows@font}{"21C8}
+  \DeclareMathSymbol{\downarrow}{\mathrel}{\M at arrows@font}{"2193}
+  \DeclareMathSymbol{\Downarrow}{\mathrel}{\M at arrows@font}{"21D3}
+  \DeclareMathSymbol{\Ddownarrow}{\mathrel}{\M at arrows@font}{"290B}
+  \DeclareMathSymbol{\downbararrow}{\mathrel}{\M at arrows@font}{"21A7}
+  \DeclareMathSymbol{\downdasharrow}{\mathrel}{\M at arrows@font}{"21E3}
+  \DeclareMathSymbol{\zigzagarrow}{\mathrel}{\M at arrows@font}{"21AF}
+    \global\let\lightningboltarrow\zigzagarrow
+  \DeclareMathSymbol{\downharpoonleft}{\mathrel}{\M at arrows@font}{"21C3}
+  \DeclareMathSymbol{\downharpoonright}{\mathrel}{\M at arrows@font}{"21C2}
+  \DeclareMathSymbol{\twoheaddownarrow}{\mathrel}{\M at arrows@font}{"21A1}
+  \DeclareMathSymbol{\downarrowtobar}{\mathrel}{\M at arrows@font}{"2913}
+  \DeclareMathSymbol{\downwhitearrow}{\mathrel}{\M at arrows@font}{"21E9}
+  \DeclareMathSymbol{\downdownarrows}{\mathrel}{\M at arrows@font}{"21CA}
+  \DeclareMathSymbol{\updownarrow}{\mathrel}{\M at arrows@font}{"2195}
+  \DeclareMathSymbol{\Updownarrow}{\mathrel}{\M at arrows@font}{"21D5}
+  \DeclareMathSymbol{\updownarrows}{\mathrel}{\M at arrows@font}{"21C5}
+  \DeclareMathSymbol{\downuparrows}{\mathrel}{\M at arrows@font}{"21F5}
+  \DeclareMathSymbol{\updownharpoons}{\mathrel}{\M at arrows@font}{"296E}
+  \DeclareMathSymbol{\downupharpoons}{\mathrel}{\M at arrows@font}{"296F}
+  \DeclareMathSymbol{\nearrow}{\mathrel}{\M at arrows@font}{"2197}
+  \DeclareMathSymbol{\Nearrow}{\mathrel}{\M at arrows@font}{"21D7}
+  \DeclareMathSymbol{\nwarrow}{\mathrel}{\M at arrows@font}{"2196}
+  \DeclareMathSymbol{\Nwarrow}{\mathrel}{\M at arrows@font}{"21D6}
+  \DeclareMathSymbol{\searrow}{\mathrel}{\M at arrows@font}{"2198}
+  \DeclareMathSymbol{\Searrow}{\mathrel}{\M at arrows@font}{"21D8}
+  \DeclareMathSymbol{\swarrow}{\mathrel}{\M at arrows@font}{"2199}
+  \DeclareMathSymbol{\Swarrow}{\mathrel}{\M at arrows@font}{"21D9}
+  \DeclareMathSymbol{\nwsearrow}{\mathrel}{\M at arrows@font}{"2921}
+  \DeclareMathSymbol{\neswarrow}{\mathrel}{\M at arrows@font}{"2922}
+  \DeclareMathSymbol{\lcirclearrow}{\mathrel}{\M at arrows@font}{"27F2}
+  \DeclareMathSymbol{\rcirclearrow}{\mathrel}{\M at arrows@font}{"27F3}}
 %    \end{macrocode}
-% Big operators.\?\M at bigops\indexpage{keywordbigops=keyword \texttt{bigops}}
+% Set blackboard bold letters and numbers.\indexpage{keywordbb=keyword \texttt{bb}}
 %    \begin{macrocode}
-\def\M at bigops@set{%
-  \edef\M at bigops{M\@bigopsshape\the\M at count}
-  \let\sum\@undefined
-  \let\prod\@undefined
-  \DeclareMathSymbol{\sum}{\mathop}{\M at bigops}{"2211}
-  \DeclareMathSymbol{\prod}{\mathop}{\M at bigops}{"220F}
-  \DeclareMathSymbol{\intop}{\mathop}{\M at bigops}{"222B}}
-%    \end{macrocode}
-% Set extended big operators.\?\M at extbigops\indexpage{keywordextbigops=keyword \texttt{extbigops}}
-%    \begin{macrocode}
-\def\M at extbigops@set{%
-  \edef\M at extbigops{M\@extbigopsshape\the\M at count}
-  \let\coprod\@undefined
-  \let\bigvee\@undefined
-  \let\bigwedge\@undefined
-  \let\bigcup\@undefined
-  \let\bigcap\@undefined
-  \let\bigoplus\@undefined
-  \let\bigotimes\@undefined
-  \let\bigodot\@undefined
-  \let\bigsqcup\@undefined
-  \DeclareMathSymbol{\coprod}{\mathop}{\M at extbigops}{"2210}
-  \DeclareMathSymbol{\bigvee}{\mathop}{\M at extbigops}{"22C1}
-  \DeclareMathSymbol{\bigwedge}{\mathop}{\M at extbigops}{"22C0}
-  \DeclareMathSymbol{\bigcup}{\mathop}{\M at extbigops}{"22C3}
-  \DeclareMathSymbol{\bigcap}{\mathord}{\M at extbigops}{"22C2}
-  \DeclareMathSymbol{\iintop}{\mathop}{\M at extbigops}{"222C}
-    \def\iint{\iintop\nolimits}
-  \DeclareMathSymbol{\iiintop}{\mathop}{\M at extbigops}{"222D}
-    \def\iiint{\iiintop\nolimits}
-  \DeclareMathSymbol{\ointop}{\mathop}{\M at extbigops}{"222E}
-    \def\oint{\ointop\nolimits}
-  \DeclareMathSymbol{\oiintop}{\mathop}{\M at extbigops}{"222F}
-    \def\oiint{\oiintop\nolimits}
-  \DeclareMathSymbol{\oiiintop}{\mathop}{\M at extbigops}{"2230}
-    \def\oiiint{\oiiintop\nolimits}
-  \DeclareMathSymbol{\bigoplus}{\mathop}{\M at extbigops}{"2A01}
-  \DeclareMathSymbol{\bigotimes}{\mathop}{\M at extbigops}{"2A02}
-  \DeclareMathSymbol{\bigodot}{\mathop}{\M at extbigops}{"2A00}
-  \DeclareMathSymbol{\bigsqcap}{\mathop}{\M at extbigops}{"2A05}
-  \DeclareMathSymbol{\bigsqcup}{\mathop}{\M at extbigops}{"2A06}}
-%    \end{macrocode}
-% Set blackboard bold letters and numbers.\?\M at bb\indexpage{keywordbb=keyword \texttt{bb}}
-%    \begin{macrocode}
 \def\M at bb@set{%
-  \edef\M at bb{M\@bbshape\the\M at count}
-  \DeclareMathSymbol{\M at bb@A}{\mathord}{\M at bb}{"1D538}
-  \DeclareMathSymbol{\M at bb@B}{\mathord}{\M at bb}{"1D539}
-  \DeclareMathSymbol{\M at bb@C}{\mathord}{\M at bb}{"2102}
-  \DeclareMathSymbol{\M at bb@D}{\mathord}{\M at bb}{"1D53B}
-  \DeclareMathSymbol{\M at bb@E}{\mathord}{\M at bb}{"1D53C}
-  \DeclareMathSymbol{\M at bb@F}{\mathord}{\M at bb}{"1D53D}
-  \DeclareMathSymbol{\M at bb@G}{\mathord}{\M at bb}{"1D53E}
-  \DeclareMathSymbol{\M at bb@H}{\mathord}{\M at bb}{"210D}
-  \DeclareMathSymbol{\M at bb@I}{\mathord}{\M at bb}{"1D540}
-  \DeclareMathSymbol{\M at bb@J}{\mathord}{\M at bb}{"1D541}
-  \DeclareMathSymbol{\M at bb@K}{\mathord}{\M at bb}{"1D542}
-  \DeclareMathSymbol{\M at bb@L}{\mathord}{\M at bb}{"1D543}
-  \DeclareMathSymbol{\M at bb@M}{\mathord}{\M at bb}{"1D544}
-  \DeclareMathSymbol{\M at bb@N}{\mathord}{\M at bb}{"2115}
-  \DeclareMathSymbol{\M at bb@O}{\mathord}{\M at bb}{"1D546}
-  \DeclareMathSymbol{\M at bb@P}{\mathord}{\M at bb}{"2119}
-  \DeclareMathSymbol{\M at bb@Q}{\mathord}{\M at bb}{"211A}
-  \DeclareMathSymbol{\M at bb@R}{\mathord}{\M at bb}{"211D}
-  \DeclareMathSymbol{\M at bb@S}{\mathord}{\M at bb}{"1D54A}
-  \DeclareMathSymbol{\M at bb@T}{\mathord}{\M at bb}{"1D54B}
-  \DeclareMathSymbol{\M at bb@U}{\mathord}{\M at bb}{"1D54C}
-  \DeclareMathSymbol{\M at bb@V}{\mathord}{\M at bb}{"1D54D}
-  \DeclareMathSymbol{\M at bb@W}{\mathord}{\M at bb}{"1D54E}
-  \DeclareMathSymbol{\M at bb@X}{\mathord}{\M at bb}{"1D54F}
-  \DeclareMathSymbol{\M at bb@Y}{\mathord}{\M at bb}{"1D550}
-  \DeclareMathSymbol{\M at bb@Z}{\mathord}{\M at bb}{"2124}
-  \DeclareMathSymbol{\M at bb@a}{\mathord}{\M at bb}{"1D552}
-  \DeclareMathSymbol{\M at bb@b}{\mathord}{\M at bb}{"1D553}
-  \DeclareMathSymbol{\M at bb@c}{\mathord}{\M at bb}{"1D554}
-  \DeclareMathSymbol{\M at bb@d}{\mathord}{\M at bb}{"1D555}
-  \DeclareMathSymbol{\M at bb@e}{\mathord}{\M at bb}{"1D556}
-  \DeclareMathSymbol{\M at bb@f}{\mathord}{\M at bb}{"1D557}
-  \DeclareMathSymbol{\M at bb@g}{\mathord}{\M at bb}{"1D558}
-  \DeclareMathSymbol{\M at bb@h}{\mathord}{\M at bb}{"1D559}
-  \DeclareMathSymbol{\M at bb@i}{\mathord}{\M at bb}{"1D55A}
-  \DeclareMathSymbol{\M at bb@j}{\mathord}{\M at bb}{"1D55B}
-  \DeclareMathSymbol{\M at bb@k}{\mathord}{\M at bb}{"1D55C}
-  \DeclareMathSymbol{\M at bb@l}{\mathord}{\M at bb}{"1D55D}
-  \DeclareMathSymbol{\M at bb@m}{\mathord}{\M at bb}{"1D55E}
-  \DeclareMathSymbol{\M at bb@n}{\mathord}{\M at bb}{"1D55F}
-  \DeclareMathSymbol{\M at bb@o}{\mathord}{\M at bb}{"1D560}
-  \DeclareMathSymbol{\M at bb@p}{\mathord}{\M at bb}{"1D561}
-  \DeclareMathSymbol{\M at bb@q}{\mathord}{\M at bb}{"1D562}
-  \DeclareMathSymbol{\M at bb@r}{\mathord}{\M at bb}{"1D563}
-  \DeclareMathSymbol{\M at bb@s}{\mathord}{\M at bb}{"1D564}
-  \DeclareMathSymbol{\M at bb@t}{\mathord}{\M at bb}{"1D565}
-  \DeclareMathSymbol{\M at bb@u}{\mathord}{\M at bb}{"1D566}
-  \DeclareMathSymbol{\M at bb@v}{\mathord}{\M at bb}{"1D567}
-  \DeclareMathSymbol{\M at bb@w}{\mathord}{\M at bb}{"1D568}
-  \DeclareMathSymbol{\M at bb@x}{\mathord}{\M at bb}{"1D569}
-  \DeclareMathSymbol{\M at bb@y}{\mathord}{\M at bb}{"1D56A}
-  \DeclareMathSymbol{\M at bb@z}{\mathord}{\M at bb}{"1D56B}
+  \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}{"1D7D8}
+    {\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}{"1D7D9}
+    {\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}{"1D7DA}
+    {\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}{"1D7DB}
+    {\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}{"1D7DC}
+    {\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}{"1D7DD}
+    {\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}{"1D7DE}
+    {\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}{"1D7DF}
+    {\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}{"1D7E0}
+    {\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}{"1D7E1}}
+    {\csname M at bb@9\endcsname}{\mathord}{\M at bb@font}{"1D7E1}}
 %    \end{macrocode}
-% Set caligraphic letters.\?\M at cal\indexpage{keywordcal=keyword \texttt{cal}}
+% Set caligraphic letters.\indexpage{keywordcal=keyword \texttt{cal}}
 %    \begin{macrocode}
 \def\M at cal@set{%
-  \edef\M at cal{M\@calshape\the\M at count}
-  \DeclareMathSymbol{\M at cal@A}{\mathord}{\M at cal}{"1D49C}
-  \DeclareMathSymbol{\M at cal@B}{\mathord}{\M at cal}{"212C}
-  \DeclareMathSymbol{\M at cal@C}{\mathord}{\M at cal}{"1D49E}
-  \DeclareMathSymbol{\M at cal@D}{\mathord}{\M at cal}{"1D49F}
-  \DeclareMathSymbol{\M at cal@E}{\mathord}{\M at cal}{"2130}
-  \DeclareMathSymbol{\M at cal@F}{\mathord}{\M at cal}{"2131}
-  \DeclareMathSymbol{\M at cal@G}{\mathord}{\M at cal}{"1D4A2}
-  \DeclareMathSymbol{\M at cal@H}{\mathord}{\M at cal}{"210B}
-  \DeclareMathSymbol{\M at cal@I}{\mathord}{\M at cal}{"2110}
-  \DeclareMathSymbol{\M at cal@J}{\mathord}{\M at cal}{"1D4A5}
-  \DeclareMathSymbol{\M at cal@K}{\mathord}{\M at cal}{"1D4A6}
-  \DeclareMathSymbol{\M at cal@L}{\mathord}{\M at cal}{"2112}
-  \DeclareMathSymbol{\M at cal@M}{\mathord}{\M at cal}{"2133}
-  \DeclareMathSymbol{\M at cal@N}{\mathord}{\M at cal}{"1D4A9}
-  \DeclareMathSymbol{\M at cal@O}{\mathord}{\M at cal}{"1D4AA}
-  \DeclareMathSymbol{\M at cal@P}{\mathord}{\M at cal}{"1D4AB}
-  \DeclareMathSymbol{\M at cal@Q}{\mathord}{\M at cal}{"1D4AC}
-  \DeclareMathSymbol{\M at cal@R}{\mathord}{\M at cal}{"211B}
-  \DeclareMathSymbol{\M at cal@S}{\mathord}{\M at cal}{"1D4AE}
-  \DeclareMathSymbol{\M at cal@T}{\mathord}{\M at cal}{"1D4AF}
-  \DeclareMathSymbol{\M at cal@U}{\mathord}{\M at cal}{"1D4B0}
-  \DeclareMathSymbol{\M at cal@V}{\mathord}{\M at cal}{"1D4B1}
-  \DeclareMathSymbol{\M at cal@W}{\mathord}{\M at cal}{"1D4B2}
-  \DeclareMathSymbol{\M at cal@X}{\mathord}{\M at cal}{"1D4B3}
-  \DeclareMathSymbol{\M at cal@Y}{\mathord}{\M at cal}{"1D4B4}
-  \DeclareMathSymbol{\M at cal@Z}{\mathord}{\M at cal}{"1D4B5}
-  \DeclareMathSymbol{\M at cal@a}{\mathord}{\M at cal}{"1D4B6}
-  \DeclareMathSymbol{\M at cal@b}{\mathord}{\M at cal}{"1D4B7}
-  \DeclareMathSymbol{\M at cal@c}{\mathord}{\M at cal}{"1D4B8}
-  \DeclareMathSymbol{\M at cal@d}{\mathord}{\M at cal}{"1D4B9}
-  \DeclareMathSymbol{\M at cal@e}{\mathord}{\M at cal}{"212F}
-  \DeclareMathSymbol{\M at cal@f}{\mathord}{\M at cal}{"1D4BB}
-  \DeclareMathSymbol{\M at cal@g}{\mathord}{\M at cal}{"210A}
-  \DeclareMathSymbol{\M at cal@h}{\mathord}{\M at cal}{"1D4BD}
-  \DeclareMathSymbol{\M at cal@i}{\mathord}{\M at cal}{"1D4BE}
-  \DeclareMathSymbol{\M at cal@j}{\mathord}{\M at cal}{"1D4BF}
-  \DeclareMathSymbol{\M at cal@k}{\mathord}{\M at cal}{"1D4C0}
-  \DeclareMathSymbol{\M at cal@l}{\mathord}{\M at cal}{"1D4C1}
-  \DeclareMathSymbol{\M at cal@m}{\mathord}{\M at cal}{"1D4C2}
-  \DeclareMathSymbol{\M at cal@n}{\mathord}{\M at cal}{"1D4C3}
-  \DeclareMathSymbol{\M at cal@o}{\mathord}{\M at cal}{"2134}
-  \DeclareMathSymbol{\M at cal@p}{\mathord}{\M at cal}{"1D4C5}
-  \DeclareMathSymbol{\M at cal@q}{\mathord}{\M at cal}{"1D4C6}
-  \DeclareMathSymbol{\M at cal@r}{\mathord}{\M at cal}{"1D4C7}
-  \DeclareMathSymbol{\M at cal@s}{\mathord}{\M at cal}{"1D4C8}
-  \DeclareMathSymbol{\M at cal@t}{\mathord}{\M at cal}{"1D4C9}
-  \DeclareMathSymbol{\M at cal@u}{\mathord}{\M at cal}{"1D4CA}
-  \DeclareMathSymbol{\M at cal@v}{\mathord}{\M at cal}{"1D4CB}
-  \DeclareMathSymbol{\M at cal@w}{\mathord}{\M at cal}{"1D4CC}
-  \DeclareMathSymbol{\M at cal@x}{\mathord}{\M at cal}{"1D4CD}
-  \DeclareMathSymbol{\M at cal@y}{\mathord}{\M at cal}{"1D4CE}
-  \DeclareMathSymbol{\M at cal@z}{\mathord}{\M at cal}{"1D4CF}}
+  \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}}
 %    \end{macrocode}
-% Set fraktur letters.\?\M at frak\indexpage{keywordfrak=keyword \texttt{frak}}
+% Set fraktur letters.\indexpage{keywordfrak=keyword \texttt{frak}}
 %    \begin{macrocode}
 \def\M at frak@set{%
-  \edef\M at frak{M\@frakshape\the\M at count}
-  \DeclareMathSymbol{\M at frak@A}{\mathord}{\M at frak}{"1D504}
-  \DeclareMathSymbol{\M at frak@B}{\mathord}{\M at frak}{"1D505}
-  \DeclareMathSymbol{\M at frak@C}{\mathord}{\M at frak}{"212D}
-  \DeclareMathSymbol{\M at frak@D}{\mathord}{\M at frak}{"1D507}
-  \DeclareMathSymbol{\M at frak@E}{\mathord}{\M at frak}{"1D508}
-  \DeclareMathSymbol{\M at frak@F}{\mathord}{\M at frak}{"1D509}
-  \DeclareMathSymbol{\M at frak@G}{\mathord}{\M at frak}{"1D50A}
-  \DeclareMathSymbol{\M at frak@H}{\mathord}{\M at frak}{"210C}
-  \DeclareMathSymbol{\M at frak@I}{\mathord}{\M at frak}{"2111}
-  \DeclareMathSymbol{\M at frak@J}{\mathord}{\M at frak}{"1D50D}
-  \DeclareMathSymbol{\M at frak@K}{\mathord}{\M at frak}{"1D50E}
-  \DeclareMathSymbol{\M at frak@L}{\mathord}{\M at frak}{"1D50F}
-  \DeclareMathSymbol{\M at frak@M}{\mathord}{\M at frak}{"1D510}
-  \DeclareMathSymbol{\M at frak@N}{\mathord}{\M at frak}{"1D511}
-  \DeclareMathSymbol{\M at frak@O}{\mathord}{\M at frak}{"1D512}
-  \DeclareMathSymbol{\M at frak@P}{\mathord}{\M at frak}{"1D513}
-  \DeclareMathSymbol{\M at frak@Q}{\mathord}{\M at frak}{"1D514}
-  \DeclareMathSymbol{\M at frak@R}{\mathord}{\M at frak}{"212C}
-  \DeclareMathSymbol{\M at frak@S}{\mathord}{\M at frak}{"1D516}
-  \DeclareMathSymbol{\M at frak@T}{\mathord}{\M at frak}{"1D517}
-  \DeclareMathSymbol{\M at frak@U}{\mathord}{\M at frak}{"1D518}
-  \DeclareMathSymbol{\M at frak@V}{\mathord}{\M at frak}{"1D519}
-  \DeclareMathSymbol{\M at frak@W}{\mathord}{\M at frak}{"1D51A}
-  \DeclareMathSymbol{\M at frak@X}{\mathord}{\M at frak}{"1D51B}
-  \DeclareMathSymbol{\M at frak@Y}{\mathord}{\M at frak}{"1D51C}
-  \DeclareMathSymbol{\M at frak@Z}{\mathord}{\M at frak}{"2128}
-  \DeclareMathSymbol{\M at frak@a}{\mathord}{\M at frak}{"1D51E}
-  \DeclareMathSymbol{\M at frak@b}{\mathord}{\M at frak}{"1D51F}
-  \DeclareMathSymbol{\M at frak@c}{\mathord}{\M at frak}{"1D520}
-  \DeclareMathSymbol{\M at frak@d}{\mathord}{\M at frak}{"1D521}
-  \DeclareMathSymbol{\M at frak@e}{\mathord}{\M at frak}{"1D522}
-  \DeclareMathSymbol{\M at frak@f}{\mathord}{\M at frak}{"1D523}
-  \DeclareMathSymbol{\M at frak@g}{\mathord}{\M at frak}{"1D524}
-  \DeclareMathSymbol{\M at frak@h}{\mathord}{\M at frak}{"1D525}
-  \DeclareMathSymbol{\M at frak@i}{\mathord}{\M at frak}{"1D526}
-  \DeclareMathSymbol{\M at frak@j}{\mathord}{\M at frak}{"1D527}
-  \DeclareMathSymbol{\M at frak@k}{\mathord}{\M at frak}{"1D528}
-  \DeclareMathSymbol{\M at frak@l}{\mathord}{\M at frak}{"1D529}
-  \DeclareMathSymbol{\M at frak@m}{\mathord}{\M at frak}{"1D52A}
-  \DeclareMathSymbol{\M at frak@n}{\mathord}{\M at frak}{"1D52B}
-  \DeclareMathSymbol{\M at frak@o}{\mathord}{\M at frak}{"1D52C}
-  \DeclareMathSymbol{\M at frak@p}{\mathord}{\M at frak}{"1D52D}
-  \DeclareMathSymbol{\M at frak@q}{\mathord}{\M at frak}{"1D52E}
-  \DeclareMathSymbol{\M at frak@r}{\mathord}{\M at frak}{"1D52F}
-  \DeclareMathSymbol{\M at frak@s}{\mathord}{\M at frak}{"1D530}
-  \DeclareMathSymbol{\M at frak@t}{\mathord}{\M at frak}{"1D531}
-  \DeclareMathSymbol{\M at frak@u}{\mathord}{\M at frak}{"1D532}
-  \DeclareMathSymbol{\M at frak@v}{\mathord}{\M at frak}{"1D533}
-  \DeclareMathSymbol{\M at frak@w}{\mathord}{\M at frak}{"1D534}
-  \DeclareMathSymbol{\M at frak@x}{\mathord}{\M at frak}{"1D535}
-  \DeclareMathSymbol{\M at frak@y}{\mathord}{\M at frak}{"1D536}
-  \DeclareMathSymbol{\M at frak@z}{\mathord}{\M at frak}{"1D537}}
+  \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}}
 %    \end{macrocode}
-% Set bold caligraphic letters.\?\M at bcal\indexpage{keywordbcal=keyword \texttt{bcal}}
+% Set bold caligraphic letters.\indexpage{keywordbcal=keyword \texttt{bcal}}
 %    \begin{macrocode}
 \def\M at bcal@set{%
-  \edef\M at bcal{M\@bcalshape\the\M at count}
-  \DeclareMathSymbol{\M at bcal@A}{\mathord}{\M at bcal}{"1D4D0}
-  \DeclareMathSymbol{\M at bcal@B}{\mathord}{\M at bcal}{"1D4D1}
-  \DeclareMathSymbol{\M at bcal@C}{\mathord}{\M at bcal}{"1D4D2}
-  \DeclareMathSymbol{\M at bcal@D}{\mathord}{\M at bcal}{"1D4D3}
-  \DeclareMathSymbol{\M at bcal@E}{\mathord}{\M at bcal}{"1D4D4}
-  \DeclareMathSymbol{\M at bcal@F}{\mathord}{\M at bcal}{"1D4D5}
-  \DeclareMathSymbol{\M at bcal@G}{\mathord}{\M at bcal}{"1D4D6}
-  \DeclareMathSymbol{\M at bcal@H}{\mathord}{\M at bcal}{"1D4D7}
-  \DeclareMathSymbol{\M at bcal@I}{\mathord}{\M at bcal}{"1D4D8}
-  \DeclareMathSymbol{\M at bcal@J}{\mathord}{\M at bcal}{"1D4D9}
-  \DeclareMathSymbol{\M at bcal@K}{\mathord}{\M at bcal}{"1D4DA}
-  \DeclareMathSymbol{\M at bcal@L}{\mathord}{\M at bcal}{"1D4DB}
-  \DeclareMathSymbol{\M at bcal@M}{\mathord}{\M at bcal}{"1D4DC}
-  \DeclareMathSymbol{\M at bcal@N}{\mathord}{\M at bcal}{"1D4DD}
-  \DeclareMathSymbol{\M at bcal@O}{\mathord}{\M at bcal}{"1D4DE}
-  \DeclareMathSymbol{\M at bcal@P}{\mathord}{\M at bcal}{"1D4DF}
-  \DeclareMathSymbol{\M at bcal@Q}{\mathord}{\M at bcal}{"1D4E0}
-  \DeclareMathSymbol{\M at bcal@R}{\mathord}{\M at bcal}{"1D4E1}
-  \DeclareMathSymbol{\M at bcal@S}{\mathord}{\M at bcal}{"1D4E2}
-  \DeclareMathSymbol{\M at bcal@T}{\mathord}{\M at bcal}{"1D4E3}
-  \DeclareMathSymbol{\M at bcal@U}{\mathord}{\M at bcal}{"1D4E4}
-  \DeclareMathSymbol{\M at bcal@V}{\mathord}{\M at bcal}{"1D4E5}
-  \DeclareMathSymbol{\M at bcal@W}{\mathord}{\M at bcal}{"1D4E6}
-  \DeclareMathSymbol{\M at bcal@X}{\mathord}{\M at bcal}{"1D4E7}
-  \DeclareMathSymbol{\M at bcal@Y}{\mathord}{\M at bcal}{"1D4E8}
-  \DeclareMathSymbol{\M at bcal@Z}{\mathord}{\M at bcal}{"1D4E9}
-  \DeclareMathSymbol{\M at bcal@a}{\mathord}{\M at bcal}{"1D4EA}
-  \DeclareMathSymbol{\M at bcal@b}{\mathord}{\M at bcal}{"1D4EB}
-  \DeclareMathSymbol{\M at bcal@c}{\mathord}{\M at bcal}{"1D4EC}
-  \DeclareMathSymbol{\M at bcal@d}{\mathord}{\M at bcal}{"1D4ED}
-  \DeclareMathSymbol{\M at bcal@e}{\mathord}{\M at bcal}{"1D4EE}
-  \DeclareMathSymbol{\M at bcal@f}{\mathord}{\M at bcal}{"1D4EF}
-  \DeclareMathSymbol{\M at bcal@g}{\mathord}{\M at bcal}{"1D4F0}
-  \DeclareMathSymbol{\M at bcal@h}{\mathord}{\M at bcal}{"1D4F1}
-  \DeclareMathSymbol{\M at bcal@i}{\mathord}{\M at bcal}{"1D4F2}
-  \DeclareMathSymbol{\M at bcal@j}{\mathord}{\M at bcal}{"1D4F3}
-  \DeclareMathSymbol{\M at bcal@k}{\mathord}{\M at bcal}{"1D4F4}
-  \DeclareMathSymbol{\M at bcal@l}{\mathord}{\M at bcal}{"1D4F5}
-  \DeclareMathSymbol{\M at bcal@m}{\mathord}{\M at bcal}{"1D4F6}
-  \DeclareMathSymbol{\M at bcal@n}{\mathord}{\M at bcal}{"1D4F7}
-  \DeclareMathSymbol{\M at bcal@o}{\mathord}{\M at bcal}{"1D4F8}
-  \DeclareMathSymbol{\M at bcal@p}{\mathord}{\M at bcal}{"1D4F9}
-  \DeclareMathSymbol{\M at bcal@q}{\mathord}{\M at bcal}{"1D4FA}
-  \DeclareMathSymbol{\M at bcal@r}{\mathord}{\M at bcal}{"1D4FB}
-  \DeclareMathSymbol{\M at bcal@s}{\mathord}{\M at bcal}{"1D4FC}
-  \DeclareMathSymbol{\M at bcal@t}{\mathord}{\M at bcal}{"1D4FD}
-  \DeclareMathSymbol{\M at bcal@u}{\mathord}{\M at bcal}{"1D4FE}
-  \DeclareMathSymbol{\M at bcal@v}{\mathord}{\M at bcal}{"1D4FF}
-  \DeclareMathSymbol{\M at bcal@w}{\mathord}{\M at bcal}{"1D500}
-  \DeclareMathSymbol{\M at bcal@x}{\mathord}{\M at bcal}{"1D501}
-  \DeclareMathSymbol{\M at bcal@y}{\mathord}{\M at bcal}{"1D502}
-  \DeclareMathSymbol{\M at bcal@z}{\mathord}{\M at bcal}{"1D503}}
+  \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}}
 %    \end{macrocode}
-% Set bold fraktur letters.\?\M at bfrak\indexpage{keywordbfrak=keyword \texttt{bfrak}}
+% Set bold fraktur letters.\indexpage{keywordbfrak=keyword \texttt{bfrak}}
 %    \begin{macrocode}
 \def\M at bfrak@set{%
-  \edef\M at bfrak{M\@bfrakshape\the\M at count}
-  \DeclareMathSymbol{\M at bfrak@A}{\mathord}{\M at bfrak}{"1D56C}
-  \DeclareMathSymbol{\M at bfrak@B}{\mathord}{\M at bfrak}{"1D56D}
-  \DeclareMathSymbol{\M at bfrak@C}{\mathord}{\M at bfrak}{"1D56E}
-  \DeclareMathSymbol{\M at bfrak@D}{\mathord}{\M at bfrak}{"1D56F}
-  \DeclareMathSymbol{\M at bfrak@E}{\mathord}{\M at bfrak}{"1D570}
-  \DeclareMathSymbol{\M at bfrak@F}{\mathord}{\M at bfrak}{"1D571}
-  \DeclareMathSymbol{\M at bfrak@G}{\mathord}{\M at bfrak}{"1D572}
-  \DeclareMathSymbol{\M at bfrak@H}{\mathord}{\M at bfrak}{"1D573}
-  \DeclareMathSymbol{\M at bfrak@I}{\mathord}{\M at bfrak}{"1D574}
-  \DeclareMathSymbol{\M at bfrak@J}{\mathord}{\M at bfrak}{"1D575}
-  \DeclareMathSymbol{\M at bfrak@K}{\mathord}{\M at bfrak}{"1D576}
-  \DeclareMathSymbol{\M at bfrak@L}{\mathord}{\M at bfrak}{"1D577}
-  \DeclareMathSymbol{\M at bfrak@M}{\mathord}{\M at bfrak}{"1D578}
-  \DeclareMathSymbol{\M at bfrak@N}{\mathord}{\M at bfrak}{"1D579}
-  \DeclareMathSymbol{\M at bfrak@O}{\mathord}{\M at bfrak}{"1D57A}
-  \DeclareMathSymbol{\M at bfrak@P}{\mathord}{\M at bfrak}{"1D57B}
-  \DeclareMathSymbol{\M at bfrak@Q}{\mathord}{\M at bfrak}{"1D57C}
-  \DeclareMathSymbol{\M at bfrak@R}{\mathord}{\M at bfrak}{"1D57D}
-  \DeclareMathSymbol{\M at bfrak@S}{\mathord}{\M at bfrak}{"1D57E}
-  \DeclareMathSymbol{\M at bfrak@T}{\mathord}{\M at bfrak}{"1D57F}
-  \DeclareMathSymbol{\M at bfrak@U}{\mathord}{\M at bfrak}{"1D580}
-  \DeclareMathSymbol{\M at bfrak@V}{\mathord}{\M at bfrak}{"1D581}
-  \DeclareMathSymbol{\M at bfrak@W}{\mathord}{\M at bfrak}{"1D582}
-  \DeclareMathSymbol{\M at bfrak@X}{\mathord}{\M at bfrak}{"1D583}
-  \DeclareMathSymbol{\M at bfrak@Y}{\mathord}{\M at bfrak}{"1D584}
-  \DeclareMathSymbol{\M at bfrak@Z}{\mathord}{\M at bfrak}{"1D585}
-  \DeclareMathSymbol{\M at bfrak@a}{\mathord}{\M at bfrak}{"1D586}
-  \DeclareMathSymbol{\M at bfrak@b}{\mathord}{\M at bfrak}{"1D587}
-  \DeclareMathSymbol{\M at bfrak@c}{\mathord}{\M at bfrak}{"1D588}
-  \DeclareMathSymbol{\M at bfrak@d}{\mathord}{\M at bfrak}{"1D589}
-  \DeclareMathSymbol{\M at bfrak@e}{\mathord}{\M at bfrak}{"1D58A}
-  \DeclareMathSymbol{\M at bfrak@f}{\mathord}{\M at bfrak}{"1D58B}
-  \DeclareMathSymbol{\M at bfrak@g}{\mathord}{\M at bfrak}{"1D58C}
-  \DeclareMathSymbol{\M at bfrak@h}{\mathord}{\M at bfrak}{"1D58D}
-  \DeclareMathSymbol{\M at bfrak@i}{\mathord}{\M at bfrak}{"1D58E}
-  \DeclareMathSymbol{\M at bfrak@j}{\mathord}{\M at bfrak}{"1D58F}
-  \DeclareMathSymbol{\M at bfrak@k}{\mathord}{\M at bfrak}{"1D590}
-  \DeclareMathSymbol{\M at bfrak@l}{\mathord}{\M at bfrak}{"1D591}
-  \DeclareMathSymbol{\M at bfrak@m}{\mathord}{\M at bfrak}{"1D592}
-  \DeclareMathSymbol{\M at bfrak@n}{\mathord}{\M at bfrak}{"1D593}
-  \DeclareMathSymbol{\M at bfrak@o}{\mathord}{\M at bfrak}{"1D594}
-  \DeclareMathSymbol{\M at bfrak@p}{\mathord}{\M at bfrak}{"1D595}
-  \DeclareMathSymbol{\M at bfrak@q}{\mathord}{\M at bfrak}{"1D596}
-  \DeclareMathSymbol{\M at bfrak@r}{\mathord}{\M at bfrak}{"1D597}
-  \DeclareMathSymbol{\M at bfrak@s}{\mathord}{\M at bfrak}{"1D598}
-  \DeclareMathSymbol{\M at bfrak@t}{\mathord}{\M at bfrak}{"1D599}
-  \DeclareMathSymbol{\M at bfrak@u}{\mathord}{\M at bfrak}{"1D59A}
-  \DeclareMathSymbol{\M at bfrak@v}{\mathord}{\M at bfrak}{"1D59B}
-  \DeclareMathSymbol{\M at bfrak@w}{\mathord}{\M at bfrak}{"1D59C}
-  \DeclareMathSymbol{\M at bfrak@x}{\mathord}{\M at bfrak}{"1D59D}
-  \DeclareMathSymbol{\M at bfrak@y}{\mathord}{\M at bfrak}{"1D59E}
-  \DeclareMathSymbol{\M at bfrak@z}{\mathord}{\M at bfrak}{"1D59F}}
+  \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}}
 %    \end{macrocode}
 % 
 % \vfill\eject
@@ -2300,6 +4656,7 @@
 % 
 % \section*{Version History}
 % 
+% New features and updates with each version. Listed in no particular order.
 % 
 % \begin{multicols*}{2}
 % \bgroup\raggedright\parskip\z@\parindent\z@\leftskip1em\obeylines
@@ -2306,7 +4663,7 @@
 % \setbox0\hbox{\hskip 1pt.\hskip 1pt}
 % \def\version#1#2{\bigskip\hbox to \hsize{\textbf{#1} \cleaders\copy0\hfill\ #2}\par}
 % \def\item{\leavevmode\raise0.5ex\hbox{\vrule height 1pt width 0.5em}\kern1pt}
-% \def\item{--\kern0.2ex\relax}^^A I like the en dash better than a vrule
+% \def\item{---\kern0.2ex\relax}^^A I like the em dash better than a vrule
 % 
 % \version{1.1b}{July 2018}
 % \item initial release
@@ -2336,7 +4693,7 @@
 % \item version history added
 % \item initial off-the-shelf use insert added
 % 
-% \version{1.6}{November 2019}
+% \version{1.6}{December 2019}
 % \item separated implementation and user documentation
 % \item created |mathfont_heading.tex|
 % \item created |mathfont_doc_patch.tex| for use with the index
@@ -2356,7 +4713,7 @@
 % \item improved error checking for |\newmathrm|, etc.\ commands
 % \item |\mathfont| now ignores bad options (on top of issuing an error)
 % \item iternal commands now begin with |\M@|\dots
-% \item added Easter egg
+% \item added Easter Egg!
 % \item improved indexing
 % \item |mathfont.dtx| renamed as |mathfont_code.dtx|
 % \item |\newmathbold| renamed as |\newmathbf|
@@ -2364,6 +4721,39 @@
 % \item added fatal error for missing \textsf{fontspec}
 % \item fatal errors result in |\endinput| rather than |\@@end|
 % 
+% \version{2.0}{December 2021\strut}
+% {\smallskip\leftskip\z@
+%   \fboxrule=1pt\relax
+%   \dimen@\hsize
+%   \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}}
+%   \par\smallskip}
+% \item added |\CharmLine| and |\CharmFile|
+% \item added |\mathconstantsfont|
+% \item certain dimensions in equations are now adjustable when typesetting with Lua\TeX
+% \item added |adjust| and |no-adjust| package options
+% \item automatic generation of |ind| file
+% \item fixed symbols for |\leftharpoonup|, |\leftharpoondown|, and fraktur R
+% \item cleaned up internal code and documentation
+% \item font names for |\mathfont| stored to avoid multiple symbol font declarations with the same font
+% \item more information about nfss family names stored and provided
+% \item added option |empty|
+% \item raised upper bound on |\DeclareSymbolFont| to 256
+% \item reintroduced |mathfont_example.tex| with different contents
+% \item changed several symbol-commands to |\protected| rather than robust macros
+% \item many user-level commands are now |\protected|
+% \item |\updefault| changed to |\shapedefault|
+% \item eliminated |\catcode| change for space characters when scanning optional argument of |\mathfont|
+% \item improved messaging for |\mathfont|
+% \item removed dependence on \textsf{fontspec} and added internal font-loader
+% \item switched |\epsilon| and |\varepsilon|
+% \item switched |\phi| and |\varphi|
+% \item changed |/| to produce a solidus in math mode and added |\fractionslash|
+% \item removed |\restoremathinternals| from the user guide
+% \item |\setfont| now sets |\mathrm|, etc.
+% \item added |\newmathsc|, other math alphabet commands for small caps
 % 
 % 
 % \egroup
@@ -2372,940 +4762,1421 @@
 % \iffalse
 % 
 %</package>
+%<*user>
+\documentclass[12pt,twoside]{article}
+\makeatletter
+\usepackage[margin=72.27pt]{geometry}
+\usepackage[factor=700,stretch=14,shrink=14,step=1]{microtype}
+\usepackage[bottom]{footmisc}
+\usepackage{booktabs}
+\usepackage{graphicx}
+\usepackage{tabularx}
+\usepackage{multirow}
+\usepackage{hyperref}
+\usepackage{enumitem}
+\SetEnumitemKey{special}{topsep=\smallskipamount,
+  itemsep=\smallskipamount,
+  parsep=\z@,partopsep=\z@}
+\setlist{special}
+\usepackage{doc}
+\MakeShortVerb{|}
+\def\link#1{\href{#1}{\nolinkurl{#1}}}
+\newcount\fig
+\fig=1\relax
+\c at topnumber\@ne
+% \skip\footins=7pt
+
+% Our own label/ref scheme because the standard one isn't working
+\def\labelfig#1{\immediate\write\@auxout{\string\makelabel{#1}{\the\fig}}}
+\def\makelabel#1#2{\expandafter\gdef\csname fig@#1\endcsname{#2}}
+
+\begin{document}
+\def\ref#1{\csname fig@#1\endcsname}
+
+
+\def\documentname{User Guide}
+\def\showabstract{1}
+\input mathfont_heading.tex
+
+
+Handling fonts in \TeX\ and \LaTeX\ is a notoriously difficult task because fonts are complicated objects.\footnote{The last 30 years have seen huge advances in loading fonts with \TeX. Donald Knuth originally designed \TeX\ to load fonts created with Metafont, and only more recent engines such as Jonathan Kew's \XeTeX\ and Hans Hagen, et al.'s Lua\TeX\ have extended \TeX's font-loading capabilities to unicode. \XeTeX\ supports OpenType and TrueType fonts natively, and Lua\TeX\ can load OpenType fonts through the \textsf{luaotfload} package. Information on \XeTeX\ is available at \link{https://tug.org/xetex/}, and information on Lua\TeX\ is available at the official website for Lua\TeX: \link{http://www.luatex.org/}. See also Ulrike Fischer, et al., ``\textsf{luaotfload}---OpenType `loader' for Plain \TeX\ and \LaTeX,'' \link{https://ctan.org/pkg/luaotfload}.} The \textsf{mathfont} package loads TrueType and OpenType fonts for use in math mode, and this document explains the package's user-level commands. For version history and code implementation, see |mathfont_code.pdf|, and for a list of all symbols accessible with \textsf{mathfont}, see |mathfont_symbol_list.pdf|. The \textsf{mathfont} installation also includes four example files, and all \textsf{mathfont} pdf documentation files are available on \textsc{ctan}.
+
+
+\section{Loading and Basic Functionality}
+
+Loading fonts for math typesetting is more complicated than for regular text. First, the commands to select fonts for math mode, both in plain \TeX\ and in the \textsc{nfss}, are more complicated than the macros to select text fonts, and second, \TeX\ expects fonts for math to contain extra information that it uses to format equations.\footnote{Specifically, this extra information is a set of large variants, math-specific parameter values associated with individual characters, and a MathConstants table. Also, math fonts often use slightly wider bounding boxes for letters in math mode---the Computer Modern $f$ is a famous example. For this reason, \textsf{mathfont} also provides an interface to enlarge the bounding boxes of Latin letters when they appear in math mode. See section 4 for details.} Broadly speaking, we say that a \textit{math font} contains this extra information, whereas a \textit{text font} does not, and typesetting math with glyphs from one or more text fonts usually results in equations that are less aesthetically pleasing than using a properly prepared math font. The functionality of \textsf{mathfont} then is twofold: (1) provide a wrapper around the \textsc{nfss} commands for math typesetting that serves as a high-level interface; and (2) implement Lua\TeX\ callbacks that artificially convert text fonts into math fonts at loading.\footnote{Values for MathConstants table are different from but inspired by Ulrik Vieth, ``Understanding the \AE sthetics of Math Typesetting,'' (Bacho\TeX\ Conference, 2008) and Ulrik Vieth ``OpenType Math Illuminated,'' \textit{TUGboat} 30 (2009): 22--31. See also Bogus\l aw Jackowski, ``Appendix G Illuminated,'' \textit{TUGboat} 27 (2006): 83--90.} Please note that \textsf{mathfont} tries its best to get your fonts right, but if you run into trouble loading the correct font files, you should declare your font family and shapes in the \textsc{nfss} before setting any fonts with \textsf{mathfont}. Because unicode text fonts greatly outnumber unicode math fon!
 ts, I hope that my package will expand the set of fonts available for typesetting math in \LaTeX. 
+
+
+You must use one of \XeLaTeX\ or Lua\LaTeX\ to typeset a document with \textsf{mathfont}. You can load \textsf{mathfont} with the standard |\usepackage{mathfont}| syntax, and the package accepts three optional arguments. If you use Lua\TeX, the options |adjust| or |no-adjust| will manually specify whether \textsf{mathfont} should adapt text fonts for math mode, and \textsf{mathfont} selects |adjust| by default. If you use \XeTeX, \textsf{mathfont} cannot adjust any font objects with Lua callbacks, and either of these package options will cause an error.\footnote{In particular, with \XeLaTeX\ \textsf{mathfont} does not add big operators or resizable delimiters. This means you will have to use the Computer Modern defaults, load a separate math font for resizable characters, or end up with a document where large operators and delimiters do not scale like they do normally.} For this reason, using Lua\TeX\ with \textsf{mathfont} is recommended as of version 2.0. If you load \textsf{mathfont} with any other optional argument, the package will interpret it as a font name and call |\setfont| (described in the next section) on your argument. Doing so selects that font for the text of your document and for the character classes in the upper section of Table~1.
+
+The \textsf{mathfont} package is closely related to several other \LaTeX\ packages. The functionality is closest to that of \textsf{mathspec} by Andrew Gilbert Moschou, which is compatible with \XeTeX\ only and selects characters from text fonts for math.\footnote{Andrew Gilbert Moschou, ``\textsf{mathspec}---Specify arbitrary fonts for mathematics in \XeTeX,'' \link{https://ctan.org/pkg/mathspec}.} The \textsf{unicode-math} package is the standard \LaTeX\ package for loading actual unicode math fonts, and if you have a unicode font with proper math support, rather than a text font that you want to use for equations, consider using this package instead of \textsf{mathfont}.\footnote{Will Robertson, et al., ``\textsf{unicode-math}---Unicode mathematics support for XeTeX and LuaTeX,'' \link{https://ctan.org/pkg/unicode-math}.} Users who want to a text font for math with pdf\LaTeX\ should consider Jean-Fran\c cois Burnol's \textsf{mathastext} because \textsf{mathfont} is incompatible with pdf\TeX.\footnote{Jean-Fran\c cois Burnol, ``\textsf{mathastext}---Use the text font in maths mode,'' \link{https://ctan.org/pkg/mathastext}. In several previous versions of this documentation, I mischaracterized the approach of \textsf{mathastext} to \TeX's internal mathematics spacing. In fact, \textsf{mathastext} preserves and in some cases extends rules for space between various math-mode characters.} Finally, you will probably be better off using \textsf{fontspec} if your document does not contain any math.\footnote{Will Robertson and Khaled Hosny, ``\textsf{fontspec}---Advanced font selection in \XeLaTeX\ and Lua\LaTeX,'' \link{https://ctan.org/pkg/fontspec}.} The \textsf{fontspec} package is designed to load TrueType and OpenType fonts for text and provides a high-level interface for selecting OpenType font features.
+
+\begin{figure}[t]\labelfig{Keywords}
+\centerline{\bfseries Table \the\fig: Character Classes\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\hsize{lXll}\toprule
+Keyword & Meaning & Default Shape & Alphabetic?\\\midrule
+|upper| & Upper-Case Latin & Italic & Yes\\
+|lower| & Lower-Case Latin & Italic & Yes\\
+|diacritics| & Diacritics & Upright & Yes\\
+|greekupper| & Upper-Case Greek & Upright & Yes\\
+|greeklower| & Lower-Case Greek & Italic & Yes\\
+|digits| & Arabic Numerals & Upright & Yes\\
+|operator| & Operator Font & Upright & Yes\\
+|delimiters| & Delimiter & Upright & No\\
+|radical| & Square Root Symbol & Upright & No\\
+|symbols| & Basic Math Symbols & Upright & No\\
+|bigops| & Big Operators & Upright & No\\\midrule
+|agreekupper| & Upper-Case Ancient Greek & Upright & Yes\\
+|agreeklower| & Lower-Case Ancient Greek & Italic & Yes\\
+|cyrillicupper| & Upper-Case Cyrillic & Upright & Yes\\
+|cyrilliclower| & Lower-Case Cyrillic & Italic & Yes\\
+|hebrew| & Hebrew & Upright & Yes\\
+|extsymbols| & Extended Math Symbols & Upright & No\\
+|arrows| & Arrows & Upright & No\\
+|extbigops| & Extended Big Operators & Upright & No\\
+|bb| & Blackboard Bold (double-struck) & Upright & No\\
+|cal| & Caligraphic & Upright & No\\
+|frak| & Fraktur & Upright & No\\
+|bcal| & Bold Caligraphic & Upright & No\\
+|bfrak| & Bold Fraktur & Upright & No\\
+\bottomrule
+\end{tabularx}
+\end{figure}
+
+
+\section{Setting the Default Font}
+
+The |\mathfont| command sets the default font for certain classes of characters when they appear in math mode. It accepts a single mandatory argument, which should be a system font name or a family name already present in the \textsc{nfss}. The macro also accepts an optional argument, which should be a comma-separated list of keywords from Table~\ref{Keywords}, as in
+\begin{code}
+|\mathfont[|\meta{keywords}|]{|\meta{font name}|}|,
+\end{code}
+and \textsf{mathfont} sets the default font face for every character in those keywords to an upright or italic version of the font from the mandatory argument. See |mathfont_symbol_list.pdf| for a list of symbols corresponding to each keyword. If you do not include an optional argument, |\mathfont| acts on all keywords in the upper section of Table~1 (but not including |delimiters|, |radical|, or |bigops| characters in \XeTeX), so calling |\mathfont| with no optional argument is a fast way to change the font for most common math characters. To change the shape, you should say ``|=upright|'' or ``|=italic|'' immediately after the keyword and before the following comma, and spaces are allowed throughout the optional argument. For example, the command
+\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.
+
+
+\begin{figure}[t]
+\labelfig{SetFont}
+\centerline{\bfseries Table \the\fig: Commands Defined by \vrb\setfont\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{XXX}\toprule
+Command & Series & Shape\\\midrule
+|\mathrm| & Medium & Upright\\
+|\mathit| & Medium & Italic\\
+|\mathbf| & Bold & Upright\\
+|\mathbfit| & Bold & Italic\\
+|\mathsc| & Medium & Small Caps\\
+|\mathscit| & Medium & Italic Small Caps\\
+|\mathbfsc| & Bold & Small Caps\\
+|\mathbfscit| & Bold & Italic Small Caps\\\bottomrule
+\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:
+\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.}
+
+
+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}
+|\math|\meta{keyword}|{|\meta{text}|}|
+\end{code}
+to typeset them. For example,
+\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.
+
+\section{Local Font Changes}
+
+With \textsf{mathfont}, it is possible to create commands that locally change the font for math alphabet characters, i.e.\ those marked as alphabetic in Table~\ref{Keywords}. The eight commands in Table~\ref{MathAlpha} accept a \meta{control sequence} as their first mandatory argument and a \meta{font name} as the second, and they define the \meta{control sequence} to typeset any math alphabet characters in their argument into the \meta{font name}. For example, the macro |\newmathrm| looks like
+\begin{code}
+|\newmathrm{|\meta{control sequence}|}{|\meta{font name}|}|.
+\end{code}
+It defines the \textit{control sequence} in its first argument to accept a string of characters that it then converts to the \textit{font name} in the second argument with upright shape and medium weight. Writing
+\begin{code}
+|\newmathrm{\matharial}{Arial}|
+\end{code}
+creates the macro
+\begin{code}
+|\matharial{|\meta{argument}|}|,
+\end{code}
+which can be used only in math mode and which converts the math alphabet characters in its \meta{argument} into the Arial font with upright shape and medium weight. The other commands in Table~\ref{MathAlpha} function in the same way except that they select different series or shape values. Finally, know that if the user specifies the font for Greek letters using |\mathfont|, macros created with the commands from this section will affect those characters, unlike in traditional \LaTeX. Similarly, the local font-change commands will affect Cyrillic and Hebrew characters after the user calls |\mathfont| for those keywords.
+
+\begin{figure}[t]
+\labelfig{MathAlpha}
+\centerline{\bfseries Table \the\fig: Macros to Create Local Font-Change Commands\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{XXX}\toprule
+Command & Series & Shape\\\midrule
+|\newmathrm| & Medium & Upright\\
+|\newmathit| & Medium & Italic\\
+|\newmathbf| & Bold & Upright\\
+|\newmathbfit| & Bold & Italic\\
+|\newmathsc| & Medium & Small Caps\\
+|\newmathscit| & Medium & Italic Small Caps\\
+|\newmathbfsc| & Bold & Small Caps\\
+|\newmathbfscit| & Bold & Italic Small Caps\\\bottomrule
+\end{tabularx}
+\end{figure}
+
+Together these eight commands will provide users with tools for most local font changes, but they won't be able to address everything. Accordingly, \textsf{mathfont} provides the more general |\newmathfontcommand| macro. Its structure is
+\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.
+
+
+\section{Lua Font Adjustments}
+
+\begin{figure}[b]
+\labelfig{Charm}
+\centerline{\bfseries Table \the\fig: Number of Integers Required in \vrb\CharmLine\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{lX}\toprule
+Type of Character & \hfil Total Number of Entries\\\midrule
+Latin Letters & \hfil5 \\
+Delimiters, Radical Sign (Surd Character), Big Operators & \hfil33\\
+Everything Else & \hfil3\\\bottomrule
+\end{tabularx}
+\end{figure}
+
+
+The \textsf{mathfont} package provides six user-level commands to change positioning of characters in math mode. The commands |\CharmLine| and |\CharmFile| affect specific to various characters. (Charm stands for ``character metric.'') The argument of |\CharmLine| should be a list of integers and/or asterisks separated by commas and/or spaces, and Table~\ref{Charm} shows how many integers you need for different types of characters. The first integer from the argument should be a unicode encoding number, and that tells \textsf{mathfont} how to handle the remaining values.
+\begin{itemize}
+\item If the unicode value corresponds to a Latin letter, the next two integers tell Lua\TeX\ how much to stretch the left and right sides of the glyph's bounding box when it appears in math mode. The final two integers determine horizontal placement of top and bottom math accents respectively.
+\item If the unicode value corresponds to a delimiter, the radical (surd) symbol, or a big operator, you will need to specify 16 pairs numbers, for a total of 32 entries. The first 15 pairs are horizontal and vertical scale factors that \textsf{mathfont} uses to create large variants, where successive pairs correspond to the next-larger glyph. The last two integers determine horizontal placement of top and bottom math accents respectively.
+\item If the unicode value corresponds to any other symbol, you should specify two more integers, which will determine the horizontal placement of top and bottom math accents respectively.
+\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]
+\labelfig{Factors}
+\centerline{\bfseries Table \the\fig: Commands to Adjust Individual Characters\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{llX}\toprule
+Command & Default Value & What It Does\\\midrule
+|\RuleThicknessFactor| & 1000 & Thickness of fraction rule and radical overbar\\
+|\IntegralItalicFactor| & 400 & Positioning of limits for integrals\\
+|\SurdVerticalFactor| & 1000 & Vertical positioning of radical overbar\\
+|\SurdHorizontalFactor| & 1000 & Horizontal positioning of radical overbar\\\bottomrule
+\end{tabularx}
+\end{figure}
+
+
+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}|
+\end{code}
+doubles the thickness of the fraction rule and radical overbar relative to the default, which varies between fonts. Changing the |\RuleThicknessFactor| is useful for fonts with particularly heavy or light weight, and the |\IntegralItalicFactor| is important for making limits better fit integral signs, and the |\SurdVerticalFactor| and |\SurdHorizontalFactor| commands are essential when the top of the surd glyph differs from the top of its bounding box. The six control sequences from this section should appear in the preamble only.
+
+
+\begin{figure}[tb]
+\labelfig{Callbacks}
+\centerline{\bfseries Table \the\fig: Lua Callbacks Created by \textsf{mathfont}\strut}
+\global\advance\fig by 1\relax
+\begin{tabularx}\textwidth{lX}\toprule
+Callback Name & What It Does By Default\\\midrule
+|"mathfont.inspect_font"| &  Nothing\\\midrule
+|"mathfont.pre_adjust"| & Nothing\\
+|"mathfont.disable_nomath"| &  Tell Lua\TeX\ that we have a math font\\
+|"mathfont.add_math_constants"| &  Create a MathConstants table\\
+|"mathfont.fix_character_metrics"|&  \raggedright\arraybackslash Adjust bounding boxes, add character-specific math fields, create large variants\\
+|"mathfont.post_adjust"| &  Nothing\\\bottomrule
+\end{tabularx}
+\end{figure}
+
+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>
 \documentclass[12pt,twoside]{article}
 \makeatletter
-\let\@@imath\imath
-\let\@@jmath\jmath
 \usepackage[margin=72.27pt]{geometry}
+\usepackage{tabularx}
+\usepackage{booktabs}
 \usepackage{multicol}
 \usepackage{graphicx}
 \usepackage{mathfont}
-\mathfont[greekupper]{Courier New}
-\mathfont[greeklower,delimiters,bigops]{Times New Roman}
-\mathfont[agreekupper,extsymbols,bb,cal,frak,bcal,bfrak]{Symbola}
-\mathfont[agreeklower=roman]{Didot Bold}
-\mathfont[hebrew]{New Peninim MT}
-\mathfont[cyrillicupper]{EB Garamond}
-\mathfont[cyrilliclower=roman]{Comic Sans MS}
-\mathfont[symbols]{Arial}
-\mathfont[arrows,extbigops]{STIXGeneral}
-\mathfont[diacritics,lower]{Baskerville}
-\usepackage{shortvrb}
+\mathfont[agreeklower=upright,agreekupper]{Crimson}
+\mathfont[hebrew]{Coelacanth}
+\mathfont[\M at normalkeys,\M at letterlikekeys]{STIXGeneral}
+\usepackage{shortvrb,doc}
 \MakeShortVerb{|}
-\pretolerance=20
-\hyphenpenalty=10
-\exhyphenpenalty=5
-\brokenpenalty=0
-\finalhyphendemerits=300
-\doublehyphendemerits=500
 \raggedcolumns
 \parskip=0pt
 \smallskipamount=2pt plus 1pt minus 1pt
 \multicolsep=0pt
 \premulticols=0pt
+\fboxrule=1pt
+\CharmLine{8747 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8748 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8749 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8750 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8751 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
+\CharmLine{8752 1200 1700 * * * * * * * * * * * * * *
+  * * * * * * * * * * * * * * * * * * * * }
 \begin{document}
 
 \def\documentname{Symbol List}
+\def\showabstract{1}
 \input mathfont_heading.tex
 
-The \textsf{mathfont} package acts on some 300 alphanumeric characters and 500 general math symbols, and this document lists all such symbols besides Latin characters and Arabic numerals. The characters are organized by keyword, and when the user calls |\mathfont| on one of the keyword classes below, the package acts on every control sequence listed under that keyword. It changes the math-mode font of the character-commands that already exist in \LaTeX, and for the control sequences that do not exist in \LaTeX, it defines them to be new characters for use in math mode. Unlike most character-providing packages, \textsf{mathfont} does not provide extra symbols by default, and users can access additional control sequences only once they act |\mathfont| on some keyword-option. Of course, typesetting these symbols depends on having a font that contains them, and most major unicode fonts lack many or most of the symbols in this document. Choose your font wisely! Finally, as stated in the user guide, the \texttt{delimiters}, \texttt{bigops}, and |\big|\argtext{symbol} (such as |\bigvee|) characters do not in general change size in different mathematical contexts. I hope to address this limitation in future package updates. For documentation of user-level commands, see |mathfont_user_guide.pdf|, and for version history and code implementation, see |mathfont_code.pdf|. Both documentation files are included with the \textsf{mathfont} installation and available on \textsc{ctan}.
+The \textsf{mathfont} package provides tools to access several hundred characters for math typesetting, and this document lists these symbols along with the control sequences to access them. To get access to the symbols from a section of this document, call |\mathfont| with the keyword-option for that section and the name of a font that contains those symbols. The package does not define any math symbols until you call |\mathfont| or |\setfont| (or load \textsf{mathfont} with a font name as package option), and if you see a symbol or control sequence here that is not part of standard \LaTeX, you will not be able to access it until you call |\mathfont| on the corresponding keyword. Further, \textsf{mathfont} does not come with or load any fonts by itself, so you are responsible for the fonts. Not all fonts contain all math symbols, so choose your font wisely!\footnote{Besides letters and digits, most unicode text fonts should contain diacritics, delimiters, and the basic math characters in the keyword |symbols|. Text fonts will often contain square root and basic operator symbols, but they may not be suitable for math typesetting. Greek characters are hit or miss, and it is unusual for English text fonts to contain Cyrillic, Hebrew, ancient Greek, arrows, letterlike characters, or any extended (keywords |extbigops| and |extsymbols|) set of symbols. After you load \textsf{mathfont}, \TeX\ will print a message to the terminal if you try to typeset a missing character from some font.} This document shows ancient Greek in Crimson, Hebrew in Coelacanth, and all other math characters in STIXGeneral.
 
-This document does not contain tables for the keywords |upper|, |lower|, and |digits|. The first of these keywords contains all capital Latin letters, and the second contains all lower-case Latin letters as well as the ``mathematical i'' $\@@imath$ coded with |\imath| and ``mathematical j'' $\@@jmath$ coded with |\jmath|. The |digits| category contains the digits 0 through 9. Unlike the \LaTeX\ kernel, \textsf{mathfont} declares both |\imath| and |\jmath| as math alphabet characters, so the package's local font-change commands will adjust the font of these two symbols.
+\begin{figure}[t]
+\centerline{\bfseries Table 1: Characters Defined by Multiple Keywords\strut}
+\begin{tabularx}\textwidth{XXX}\toprule
+Character & Keywords & Default Font\\\midrule
+\vrb\increment & \texttt{greekupper} & \texttt{symbols}\\
+ & \texttt{symbols} & \\\midrule
+\vrb\nabla & \texttt{greekupper} & \texttt{(ext)symbols}\\
+ & \texttt{symbols} with Lua\TeX & \\
+ & \texttt{extsymbols} with \XeTeX & \\\midrule
+\expandafter\vrb\string| & \texttt{symbols} & \texttt{symbols} normally\\
+ & \texttt{delimiters} with Lua\TeX & \texttt{delimiters} after |\left|, \hfil\penalty0|\right|, etc.\\\midrule
+\vrb\simeq\ and \vrb\cong & \texttt{symbols} & \texttt{extsymbols} \\
+ & \texttt{extsymbols} & \\\bottomrule
+\end{tabularx}
+\end{figure}
 
+As of version 2.0, \textsf{mathfont} artificially adds resizable delimiters and big operator characters to text fonts when you complile with Lua\LaTeX. In this case, square root symbols will automatically resize, big operators will appear larger in |\displaystyle|, and you can use |\left|, |\right|, and |\big|, etc.\ with characters from the keyword |delimiters|. If you use \XeTeX, \textsf{mathfont} will not create large variants of characters, and your unicode math symbols will all be the same size as they appear in the font. In this case, you may be best off sticking with the Computer Modern defaults for resizable characters provided they don't clash with the rest of your document. Throughout this document, anything labeled ``Lua\TeX\ only'' means that \textsf{mathfont} provides this functionality only if you enable Lua-based font adjustments. If you load \textsf{mathfont} with the |no-adjust| option, you will not be able to access these features the same as if you compile with \XeTeX.
+
+
+A few characters appear multiple times in this list. When that happens, it means that \textsf{mathfont} defines the control sequence for multiple keywords. If you call |\mathfont| for only one of those keywords, your symbol will appear in the font associated with that keyword. If you call |\mathfont| on multiple keywords, the package uses the font associated with the default keyword/font for that character. Table~1 lists the default keyword for each command that appears multiple times in this document. If you need unicode encoding slot numbers for character metric adjustments, each symbol corresponds to its standard unicode encoding value, with the exception of the fake angle brackets. When you typeset with Lua\TeX, \textsf{mathfont} artificially adds |\fakelangle|, |\fakerangle|, |\fakellangle|, and |\fakerrangle| to the font in encoding slots 1,044,508--1,044,511 respectively.
+
+
+
+\bigskip\centerline{\vrule height 0.5pt width 2.5in}\medskip\smallskip
+
 \catcode`\|=12
-\parskip=1pt
 
-\blockheader{diacritics}{Accent}{Baskerville}
+\blockheader{lower}{Lower-Case Latin}
 
 \begin{multicols}{3}
-\makeaccent{\acute}
-\makeaccent{\aacute}
-\makeaccent{\dot}
-\makeaccent{\ddot}
-\makeaccent{\grave}
-\makeaccent{\breve}
-\makeaccent{\hat}
-\makeaccent{\check}
-\makeaccent{\bar}
-\makeaccent{\mathring}
-\makeaccent{\tilde}
+\charexample a
+\charexample b
+\charexample c
+\charexample d
+\charexample e
+\charexample f
+\charexample g
+\charexample h
+\charexample i
+\charexample j
+\charexample k
+\charexample l
+\charexample m
+\charexample n
+\charexample o
+\charexample p
+\charexample q
+\charexample r
+\charexample s
+\charexample t
+\charexample u
+\charexample v
+\charexample w
+\charexample x
+\charexample y
+\charexample z
+\charexample\hbar
+\charexample\imath
+\charexample\jmath
 \end{multicols}
 
-\blockheader{greekupper}{Upper-Case Greek}{Courier New}
+\blockheader{upper}{Upper-Case Latin}
 
 \begin{multicols}{3}
-\makechar{\Alpha}
-\makechar{\Beta}
-\makechar{\Gamma}
-\makechar{\Delta}
-\makechar{\Epsilon}
-\makechar{\Zeta}
-\makechar{\Eta}
-\makechar{\Theta}
-\makechar{\Iota}
-\makechar{\Kappa}
-\makechar{\Lambda}
-\makechar{\Mu}
-\makechar{\Nu}
-\makechar{\Xi}
-\makechar{\Omicron}
-\makechar{\Pi}
-\makechar{\Rho}
-\makechar{\Sigma}
-\makechar{\Tau}
-\makechar{\Upsilon}
-\makechar{\Phi}
-\makechar{\Chi}
-\makechar{\Psi}
-\makechar{\Omega}
-\makechar{\varTheta}
+\charexample A
+\charexample B
+\charexample C
+\charexample D
+\charexample E
+\charexample F
+\charexample G
+\charexample H
+\charexample I
+\charexample J
+\charexample K
+\charexample L
+\charexample M
+\charexample N
+\charexample O
+\charexample P
+\charexample Q
+\charexample R
+\charexample S
+\charexample T
+\charexample U
+\charexample V
+\charexample W
+\charexample X
+\charexample Y
+\charexample Z
 \end{multicols}
 
-\blockheader{greeklower}{Lower-Case Greek}{Times New Roman}
+\blockheader{diacritics}{Accent}
 
 \begin{multicols}{3}
-\makechar{\alpha}
-\makechar{\beta}
-\makechar{\gamma}
-\makechar{\delta}
-\makechar{\epsilon}
-\makechar{\zeta}
-\makechar{\eta}
-\makechar{\theta}
-\makechar{\iota}
-\makechar{\kappa}
-\makechar{\lambda}
-\makechar{\mu}
-\makechar{\nu}
-\makechar{\xi}
-\makechar{\omicron}
-\makechar{\pi}
-\makechar{\rho}
-\makechar{\sigma}
-\makechar{\tau}
-\makechar{\upsilon}
-\makechar{\phi}
-\makechar{\chi}
-\makechar{\psi}
-\makechar{\omega}
-\makechar{\varbeta}
-\makechar{\varepsilon}
-\makechar{\vartheta}
-\makechar{\varrho}
-\makechar{\varsigma}
-\makechar{\varphi}
+\accentexample\acute
+\accentexample\aacute
+\accentexample\dot
+\accentexample\ddot
+\accentexample\grave
+\accentexample\breve
+\accentexample\hat
+\accentexample\check
+\accentexample\bar
+\accentexample\mathring
+\accentexample\tilde
 \end{multicols}
 
-\blockheader{agreekupper}{Upper-Case Ancient Greek}{Symbola}
+\blockheader{digits}{Arabic Numeral}
 
 \begin{multicols}{3}
-\makechar{\Heta}
-\makechar{\Sampi}
-\makechar{\Digamma}
-\makechar{\Koppa}
-\makechar{\Stigma}
-\makechar{\Sho}
-\makechar{\San}
-\makechar{\varSampi}
-\makechar{\varDigamma}
-\makechar{\varKoppa}
+\charexample0
+\charexample1
+\charexample2
+\charexample3
+\charexample4
+\charexample5
+\charexample6
+\charexample7
+\charexample8
+\charexample9
 \end{multicols}
 
-\blockheader{agreeklower}{Lower-Case Ancient Greek}{Didot Bold}
+\blockheader{greekupper}{Upper-Case Greek}
 
 \begin{multicols}{3}
-\makechar{\heta}
-\makechar{\sampi}
-\makechar{\digamma}
-\makechar{\koppa}
-\makechar{\stigma}
-\makechar{\sho}
-\makechar{\san}
-\makechar{\varsampi}
-\makechar{\vardigamma}
-\makechar{\varkoppa}
+\charexample\Alpha
+\charexample\Beta
+\charexample\Gamma
+\charexample\Delta
+\charexample\Epsilon
+\charexample\Zeta
+\charexample\Eta
+\charexample\Theta
+\charexample\Iota
+\charexample\Kappa
+\charexample\Lambda
+\charexample\Mu
+\charexample\Nu
+\charexample\Xi
+\charexample\Omicron
+\charexample\Pi
+\charexample\Rho
+\charexample\Sigma
+\charexample\Tau
+\charexample\Upsilon
+\charexample\Phi
+\charexample\Chi
+\charexample\Psi
+\charexample\Omega
+\charexample\varTheta
+\charexample\increment
+\charexample\nabla
 \end{multicols}
 
-\blockheader{cyrillicupper}{Upper-Case Cyrillic}{EB Garamond}
+\blockheader{greeklower}{Lower-Case Greek}
 
 \begin{multicols}{3}
-\makechar{\cyrA}
-\makechar{\cyrBe}
-\makechar{\cyrVe}
-\makechar{\cyrGhe}
-\makechar{\cyrDe}
-\makechar{\cyrIe}
-\makechar{\cyrZhe}
-\makechar{\cyrZe}
-\makechar{\cyrI}
-\makechar{\cyrKa}
-\makechar{\cyrEl}
-\makechar{\cyrEm}
-\makechar{\cyrEn}
-\makechar{\cyrO}
-\makechar{\cyrPe}
-\makechar{\cyrEr}
-\makechar{\cyrEs}
-\makechar{\cyrTe}
-\makechar{\cyrU}
-\makechar{\cyrEf}
-\makechar{\cyrHa}
-\makechar{\cyrTse}
-\makechar{\cyrChe}
-\makechar{\cyrSha}
-\makechar{\cyrShcha}
-\makechar{\cyrHard}
-\makechar{\cyrYeru}
-\makechar{\cyrSoft}
-\makechar{\cyrE}
-\makechar{\cyrYu}
-\makechar{\cyrYa}
-\makechar{\cyrvarI}
+\charexample\alpha
+\charexample\beta
+\charexample\gamma
+\charexample\delta
+\charexample\epsilon
+\charexample\zeta
+\charexample\eta
+\charexample\theta
+\charexample\iota
+\charexample\kappa
+\charexample\lambda
+\charexample\mu
+\charexample\nu
+\charexample\xi
+\charexample\omicron
+\charexample\pi
+\charexample\rho
+\charexample\sigma
+\charexample\tau
+\charexample\upsilon
+\charexample\phi
+\charexample\chi
+\charexample\psi
+\charexample\omega
+\charexample\varbeta
+\charexample\varepsilon
+\charexample\varkappa
+\charexample\vartheta
+\charexample\varrho
+\charexample\varsigma
+\charexample\varphi
 \end{multicols}
 
-\blockheader{cyrilliclower}{Lower-Case Cyrillic}{Comic Sans MS%
-  \footnote{Yes, you too can now create beautifully spaced mathematics in Comic Sans!}}
+\blockheader{agreekupper}{Upper-Case Ancient Greek}
 
 \begin{multicols}{3}
-\makechar{\cyra}
-\makechar{\cyrbe}
-\makechar{\cyrve}
-\makechar{\cyrghe}
-\makechar{\cyrde}
-\makechar{\cyrie}
-\makechar{\cyrzhe}
-\makechar{\cyrze}
-\makechar{\cyri}
-\makechar{\cyrka}
-\makechar{\cyrel}
-\makechar{\cyrem}
-\makechar{\cyren}
-\makechar{\cyro}
-\makechar{\cyrpe}
-\makechar{\cyrer}
-\makechar{\cyres}
-\makechar{\cyrte}
-\makechar{\cyru}
-\makechar{\cyref}
-\makechar{\cyrha}
-\makechar{\cyrtse}
-\makechar{\cyrche}
-\makechar{\cyrsha}
-\makechar{\cyrshcha}
-\makechar{\cyrhard}
-\makechar{\cyryeru}
-\makechar{\cyrsoft}
-\makechar{\cyre}
-\makechar{\cyryu}
-\makechar{\cyrya}
-\makechar{\cyrvari}
+\charexample\Heta
+\charexample\Sampi
+\charexample\Digamma
+\charexample\Koppa
+\charexample\Stigma
+\charexample\Sho
+\charexample\San
+\charexample\varSampi
+\charexample\varDigamma
+\charexample\varKoppa
 \end{multicols}
 
-\blockheader{hebrew}{Hebrew}{New Peninim MT}
+\blockheader{agreeklower}{Lower-Case Ancient Greek}
 
 \begin{multicols}{3}
-\makechar{\aleph}
-\makechar{\beth}
-\makechar{\gimel}
-\makechar{\daleth}
-\makechar{\he}
-\makechar{\vav}
-\makechar{\zayin}
-\makechar{\het}
-\makechar{\tet}
-\makechar{\yod}
-\makechar{\kaf}
-\makechar{\lamed}
-\makechar{\mem}
-\makechar{\nun}
-\makechar{\samekh}
-\makechar{\ayin}
-\makechar{\pe}
-\makechar{\tsadi}
-\makechar{\qof}
-\makechar{\resh}
-\makechar{\shin}
-\makechar{\tav}
-\makechar{\varkaf}
-\makechar{\varmem}
-\makechar{\varnun}
-\makechar{\varpe}
-\makechar{\vartsadi}
+\charexample\heta
+\charexample\sampi
+\charexample\digamma
+\charexample\koppa
+\charexample\stigma
+\charexample\sho
+\charexample\san
+\charexample\varsampi
+\charexample\vardigamma
+\charexample\varkoppa
 \end{multicols}
 
-\blockheader{symbols}{Basic Math}{Arial}
+\blockheader{cyrillicupper}{Upper-Case Cyrillic}
 
 \begin{multicols}{3}
-\makechar{.}
-\makechar{@}
-\let\par\relax
-\makechar{\#}\footnote{When it acts on \vrb\#, \vrb\%, and \vrb\&, \textsf{mathfont} redefines them as robust commands that expand to their usual \vrb\char\ definition in horizontal mode and a math symbol in math mode. This prevents any changes to their font outside of math mode and is how other commands such as \vrb\$ or \vrb\P\ function in both math mode and horizontal mode.}\@@par
-\makechar{\$}\footnote{Technically, \textsf{mathfont} doesn't redefine \vrb\$, \vrb\P, \vrb\S, \vrb\pounds, \vrb\dag, or \vrb\ddag. The package recodes the character-command that these macros expand to when in math mode.}\@par
-\makechar{\%}
-\makechar{\&}
-\makechar{\P}
-\makechar{\S}
-\makechar{\pounds}
-\makechar{|}
-\makechar{\neg}
-\makechar{\infty}
-\makechar{\partial}
-\makechar{\mathbackslash}
-\makechar{\degree}
-\makechar{\increment}
-\makechar{\hbar}
-\makechar{'}
-\makechar{"}
-\let\par\relax
-\makechar{\comma}\footnote{In addition to the comma and colon punctuation marks, the package defines \vrb\comma\ and \vrb\colon. The difference lies in the spacing. \TeX\ treats the comma and colon keystrokes as \vrb\mathpunct\ and \vrb\mathrel\ types respectively. The package codes the \vrb\comma\ and \vrb\colon\ control sequences as \vrb\mathord\ and \vrb\mathpunct\ types respectively, so both control sequence result in less space than the corresponding keystroke. I recommend using \vrb\comma\ to typeset commas in large real numbers and \vrb\colon\ to typeset colon punctuation marks, for example following a function or to indicate a subset specification.}\@par
-\makechar{+}
-\makechar{-}
-\makechar{*}
-\makechar{\times}
-\makechar{/}
-\makechar{\div}
-\makechar{\pm}
-\makechar{\bullet}
-\makechar{\dag}
-\makechar{\ddag}
-\makechar{\cdot}
-\makechar{\setminus}
-\makechar{=}
-\makechar{<}
-\makechar{>}
-\makechar{\leq}
-\makechar{\geq}
-\makechar{\sim}
-\makechar{\approx}
-\makechar{\equiv}
-\makechar{\mid}
-\makechar{\parallel}
-\makechar{:}
-\makechar{?}
-\makechar{!}
-\makechar{,}
-\makechar{;}
-\makechar{\colon}
-\makechar{\mathellipsis}
+\charexample\cyrA
+\charexample\cyrBe
+\charexample\cyrVe
+\charexample\cyrGhe
+\charexample\cyrDe
+\charexample\cyrIe
+\charexample\cyrZhe
+\charexample\cyrZe
+\charexample\cyrI
+\charexample\cyrKa
+\charexample\cyrEl
+\charexample\cyrEm
+\charexample\cyrEn
+\charexample\cyrO
+\charexample\cyrPe
+\charexample\cyrEr
+\charexample\cyrEs
+\charexample\cyrTe
+\charexample\cyrU
+\charexample\cyrEf
+\charexample\cyrHa
+\charexample\cyrTse
+\charexample\cyrChe
+\charexample\cyrSha
+\charexample\cyrShcha
+\charexample\cyrHard
+\charexample\cyrYeru
+\charexample\cyrSoft
+\charexample\cyrE
+\charexample\cyrYu
+\charexample\cyrYa
+\charexample\cyrvarI
 \end{multicols}
 
-\blockheader{extsymbols}{Extended Math}{Symbola}
+\blockheader{cyrilliclower}{Lower-Case Cyrillic}
 
 \begin{multicols}{3}
-\makechar{\wp}
-\makechar{\Re}
-\makechar{\Im}
-\makechar{\ell}
-\makechar{\forall}
-\makechar{\exists}
-\makechar{\emptyset}
-\makechar{\nabla}
-\makechar{\in}
-\makechar{\ni}
-\makechar{\mp}
-\makechar{\angle}
-\makechar{\top}
-\makechar{\bot}
-\makechar{\vdash}
-\makechar{\dashv}
-\makechar{\flat}
-\makechar{\natural}
-\makechar{\sharp}
-\makechar{\fflat}
-\makechar{\ssharp}
-\let\par\relax
-\makechar{\bclubsuit}\footnote{Also \vrb\clubsuit.}\@par
-\makechar{\bdiamondsuit}
-\makechar{\bheartsuit}
-\let\par\relax
-\makechar{\bspadesuit}\footnote{Also \vrb\spadesuit.}\@par
-\makechar{\wclubsuit}
-\let\par\relax
-\makechar{\wdiamondsuit}\footnote{Also \vrb\diamondsuit.}\@@par
-\makechar{\wheartsuit}\footnote{Also \vrb\heartsuit.}\@par
-\makechar{\wspadesuit}
-\makechar{\wedge}
-\makechar{\vee}
-\makechar{\cap}
-\makechar{\cup}
-\makechar{\sqcap}
-\makechar{\sqcup}
-\makechar{\amalg}
-\makechar{\wr}
-\makechar{\ast}
-\makechar{\star}
-\makechar{\diamond}
-\makechar{\varcdot}
-\makechar{\varsetminus}
-\makechar{\oplus}
-\makechar{\otimes}
-\makechar{\ominus}
-\makechar{\odiv}
-\makechar{\oslash}
-\makechar{\odot}
-\makechar{\sqplus}
-\makechar{\sqtimes}
-\makechar{\sqminus}
-\makechar{\sqdot}
-\makechar{\in}
-\makechar{\ni}
-\makechar{\subset}
-\makechar{\supset}
-\makechar{\subseteq}
-\makechar{\supseteq}
-\makechar{\sqsubset}
-\makechar{\sqsupset}
-\makechar{\sqsubseteq}
-\makechar{\sqsupseteq}
-\makechar{\triangleleft}
-\makechar{\triangleright}
-\makechar{\trianglelefteq}
-\makechar{\trianglerighteq}
-\makechar{\propto}
-\makechar{\bowtie}
-\makechar{\hourglass}
-\makechar{\therefore}
-\makechar{\because}
-\makechar{\ratio}
-\makechar{\proportion}
-\makechar{\ll}
-\makechar{\gg}
-\makechar{\lll}
-\makechar{\ggg}
-\makechar{\leqq}
-\makechar{\geqq}
-\makechar{\lapprox}
-\makechar{\gapprox}
-\makechar{\simeq}
-\makechar{\eqsim}
-\let\par\relax
-\makechar{\simeqq}\footnote{Also \vrb\cong.}\@par
-\makechar{\approxeq}
-\makechar{\sssim}
-\makechar{\seq}
-\makechar{\doteq}
-\makechar{\coloneq}
-\makechar{\eqcolon}
-\makechar{\ringeq}
-\makechar{\arceq}
-\makechar{\wedgeeq}
-\makechar{\veeeq}
-\makechar{\stareq}
-\makechar{\triangleeq}
-\makechar{\defeq}
-\makechar{\qeq}
-\makechar{\lsim}
-\makechar{\gsim}
-\makechar{\prec}
-\makechar{\succ}
-\makechar{\preceq}
-\makechar{\succeq}
-\makechar{\preceqq}
-\makechar{\succeqq}
-\makechar{\precsim}
-\makechar{\succsim}
-\makechar{\precapprox}
-\makechar{\succapprox}
-\makechar{\precprec}
-\makechar{\succsucc}
-\makechar{\asymp}
-\makechar{\nin}
-\makechar{\nni}
-\makechar{\nsubset}
-\makechar{\nsupset}
-\makechar{\nsubseteq}
-\makechar{\nsupseteq}
-\makechar{\subsetneq}
-\makechar{\supsetneq}
-\makechar{\nsqsubseteq}
-\makechar{\nsqsupseteq}
-\makechar{\sqsubsetneq}
-\makechar{\sqsupsetneq}
-\makechar{\neq}
-\makechar{\nl}
-\makechar{\ng}
-\makechar{\nleq}
-\makechar{\ngeq}
-\makechar{\lneq}
-\makechar{\gneq}
-\makechar{\lneqq}
-\makechar{\gneqq}
-\makechar{\ntriangleleft}
-\makechar{\ntriangleright}
-\makechar{\ntrianglelefteq}
-\makechar{\ntrianglerighteq}
-\makechar{\nsim}
-\makechar{\napprox}
-\makechar{\nsimeq}
-\makechar{\nsimeqq}
-\makechar{\simneqq}
-\makechar{\nlsim}
-\makechar{\ngsim}
-\makechar{\lnsim}
-\makechar{\gnsim}
-\makechar{\lnapprox}
-\makechar{\gnapprox}
-\makechar{\nprec}
-\makechar{\nsucc}
-\makechar{\npreceq}
-\makechar{\nsucceq}
-\makechar{\precneq}
-\makechar{\succneq}
-\makechar{\precneqq}
-\makechar{\succneqq}
-\makechar{\precnsim}
-\makechar{\succnsim}
-\makechar{\precnapprox}
-\makechar{\succnapprox}
-\makechar{\nequiv}
+\charexample\cyra
+\charexample\cyrbe
+\charexample\cyrve
+\charexample\cyrghe
+\charexample\cyrde
+\charexample\cyrie
+\charexample\cyrzhe
+\charexample\cyrze
+\charexample\cyri
+\charexample\cyrka
+\charexample\cyrel
+\charexample\cyrem
+\charexample\cyren
+\charexample\cyro
+\charexample\cyrpe
+\charexample\cyrer
+\charexample\cyres
+\charexample\cyrte
+\charexample\cyru
+\charexample\cyref
+\charexample\cyrha
+\charexample\cyrtse
+\charexample\cyrche
+\charexample\cyrsha
+\charexample\cyrshcha
+\charexample\cyrhard
+\charexample\cyryeru
+\charexample\cyrsoft
+\charexample\cyre
+\charexample\cyryu
+\charexample\cyrya
+\charexample\cyrvari
 \end{multicols}
 
-\blockheader{delimiters}{Delimiter}{Times New Roman}
+\blockheader{hebrew}{Hebrew}
 
 \begin{multicols}{3}
-\makechar{(}
-\makechar{)}
-\makechar{[}
-\makechar{]}
-\makechar{\leftbrace}
-\makechar{\rightbrace}
+\charexample\aleph
+\charexample\beth
+\charexample\gimel
+\charexample\daleth
+\charexample\he
+\charexample\vav
+\charexample\zayin
+\charexample\het
+\charexample\tet
+\charexample\yod
+\charexample\kaf
+\charexample\lamed
+\charexample\mem
+\charexample\nun
+\charexample\samekh
+\charexample\ayin
+\charexample\pe
+\charexample\tsadi
+\charexample\qof
+\charexample\resh
+\charexample\shin
+\charexample\tav
+\charexample\varkaf
+\charexample\varmem
+\charexample\varnun
+\charexample\varpe
+\charexample\vartsadi
 \end{multicols}
 
-\blockheader{arrows}{Arrow}{STIXGeneral}
+\medskip
+\def\temp{; shown in \texttt{\vrb\big}, etc.\ sizes}
+\blockheader{delimiters\aftergroup\temp}{Delimiter}
+\medskip
+\begin{multicols}{3}
+\delimexample(
+\delimexample)
+\delimexample[
+\delimexample]
+\delimexample{\{\ifmmode\else\space(Lua\TeX\ only)\fi}
+\delimexample{\}\ifmmode\else\space(Lua\TeX\ only)\fi}
+\delimexample{|\,\ifmmode\else\space(Lua\TeX\ only)\fi}
+\delimexample\lguil
+\delimexample\rguil
+\delimexample\llguil
+\delimexample\rrguil
+\luadelimexample\fakelangle
+\luadelimexample\fakerangle
+\luadelimexample\fakellangle
+\luadelimexample\fakerrangle
+\hbox to \hsize{\hbox to 0.8in{$\leftbrace$\hfil}\vrb\leftbrace\hfil}
+\hbox to \hsize{\hbox to 0.8in{$\rightbrace$\hfil}\vrb\rightbrace\hfil}
+\end{multicols}
+\medskip
 
+\blockheader{radical}{Square Root}
+\smallskip
 \begin{multicols}{2}
-\let\par\relax
-\makechar{\rightarrow}\footnote{Also \vrb\to.}\@par
-\makechar{\nrightarrow}
-\makechar{\Rightarrow}
-\makechar{\nRightarrow}
-\makechar{\Rrightarrow}
-\makechar{\longrightarrow}
-\makechar{\Longrightarrow}
-\let\par\relax
-\makechar{\rightbararrow}\footnote{Also \vrb\mapsto.}\@par
-\makechar{\Rightbararrow}
-\let\par\relax
-\makechar{\longrightbararrow}\footnote{Also \vrb\longmapsto.}\@par
-\makechar{\Longrightbararrow}
-\makechar{\hookrightarrow}
-\makechar{\rightdasharrow}
-\makechar{\rightharpoonup}
-\makechar{\rightharpoondown}
-\makechar{\rightarrowtail}
-\makechar{\rightoplusarrow}
-\makechar{\rightwavearrow}
-\makechar{\rightsquigarrow}
-\makechar{\longrightsquigarrow}
-\makechar{\looparrowright}
-\makechar{\curvearrowright}
-\makechar{\circlearrowright}
-\makechar{\twoheadrightarrow}
-\makechar{\rightarrowtobar}
-\makechar{\rightwhitearrow}
-\makechar{\rightrightarrows}
-\makechar{\rightrightrightarrows}
-\let\par\relax
-\makechar{\leftarrow}\footnote{Also \vrb\from.}\@par
-\makechar{\nleftarrow}
-\makechar{\Leftarrow}
-\makechar{\nLeftarrow}
-\makechar{\Lleftarrow}
-\makechar{\longleftarrow}
-\makechar{\Longleftarrow}
-\let\par\relax
-\makechar{\leftbararrow}\footnote{Also \vrb\mapsfrom.}\@par
-\makechar{\Leftbararrow}
-\let\par\relax
-\makechar{\longleftbararrow}\footnote{Also \vrb\longmapsfrom.}\@par
-\makechar{\Longleftbararrow}
-\makechar{\hookleftarrow}
-\makechar{\leftdasharrow}
-\makechar{\leftharpoonup}
-\makechar{\leftharpoondown}
-\makechar{\leftarrowtail}
-\makechar{\leftoplusarrow}
-\makechar{\leftwavearrow}
-\makechar{\leftsquigarrow}
-\makechar{\longleftsquigarrow}
-\makechar{\looparrowleft}
-\makechar{\curvearrowleft}
-\makechar{\circlearrowleft}
-\makechar{\twoheadleftarrow}
-\makechar{\leftarrowtobar}
-\makechar{\leftwhitearrow}
-\makechar{\leftleftarrows}
-\makechar{\leftleftleftarrows}
-\makechar{\leftrightarrow}
-\makechar{\Leftrightarrow}
-\makechar{\nLeftrightarrow}
-\makechar{\longleftrightarrow}
-\makechar{\Longleftrightarrow}
-\makechar{\leftrightwavearrow}
-\makechar{\leftrightarrows}
-\makechar{\leftrightharpoons}
-\makechar{\leftrightarrowstobar}
-\makechar{\rightleftarrows}
-\makechar{\rightleftharpoons}
-\makechar{\uparrow}
-\makechar{\Uparrow}
-\makechar{\Uuparrow}
-\makechar{\upbararrow}
-\makechar{\updasharrow}
-\makechar{\upharpoonleft}
-\makechar{\upharpoonright}
-\makechar{\twoheaduparrow}
-\makechar{\uparrowtobar}
-\makechar{\upwhitearrow}
-\makechar{\upwhitebararrow}
-\makechar{\upuparrows}
-\makechar{\downarrow}
-\makechar{\Downarrow}
-\makechar{\Ddownarrow}
-\makechar{\downbararrow}
-\makechar{\downdasharrow}
-\makechar{\zigzagarrow}
-\makechar{\downharpoonleft}
-\makechar{\downharpoonright}
-\makechar{\twoheaddownarrow}
-\makechar{\downarrowtobar}
-\makechar{\downwhitearrow}
-\makechar{\downdownarrows}
-\makechar{\updownarrow}
-\makechar{\Updownarrow}
-\makechar{\updownarrows}
-\makechar{\downuparrows}
-\makechar{\updownharpoons}
-\makechar{\downupharpoons}
-\makechar{\nearrow}
-\makechar{\Nearrow}
-\makechar{\nwarrow}
-\makechar{\Nwarrow}
-\makechar{\searrow}
-\makechar{\Searrow}
-\makechar{\swarrow}
-\makechar{\Swarrow}
-\makechar{\nwsearrow}
-\makechar{\neswarrow}
-\makechar{\lcirclearrow}
-\makechar{\rcirclearrow}
+\charexample\surd
+\def\temp{ (Lua\TeX\ only)\hfill}
+\charexample{\sqrt{\ifmmode\mkern 12mu\vphantom{1}\else\temp\fi}}
 \end{multicols}
 
-\blockheader{bigops}{Big Operator}{Times New Roman}
+\blockheader{bigops}{Big Operator}
+\smallskip
+\begin{multicols}{2}
+\operatorexample\sum
+\operatorexample\prod
+\operatorexample\intop
+\end{multicols}
+\medskip
 
+\blockheader{extbigops}{Extended Big Operators}
+\smallskip
 \begin{multicols}{3}
-\makechar{\sum}
-\makechar{\prod}
-\makechar{\intop}
+\operatorexample\coprod
+\operatorexample\bigvee
+\operatorexample\bigwedge
+\operatorexample\bigcap
+\operatorexample\bigcup
+\operatorexample\bigoplus
+\operatorexample\bigotimes
+\operatorexample\bigodot
+\operatorexample\bigsqcap
+\operatorexample\bigsqcup
+\operatorexample\iint
+\operatorexample\iiint
+\operatorexample\oint
+\operatorexample\oiint
+\operatorexample\oiiint
 \end{multicols}
 
-\blockheader{extbigops}{Extended Big Operators}{STIXGeneral}
+\medskip
 
+\blockheader{symbols}{Basic Math}
 \begin{multicols}{3}
-\makechar{\coprod}
-\makechar{\bigvee}
-\makechar{\bigwedge}
-\makechar{\bigcup}
-\makechar{\bigcap}
-\makechar{\iint}
-\makechar{\iiint}
-\makechar{\oint}
-\makechar{\oiint}
-\makechar{\oiiint}
-\makechar{\bigoplus}
-\makechar{\bigotimes}
-\makechar{\bigodot}
-\makechar{\bigsqcap}
-\makechar{\bigsqcup}
+\charexample.
+\charexample @
+\let\par\relax
+\charexample\#
+\charexample\$
+\charexample\%
+\charexample\&
+\charexample\P
+\charexample\S
+\charexample\pounds
+\charexample|
+\charexample\neg
+\charexample\infty
+\charexample\partial
+\charexample\mathbackslash
+\charexample\degree
+\charexample\increment
+\def\temp{ (Lua\TeX only)}
+\charexample{\nabla\ifmmode\else\temp\fi}
+\charexample'
+\charexample\prime
+\charexample"
+\charexample+
+\charexample-
+\charexample*
+\charexample\times
+\charexample/
+\charexample\fractionslash
+\charexample\div
+\charexample\pm
+\charexample\bullet
+\charexample\dag
+\charexample\ddag
+\charexample\cdot
+\charexample\setminus
+\charexample=
+\charexample<
+\charexample>
+\charexample\leq
+\charexample\geq
+\charexample\sim
+\charexample\approx
+\charexample\simeq
+\charexample\equiv
+\charexample\cong
+\charexample\mid
+\charexample\parallel
+\charexample!
+\charexample?
+\charexample{,\ifmmode\else\phantom{\texttt{comma}} (as \rlap{\vrb\mathpunct)}\fi}
+\charexample{\comma\ifmmode\else\space(as \vrb\mathord)\fi}
+\charexample{:\ifmmode\else\phantom{\texttt{colon}} (as \vrb\mathrel)\fi}
+\charexample{\colon\ifmmode\else\space(as \vrb\mathord)\fi}
+\charexample;
+\charexample\mathellipsis
 \end{multicols}
+\blockheader{symbols}{Lua\TeX-only (!) Operator}
+\begin{multicols}{3}
+\operatorexample\bigat
+\operatorexample\bighash
+\operatorexample\bigdollar
+\operatorexample\bigpercent
+\operatorexample\bigand
+\operatorexample\bigplus
+\operatorexample\bigp
+\operatorexample\bigq
+\operatorexample\bigS
+\operatorexample\bigtimes
+\operatorexample\bigdiv
+\end{multicols}
 
-\blockheader{bb}{Blackboard Bold}{Symbola and Accessed with \vrb\mathbb}
 
+
+
+\blockheader{extsymbols}{Extended Math}
+\begin{multicols}{3}
+\charexample\wp
+\charexample\Re
+\charexample\Im
+\charexample\ell
+\charexample\forall
+\charexample\exists
+\charexample\emptyset
+\charexample{\nabla\ifmmode\else\space(\XeTeX)\fi}
+\charexample\in
+\charexample\ni
+\charexample\mp
+\charexample\angle
+\charexample\top
+\charexample\bot
+\charexample\vdash
+\charexample\dashv
+\charexample\flat
+\charexample\natural
+\charexample\sharp
+\charexample\bclubsuit
+\charexample\clubsuit
+\charexample\bdiamondsuit
+\charexample\bheartsuit
+\charexample\bspadesuit
+\charexample\spadesuit
+\charexample\wclubsuit
+\charexample\wdiamondsuit
+\charexample\diamondsuit
+\charexample\wheartsuit
+\charexample\heartsuit
+\charexample\wspadesuit
+\charexample\wedge
+\charexample\vee
+\charexample\cap
+\charexample\cup
+\charexample\sqcap
+\charexample\sqcup
+\charexample\amalg
+\charexample\wr
+\charexample\ast
+\charexample\star
+\charexample\diamond
+\charexample\varcdot
+\charexample\varsetminus
+\charexample\oplus
+\charexample\otimes
+\charexample\ominus
+\charexample\odiv
+\charexample\oslash
+\charexample\odot
+\charexample\sqplus
+\charexample\sqtimes
+\charexample\sqminus
+\charexample\sqdot
+\charexample\in
+\charexample\ni
+\charexample\subset
+\charexample\supset
+\charexample\subseteq
+\charexample\supseteq
+\charexample\sqsubset
+\charexample\sqsupset
+\charexample\sqsubseteq
+\charexample\sqsupseteq
+\charexample\triangleleft
+\charexample\triangleright
+\charexample\trianglelefteq
+\charexample\trianglerighteq
+\charexample\propto
+\charexample\bowtie
+\charexample\hourglass
+\charexample\therefore
+\charexample\because
+\charexample\ratio
+\charexample\proportion
+\charexample\ll
+\charexample\gg
+\charexample\lll
+\charexample\ggg
+\charexample\leqq
+\charexample\geqq
+\charexample\lapprox
+\charexample\gapprox
+\charexample\simeq
+\charexample\eqsim
+\charexample\simeqq
+\charexample\cong
+\charexample\approxeq
+\charexample\sssim
+\charexample\seq
+\charexample\doteq
+\charexample\coloneq
+\charexample\eqcolon
+\charexample\ringeq
+\charexample\arceq
+\charexample\wedgeeq
+\charexample\veeeq
+\charexample\stareq
+\charexample\triangleeq
+\charexample\defeq
+\charexample\qeq
+\charexample\lsim
+\charexample\gsim
+\charexample\prec
+\charexample\succ
+\charexample\preceq
+\charexample\succeq
+\charexample\preceqq
+\charexample\succeqq
+\charexample\precsim
+\charexample\succsim
+\charexample\precapprox
+\charexample\succapprox
+\charexample\precprec
+\charexample\succsucc
+\charexample\asymp
+\charexample\nin
+\charexample\nni
+\charexample\nsubset
+\charexample\nsupset
+\charexample\nsubseteq
+\charexample\nsupseteq
+\charexample\subsetneq
+\charexample\supsetneq
+\charexample\nsqsubseteq
+\charexample\nsqsupseteq
+\charexample\sqsubsetneq
+\charexample\sqsupsetneq
+\charexample\neq
+\charexample\nl
+\charexample\ng
+\charexample\nleq
+\charexample\ngeq
+\charexample\lneq
+\charexample\gneq
+\charexample\lneqq
+\charexample\gneqq
+\charexample\ntriangleleft
+\charexample\ntriangleright
+\charexample\ntrianglelefteq
+\charexample\ntrianglerighteq
+\charexample\nsim
+\charexample\napprox
+\charexample\nsimeq
+\charexample\nsimeqq
+\charexample\simneqq
+\charexample\nlsim
+\charexample\ngsim
+\charexample\lnsim
+\charexample\gnsim
+\charexample\lnapprox
+\charexample\gnapprox
+\charexample\nprec
+\charexample\nsucc
+\charexample\npreceq
+\charexample\nsucceq
+\charexample\precneq
+\charexample\succneq
+\charexample\precneqq
+\charexample\succneqq
+\charexample\precnsim
+\charexample\succnsim
+\charexample\precnapprox
+\charexample\succnapprox
+\charexample\nequiv
+\end{multicols}
+
+
+\blockheader{arrows}{Arrow}
+\begin{multicols}{2}
+\charexample\rightarrow
+\charexample\to
+\charexample\nrightarrow
+\charexample\Rightarrow
+\charexample\nRightarrow
+\charexample\Rrightarrow
+\charexample\longrightarrow
+\charexample\Longrightarrow
+\charexample\rightbararrow
+\charexample\mapsto
+\charexample\Rightbararrow
+\charexample\longrightbararrow
+\charexample\longmapsto
+\charexample\Longrightbararrow
+\charexample\hookrightarrow
+\charexample\rightdasharrow
+\charexample\rightharpoonup
+\charexample\rightharpoondown
+\charexample\rightarrowtail
+\charexample\rightoplusarrow
+\charexample\rightwavearrow
+\charexample\rightsquigarrow
+\charexample\longrightsquigarrow
+\charexample\looparrowright
+\charexample\curvearrowright
+\charexample\circlearrowright
+\charexample\twoheadrightarrow
+\charexample\rightarrowtobar
+\charexample\rightwhitearrow
+\charexample\rightrightarrows
+\charexample\rightrightrightarrows
+\charexample\leftarrow
+\charexample\from
+\charexample\nleftarrow
+\charexample\Leftarrow
+\charexample\nLeftarrow
+\charexample\Lleftarrow
+\charexample\longleftarrow
+\charexample\Longleftarrow
+\charexample\leftbararrow
+\charexample\mapsfrom
+\charexample\Leftbararrow
+\charexample\longleftbararrow
+\charexample\longmapsfrom
+\charexample\Longleftbararrow
+\charexample\hookleftarrow
+\charexample\leftdasharrow
+\charexample\leftharpoonup
+\charexample\leftharpoondown
+\charexample\leftarrowtail
+\charexample\leftoplusarrow
+\charexample\leftwavearrow
+\charexample\leftsquigarrow
+\charexample\longleftsquigarrow
+\charexample\looparrowleft
+\charexample\curvearrowleft
+\charexample\circlearrowleft
+\charexample\twoheadleftarrow
+\charexample\leftarrowtobar
+\charexample\leftwhitearrow
+\charexample\leftleftarrows
+\charexample\leftleftleftarrows
+\charexample\leftrightarrow
+\charexample\Leftrightarrow
+\charexample\nLeftrightarrow
+\charexample\longleftrightarrow
+\charexample\Longleftrightarrow
+\charexample\leftrightwavearrow
+\charexample\leftrightarrows
+\charexample\leftrightharpoons
+\charexample\leftrightarrowstobar
+\charexample\rightleftarrows
+\charexample\rightleftharpoons
+\charexample\uparrow
+\charexample\Uparrow
+\charexample\Uuparrow
+\charexample\upbararrow
+\charexample\updasharrow
+\charexample\upharpoonleft
+\charexample\upharpoonright
+\charexample\twoheaduparrow
+\charexample\uparrowtobar
+\charexample\upwhitearrow
+\charexample\upwhitebararrow
+\charexample\upuparrows
+\charexample\downarrow
+\charexample\Downarrow
+\charexample\Ddownarrow
+\charexample\downbararrow
+\charexample\downdasharrow
+\charexample\zigzagarrow
+\charexample\lightningboltarrow
+\charexample\downharpoonleft
+\charexample\downharpoonright
+\charexample\twoheaddownarrow
+\charexample\downarrowtobar
+\charexample\downwhitearrow
+\charexample\downdownarrows
+\charexample\updownarrow
+\charexample\Updownarrow
+\charexample\updownarrows
+\charexample\downuparrows
+\charexample\updownharpoons
+\charexample\downupharpoons
+\charexample\nearrow
+\charexample\Nearrow
+\charexample\nwarrow
+\charexample\Nwarrow
+\charexample\searrow
+\charexample\Searrow
+\charexample\swarrow
+\charexample\Swarrow
+\charexample\nwsearrow
+\charexample\neswarrow
+\charexample\lcirclearrow
+\charexample\rcirclearrow
+\end{multicols}
+
+
+\blockheader{bb}{Blackboard Bold}
+
 \letterlikechars\mathbb
 \hbox to 10em{\printchars\digits}
 
-\blockheader{cal}{Calligraphic}{Symbola and Accessed with \vrb\mathcal}
+\blockheader{cal}{Caligraphic}
 
 \letterlikechars\mathcal
 
-\blockheader{frak}{Fraktur}{Symbola and Accessed with \vrb\mathfrak}
+\blockheader{frak}{Fraktur}
 
 \letterlikechars\mathfrak
 
-\blockheader{bcal}{Bold Calligraphic}{Symbola and Accessed with \vrb\mathbcal}
+\blockheader{bcal}{Bold Calligraphic}
 
 \letterlikechars\mathbcal
 
-\blockheader{bfrak}{Bold Fraktur}{Symbola and Accessed with \vrb\mathbfrak}
+\blockheader{bfrak}{Bold Fraktur}
 
 \letterlikechars\mathbfrak
 
 \end{document}
 %</chars>
-%<*user>
-\documentclass[12pt,twoside]{article}
-\makeatletter
-\usepackage[margin=72.27pt]{geometry}
-\usepackage[factor=700,stretch=14,shrink=14,step=1]{microtype}
-\usepackage[bottom]{footmisc}
-\usepackage{booktabs}
-\usepackage{graphicx}
-\usepackage{tabularx}
-\usepackage{shortvrb}
-\skip\footins=7pt
-\MakeShortVerb{|}
-\hyphenpenalty=10
-\pretolerance=20
-\hyphenpenalty=10
-\exhyphenpenalty=5
-\brokenpenalty=0
-\clubpenalty=5
-\widowpenalty=5
-\finalhyphendemerits=300
-\doublehyphendemerits=500
-\renewcommand\textfraction{0.4}
-\begin{document}
+%<*equations>
+\begin{multicols}{2}
+\let\medskip\relax
 
-\def\documentname{User Guide}
-\input mathfont_heading.tex
+Black-Scholes Equation
+\[
+\frac{\partial V}{\partial t}+\frac12\sigma^2S^2\frac{\partial^2V}{\partial S^2}=
+  rV-rS\frac{\partial V}{\partial X}
+\]
+\medskip
 
+Cardano's Formula/Cubic Formula
+\begin{align*}
+t_i&=\omega_i\sqrt[3]{-\frac q2+\sqrt{\frac{q^2}4+\frac{p^3}{27}}}\\
+  &\qquad\qquad{}+\omega_i^2\sqrt[3]{-\frac q2-\sqrt{\frac{q^2}4+\frac{p^3}{27}}}
+\end{align*}
+\medskip
 
-Handling fonts in \TeX\ and \LaTeX\ is a notoriously difficult task. Donald Knuth originally designed \TeX\ to support fonts created with Metafont, and while subsequent versions of \TeX\ extended this functionality to postscript fonts, Plain \TeX's font-loading capabilities remain limited. Many, if not most, \LaTeX\ users are unfamiliar with the |fd| files that must be used in font declaration, and the minutiae of \TeX's |\font| primitive can be esoteric and confusing. \LaTeXe's New Font Selection System (\textsc{nfss}) implemented a straightforward syntax for loading and managing fonts, but \LaTeX\ macros overlaying a \TeX\ core face the same versatility issues as Plain \TeX\ itself. Fonts in math mode present a double challenge: after loading a font either in Plain \TeX\ or through the \textsc{nfss}, defining math symbols can be unintuitive for users who are unfamiliar with \TeX's |\mathcode| primitive. More recent engines such as Jonathan Kew's \XeTeX\ and Hans Hagen, et al.'s Lua\TeX\ significantly extend the font-loading capabilities of \TeX.\footnote{Information on \XeTeX\ is available at \texttt{https://tug.org/xetex/}, and information on Lua\TeX\ is available at the official website for Lua\TeX: \texttt{http://www.luatex.org/}.} Both support TrueType and OpenType font formats and provide many additional primitives for managing fonts, and the \textsf{fontspec} package by Will Robertson and Khaled Hosny acts as a front-end for the font management built into these two engines.\footnote{Will Robertson and Khaled Hosny, ``\textsf{fontspec}---Advanced font selection in \XeLaTeX\ and Lua\LaTeX,'' \texttt{https://ctan.org/pkg/fontspec}.}
+Einstein's Field Equation (General Relativity)
+\[
+R_{\mu\nu}-\frac12Rg_{\mu\nu}+\Lambda g_{\mu\nu}=\frac{8\pi G}{c^4}T_{\mu\nu}
+\]
+\medskip
 
-The \textsf{mathfont} package applies \textsf{fontspec}'s advances in font selection to mathematics typesetting, and this document explains the package's user-level commands. Section~1 presents the basic functionality and related packages. Section~2 explains how to use the default font-change commands, and users in a hurry will find the most important information here. Section~3 describes the local font-change commands, and section~4 discusses mathematical symbols and aspects of their implementation. Section~5 addresses error messages. For version history and code implementation, see |mathfont_code.pdf|, and for a list of all symbols accessible with \textsf{mathfont}, see |mathfont_symbol_list.pdf|. Both of these documentation files are included with the \textsf{mathfont} installation and are available on \textsc{ctan}.
+First Isomorphism Theorem
+\[
+\phi(X)\cong X/\ker(\phi)
+\]
+\medskip
 
-\section{Basic Functionality}
+Gauss-Bonnet Formula
+\[
+\int_MK\ dA+\int_{\partial M}k_g\ ds=2\pi\chi(M)
+\]
+\medskip
 
-The \textsf{mathfont} package uses \textsf{fontspec} as a back end to load fonts for use in math mode, and it provides two ways to do this: (1) changing the default font for certain classes of math-mode characters; and (2) defining new commands that change the font locally for the so-called ``math-alphabet'' characters. The package can change the default math-mode font used for Latin, Greek, Cyrillic, and Hebrew letters; Arabic numerals; roughly 300 unicode math symbols; and standard unicode alphanumeric characters. The package accepts any OpenType or TrueType font, and tables~1 and 2 display the specific classes of characters that \textsf{mathfont}'s default font-change command acts on. The default math-alphabet characters are Latin letters, Arabic numerals, upper-case Greek characters, and diacritics. When \textsf{mathfont} sets the default font for any of these four character classes, it preserves their math alphabet status, and when the package sets the default font for lower-case Greek, ancient Greek, Cyrillic, or Hebrew characters, it recodes each symbol in the class as math-alphabet type. At that point, the local font-change commands will act on any characters in those classes.
+Maxwell's Equations
+\begin{align*}
+\nabla\bullet\mathbf E&=\frac\rho{\epsilon_0}&
+\nabla\bullet\mathbf B&=0\\
+\nabla\times\mathbf E&=-\frac{\partial\mathbf B}{\partial t}&
+\nabla\times\mathbf B&=\mu_0\left(\mathbf J+
+  \epsilon_0\frac{\partial\mathbf E}{\partial t}\right)
+\end{align*}
+\medskip
 
-The package must be loaded with \XeLaTeX or Lua\LaTeX. It can be loaded with the standard |\usepackage| syntax, and it accepts one optional argument. It treats the argument as a font name and changes all main fonts to that option. Specifically, the package invokes both |\mathfont| and \textsf{fontspec}'s |\setmainfont|, and it defines the four local font-changing commands |\mathrm|, |\mathit|, |\mathbf|, and |\mathbfit| to produce text from the desired font in combinations of upright, italic, and bold styles according to the control sequences' last letters. \XeTeX\ users may run into trouble with fonts whose name contains multiple words because \LaTeX\ eats spaces during package-option parsing. In this case, you will have to load the package and separately declare |\setfont| in your preamble. The package loads \textsf{fontspec} with the |no-math| option if and only if the user has not already loaded \textsf{fontspec}. Users who want \textsf{fontspec} without |no-math| or with other options in place can manually load it before requiring \textsf{mathfont}. Regardless, I strongly recommend that \textsf{fontspec} be loaded with |no-math| because otherwise some font changes may not render properly.
+Michaelis-Menten Model
+\[
+v=\frac{d[P]}{dt}=V\frac{[S]}{K_M+[S]}
+\]
 
-During loading, \textsf{mathfont} redefines three \LaTeX\ internal macros to make symbol declaration compatible with unicode fonts, and default math-font changes work only with the redefinitions in place. Because the internal changes are relatively unobtrusive, \textsf{mathfont}'s adjustments almost certainly do not affect \LaTeX\ packages loaded later, and the package does not restore the commands automatically. Instead, |\restoremathinternals| returns the internal commands to their default definitions, and users who want the previous definitions should reset the kernel manually. The corollary is that |\mathfont| and |\setfont| work before |\restoremathinternals| but not after. As of version~1.6, the package optional arguments |packages|, |operators|, and |no-operators| are depreciated. Instead, \textsf{mathfont} offers |\restoremathinternals| as the only way to interact directly with the kernel.\footnote{To be clear, as of version~1.6, \textsf{mathfont} does not restore the \LaTeX\ kernel when the user loads other packages. Given the scope and nature of the changes, I determined that the convenience factor of being able to use \vrb\mathfont\ anywhere in the preamble outweighs the incredibly small risk of interfering with another package. As far as I can tell, the biggest change is using a different primitive to code math symbols, but even that will probably never affect practical applications. The test \expandafter\vrb\csname if\endcsname\vrb\mathchar\vrb\alpha\ succeeds both before and after calling \vrb\mathfont, even though afterwards \vrb\alpha\ is defined with \vrb\Umathchar\ instead.} For changes to big operators, use the |bigops| keyword in section~2.
 
-The functionality of \textsf{mathfont} is most closely related to that of the \textsf{mathspec} package by Andrew Gilbert Moschou.\footnote{Andrew Gilbert Moschou, ``\textsf{mathspec}---Specify arbitrary fonts for mathematics in \XeTeX,''\hfil\break\texttt{https://ctan.org/pkg/mathspec}.} These two packages incorporate the use of individual unicode characters into math mode, and their symbol declaration process is similar. Both use \textsf{fontspec} as a back end, and both create font-changing commands for math-mode characters. However, the functionality differs in three crucial respects: (1) \textsf{mathfont} is compatible with Lua\LaTeX; (2) it can adjust the font of basic mathematical symbols such as those in the first half of table~2; and (3) \textsf{mathfont} lacks \textsf{mathspec}'s convenient space-adjustment character |"|.% footnote %
-\footnote{Compatibility with Lua\LaTeX\ comes at the expense of \textsf{mathspec}'s space-adjustment character |"|, and spacing-conscientious users can either manually add |\string\kern| or |\string\muskip| to their equations or redefine an active version of |"|. For example, the code
-\begin{code} % footnotes and verbatim really don't play well together
-\begingroup\texttt{\string\catcode`\string\"=\string\active}\par
-\texttt{\string\def"\expandafter\@gobble\string\#1\char"7B\relax
-  \expandafter\string\csname ifmmode\endcsname}\par
-\texttt{\ \ \string\kern}\argtext{dimension}%
-  \texttt{\string\relax\ \expandafter\@gobble\string\#1\string\kern}%
-  \argtext{other dimension}\texttt{\string\relax}\par
-\texttt{\expandafter\string\csname else\endcsname}\par
-\texttt{\ \ \string\char`\string\"\expandafter\@gobble\string\#1\%}\par
-\texttt{\expandafter\string\csname fi\endcsname\char"7D\relax}\endgroup
-\end{code}
-will serve as a hack that very roughly approximates \textsf{mathspec}'s |"|. This code will redefine |"| to typeset a right double quotation mark in horizontal mode, but in math mode, the character will insert \textit{dimension} and \textit{other dimension} of white space on each side respectively of the next character. More advanced users can automate the dimensions by using \TeX's \texttt{\expandafter\string\csname if\endcsname} or \LaTeX's |\string\@ifnextchar| conditionals to test whether the following character needs a particular spacing adjustment.} % end footnote %
-Further, as far as I am aware, this package is the first to provide support for the unicode alphanumeric symbols listed in Table~2, even in the context of fonts without built-in math support. (Please let me know if this is incorrect!) In this way \textsf{mathfont}, like \textsf{mathspec}, is more versatile than the \textsf{unicode-math} package, although potentially less far-reaching.\footnote{Will Robertson, ``\textsf{unicode-math}---Unicode mathematics support for \XeTeX\ and Lua\TeX,''\hfil\break\texttt{https://ctan.org/pkg/unicode-math}.}
+%% next column begins here
 
-Users who want to stick with pdf\LaTeX\ should consider Jean-Fran\c cois Burnol's \textsf{mathastext} as a useful alternative to \textsf{mathfont}.\footnote{Jean-Fran\c cois Burnol, ``\textsf{mathastext}---Use the text font in maths mode,''\hfil\break\texttt{https://ctan.org/pkg/mathastext}. In several previous versions of this documentation, I mistakenly stated that \textsf{mathastext} distorts \TeX's internal mathematics spacing. In fact the opposite is true: \textsf{mathastext} preserves and in some cases extends rules for space between various math-mode characters.} This package allows the user to specify the math-mode font for a large subset of the ASCII characters and is the most closely related package to \textsf{mathfont} among those packages designed specifically for pdf\LaTeX. Whereas \textsf{mathfont} works exclusively in the context of unicode fonts, \textsf{mathastext} was designed for the T1 and related encodings of Plain \TeX\ and \LaTeX. However, the \textsf{mathastext} functionality extends beyond that of \textsf{mathfont} in two notable aspects: (1) \textsf{mathastext} makes use of math versions, extra spacing, and italic corrections; and (2) \textsf{mathastext} allows users to change the font for the twenty-five non-alphanumeric characters supported by that package multiple times. After setting the default font for a class of characters, \textsf{mathfont} allows only the local font changes outlined in section~3.
 
-\section{Setting the Default Font}
+Navier-Stokes Equation
+\begin{align*}
+\frac{\partial}{\partial t}(\rho\mathbf{u})+\nabla\bullet
+  (\rho \mathbf{u}\otimes \mathbf{u})={}
+  &{-}\nabla\bar p+\mu\nabla^2\mathbf{u}\\
+  &+\frac13\mu\nabla(\nabla\bullet u)+
+  \rho\mathbf{g}
+\end{align*}
+\medskip
 
-The |\mathfont| command sets the default font for certain classes of characters. Its structure is given by
-\begin{code}
-|\mathfont[|\argtext{optional character classes}|]{|\argtext{font name}|}|,
-\end{code}
-where the \textit{optional character classes} can be any set of keywords from Tables~1 and 2 separated by commas, and the \textit{font name} can be any OpenType or TrueType font in a directory searchable by \TeX.\footnote{When specifying the \textit{font name}, users need to input a name that \textsf{fontspec} will recognize and be able to load. Advanced users will note that \vrb\mathfont\ uses \fontspeccommand\ and therefore loads fonts in the same way as \vrb\fontspec\ and related macros from that package.} The command loops through all keywords in the optional argument, and for each keyword, it changes the math-mode font for every character in that class to the \textit{font name}.\footnote{These changes happen through \LaTeX's \vrb\DeclareMathSymbol, and \vrb\mathfont\ is basically a very elaborately wrapped version of this command.} Currently, \textsf{mathfont} does not support OpenType features in math mode. To change both math and text fonts simultaneously, the package provides the command
-\begin{code}
-|\setfont{|\argtext{font name}|}|,
-\end{code}
-which calls both |\mathfont| and \textsf{fontspec}'s |\setmainfont| using the \textit{font name} as arguments. The package's optional argument is equivalent to calling |\setfont| and three local font-change commands from section 3, and most users will find this command sufficient for most applications. Both |\mathfont| and |\setfont| should appear only in the document preamble, i.e.\ before |\begin{document}|.
 
-The user should specify any optional arguments for |\mathfont| as entries in a comma-separated list. The order is irrelevant, and spaces throughout the optional argument are permitted. The argument should contain no braces! Leaving out the optional argument will cause the command to revert to its default behavior, where it acts on keyword classes |upper|, |lower|, |diacritics|, |greekupper|, |greeklower|, |digits|, |operator|, and |symbols|. For example, if the user writes
-\begin{code}
-|\mathfont{Arial}|,
-\end{code}
-\textsf{mathfont} will change the font of all Latin characters, Greek characters, diacritics, digits, operators such as $\log$ or $\sin$, and |symbols| characters to Arial whenever they come up in math mode. The package provides control sequences to typeset many symbols that \LaTeX\ does not include by default, and users gain access to these commands when they call |\mathfont| or |\setfont| with the appropriate keyword-option. In total, the package is capable of acting on some 800 unicode characters, and for a full list of symbols and control sequences, see |mathfont_symbol_list.pdf|, which is included in the \textsf{mathfont} installation and is available on \textsc{ctan}. Users can feed |\mathfont| a control sequence as its optional argument as long as the macro eventually expands to a comma-separated list of keywords and suboptions without braces.% footnote
-\footnote{Technically, \vrb\mathfont\ expands its optional argument inside an \vrb\edef. When it scans an optional argument, \textsf{mathfont} temporarily converts spaces to catcode~9 and ignores them. However, if you feed \vrb\mathfont\ a macro with spaces in it, \TeX\ has already scanned and tokenized those spaces, so we use \vrb\zap at space\ from the \LaTeX\ kernel instead. Braces will wreck both this process and the \vrb\@for\ loop that comes later.} % end footnote
-Finally, |\mathfont| and |\setfont| will not change the default font for a class of symbols once one of them has already done so.
+Quadratic Formula
+\[
+x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
+\]
+\medskip
 
-\begin{figure}[tb]
-\centering
-Table~1: Math Alphabet Characters\par\penalty\@M\smallskip
-\begin{tabularx}\hsize{p{1.8in}Xp{1.3in}}
-\toprule
-Keyword & Meaning & Default shape\\
-\midrule
-|upper| & Capital Latin Letters & Italic\\
-|lower| & Minuscule Latin Letters & Italic\\
-|diacritics| & Diacritics & Upright\\
-|greekupper| & Capital Greek Letters & Upright\\
-|greeklower| & Minuscule Greek Letters & Italic\\
-|agreekupper| & Capital Ancient Greek Letters & Upright\\
-|agreeklower| & Minuscule Ancient Greek Letters & Italic\\
-|cyrillicupper| & Capital Cyrillic Letters & Upright\\
-|cyrilliclower| & Minuscule Cyrillic Letters & Italic\\
-|hebrew| & Hebrew Letters & Upright\\
-|digits| & Arabic Numerals & Upright\\
-|operator| & Operator Font & Upright\\
-\bottomrule
-\end{tabularx}
-\end{figure}
+Ramanujan's Approximation for $\Gamma$
+\[
+\Gamma(1+x)\approx\sqrt\pi\,x^xe^{-x}\,\sqrt[6]{8x^3+4x^2+x+\frac1{30}}
+\]
+\medskip
 
-By default, \textsf{mathfont} will use one of an upright or italic shape for every character class, and users can override this setting by writing an |=| next to the keyword and either |roman| or |italic| following that. These two suboptions correspond respectively to an upright shape---normal shape in the language of the \textsc{nfss}---and an italic shape. Table~1 includes the default shape-values for each keyword, and the package declares characters for all keywords in table~2 as upright by default. For example, the command
-\begin{code}
-|\mathfont[upper=roman,lower=roman]{Times New Roman}|
-\end{code}
-changes all math-mode Latin letters to Times New Roman with upright shape.
 
-\begin{figure}[t]
-\centering
-Table~2: Letter-Like and Other Symbols\par\penalty\@M\smallskip
-\begin{tabularx}\hsize{p{1.8in}X}
-\toprule
-Keyword & Meaning\\
-\midrule
-|symbols| & Basic Symbols\\
-|extsymbols| & Extended Symbols\\
-|delimiters| & Parentheses, Brackets, and Braces\\
-|arrows| & Arrows\\
-|bigops| & ``Big'' Operators (see section 4)\\
-|extbigops| & Extended ``Big'' Operators\\
-|bb| & Blackboard Bold (double-struck)\\
-|cal| & Caligraphic\\
-|frak| & Fraktur\\
-|bcal| & Bold Caligraphic\\
-|bfrak| & Bold Fraktur\\
-\bottomrule
-\end{tabularx}
-\end{figure}
+Residue Theorem
+\[
+\frac1{2i\pi}\int_{\gamma}f(z)\ dz=\sum_{k=1}^n\Res_{a_k}(f)
+\]
+\medskip
 
-The package provides access to several types of letterlike symbols that appear frequently in mathematical writing, and the last five keywords in table~2 constitute these classes. Unlike with other keywords, \textsf{mathfont} doesn't create control sequences to access the symbols directly but rather defines a new command that converts letters into the appropriate style. When the user calls |\mathfont| with any of the last five keywords from table~2, the package both declares the appropriate unicode characters as math symbols and defines the macro
-\begin{code}
-|\math|\argtext{keyword}|{|\argtext{argument}|}|
-\end{code}
-to typeset them. For example,
-\begin{code}
-|\mathfont[bcal]{STIXGeneral}|
-\end{code}
-will set STIXGeneral as the font for bold calligraphic characters and define the command |\mathbcal| to access them in math mode. For the |bb| case, the associated command acts on Latin letters and Arabic numerals, and for the other four keywords, the associated command acts just on Latin letters. \TeX\ will ignore and issue a warning in response to any other characters in the \textit{argument}.
 
-\section{Local Font Changes}
+Riemann Zeta Function
+\begin{align*}
+\zeta(z)&=\sum_{i=1}^\infty\frac1{z^i}
+  =\frac1{\Gamma(z)}\int_0^\infty\frac{x^{z-1}}{e^x-1}\ dx\\
+  &=2^z\pi^{z-1}\sin\left(\frac{\pi z}2\right)\,\Gamma(1-z)\,\zeta(1-z)
+\end{align*}
+\medskip
 
-With \textsf{mathfont}, users can locally change the font in math mode by creating and then using a new control sequence for each new font desired.\footnote{The five macros in this section are basically wrapped versions of \LaTeX's \vrb\DeclareMathAlphabet.} The control sequences created this way function analogously to the standard math font macros such as |\mathrm|, |\mathit|, and |\mathnormal| from the \LaTeX\ kernel, and the package provides four basic commands to produce them. Table~3 lists these commands. All four have the same argument structure: a control sequence as the first mandatory argument and a font name as the second. For example, the macro |\newmathrm| looks like
-\begin{code}
-|\newmathrm{|\argtext{control sequence}|}{|\argtext{font name}|}|.
-\end{code}
-It defines the \textit{control sequence} in its first argument to accept a string of characters that it then converts to the \textit{font name} in the second argument with upright shape and medium weight. Writing
-\begin{code}
-|\newmathrm{\matharial}{Arial}|
-\end{code}
-would create the macro
-\begin{code}
-|\matharial{|\argtext{argument}|}|,
-\end{code}
-which can be used only in math mode and which converts the math alphabet characters in its \textit{argument} into the Arial font with upright shape and medium weight. The other three commands in table~3 function in the same way except that they select different series or shape values for the font in question. Table~3 lists this information. As of version~1.6, |\newmathbold| has been renamed to |\newmathbf| to put it in line with \textsc{nfss} naming conventions.
+Schrodinger Equation
+\[
+i\hbar\frac d{dt}|\Psi(t)\fakerangle=\hat H|\Psi(t)\fakerangle
+\]
+\medskip
 
-\begin{figure}[t]
-\centering
-Table 3: Font-changing Commands\par\penalty\@M\smallskip
-\begin{tabularx}\hsize{p{1.8in}X}
-\toprule
-Command & Font Characteristics\\
-\midrule
-|\newmathrm| & Upright shape; medium weight\\
-|\newmathit| & Italic shape; medium weight\\
-|\newmathbf| & Upright shape; bold-expanded weight\\
-|\newmathbfit| & Italic shape; bold-expanded weight\\
-\bottomrule
-\end{tabularx}
-\end{figure}
+Lorentz Transformation (Special Relativity)
+\[
+t'=\left(t-\frac{vx}{c^2}\right)\frac1{\sqrt{1-\frac{v^2}{c^2}}}
+\]
 
-Together these four commands will provide users with the tools for almost all desired local font changes, but they inevitably will be insufficient for some particular case. Accordingly, \textsf{mathfont} provides the more general |\newmathfontcommand| macro that functions similarly to the commands from table~3 but allows for more general font characteristics.\footnote{The package defines the four commands from table~3 in terms of \vrb\newmathfontcommand, and it specifies their style characteristics according to the kernel commands \vrb\updefault, \vrb\itdefault, \vrb\mddefault, and \vrb\bfdefault. Changing these macros will implicitly change the characteristics of the commands in table~3.} Its structure is
-\begin{code}
-|\newmathfontcommand{|\argtext{control sequence}|}{|\argtext{font name}|}{|\argtext{series}|}{|\argtext{shape}|}|,
-\end{code}
-where the control sequence in the first argument again becomes the macro that allows the user to access the specified font. The font name means any OpenType or TrueType font in a directory searchable by \TeX, and the series and shape information refers to the \textsc{nfss} codes for these attributes. Like |\mathfont| and |\setfont|, these commands should appear only in the document preamble.
+\end{multicols}
+%</equations>
+%<*cormorant>
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\DeclareFontFamily{TU}{Cormorant}{}
+\DeclareFontShape{TU}{Cormorant}{m}{n}
+  {<->"Cormorant Medium:\M at default@otf at features;-liga"}{}
+\DeclareFontShape{TU}{Cormorant}{m}{it}
+  {<->"Cormorant Medium Italic:\M at default@otf at features"}{}
+\mathfont[greeklower=upright,greekupper]{Crimson}
+\mathfont[diacritics]{Bona Nova}
+\setfont{Cormorant}
+\RuleThicknessFactor{600}
+\DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
+\DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
+\parindent=0pt\relax
+\begin{document}
 
-Unlike the traditional |\mathrm| and company, \textsf{mathfont}'s local font change commands create macros that can act on Greek characters. If the user specifies the font for Greek letters using |\mathfont|, macros created with the commands from Table~3 will affect those characters; otherwise, they will not.\footnote{\LaTeXe\ defines lower-case Greek letters as \vrb\mathord\ characters, and \textsf{mathfont} changes this classification to \vrb\mathalpha\ type when it declares them as symbols. The local font change commands act only on characters of class \vrb\mathalpha, so these commands will act on lower-case Greek letters if \vrb\mathfont\ redefines them to be \vrb\mathalpha.} Similarly, the local font-change commands will act on Cyrillic and Hebrew characters after the user calls |\mathfont| for those keyword-classes.
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Cormorant}
 
+\input mathfont_heading.tex
 
-\section{Math Symbols}
+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!
 
-Choosing which unicode characters to recode is something of a delicate task because few unicode fonts contain more than the most basic math symbols. In designing this portion of \textsf{mathfont}, I attempted to find the largest set of characters that reliably appears in every or nearly every major unicode font, and I coded those characters in the |symbols| keyword. This keyword contains punctuation and common symbols such as $\pm$, $\div$, and $\infty$, and it will be sufficient for basic math typesetting. That being said, most math relies on a much broader collection of characters and arrows, and in other keywords, I coded every unicode math symbol that I could reasonably see being useful. The extended math symbols keyword |extsymbols| contains quantifiers, set and element relations, just about any binary relation you can imagine, and a few miscellaneous symbols such as |\sharp| and |\flat|. The |arrows| keyword contains a swath of hooked, curved, and bar arrows and even one lightning bolt arrow. Most standard unicode fonts don't contain many of those glyphs, and users who call |\mathfont| for a font without certain characters will see blank spaces in their final output instead of the corresponding symbols from |mathfont_symbol_list.pdf|. If this happens, check the |log| file because it will display any missing characters in your fonts.
 
-It's worth emphasizing three aspects of \textsf{mathfont}'s symbol declaration process. First, the package does not provide any symbols in and of itself but rather gives users access to symbols that already exist on their computers. This is why \textsf{mathfont} provides no additional symbols directly at loading and why some package commands can create blank spaces rather than their intended output. Second, \textsf{mathfont}'s functionality currently does not include math symbols of variable sizes.% footnote
-\footnote{Dynamic math-mode character sizing is a surprisingly thorny task. OpenType font designers specifically code certain characters to change size when they design the font, and Lua\TeX's \vrb\Udelimiter\ and \vrb\Umathoperatorsize\ depend on this embedded feature. Because most unicode fonts come without resizing information, \textsf{mathfont} would have to manually add these settings to the Lua\TeX\ font table. I intend to add this functionality in some future update, but I do not know what the timeframe looks like for those changes.} % end footnote
-Recoded delimiters do not respond to |\left| and |\right|, and \LaTeX\ replaces them with their original Latin Modern equivalents before rescaling appropriately. Thus |\mathfont| with the |delimiters| keyword will produce normally sized delimiters in the font of your choice and big delimiters in Latin Modern Roman. Similarly, big operators such as |\sum| and |\prod| appear normally sized instead of larger after setting their font with |\mathfont|. This is undesirable! I have isolated all delimiter and big operator characters in their own keywords, and I hope to address this limitation in future updates. Third, the package provides an extra comma character, similar to \LaTeX's |\colon|.% footnote
-\footnote{Consider $\{x:x\not=0\}$ versus $\{x\colon x\not=0\}$. The first specification uses |:| while the second uses \vrb\colon. As a rule of thumb, use |:| for ratios and \vrb\colon\ as a punctuation mark.} % end footnote
-\TeX\ users have likely noticed the extra space surrounding commas in math mode, e.g.\ $10,000$ versus $10\mathord,000$, and \textsf{mathfont}'s |\comma| addresses this problem. Here the first ten thousand uses a standard~|,|~while the second uses |\comma|. As a rule of thumb, use |,| as a punctuation mark and |\comma| as a character separator.
+\input{mathfont_equations.tex}
 
-\section{Handling Errors}
+\end{document}
+%</cormorant>
+%<*kelvinch>
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\mathfont[radical]{Crimson}
+\setfont{Kelvinch}
+\IntegralItalicFactor{500}
+\SurdHorizontalFactor{900}
+\parindent=0pt\relax
+\begin{document}
 
-I have tried to make \textsf{mathfont}'s error messages as clear as possible, and the help text will contain instructions for how to resolve the problem. Nevertheless, some of the possible error messages warrant additional explanation.
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Kelvinch}
 
-The most salient errors are the ``Could not find \textsf{fontspec}'' and ``Missing \XeTeX\ or Lua\TeX'' fatal errors. When the user loads \textsf{mathfont}, \TeX\ must be able to find the package file |fontspec.sty|, and \TeX\ must be operating under the \XeTeX\ or Lua\TeX\ engine. If either condition fails, \TeX\ will stop reading in |mathfont.sty|.% footnote
-\footnote{Note that \textsf{mathfont} doesn't actually determine the typesetting engine. Rather, it checks whether the \XeTeX\ and Lua\TeX\ primitives \vrb\Umathcode, \vrb\Umathchardef, and \vrb\Umathaccent\ are defined, so if for some reason these control sequences have definitions when the user loads \textsf{mathfont} with another engine, \textsf{fontspec}'s more robust engine checks will take over and cause \TeX\ to abort. The reasoning here is straightforward: \textsf{mathfont} verifies only that the current typesetting engine provides the commands that it directly needs, so its potential functionality remains as broad as possible. If \textsf{fontspec} becomes compatible with a third engine that also provides (analogues of) these primitives, there is no reason to prevent \textsf{mathfont} from working with that engine as well.} % end footnote
-As of version 1.6, \textsf{mathfont}'s fatal errors prevent \TeX\ from reading in the rest of the |sty| file but do not crash the compilation process, and users who continue past one of \textsf{mathfont}'s fatal error messages will see an ``invalid command'' error if they call a user-level command in their document. I designed these errors to be unobtrusive, and users can safely ignore them. Because of how \textsf{mathfont} performs its engine check, it is theoretically possible that users with very old \XeTeX\ or Lua\TeX\ distributions may see the second fatal error even when running one of these two engines, and the solution is probably to upgrade to a more recent version of the engine in question. Unfortunately, I do not know what the exact cutoff for \XeTeX\ and Lua\TeX\ versions is.\footnote{However, the manual for a beta version of Lua\TeX, v.\ 0.70.1, includes these primitives, so they are at least as old as May 2011. See\hfill\break \texttt{https://osl.ugr.es/CTAN/obsolete/systems/luatex/base/manual/luatexref-t.pdf}}
+\input mathfont_heading.tex
 
-The \textsf{fontspec} package includes a ``|no-math|'' option, and \textsf{mathfont} expects \textsf{fontspec} to be loaded with this option. As mentioned previously, \textsf{mathfont} loads \textsf{fontspec} by default, but users can load \textsf{fontspec} before \textsf{mathfont} if they want to manually specify the package options. Alternatively, \LaTeX's |\PassOptionsToPackage| may be an even better way to proceed. If \textsf{mathfont} detects that \textsf{fontspec} was loaded without the |no-math| option, it will issue an error message saying so. This error is not paramount in the sense that the document will compile normally if a user ignores it, but \textsf{mathfont} will probably have trouble changing the font of certain math-mode characters in this situation. During development, Arabic numerals posed a particular challenge in this regard.
+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!
 
-The ``internal commands restored'' error arises when the user calls |\mathfont| after the package already restored the small portion of the \LaTeX\ kernel that it adjusts when loaded. Typically this happens when the user calls |\mathfont| after |\restoremathinternals|. The package will ignore any |\mathfont| commands in this situation, so while the error is technically harmless, you may not see some font changes you might have been expecting. Similarly, if the user tries to set the default font multiple times for some character class, the package will ignore any additional attempts, issue a warning, and continue the compilation process.
+\input{mathfont_equations.tex}
 
-What should you do if you can't resolve an error? First, always, always make sure that you spelled all of your commands correctly and closed all braces and brackets. Then check the \textsf{mathfont} documentation---you may be trying to do something outside the scope of the package, or you may be dealing with a special case. The internet is a great resource, and websites such as the \TeX\ StackExchange, Share\LaTeX, and Wikibooks' \LaTeX\ wiki are often invaluable when dealing with \TeX-related issues. Definitely ask another human as well! At that point you should email the author about your code---you might have identified a bug. I welcome emails about \textsf{mathfont} and will make every effort to write back to correspondence about the package, but I cannot guarantee a timely response.
+\end{document}
+%</kelvinch>
+%<*roboto>
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\mathfont[radical]{Overpass}
+\setfont{Roboto}
+\mathfont[]{STIXGeneral}
+\DeclareSymbolFont{Mupright2}{TU}{STIXGeneral}{m}{n}
+\DeclareMathSymbol{\otimes}{\mathbin}{Mupright2}{"2297}
+\RuleThicknessFactor{1900}
+\IntegralItalicFactor{500}
+\SurdHorizontalFactor{800}
+\parindent=0pt\relax
+\begin{document}
 
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Roboto}
+
+\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!
+
+
+\input{mathfont_equations.tex}
+
 \end{document}
-%</user>
+%</roboto>
+%<*typey>
+\documentclass[12pt]{article}
+\makeatletter
+\usepackage[margin=1in]{geometry}
+\usepackage{innerscript}
+\usepackage{multicol}
+\usepackage{amsmath}
+\DeclareMathOperator{\Res}{Res}
+\usepackage{mathfont}
+\mathfont[radical]{Crimson}
+\DeclareFontFamily{TU}{Typey}{}
+\DeclareFontShape{TU}{Typey}{m}{n}
+  {<->"Typey McTypeface:\M at default@otf at features"}{}
+\DeclareFontShape{TU}{Typey}{m}{it}
+  {<->"Typey McTypeface/I:\M at default@otf at features"}{}
+\DeclareFontShape{TU}{Typey}{b}{n}
+  {<->"Typey McTypeface:\M at default@otf at features;embolden=6"}{}
+\DeclareFontShape{TU}{Typey}{b}{it}
+  {<->"Typey McTypeface/I:\M at default@otf at features;embolden=6"}{}
+\setfont{Typey}
+\mathfont[]{STIXGeneral}
+\DeclareSymbolFont{Mroman2}{TU}{STIXGeneral}{m}{n}
+\DeclareMathSymbol{\otimes}{\mathbin}{Mroman2}{"2297}
+\RuleThicknessFactor{1300}
+\SurdHorizontalFactor{860}
+\parindent=0pt\relax
+\begin{document}
+
+\let\footnote\@gobble
+\def\showabstract{0}
+\let\textsf\relax
+\let\ttfamily\relax
+\def\documentname{Example---Typey McTypeface}
+
+\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!
+
+\let\bullet\cdot
+\input{mathfont_equations.tex}
+
+\end{document}
+%</typey>
 %<*heading>
 
 % package date and edition
-\def\packagedate{December 2019}
-\def\packageversion{1.6}
+\def\packagedate{December 2021}
+\def\packageversion{2.0}
 
 % header and footer commands
+
+
+
 \let\@@section\section
-\let\@sectionname\relax
-\def\@tempsec#1{\penalty-1000\@@section{#1}\penalty0\gdef\@sectionname{#1}}
-\def\@tempsecstar#1{\@@section*{#1}\gdef\@sectionname{#1}}
-\def\section{\@ifstar\@tempsecstar\@tempsec}
+\def\section{\@ifstar\star at sect\no at star@sect}
+\def\star at sect#1{\@@section*{#1}\section at name{#1}}
+\def\no at star@sect#1{\@@section{#1}\section at name{#1}}
+\def\section at name#1{\expandafter
+  \def\csname section@\thesection\endcsname{#1}}
+\def\sectionname{\csname section@\thesection\endcsname}
+
 \def\@oddhead{\ifnum\count0>1\relax
-  \rlap{\textit{\@sectionname}}\hfil
+  \rlap{\textit{\sectionname}}\hfil
   \hbox to 0pt{\hss\documentname\hss}\hfil
   \llap{\the\count0}\fi}
 \def\@evenhead{\ifnum\count0>1\relax
   \rlap{\the\count0}\hfil
   \hbox to 0pt{\hss\documentname\hss}\hfil
-  \llap{\textit{\@sectionname}}\fi}
+  \llap{\textit{\sectionname}}\fi}
 \def\@oddfoot{\hfil\ifnum\count0=1\relax1\fi\hfil}
 \let\@evenfoot\@empty
 
+% penalties
+\pretolerance=20
+\hyphenpenalty=10
+\exhyphenpenalty=5
+\brokenpenalty=0
+\clubpenalty=5
+\widowpenalty=5
+\finalhyphendemerits=300
+\doublehyphendemerits=500
+
 % general macros
-\DeclareRobustCommand\XeTeX{X\kern-0.1em
+\protected\def\XeTeX{X\kern-0.1em
   \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.15em
   \TeX}
-\DeclareRobustCommand\XeLaTeX{X\kern-0.1em
+\protected\def\XeLaTeX{X\kern-0.1em
   \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.13em
   \LaTeX}
 \bgroup
   \count@\catcode`\|
   \catcode`\|=12\relax
-  \gdef\indexpage#1{\index{#1|textit}}
-  \catcode`\|\count@
+  \gdef\indexpage#1{\index{#1|usage}}
 \egroup
-\edef\fontspeccommand{\noexpand\protect\expandafter\noexpand\csname fontspeccommand \endcsname}
+\protected\def\usage#1{\textit{#1}}
 \bgroup
 \catcode`\_=12
-  \expandafter\gdef\csname fontspeccommand \endcsname{%
-    \texttt{\string\fontspec_set_family:Nnn}}
+  \protected\gdef\fontspeccommand{\texttt{\string\fontspec_set_family:Nnn}}
+  \protected\gdef\fontspecbool{\texttt{\string\g__fontspec_math_bool}}
 \egroup
-\renewcommand\topfraction{1}
-\renewcommand\bottomfraction{1}
+\def\topfraction{1}
+\def\bottomfraction{1}
 \newenvironment{code}
-  {\strut\vadjust\bgroup\medskip\parindent=4em\relax\indent\strut\ignorespaces}
+  {\strut\vadjust\bgroup\medskip\parindent\z@\leftskip2em\relax
+    \noindent\strut\ignorespaces}
   {\strut\par\medskip\egroup\hfill\break\strut\ignorespacesafterend}
-\def\argtext#1{\ensuremath{\langle$\textit{#1}$\rangle}}
 \def\vrb#1{\expandafter\texttt\expandafter{\string#1}}
 \parskip=0pt
 
 % symbol list macros
-\def\makechar#1{\noindent\hbox to 0.4in{$#1{}$\hfil}\vrb#1\par}
-\def\makeaccent#1{\noindent\hbox to 0.4in{$#1 a$\hfil}\vrb#1\par}
-\def\blockheader#1#2#3{\smallskip\bigskip\centerline{#2 Characters (\texttt{#1})}
-  \penalty\@M{\noindent\hfil\fontsize{9pt}{12pt}\selectfont
-  \strut Rendered in #3\par}\penalty\@M
-  \smallskip\hrule height 0.5pt\penalty\@M\smallskip}
+\def\charexample#1{\hbox to \hsize{\hbox to 0.4in{$#1$\hfil}\vrb#1\hfil}}
+\def\accentexample#1{\hbox to \hsize{\hbox to 0.4in{$#1 a$\hfil}\vrb#1\hfil}}
+\def\delimexample#1{\hbox to \hsize{%
+  \hbox to 0.8in{$#1\big#1\Big#1\bigg#1\Bigg#1$\hfil}\vrb#1\hfil}}
+\def\luadelimexample#1{\hbox{\vbox{\hbox to 0.8in{%
+    $#1\big#1\Big#1\bigg#1\Bigg#1$\hfil}\hrule width 0pt height 0pt\relax}%
+  \hbox to \dimexpr\hsize-0.8in{\vbox{\vss
+    \hbox{\vrb#1}
+    \hbox{\quad(Lua\TeX only)}
+    \vss}\hfil}}}
+\def\operatorexample#1{\hbox to \hsize{%
+  \hbox to 0.4in{$#1$\hfil}%
+  \hbox to 0.4in{$\displaystyle#1$\hfil}\vrb#1\hfil}\smallskip}
+\def\blockheader#1#2{%
+  \bigskip\medskip
+  \penalty-9000
+  \hbox{\fbox{\hbox to \dimexpr\hsize-2\fboxrule-2\fboxsep\relax{%
+    \hfil#2 Characters (Keyword \texttt{#1})\strut\hfil}}}
+  \medskip}
 \def\upperalphabet{ABCDEFGHIJKLMNOPQRSTUVWXY}
 \def\loweralphabet{abcdefghijklmnopqrstuvwxy}
 \def\digits{0123456789}
@@ -3318,7 +6189,7 @@
 
 % title information
 {\large\parindent=0pt\leftskip=0pt plus 1 fil\rightskip=0pt plus 1fil\parfillskip=0pt
-{\strut\Large Package \textsf{mathfont} v.\ \packageversion\ \documentname\let\thefootnote\relax\footnote{Acknowledgements: Thanks to Lyric Bingham for her work checking my unicode hex values. Thanks to Herbert Voss and Andreas Zidak for pointing out bugs in previous versions of \textsf{mathfont}.}\global\advance\c at footnote\m at ne}\par
+{\strut\Large Package \textsf{mathfont} v.\ \packageversion\ \documentname\let\thefootnote\relax\footnote{Acknowledgements: Thanks to Lyric Bingham for her work checking my unicode hex values. Thanks to Herbert Voss and Andreas Zidak for pointing out bugs in previous versions of \textsf{mathfont}. Thanks to Jean-Fran\c cois Burnol for pointing out an error in the documentation in reference to their \textsf{mathastext} package.}\global\advance\c at footnote\m at ne}\par
 {\strut Conrad Kosowsky}\par
 {\strut\packagedate}\par
 {\strut\ttfamily kosowsky.latex at gmail.com}\par}
@@ -3325,22 +6196,32 @@
 
 \bigskip
 
+\ifnum\showabstract=1\relax
 % off-the-shelf insert
-\begin{figure}[h]
+
 \hrule height \p@\hbox{\vrule width \p@\kern-\p@\relax\vbox{\medskip
-{\leftskip=7em\rightskip=7em
-\noindent\strut For easy, off-the-shelf use, type the following in your document preamble and compile using \XeLaTeX\ or Lua\LaTeX:\par}
+{\leftskip=1.4in\rightskip=1.4in
+\noindent\strut For easy, off-the-shelf use, type the following in your preamble and compile with \XeLaTeX\ or Lua\LaTeX:\par
 \medskip
-\vbox{\noindent\hfil{|\usepackage[|\argtext{font name}|]{mathfont}|}\hfil}
+\vbox{\noindent\hfil{|\usepackage[|\meta{font name}|]{mathfont}|}\hfil}
+\medskip
+\noindent As of version 2.0, using Lua\LaTeX\ is recommended.\par}
 \medskip}\kern-\p@\vrule width \p@}\hrule height \p@
-\end{figure}
 
-% abstract
-\begin{abstract}
-The \textsf{mathfont} package provides a flexible interface for changing the font of math-mode characters. The package allows the user to specify a default unicode font for each of six basic classes of Latin and Greek characters, and it provides additional support for unicode math and alphanumeric symbols, including punctuation. Crucially, \textsf{mathfont} is compatible with both \XeLaTeX\ and Lua\LaTeX, and it provides several font-loading commands that allow the user to change fonts locally or for individual characters within math mode.
-\end{abstract}
+\bigskip
 
-\bigskip
+{\small
+
+\centerline{\bfseries Overview\strut}
+\smallskip
+
+\leftskip=0.5in\relax
+\rightskip=0.5in\relax
+\noindent The \textsf{mathfont} package adapts unicode text fonts for math mode. The package allows the user to specify a default unicode font for different classes of math symbols, and it provides tools to change the font locally for math alphabet characters. When typesetting with Lua\TeX, \textsf{mathfont} adds resizable delimiters, big operators, and a MathConstants table to text fonts.\par}
+
+\bigskip\bigskip\nointerlineskip
+\centerline{\vrule height 0.5pt width 2.5in}\bigskip\medskip
+\fi
 %</heading>
 %<*doc>
 
@@ -3398,7 +6279,7 @@
     \fi
   \fi}
 
-% the other patch (just one change: \parskip\z@ to parskip 0pt plus 0.2pt)
+% the other patch (just one change: \parskip\z@ to \parskip 0pt plus 0.2pt)
 \def\macro at code{%
    \topsep \MacrocodeTopsep
    \@beginparpenalty0% \predisplaypenalty
@@ -3424,30 +6305,6 @@
    \fi
    \init at crossref}
 %</doc>
-%<*idxwarning>
-\begingroup
-\bigskip
-\hrule height \p@\hbox{\vrule width \p@\kern-\p@\relax\vbox{\bigskip
-{\leftskip=12pt\rightskip=12pt\parindent=0pt
-
-\hfil WARNING\hfil
-
-\medskip
-
-It looks like you obtained a copy of |mathfont_code.pdf| without the index. To produce documentation with index, do the following: (1) run |mathfont_code.dtx| through \LaTeX\ to produce the |idx| file; (2) while in the directory containing |mathfont_code.dtx|, type
-
-\medskip
-
-\hfil|makeindex -s gind.ist mathfont_code.idx|\hfil
-
-\medskip
-
-in the command line; and (3) rerun |mathfont_code.dtx| through \LaTeX\ to recreate the full documentation.
-
-}\bigskip}\kern-\p@\vrule width \p@}\hrule height \p@
-\bigskip
-\endgroup
-%</idxwarning>
 % 
 % \fi
 % 

Modified: trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty	2021-12-29 21:35:02 UTC (rev 61439)
+++ trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty	2021-12-29 21:35:30 UTC (rev 61440)
@@ -6,250 +6,300 @@
 %%
 %% mathfont_code.dtx  (with options: `package')
 %% 
-%% This file is file from version 1.6 of the LaTeX package "mathfont,"
-%% to be used in conjunction with the XeTeX or LuaTeX engines.
+%% This file is from version 2.0 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-2019 by Conrad Kosowsky
+%% 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
+%% 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
 %% 
-%%            https://www.latex-project.org/lppl/.
+%%           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 of the
-%% following items:
+%% 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.
 %% 
-%%   (1) the base file mathfont_code.dtx;
+%% 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.
 %% 
-%%   (2) the package code contained in mathfont.sty;
+%% 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.
 %% 
-%%   (3) the derived files mathfont_symbol_list.tex,
-%% mathfont_user_guide.tex, mathfont_heading.tex, and
-%% mathfont_doc_patch.tex;
+%% 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.
 %% 
-%%   (4) the pdf documentation files mathfont_code.pdf,
-%% mathfont_symbol_list.pdf, and mathfont_user_guide.pdf;
+%% For more information, see the mathfont_code.dtx.
 %% 
-%%   (5) all other files created through the configuration process
-%% such as mathfont.idx and mathfont.ind; and
+%% Happy TeXing!
 %% 
-%%   (6) the associated README.txt file.
-%% 
-%% For more information, see the original mathfont.dtx file. To
-%% install mathfont on your computer, run mathfont_code.dtx through
-%% LaTeX and place the derived file mathfont.sty in a directory
-%% searchable by TeX.
-%% 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mathfont}[2019/12/05 v. 1.6 Package mathfont]
-\newif\ifM at font@loaded
-\newif\ifM at special\M at specialtrue
-\newif\ifM at XeTeXLuaTeX
-\def\@gobbletwo at brackets[#1]#2{}
+\ProvidesPackage{mathfont}[2021/12/28 v. 2.0 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?
+\newif\ifM at font@loaded     % load mathfont with font specified?
+\newif\ifE at sterEggDecl@red % already did easter egg?
+\long\def\@gobbletwo at brackets[#1]#2{}
 \def\M at NoMathfontError#1{\PackageError{mathfont}
   {\MessageBreak Invalid command\MessageBreak
   \string#1 on line \the\inputlineno}
   {Your command was ignored. I couldn't\MessageBreak
-  load mathfont successfully, so this\MessageBreak
-  control sequence was never defined.}}
+  load mathfont, so I never defined this\MessageBreak
+  control sequence.}}
 \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}
-\begingroup
-\catcode`\+=\active
-\def+{ }
-\def\M at NoFontspecError{\GenericError{}
-  {\MessageBreak\MessageBreak
-  Package mathfont fatal error:
-  \MessageBreak\MessageBreak
-  +*********************\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*++!!FATAL ERROR!!++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*+++++Could not+++++*\MessageBreak
-  +*+++find+fontspec+++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*********************\MessageBreak\@gobbletwo}
-  {See the mathfont package documentation for explanation.}
-  {Um, I couldn't find the file fontspec.sty.\MessageBreak
-  The mathfont package is useless without\MessageBreak
-  fontspec, so I'm going to stop reading it\MessageBreak
-  in now. (You won't be able to use any\MessageBreak
-  commands from mathfont in your document.)\MessageBreak
-  To make mathfont work correctly, please\MessageBreak
-  install fontspec on your computer.}}
-\IfFileExists{fontspec.sty}{\endgroup}
-  {\M at NoFontspecError\endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line}}
-  \endinput}
-\begingroup
-\catcode`\+=\active
-\def+{ }
-\def\M at XeTeXLuaTeXError{\GenericError{}
-  {\MessageBreak\MessageBreak
-  Package mathfont fatal error:
-  \MessageBreak\MessageBreak
-  +*********************\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*++!!FATAL ERROR!!++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*+++Missing XeTeX+++*\MessageBreak
-  +*+++++or LuaTeX+++++*\MessageBreak
-  +*+++++++++++++++++++*\MessageBreak
-  +*********************\MessageBreak\@gobbletwo}
-  {See the mathfont package documentation for explanation.}
-  {I need XeTeX or LuaTeX to make this\MessageBreak
-  package work properly. It looks like the\MessageBreak
-  current engine is something else, so I'm\MessageBreak
-  going to stop reading in the package file\MessageBreak
-  now. (You won't be able to use commands\MessageBreak
-  from mathfont in your document.) To make\MessageBreak
-  mathfont work correctly, please retypeset\MessageBreak
-  this file with one of those two engines.}}
-\ifx\Umathcode\@undefined
-\else
-  \ifx\Umathchardef\@undefined
-  \else
-    \ifx\Umathaccent\@undefined
-    \else
-      \M at XeTeXLuaTeXtrue
-    \fi
-  \fi
+\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}
+\ifdefined\directlua
+  \M at XeTeXLuaTeXtrue
 \fi
-\ifM at XeTeXLuaTeX
+\ifdefined\XeTeXrevision
+  \M at XeTeXLuaTeXtrue
+\fi
+\ifM at XeTeXLuaTeX\else
+  \begingroup
+    \catcode`\+=\active
+    \def+{ }
+    \def\M at XeTeXLuaTeXError{\GenericError{}
+      {\MessageBreak\MessageBreak
+      Package mathfont error:
+      \MessageBreak\MessageBreak
+      +*************************\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*+++++++UNABLE TO+++++++*\MessageBreak
+      +*+++++LOAD MATHFONT+++++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*+++++Missing XeTeX+++++*\MessageBreak
+      +*+++++++or LuaTeX+++++++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*************************\MessageBreak\@gobbletwo}
+      {See the mathfont package documentation for explanation.}
+      {I need XeTeX or LuaTeX to make mathfont\MessageBreak
+      work properly. It looks like the current\MessageBreak
+      engine is something else, so I'm going to\MessageBreak
+      stop reading in the package file now. (You\MessageBreak
+      won't be able to use commands from mathfont\MessageBreak
+      in your document.) To make mathfont work\MessageBreak
+      correctly, please retypeset your document\MessageBreak
+      with one of those two engines.^^J}}
+    \M at XeTeXLuaTeXError
   \endgroup
+  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line.}}
+  \expandafter\endinput % we should \endinput with a balanced conditional
+\fi
+\ifdefined\directlua
+  \M at adjust@fonttrue % if engine is LuaTeX, adjust font by default
+  \IfFileExists{luaotfload.sty}{\M at Noluaotfloadfalse}{\M at Noluaotfloadtrue}
 \else
-  \M at XeTeXLuaTeXError\endgroup
-  \AtEndOfPackage{\typeout{Package mathfont failed to load\on at line}}
-  \expandafter\endinput% we should \endinput with a balanced conditional
+  \PackageWarningNoLine{mathfont}{%
+    The current engine is XeTeX, but as\MessageBreak
+    of mathfont version 2.0, LuaTeX is\MessageBreak
+    recommended. Consider compiling with\MessageBreak
+    LuaLaTeX. Certain features will not\MessageBreak
+    work with XeTeX}
 \fi
-\def\M at OptionDepreciated#1#2{\PackageError{mathfont}
-  {Option "#1" depreciated}
+\ifM at Noluaotfload % false by default; true if LuaTeX AND no luaotfload.sty
+  \begingroup
+    \catcode`\+=\active
+    \def+{ }
+    \def\M at NoluaotfloadError{\GenericError{}
+      {\MessageBreak\MessageBreak
+      Package mathfont error:
+      \MessageBreak\MessageBreak
+      +*************************\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*+++++++UNABLE TO+++++++*\MessageBreak
+      +*+++++LOAD MATHFONT+++++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*++++Cannot find the++++*\MessageBreak
+      +*++file luaotfload.sty++*\MessageBreak
+      +*+++++++++++++++++++++++*\MessageBreak
+      +*************************\MessageBreak\@gobbletwo}
+      {You are likely seeing this message because you haven't^^J%
+      installed luaotfload. Check your TeX distribution for a^^J%
+      list of the packages on your system. See the mathfont^^J%
+      documentation for further explanation.^^J}
+      {It looks like the current engine is LuaTeX, so I\MessageBreak
+      need the luaotfload package to make mathfont work\MessageBreak
+      correctly. I can't find luaotfload, so I'm going to\MessageBreak
+      stop reading in the mathfont package file now. (You\MessageBreak
+      won't be able to use commands from mathfont in your\MessageBreak
+      document.) To make mathfont work correctly, make\MessageBreak
+      sure luaotfload.sty is installed on your computer\MessageBreak
+      in a directory searchable by TeX or compile with\MessageBreak
+      XeLaTeX.^^J}}
+    \M at NoluaotfloadError
+  \endgroup
+  \AtEndOfPackage{\typeout{Package 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}
+  {Option "#1" deprecated}
   {Your option was ignored. Please\MessageBreak
   use #2\MessageBreak
   instead. For more information,\MessageBreak
   see the mathfont documentation.}}
 \IfFileExists{atveryend.sty}
-  {\RequirePackage{atveryend}\let\M at SpecialHook\AtVeryVeryEnd}
-  {\let\M at SpecialHook\AtEndDocument}
-\DeclareOption{packages}{\M at OptionDepreciated{packages}
-  {\string\restoremathinternals}}
-\DeclareOption{operators}{\M at OptionDepreciated{operators}
+  {\RequirePackage{atveryend}\let\E at sterEggHook\AtVeryVeryEnd}
+  {\let\E at sterEggHook\AtEndDocument}
+\DeclareOption{packages}{%
+  \M at Optiondeprecated{packages}
+  {the macro \string\restoremathinternals}}
+\DeclareOption{operators}{%
+  \M at Optiondeprecated{operators}
   {the bigops keyword with \string\mathfont}}
-\DeclareOption{no-operators}{\M at OptionDepreciated{no-operators}
+\DeclareOption{no-operators}{%
+  \M at Optiondeprecated{no-operators}
   {the bigops keyword with \string\mathfont}}
-\DeclareOption{easter-egg}{\ifM at special\M at specialfalse
-  \def\EasterEggUpdate{\show\E at sterEggUpdate}
-  \def\E at sterEggUpdate{Okay, opening your Easter egg}
-    \EasterEggUpdate
-  \def\E at sterEggUpdate{..}
-    \EasterEggUpdate
-    \EasterEggUpdate
-  \typeout{^^JHm, I think it flew out the^^J%
-    window. Check back here when^^J%
-    everything's done compiling^^J}
-  \def\E at sterEggUpdate{Uh oh}
-    \EasterEggUpdate
-  \def\E at sterEggUpdate{Still wrangling. Try back later}
-  \AtBeginDocument\EasterEggUpdate
-  \M at SpecialHook{%
-    \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 sterEggUpdate{Got it}
-      \EasterEggUpdate}
+\DeclareOption{easter-egg}{%
+  \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}
+      \EasterEggUpdate
+    \def\E at sterEggUpd@te{..}
+      \EasterEggUpdate
+      \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}
   \fi}% my easter egg :)
+\DeclareOption{adjust}{\M at adjust@fonttrue}
+\DeclareOption{no-adjust}{\M at adjust@fontfalse}
 \DeclareOption*{\M at font@loadedtrue\edef\M at font@load{\CurrentOption}}
 \ProcessOptions*
-\def\M at FontChangeInfo#1#2{\wlog{Package mathfont Info:
-  Changing #1 characters to #2!}}
+\ifdefined\directlua
+  \ifM at adjust@font
+    \AtEndOfPackage{%
+      \typeout{:: mathfont :: Lua-based font adjustments enabled.}}
+  \else
+    \AtEndOfPackage{%
+      \typeout{:: mathfont :: Lua-based font adjustments disabled.}}
+  \fi
+\else
+  \AtEndOfPackage{%
+    \typeout{:: mathfont :: Lua-based font adjustments disabled.}}
+  \ifM at adjust@font
+    \AtEndOfPackage{%
+    \PackageError{mathfont}{Option^^J"adjust" ignored with XeTeX}
+    {Your package option "adjust" was ignored.\MessageBreak
+    This option works only with LuaTeX, and it\MessageBreak
+    looks like the current engine is XeTeX. To\MessageBreak
+    enable Lua-based font adjustments, compile\MessageBreak
+    with LuaLaTeX.^^J}}
+    \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{\wlog{Package mathfont Info: Creating
-  math alphabet command \noexpand#1 using^^J%
-  #2 font with series #3 and shape #4 on line \the\inputlineno.}}
-\def\M at SetInternalsInfo{\wlog{Package mathfont Info: Setting
-  \string\set at mathchar, \string\set at mathsymbol, \string\set at mathaccent.}}
-\def\M at RestoreInternalsInfo{\wlog{Package mathfont Info: Fixing
-  \string\set at mathchar, \string\set at mathsymbol, \string\set at mathaccent.}}
+\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%
+  Series/Shape Info: #4/#5^^J}}
 \def\M at CharsSetWarning#1{\PackageWarning{mathfont}
-  {Font for #1 chars has already\MessageBreak
-  been set, so I'm ignoring this\MessageBreak
-  keyword}}
+  {I already set the font for\MessageBreak
+  #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
-  "#1" that are grouped together in\MessageBreak
-  the argument of your \expandafter\string#2\space command\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
-  "#1" from your \expandafter\string#2\MessageBreak
+  "#2" from your \string#1\MessageBreak
   command}}
-\def\M at ControlSequenceArgWarning#1#2{\PackageWarning{mathfont}
+\def\M at CSArgWarning#1#2{\PackageWarning{mathfont}
   {I'm ignoring the unexpandable control\MessageBreak
-  sequence \expandafter\string#1\space that appears in the\MessageBreak
-  argument of your \expandafter\string#2\space command\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 "#1" in the\MessageBreak
-  argument of your \expandafter\string#2\MessageBreak
+  {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 DepreciatedWarning#1#2{\PackageWarning{mathfont}
-  {Your \string#1\space command is\MessageBreak
-  depreciated, and I replaced it with\MessageBreak
-  \string#2}}
-\def\M at NoMathError{\PackageError{mathfont}
-  {Package fontspec was loaded\MessageBreak
-  without the "no-math" option}
-  {This isn't really an error--it's fine to load\MessageBreak
-  fontspec without "no-math." However, strange\MessageBreak
-  things could happen, so beware of any sudden\MessageBreak
-  and unexpected font changes. To resolve this\MessageBreak
-  error message, load fontspec with the "no-\MessageBreak
-  math" option. If you haven't loaded fontspec\MessageBreak
-  manually, try loading mathfont earlier in your\MessageBreak
-  preamble.}}
+\def\M at DeprecatedWarning#1#2{\PackageWarning{mathfont}
+  {Your \string#1\space command on\MessageBreak
+  line \the\inputlineno\space is deprecated, and I\MessageBreak
+  replaced it with \string#2\@gobble}}
 \def\M at InvalidOptionError#1{\PackageError{mathfont}
-  {Invalid option "#1"\MessageBreak
-  for \string\mathfont\on at line}
-  {Hm. Check that you spelled the\MessageBreak
-  option correctly. Otherwise, I'm\MessageBreak
-  not sure what's wrong. Is this\MessageBreak
-  option listed in the package\MessageBreak
-  documentation? In any event, I'm\MessageBreak
-  going to ignore this option.}}
+  {Invalid^^Joption "#1" for \string\mathfont\on at line}
+  {Hm. You used a keyword that isn't actually an optional\MessageBreak
+  argument for \string\mathfont. Check
+  that you spelled the keyword\MessageBreak
+  correctly. Otherwise, I'm not sure what's wrong. Is this\MessageBreak
+  option listed in the package documentation? In any event,\MessageBreak
+  I'm going to ignore it.^^J}}
 \def\M at InvalidSuboptionError#1{\PackageError{mathfont}
-  {Invalid suboption "#1"\MessageBreak
-  for \string\mathfont\on at line}
-  {Hm. Check that you spelled the\MessageBreak
-  suboption correctly. Otherwise, I'm\MessageBreak
-  not sure what's wrong. Is this\MessageBreak
-  suboption listed in the package\MessageBreak
-  documentation? In any event, I'm\MessageBreak
-  going to ignore this suboption.}}
+  {Invalid^^Jsuboption "#1" for \string\mathfont\on at line}
+  {Hm. You used a keyword that isn't actually a suboption\MessageBreak
+  for \string\mathfont. Check that you
+  spelled the keyword correctly.\MessageBreak
+  Otherwise, I'm not sure what's wrong. Is this suboption\MessageBreak
+  listed in the package documentation? In any event, I'm\MessageBreak
+  going to ignore it.^^J}}
 \def\M at MissingOptionError{\PackageError{mathfont}
-  {Missing option for\MessageBreak
-  \string\mathfont\on at line}
+  {Missing^^Joption for \string\mathfont\on at line}
   {It looks like you included a , or = in\MessageBreak
-  the optional argument of \string\mathfont\MessageBreak
-  but didn't put anything before it.}}
+  the optional argument of \string\mathfont\space but\MessageBreak
+  didn't put anything before it.^^J}}
 \def\M at MissingSuboptionError{\PackageError{mathfont}
-  {Missing suboption for\MessageBreak
-  \string\mathfont\on at line}
+  {Missing^^Jsuboption for \string\mathfont\on at line}
   {It looks like you included an = somewhere\MessageBreak
   but didn't put the suboption after it. Either\MessageBreak
   that or you typed == instead of = in the\MessageBreak
-  optional argument of \string\mathfont.}}
+  optional argument of \string\mathfont.^^J}}
 \def\M at InternalsRestoredError{\PackageError{mathfont}
-  {Internal commands restored}
+  {Internal^^Jcommands restored}
   {This package slightly changes two LaTeX\MessageBreak
   internal commands, and you really shouldn't\MessageBreak
   be loading new math fonts without those\MessageBreak
@@ -259,42 +309,102 @@
   tions. Presumably you used \string\mathfont\space after\MessageBreak
   calling the \string\restoremathinternals\space command.\MessageBreak
   I'm going to ignore this call to \string\mathfont.\MessageBreak
-  Try retypesetting this document with all\MessageBreak
+  Try typesetting this document with all\MessageBreak
   \string\mathfont\space commands placed before you call\MessageBreak
-  \string\restoremathinternals.}}
+  \string\restoremathinternals.^^J}}
+\def\M at NoFontspecFamilyError{\PackageError{mathfont}
+  {No previous^^Jfont loaded by fontspec}
+  {You called \string\mathfont\space
+  with the argument "fontspec" \MessageBreak
+  on line \the\inputlineno,
+  and that tells me to use the previous \MessageBreak
+  font loaded by the fontspec package. However, it \MessageBreak
+  looks like you haven't loaded any fonts yet with \MessageBreak
+  fontspec. To resolve this error, try using for \MessageBreak
+  example \string\setmainfont\space
+  before calling \string\mathfont.^^J}}
+\def\M at NoFontspecError{\PackageError{mathfont}
+  {Missing^^Jpackage fontspec}
+  {You called \string\mathfont\space
+  with the argument "fontspec" \MessageBreak
+  on line \the\inputlineno,
+  and that tells me to use the previous \MessageBreak
+  font loaded by the fontspec package. However, you\MessageBreak
+  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 MissingControlSequenceError#1#2{\PackageError{mathfont}
   {Missing control sequence\MessageBreak
   for\string#1\MessageBreak on input line \the\inputlineno}
   {Your command was ignored. Right now the\MessageBreak
   first argument of \string#1\space is "#2."\MessageBreak
-  Please use a control sequence instead.}}
+  Please use a control sequence instead.^^J}}
 \def\M at DoubleArgError#1#2{\PackageError{mathfont}
   {Multiple characters in\MessageBreak
-  first argument of \string#2\MessageBreak
+  first argument of \string#1\MessageBreak
   on input line \the\inputlineno}
   {Your command was ignored. Right now the\MessageBreak
-  first argument of \string#2\space is "#1,"\MessageBreak
+  first argument of \string#1\space is "#2,"\MessageBreak
   which is multiple characters. Please use\MessageBreak
-  a single character instead.}}
+  a single character instead.^^J}}
 \def\M at HModeError#1{\PackageError{mathfont}
-  {Missing \$ inserted. The\MessageBreak
-  command \string#1\space must be used in\MessageBreak
-  math mode\on at line}
-  {I generated an error because\MessageBreak
+  {Missing \string$ inserted\MessageBreak
+  inserted\on at line. Command\MessageBreak
+  \string#1\space is for math mode only\MessageBreak}
+  {I generated an error because
   you used \string#1\space outside of\MessageBreak
-  math mode. I've inserted a \string$\MessageBreak
+  math mode. I've inserted a \string$
   just before your \string#1, so\MessageBreak
-  we should be all good now.}}
+  we 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
+  macro on line \the\inputlineno\MessageBreak
+  contains the character #1, which will mess me up\MessageBreak
+  if I try to read it, so I'm ignoring this call\MessageBreak
+  to \string\CharmLine. To resolve this error, make sure\MessageBreak
+  your charm information contains only integers,\MessageBreak
+  floats, asterisks, commas, and spaces.^^J}}
+\def\M at ForbiddenCharmFile#1{\PackageError{mathfont}
+  {Forbidden charm info contains #1}
+  {One of the lines in your \string\CharmFile\space
+  from line \the\inputlineno\MessageBreak
+  contains the character #1, which will mess me up\MessageBreak
+  if I try to read it, so I'm ignoring this line\MessageBreak
+  from your file. To resolve this error, make sure\MessageBreak
+  your charm information contains only integers,\MessageBreak
+  floats, asterisks, commas, and spaces.^^J}}
+\def\M at NoFontAdjustError#1{\PackageError{mathfont}
+  {Your command \MessageBreak\string#1 is invalid\MessageBreak
+  without Lua-based font adjustments}
+  {You haven't enabled Lua-based font adjustments,\MessageBreak
+  but the macro you called won't do anything without\MessageBreak
+  them. I'm going to ignore your command for now. To\MessageBreak
+  resolve this error, load mathfont with the package\MessageBreak
+  option "adjust" or compile with LuaLaTeX.^^J}}
+\def\M at BadIntegerError#1#2{\PackageError{mathfont}
+  {Bad argument for\MessageBreak\string#1}
+  {Your command was ignored. Please make sure\MessageBreak
+  that your argument of \string#1\space\MessageBreak
+  is a nonnegative integer. Right now it's\MessageBreak
+  "#2".^^J}}
 \@ifpackageloaded{fontspec}
-  {\ifnum\csname g__fontspec_math_bool\endcsname=\@ne
-    \M at NoMathError
-  \fi}{\RequirePackage[no-math]{fontspec}}
-\expandafter\let\expandafter\@newfont
-  \csname fontspec_set_family:Nnn\endcsname
-\M at SetInternalsInfo
+  {\csname bool_set_false:N\expandafter\endcsname
+    \csname g__fontspec_math_bool\endcsname}
+  {\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
+\let\@@DeclareSymbolFont\DeclareSymbolFont
+\@onlypreamble\@@set at mathchar
+\@onlypreamble\@@set at mathsymbol
+\@onlypreamble\@@set at mathaccent
+\@onlypreamble\@@DeclareSymbolFont
+\wlog{Package mathfont Info: Adapting \noexpand\set at mathchar for unicode.}
+\wlog{Package mathfont Info: Adapting \noexpand\set at mathsymbol for unicode.}
+\wlog{Package mathfont Info: Adapting \noexpand\set at mathaccent for unicode.}
+\wlog{Package mathfont Info: Increasing upper bound on
+  \noexpand\DeclareSymbolFont to 256.}
 \def\set at mathchar#1#2#3#4{%
   \multiply\count\z@ by 16\relax
   \advance\count\z@\count\tw@
@@ -302,198 +412,365 @@
 \def\set at mathsymbol#1#2#3#4{%
   \multiply\count\z@ by 16\relax
   \advance\count\z@\count\tw@
-  \global\Umathchardef#2\mathchar at type#3+#1+\count\z@\relax}
+  \global\Umathchardef#2=\mathchar at type#3+#1+\count\z@\relax}
 \def\set at mathaccent#1#2#3#4{%
   \multiply\count\z@ by 16\relax
   \advance\count\z@\count\tw@
-  \xdef#2{\Umathaccent\mathchar at type#3+#1+\the\count\z@\relax}}
+  \protected\xdef#2{%
+    \Umathaccent\mathchar at type#3+\number#1+\the\count\z@\relax}}
+\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}
+\ifdefined\directlua
+  \expandafter\@tempa\expandafter{\scantextokens\expandafter{\M at DecSymDef}}
+\else
+  \begingroup
+  \everyeof{\noexpand}
+  \endlinechar\m at ne
+  \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}
+\fi
+\@onlypreamble\@@DeclareSymbolFont
+\newbox\surdbox
 \newcount\M at count
-\newcount\M at return
+\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
+\newcount\M at surd@horizontal at factor
+\newmuskip\radicandoffset
+\newread\M at Charm
+\newtoks\M at toks
 \M at count\z@
-\newtoks\M at toks
-\newif\if at upper
-\newif\if at lower
-\newif\if at diacritics
-\newif\if at greekupper
-\newif\if at greeklower
-\newif\if at agreekupper
-\newif\if at agreeklower
-\newif\if at cyrillicupper
-\newif\if at cyrilliclower
-\newif\if at hebrew
-\newif\if at digits
-\newif\if at operator
-\newif\if at symbols
-\newif\if at extsymbols
-\newif\if at delimiters
-\newif\if at arrows
-\newif\if at bigops
-\newif\if at extbigops
-\newif\if at bb
-\newif\if at cal
-\newif\if at frak
-\newif\if at bcal
-\newif\if at bfrak
+\M at rule@thickness at factor\@m
+\M at integral@italic at factor=400\relax
+\M at surd@horizontal at factor\@m
+\M at surd@vertical at factor\@m
+\radicandoffset=3mu\relax
+\newif\ifM at upper
+\newif\ifM at lower
+\newif\ifM at diacritics
+\newif\ifM at greekupper
+\newif\ifM at greeklower
+\newif\ifM at agreekupper
+\newif\ifM at agreeklower
+\newif\ifM at cyrillicupper
+\newif\ifM at cyrilliclower
+\newif\ifM at hebrew
+\newif\ifM at digits
+\newif\ifM at operator
+\newif\ifM at symbols
+\newif\ifM at extsymbols
+\newif\ifM at delimiters
+\newif\ifM at radical
+\newif\ifM at arrows
+\newif\ifM at bigops
+\newif\ifM at extbigops
+\newif\ifM at bb
+\newif\ifM at cal
+\newif\ifM at frak
+\newif\ifM at bcal
+\newif\ifM at bfrak
 \newif\if at optionpresent
 \newif\if at suboptionpresent
-\newif\ifM at mathfont@firstoption
-\newif\ifM at anychars@changed
 \newif\ifM at arg@good
-\def\@uppershape{italic}% latin upper
-\def\@lowershape{italic}% latin lower
-\def\@diacriticsshape{roman}% diacritics
-\def\@greekuppershape{roman}% greek upper
-\def\@greeklowershape{italic}% greek lower
-\def\@agreekuppershape{roman}% ancient greek upper
-\def\@agreeklowershape{italic}% ancient greek lower
-\def\@cyrillicuppershape{roman}% cyrillic upper
-\def\@cyrilliclowershape{italic}% cyrillic lower
-\def\@hebrewshape{roman}% hebrew
-\def\@digitsshape{roman}% numerals
-\def\@operatorshape{roman}% operator font
-\def\@symbolsshape{roman}% basic symbols
-\def\@extsymbolsshape{roman}% extended symbols
-\def\@delimitersshape{roman}% delimiters
-\def\@arrowsshape{roman}% arrows
-\def\@bigopsshape{roman}% big operators
-\def\@extbigopsshape{roman}% extended big operators
-\def\@bbshape{roman}% blackboard bold
-\def\@calshape{roman}% caligraphic
-\def\@frakshape{roman}% fraktur
-\def\@bcalshape{roman}% bold caligraphic
-\def\@bfrakshape{roman}% bold fraktur
-\def\@defaultkeys{upper,lower,diacritics,greekupper,greeklower,%
-  digits,symbols,operator}
-\def\@normalkeys{upper,lower,diacritics,greekupper,greeklower,agreekupper,%
-  agreeklower,cyrillicupper,cyrilliclower,hebrew,digits,operator,symbols,%
-  extsymbols,delimiters,arrows,bigops,extbigops}
-\def\@alphanumkeys{bb,cal,frak,bcal,bfrak}
+\newif\ifM at Decl@reF at mily
+\newif\ifM at fromCharmFile
+\def\M at uppershape{italic} % latin upper
+\def\M at lowershape{italic} % latin lower
+\def\M at diacriticsshape{upright} % diacritics
+\def\M at greekuppershape{upright} % greek upper
+\def\M at greeklowershape{italic} % greek lower
+\def\M at agreekuppershape{upright} % ancient greek upper
+\def\M at agreeklowershape{italic} % ancient greek lower
+\def\M at cyrillicuppershape{upright} % cyrillic upper
+\def\M at cyrilliclowershape{italic} % cyrillic lower
+\def\M at hebrewshape{upright} % hebrew
+\def\M at digitsshape{upright} % numerals
+\def\M at operatorshape{upright} % operator font
+\def\M at delimitersshape{upright} % delimiters
+\def\M at radicalshape{upright} % surd
+\def\M at bigopsshape{upright} % big operators
+\def\M at extbigopsshape{upright} % extended big operators
+\def\M at symbolsshape{upright} % basic symbols
+\def\M at extsymbolsshape{upright} % extended symbols
+\def\M at arrowsshape{upright} % arrows
+\def\M at bbshape{upright} % blackboard bold
+\def\M at calshape{upright} % caligraphic
+\def\M at frakshape{upright} % fraktur
+\def\M at bcalshape{upright} % bold caligraphic
+\def\M at bfrakshape{upright} % bold fraktur
+\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;%
+  tlig=true;liga=true;smcp=false;lnum=true}
+\def\M at default@otf at features@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 check@option at valid#1{%
-  \def\@temperror{\M at InvalidOptionError{#1}}
-  \@for\@j:=\@normalkeys\do{%
+  \let\@temperror\M at InvalidOptionError % error by default
+  \@for\@j:=\M at normalkeys\do{%
     \ifx\@j#1
-      \let\@temperror\relax
-      \@optionpresenttrue% set switch to true if option is valid
-      \advance\M at return\@ne
+      \let\@temperror\@gobble % eliminate error
+      \@optionpresenttrue % set switch to true
     \fi}
-  \@for\@j:=\@alphanumkeys\do{%
+  \@for\@j:=\M at letterlikekeys\do{%
     \ifx\@j#1
-      \let\@temperror\relax
-      \expandafter\M at CommandInitializeInfo\csname math\@j\endcsname
-      \csname define@\@j\endcsname% initialize
-      \@optionpresenttrue% set switch to true if option is valid
-      \advance\M at return\@ne
+      \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}
+    \@temperror{#1}}
 \def\M at check@suboption at valid#1{%
-  \def\@temperror{\M at InvalidSuboptionError{#1}}
-  \@for\@j:=roman,italic\do{%
+  \let\@temperror\M at InvalidSuboptionError % error by default
+  \@for\@j:=roman,upright,italic\do{%
     \ifx\@j#1
-      \let\@temperror\relax
-      \@suboptionpresenttrue% set switch to true if suboption is valid
-      \advance\M at return\@ne
+      \let\@temperror\@gobble % eliminate error
+      \@suboptionpresenttrue % set switch to true
     \fi}
-  \@temperror}
+  \@temperror{#1}}
 \def\M at strip@equals#1={#1}
 \def\M at parse@option#1=#2\@nil{%
-  \@optionpresentfalse% set switch to false by default
-  \@suboptionpresentfalse% set switch to false by default
-  \def\@tempa{#1}
-  \def\@tempb{#2}
-  \ifx\@tempa\@empty
+  \@optionpresentfalse % set switch to false by default
+  \@suboptionpresentfalse % set switch to false by default
+  \def\@temp at opt{#1} % store option
+  \def\@temp at sub{#2} % store suboption
+  \ifx\@temp at opt\@empty
     \M at MissingOptionError
   \else
-    \M at check@option at valid\@tempa
-    \def\@tempc{=}
-    \ifx\@tempb\@tempc
+    \M at check@option at valid\@temp at opt
+    \bgroup\def\@tempa{=}
+    \ifx\@temp at sub\@tempa
+      \egroup % first branch \egroup
       \M at MissingSuboptionError
     \else
-      \ifx\@tempb\@empty
+      \egroup % second branch \egroup
+      \ifx\@temp at sub\@empty
       \else
-        \edef\@tempb{\expandafter\M at strip@equals\@tempb}
-        \M at check@suboption at valid\@tempb
+        \edef\@temp at sub{\expandafter\M at strip@equals\@temp at sub}
+        \M at check@suboption at valid\@temp at sub % check that suboption is valid
       \fi
     \fi
+    \bgroup\def\@tempa{roman}
+    \ifx\@temp at sub\@tempa
+      \egroup % first branch \egroup
+      \def\@temp at sub{upright}
+    \else
+      \egroup % second branch \egroup
+    \fi
   \fi}
-\def\M at eat@spaces#1{\expandafter\zap at space#1 \@empty}
-\def\M at check@arglength#1#2\@nil#3#4{%
-  \ifx\@nnil#2\@nnil
+\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
-    #3{#1#2}{#4}%
-    \M at arg@goodfalse
+    \@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}
-\def\mathfont{\@ifnextchar[% next line is the two possible branches
-  {\bgroup\catcode`\ =9\relax\m at thf@nt}{\@mathfont[\@defaultkeys]}}
-\def\m at thf@nt[#1]{\egroup\@mathfont[#1]}
+\@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]}
 \def\@mathfont[#1]#2{%
   \ifx\set at mathchar\@@set at mathchar
     \M at InternalsRestoredError
   \else
-    \M at return\thr@@
     \M at toks{}
-    \M at mathfont@firstoptiontrue
-    \wlog{Package mathfont Info: Loading font #2 with package fontspec.}
-    \expandafter\@newfont\csname M at font\the\M at count\endcsname{}{#2}
-    \edef\@tempa{#1}
-    \edef\@tempa{\M at eat@spaces\@tempa}
-    \@for\@i:=\@tempa\do{\expandafter\M at parse@option\@i=\@nil
+    \M at newfont{#2}
+    \expandafter\edef\csname M at fontfamily@#2\endcsname{\M at f@ntn at me}
+    \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}
+      \advance\M at count\@ne
+    \fi
+    \edef\@tempa{\csname M at fontid@\M at f@ntn at me\endcsname}
+    \edef at nospace\@tempb{#1}
+    \@for\@i:=\@tempb\do{\expandafter\M at parse@option\@i=\@nil
       \if at optionpresent
-        \expandafter\ifx% next line is two cs to be compared
-              \csname if@\@tempa\expandafter\endcsname\csname iftrue\endcsname
-          \M at CharsSetWarning{\@tempa}
+        \expandafter\ifx % next line is two cs to be compared
+          \csname ifM@\@temp at opt\expandafter\endcsname\csname iftrue\endcsname
+          \M at CharsSetWarning{\@temp at opt}
         \else
-          \ifM at mathfont@firstoption
-            \M at mathfont@firstoptionfalse
-          \else
-            \ifnum\M at return>5\relax
-              \expandafter\M at toks\expandafter{\the\M at toks,^^J}
-              \M at return\z@
-            \else
-              \expandafter\M at toks\expandafter{\the\M at toks, }
-            \fi
-          \fi
-          \edef\@tempc{\the\M at toks\@tempa}
-          \expandafter\M at toks\expandafter{\@tempc}
+          \edef\@tempc{\the\M at toks^^J\@temp at opt}
+          \M at toks\expandafter{\@tempc}
           \if at suboptionpresent
-            \expandafter\edef\csname @\@tempa shape\endcsname{\@tempb}
-            \edef\@tempc{\the\M at toks\space(\@tempb)}
-            \expandafter\M at toks\expandafter{\@tempc}
+            \expandafter\edef\csname M@\@temp at opt shape\endcsname{\@temp at sub}
           \fi
-          \def\@tempb{roman}
-          \expandafter\ifx\csname @\@tempa shape\endcsname\@tempb
-            \@ifundefined{symMroman\the\M at count}
-              {\DeclareSymbolFont{Mroman\the\M at count}{TU}
-                {\csname M at font\the\M at count\endcsname}{m}{n}}{}
+          \edef\@tempc{\the\M at toks\space
+            (\csname M@\@temp at opt shape\endcsname)}
+          \M at toks\expandafter{\@tempc}
+          \edef\@tempc{\csname M@\@temp at opt shape\endcsname}
+          \def\@tempb{upright}
+          \ifx\@tempb\@tempc
+            \let\@tempb\shapedefault
+          \else
+            \let\@tempb\itdefault
           \fi
-          \def\@tempb{italic}
-          \expandafter\ifx\csname @\@tempa shape\endcsname\@tempb
-            \@ifundefined{symMitalic\the\M at count}
-              {\DeclareSymbolFont{Mitalic\the\M at count}{TU}
-                {\csname M at font\the\M at count\endcsname}{m}{it}}{}
+          \ifcsname symM\@tempc\@tempa\endcsname\else
+            \DeclareSymbolFont
+              {M\@tempc\@tempa}{TU}{\M at f@ntn at me}{\mddefault}{\@tempb}
           \fi
-          \expandafter\edef\csname M@\@tempa @fontinfo\endcsname{#2}
-          \M at anychars@changedtrue
-          \M at FontChangeInfo{\@tempa}{#2}
-          \csname M@\@tempa @set\endcsname% set default font
-          \csname @\@tempa true\endcsname% set switch to true
+          \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}
+          \csname M@\@temp at opt @set\endcsname % set default font
+          \csname M@\@temp at opt true\endcsname % set switch to true
         \fi
       \fi}
-    \advance\M at count\@ne
     \edef\@tempa{\the\M at toks}
     \ifx\@tempa\@empty
       \wlog{The \string\mathfont\space command on line \the\inputlineno\space
         did not change the font for any characters!}
     \else
-      \typeout{:: mathfont :: Math font set to #2\space
+      \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^^J}
     \fi
   \fi}
 \@onlypreamble\mathfont
 \@onlypreamble\m at thf@nt
 \@onlypreamble\@mathfont
-\def\setfont#1{\setmainfont[Ligatures=TeX]{#1}\mathfont{#1}}
+\protected\def\setfont#1{%
+  \mathfont{#1}
+  \mathconstantsfont{#1}
+  \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}
+    \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}
+      \fi
+      \let\m at th@const at nts@font\@tempa
+    \fi}
+  \let\M at SetMathConstants\relax
+  \def\math at fonts{\aftergroup\M at SetMathConstants}
+  \@onlypreamble\mathconstantsfont
+\fi
 \def\M at check@mode#1{%
   \let\@tempa#1%
   \ifmmode
@@ -504,28 +781,29 @@
       \expandafter
     \egroup
     \expandafter\M at HModeError\csname\expandafter\@gobble\string#1\endcsname
-    \leavevmode\expandafter$\expandafter\@tempa
+    \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}{#2}%
-  \ifM at arg@good
-    \csname M@#2@\@k\endcsname
-  \fi}}
-\def\M at check@token#1#2{%
-  \M at arg@goodtrue
-  \M at check@arglength#1\@nil\M at DoubleArgWarning{\csname math#2\endcsname}%
-  \ifM at arg@good% good
+    \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 NestedArgWarning{#1}{\csname math#2\endcsname}%
-      \M at arg@goodfalse
+      \M at errcode\@ne
     \else}%
       \ifcat\relax\noexpand#1% bad
-      \M at ControlSequenceArgWarning{#1}{\csname math#2\endcsname}%
-      \M at arg@goodfalse
+        \M at errcode\tw@
       \else
-        \ifcat a#1% good
+        \ifnum\catcode`#1=11\relax% good
         \else
           \if 0#1% good
           \else
@@ -547,9 +825,7 @@
                           \else
                             \if 9#1% good
                             \else
-                              \M at CharacterArgWarning
-                                {#1}{\csname math#2\endcsname}%
-                              \M at arg@goodfalse
+                              \M at errcode\thr@@
                             \fi
                           \fi
                         \fi
@@ -563,96 +839,185 @@
         \fi
       \fi
     \fi
+  \else% matches the original \ifx\@nnil, etc.
+    \M at errcode=4\relax
   \fi}
 \def\define at bb{%
-  \def\mathbb{\M at check@mode\@mathbb}%
+  \protected\def\mathbb{\M at check@mode\@mathbb}%
   \def\@mathbb##1{\M at process@tokens{##1}{bb}}}
 \def\define at cal{%
-  \def\mathcal{\M at check@mode\@mathcal}%
+  \protected\def\mathcal{\M at check@mode\@mathcal}%
   \def\@mathcal##1{\M at process@tokens{##1}{cal}}}
 \def\define at frak{%
-  \def\mathfrak{\M at check@mode\@mathfrak}%
+  \protected\def\mathfrak{\M at check@mode\@mathfrak}%
   \def\@mathfrak##1{\M at process@tokens{##1}{frak}}}
 \def\define at bcal{%
-  \def\mathbcal{\M at check@mode\@mathbcal}%
+  \protected\def\mathbcal{\M at check@mode\@mathbcal}%
   \def\@mathbcal##1{\M at process@tokens{##1}{bcal}}}
 \def\define at bfrak{%
-  \def\mathbfrak{\M at check@mode\@mathbfrak}%
+  \protected\def\mathbfrak{\M at check@mode\@mathbfrak}%
   \def\@mathbfrak##1{\M at process@tokens{##1}{bfrak}}}
-\def\M at check@csarg#1#2#3{%
-  \M at arg@goodtrue
-  \M at check@arglength#2\@nil\M at DoubleArgError{#1}
-  \ifM at arg@good% good
+\def\M at check@csarg#1#2{%
+  \expandafter\ifx\expandafter\@nnil\@gobble#2\@nnil% good
     \ifcat\relax\noexpand#2% good
+      \M at arg@goodtrue
     \else
-      \M at MissingControlSequenceError{#1}{#2}
+      \M at MissingControlSequenceError#1{#2}
       \M at arg@goodfalse
     \fi
-  \fi
-  \ifM at arg@good
-    \def\@tempa{#2}
-    \wlog{Package mathfont Info: Loading font #3 with package fontspec.}
-    \@newfont\@tempb{}{#3}
-    \expandafter\@newmathfontcommand
   \else
-    \expandafter\@gobbletwo
+    \M at DoubleArgError#1{#2}
+    \M at arg@goodfalse
   \fi}
-\@onlypreamble\M at check@csarg
-\def\@newmathfontcommand#1#2{%
-  \expandafter\M at NewFontCommandInfo\expandafter
-    {\@tempa}{\@tempb}{#1}{#2}
-  \expandafter\DeclareMathAlphabet\expandafter
-    {\@tempa}{TU}{\@tempb}{#1}{#2}}
-\def\newmathfontcommand{\M at check@csarg\newmathfontcommand}
-\@onlypreamble\@newmathfontcommand
+\protected\def\newmathfontcommand#1#2#3#4{%
+  \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}
+  \fi}
 \@onlypreamble\newmathfontcommand
-\def\newmathrm#1#2{\M at check@csarg\newmathrm{#1}{#2}
-  {\mddefault}{\updefault}}
-\def\newmathit#1#2{\M at check@csarg\newmathit{#1}{#2}
-  {\mddefault}{\itdefault}}
-\def\newmathbf#1#2{\M at check@csarg\newmathbf{#1}{#2}
-  {\bfdefault}{\updefault}}
-\def\newmathbfit#1#2{\M at check@csarg\newmathbfit{#1}{#2}
-  {\bfdefault}{\itdefault}}
+\def\M at define@newmath at cmd#1#2#3{%
+  \protected\def#1##1##2{%
+    \M at check@csarg{#1}{##1}
+    \newmathfontcommand{##1}{##2}{#2}{#3}}}
+\def\M at default@newmath at cmds{%
+  \newmathrm{\mddefault}{\shapedefault},%
+  \newmathit{\mddefault}{\itdefault},%
+  \newmathbf{\bfdefault}{\shapedefault},%
+  \newmathbfit{\bfdefault}{\itdefault},%
+  \newmathsc{\mddefault}{\scdefault},%
+  \newmathscit{\mddefault}{\scdefault\itdefault},%
+  \newmathbfsc{\bfdefault}{\scdefault},%
+  \newmathbfscit{\bfdefault}{\scdefault\itdefault}}
+\@for\@i:=\M at default@newmath at cmds\do{\expandafter\M at define@newmath at cmd\@i}
 \@onlypreamble\newmathrm
 \@onlypreamble\newmathit
 \@onlypreamble\newmathbf
 \@onlypreamble\newmathbfit
-\def\newmathbold{%
-  \M at DepreciatedWarning\newmathbold\newmathbf
+\@onlypreamble\newmathsc
+\@onlypreamble\newmathscit
+\@onlypreamble\newmathbfsc
+\@onlypreamble\newmathbfscit
+\@onlypreamble\M at define@newmath at cmd
+\let\M at default@newmath at cmds\relax
+\protected\def\setmathfontcommands#1{%
+  \newmathrm\mathrm{#1}
+  \newmathit\mathit{#1}
+  \newmathbf\mathbf{#1}
+  \newmathbfit\mathbfit{#1}
+  \newmathsc\mathsc{#1}
+  \newmathscit\mathscit{#1}
+  \newmathbfsc\mathbfsc{#1}
+  \newmathbfscit\mathbfscit{#1}}
+\@onlypreamble\setmathfontcommands
+\protected\def\newmathbold{%
+  \M at DeprecatedWarning\newmathbold\newmathbf
   \newmathbf}
-\def\newmathboldit{%
-  \M at DepreciatedWarning\newmathboldit\newmathbfit
+\protected\def\newmathboldit{%
+  \M at DeprecatedWarning\newmathboldit\newmathbfit
   \newmathbfit}
+\ifM at adjust@font
+  \def\M at check@int#1{%
+  \M at arg@goodfalse
+  \begingroup
+  \edef\@tempa{\number0#1}
+  \edef\@tempa{\detokenize\expandafter{\@tempa}}
+  \@expandtwoargs\in@{"}{\@tempa}
+  \ifin@ % is " in #1?
+    \endgroup % first branch \endgroup
+  \else
+    \@expandtwoargs\in@{\@backslashchar}{\@tempa}
+    \ifin@ % is \ in #1?
+      \endgroup % second branch \endgroup
+    \else
+      \directlua{
+      local num = tonumber("\@tempa")
+      if num then % if number?
+        if num == num - (num \@percentchar 1) then % if integer?
+          if num >= 0 then % if nonnegative?
+            tex.print("\@backslashchar\@backslashchar endgroup%
+              \@backslashchar\@backslashchar M at arg@goodtrue")
+          end
+        end
+      end}
+    \fi
+  \fi}
+  \def\RuleThicknessFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at rule@thickness at factor=#1\relax
+    \else
+      \M at BadIntegerError\RuleThicknessFactor{#1}
+    \fi}
+  \def\IntegralItalicFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at integral@italic at factor=#1\relax
+    \else
+      \M at BadIntegerError\IntegralItalicFactor{#1}
+    \fi}
+  \def\SurdHorizontalFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at surd@horizontal at factor=#1\relax
+    \else
+      \M at BadIntegerError\SurdHorizontalFactor{#1}
+    \fi}
+  \def\SurdVerticalFactor#1{%
+    \M at check@int{#1}
+    \ifM at arg@good
+      \global\M at surd@vertical at factor=#1\relax
+    \else
+      \M at BadIntegerError\SurdVerticalFactor{#1}
+    \fi}
+\else
+  \@tfor\@i:=\RuleThicknessFactor\IntegralItalicFactor\SurdHorizontalFactor
+    \SurdVerticalFactor\CharmLine\CharmFile\mathconstantsfont
+      \do{%
+        \expandafter\edef\@i{\noexpand\M at NoFontAdjustError
+          \expandafter\noexpand\@i
+          \noexpand\@gobble}}
+\fi
+\@onlypreamble\RuleThicknessFactor
+\@onlypreamble\IntegralItalicFactor
+\@onlypreamble\SurdHorizontalFactor
+\@onlypreamble\SurdVerticalFactor
+\@onlypreamble\CharmLine
+\@onlypreamble\CharmFile
 \def\restoremathinternals{%
   \ifx\set at mathchar\@@set at mathchar
   \else
-    \M at RestoreInternalsInfo
-  \fi
-  \let\set at mathchar\@@set at mathchar
-  \let\set at mathsymbol\@@set at mathsymbol
-  \let\set at mathaccent\@@set at mathaccent}
-\def\keyword at info@begindocument#1{%
-  \expandafter\ifx% next line is two cs to be compared
-        \csname if@#1\expandafter\endcsname\csname iftrue\endcsname
-    \wlog{Keyword #1: Set to \csname M@#1 at fontinfo\endcsname\space with
-      \csname @#1shape\endcsname\space shape.}
-  \else
-    \wlog{Keyword #1: No change.}
+    \wlog{Package mathfont Info: Restoring \string\set at mathchar.}
+    \wlog{Package mathfont Info: Restoring \string\set at mathsymbol.}
+    \wlog{Package mathfont Info: Restoring \string\set at mathaccent.}
+    \wlog{Package mathfont Info: Restoring \string\DeclareSymbolFont.}
+    \let\set at mathchar\@@set at mathchar
+    \let\set at mathsymbol\@@set at mathsymbol
+    \let\set at mathaccent\@@set at mathaccent
+    \let\DeclareSymbolFont\@@DeclareSymbolFont
   \fi}
-\AtBeginDocument{%
-  \ifM at anychars@changed
-    \edef\@tempa{\@normalkeys,\@alphanumkeys}
-    \wlog{^^J:: mathfont :: List of fonts changed by mathfont:}
-    \@for\@i:=\@tempa\do{%
-      \expandafter\keyword at info@begindocument\expandafter{\@i}}
-    \wlog{}
-  \else
-    \wlog{^^J:: mathfont :: No fonts were changed by mathfont.^^J}
-  \fi}
-\tracinglostchars=1
-\ifx\XeTeXrevision\@undefined
-\else
+  \protected\gdef\clap#1{\hb at xt@\z@{\hss#1\hss}}
+  \protected\def\stack at flatrel#1#2{\expandafter
+    \st at ck@fl at trel\expandafter#1\@firstofone#2}
+  \protected\gdef\st at ck@fl at trel#1#2#3{%
+    {\setbox0\hbox{$\m at th#1#2$}% contains \mathrel symbol
+    \setbox1\hbox{$\m at th#1#3$}% gets raised over \box0
+    \if\wd0>\wd1\relax
+      \hb at xt@\wd0{%
+        \hfil
+        \clap{\raise0.7\ht0\box1}%
+        \clap{\box0}\hfil}%
+    \else
+      \hb at xt@\wd1{%
+        \hfil
+        \clap{\raise0.7\ht0\box1}%
+        \clap{\box0}\hfil}%
+    \fi}}
+\ifnum\tracinglostchars<\tw@
+  \tracinglostchars\tw@
+\fi
+\ifdefined\XeTeXrevision
   \ifM at font@loaded
     \AtEndOfPackage{%
     \PackageWarningNoLine{mathfont}
@@ -661,49 +1026,72 @@
     mathfont. If you run into problems\MessageBreak
     with a font whose name is multiple\MessageBreak
     words, try compiling with LuaLaTeX\MessageBreak
-    instead or call \string\setfont\space
-    or \string\mathfont\MessageBreak manually}}
+    or call \string\setfont\space or \string\mathfont\MessageBreak
+    manually}}
   \fi
 \fi
-\ifM at font@loaded
-  \AtEndOfPackage{%
-  \setfont\M at font@load
-  \newmathrm\mathrm\M at font@load
-  \newmathit\mathit\M at font@load
-  \newmathbf\mathbf\M at font@load
-  \newmathbfit\mathbfit\M at font@load}
-\fi
 \AtBeginDocument{%
-  \if at bb
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathbb\space may be duplicated\MessageBreak
-    inside the align environment}}{}
+  \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
-  \if at cal
+  \expandafter\egroup\if at tempswa
     \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathcal\space may be duplicated\MessageBreak
-    inside the align environment}}{}
-  \fi
-  \if at frak
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathfrak\space may be duplicated\MessageBreak
-    inside the align environment}}{}
-  \fi
-  \if at bcal
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathbcal\space may be duplicated\MessageBreak
-    inside the align environment}}{}
-  \fi
-  \if at bfrak
-    \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont}
-    {Package amsmath detected. Some warning\MessageBreak
-    messages for \string\mathbfrak\space may be duplicated\MessageBreak
-    inside the align environment}}{}
+    {\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
+    \wlog{#1:#2\@spaces Set to
+      \csname M@#1 at fontinfo\endcsname,
+      \csname M@#1shape\endcsname\space shape.}
+  \else
+    \wlog{#1:#2\@spaces No change.}
+  \fi}
+\AtBeginDocument{%
+  \def\@tempa{%    <---- everything should be 13 characters long plus :
+    upper:\@spaces\@spaces,%
+    lower:\@spaces\@spaces,%
+    diacritics:\space\space\space,%
+    greekupper:\space\space\space,%
+    greeklower:\space\space\space,%
+    agreekupper:\space\space,%
+    agreeklower:\space\space,%
+    cyrillicupper:,%
+    cyrilliclower:,%
+    hebrew:\@spaces\space\space\space,%
+    digits:\@spaces\space\space\space,%
+    operator:\@spaces\space,%
+    delimiters:\space\space\space,%
+    radical:\@spaces\space\space,%
+    bigops:\@spaces\space\space\space,%
+    extbigops:\@spaces,%
+    symbols:\@spaces\space\space,%
+    extsymbols:\space\space\space,%
+    arrows:\@spaces\space\space\space,%
+    bb:\@spaces\@spaces\space\space\space,%
+    cal:\@spaces\@spaces\space\space,%
+    frak:\@spaces\@spaces\space,%
+    bcal:\@spaces\@spaces\space,%
+    bfrak:\@spaces\@spaces}
+  \wlog{^^JPackage mathfont Info: List of changes made in the preamble---}
+  \@for\@i:=\@tempa\do{%
+    \expandafter\keyword at info@begindocument\@i\@nil}
+  \wlog{}}
+\ifM at font@loaded
+  \AtEndOfPackage{\setfont\M at font@load}
+\fi
 \@onlypreamble\M at upper@set
 \@onlypreamble\M at lower@set
 \@onlypreamble\M at diacritics@set
@@ -727,337 +1115,1553 @@
 \@onlypreamble\M at frak@set
 \@onlypreamble\M at bcal@set
 \@onlypreamble\M at bfrak@set
-\def\M at upper@set{%
-  \edef\M at upper{M\@uppershape\the\M at count}
-  \DeclareMathSymbol{A}{\mathalpha}{\M at upper}{`A}
-  \DeclareMathSymbol{B}{\mathalpha}{\M at upper}{`B}
-  \DeclareMathSymbol{C}{\mathalpha}{\M at upper}{`C}
-  \DeclareMathSymbol{D}{\mathalpha}{\M at upper}{`D}
-  \DeclareMathSymbol{E}{\mathalpha}{\M at upper}{`E}
-  \DeclareMathSymbol{F}{\mathalpha}{\M at upper}{`F}
-  \DeclareMathSymbol{G}{\mathalpha}{\M at upper}{`G}
-  \DeclareMathSymbol{H}{\mathalpha}{\M at upper}{`H}
-  \DeclareMathSymbol{I}{\mathalpha}{\M at upper}{`I}
-  \DeclareMathSymbol{J}{\mathalpha}{\M at upper}{`J}
-  \DeclareMathSymbol{K}{\mathalpha}{\M at upper}{`K}
-  \DeclareMathSymbol{L}{\mathalpha}{\M at upper}{`L}
-  \DeclareMathSymbol{M}{\mathalpha}{\M at upper}{`M}
-  \DeclareMathSymbol{N}{\mathalpha}{\M at upper}{`N}
-  \DeclareMathSymbol{O}{\mathalpha}{\M at upper}{`O}
-  \DeclareMathSymbol{P}{\mathalpha}{\M at upper}{`P}
-  \DeclareMathSymbol{Q}{\mathalpha}{\M at upper}{`Q}
-  \DeclareMathSymbol{R}{\mathalpha}{\M at upper}{`R}
-  \DeclareMathSymbol{S}{\mathalpha}{\M at upper}{`S}
-  \DeclareMathSymbol{T}{\mathalpha}{\M at upper}{`T}
-  \DeclareMathSymbol{U}{\mathalpha}{\M at upper}{`U}
-  \DeclareMathSymbol{V}{\mathalpha}{\M at upper}{`V}
-  \DeclareMathSymbol{W}{\mathalpha}{\M at upper}{`W}
-  \DeclareMathSymbol{X}{\mathalpha}{\M at upper}{`X}
-  \DeclareMathSymbol{Y}{\mathalpha}{\M at upper}{`Y}
-  \DeclareMathSymbol{Z}{\mathalpha}{\M at upper}{`Z}}
-\def\M at lower@set{%
-  \edef\M at lower{M\@lowershape\the\M at count}
-  \DeclareMathSymbol{a}{\mathalpha}{\M at lower}{`a}
-  \DeclareMathSymbol{b}{\mathalpha}{\M at lower}{`b}
-  \DeclareMathSymbol{c}{\mathalpha}{\M at lower}{`c}
-  \DeclareMathSymbol{d}{\mathalpha}{\M at lower}{`d}
-  \DeclareMathSymbol{e}{\mathalpha}{\M at lower}{`e}
-  \DeclareMathSymbol{f}{\mathalpha}{\M at lower}{`f}
-  \DeclareMathSymbol{g}{\mathalpha}{\M at lower}{`g}
-  \DeclareMathSymbol{h}{\mathalpha}{\M at lower}{`h}
-  \DeclareMathSymbol{i}{\mathalpha}{\M at lower}{`i}
-  \DeclareMathSymbol{\imath}{\mathalpha}{\M at lower}{"131}
-  \DeclareMathSymbol{j}{\mathalpha}{\M at lower}{`j}
-  \DeclareMathSymbol{\jmath}{\mathalpha}{\M at lower}{"237}
-  \DeclareMathSymbol{k}{\mathalpha}{\M at lower}{`k}
-  \DeclareMathSymbol{l}{\mathalpha}{\M at lower}{`l}
-  \DeclareMathSymbol{m}{\mathalpha}{\M at lower}{`m}
-  \DeclareMathSymbol{n}{\mathalpha}{\M at lower}{`n}
-  \DeclareMathSymbol{o}{\mathalpha}{\M at lower}{`o}
-  \DeclareMathSymbol{p}{\mathalpha}{\M at lower}{`p}
-  \DeclareMathSymbol{q}{\mathalpha}{\M at lower}{`q}
-  \DeclareMathSymbol{r}{\mathalpha}{\M at lower}{`r}
-  \DeclareMathSymbol{s}{\mathalpha}{\M at lower}{`s}
-  \DeclareMathSymbol{t}{\mathalpha}{\M at lower}{`t}
-  \DeclareMathSymbol{u}{\mathalpha}{\M at lower}{`u}
-  \DeclareMathSymbol{v}{\mathalpha}{\M at lower}{`v}
-  \DeclareMathSymbol{w}{\mathalpha}{\M at lower}{`w}
-  \DeclareMathSymbol{x}{\mathalpha}{\M at lower}{`x}
-  \DeclareMathSymbol{y}{\mathalpha}{\M at lower}{`y}
-  \DeclareMathSymbol{z}{\mathalpha}{\M at lower}{`z}}
+\ifM at adjust@font
+\mathnolimitsmode=4\relax
+\bgroup
+  \catcode`\~=0
+  ~catcode`~\=12
+  ~@firstofone{
+~egroup
+~def~M at number@ssert{"\n%
+  Package mathfont error: Nonnumeric charm value.\n\n%
+  I'm having trouble with a character metric.\n%
+  Your \\CharmLine or \\CharmFile contains \""..temp_string.."\"\n%
+  which is not a number. Make sure that your\n%
+  charm information is all integers, floats,\n%
+  or asterisks separated by commas or spaces.\n"}
+~def~M at index@ssert{"\n%
+  Package mathfont error: Invalid unicode index.\n\n%
+  The unicode index \""..split_string[1].."\" is invalid. Make sure\n%
+  that the first number in your \\CharmLine and in each\n%
+  line of your \\CharmFile is an integer between 0 and\n%
+  1,114,111.\n"}
+~def~M at entries@ssert{"\n%
+  Package mathfont error: Charm values too short.\n\n%
+  Your charm information for U+"..index.." needs more\n%
+  entries. Right now you have "..number_of_entries.." entries, and\n%
+  you need at least "..entries_needed..". If you aren't sure what\n%
+  to do, try adding asterisks to your \\CharmLine\n%
+  or line in your \\CharmFile.\n"}}
+\protected\def\CharmLine#1{%
+  \begingroup
+  \edef\@tempa{#1}
+  \edef\@tempa{\detokenize\expandafter{\@tempa}}
+  \@expandtwoargs\in@{"}{\@tempa}
+  \ifin@ % is " in #1?
+    \ifM at fromCharmFile
+      \M at ForbiddenCharmFile{"}
+    \else
+      \M at ForbiddenCharmLine{"}
+    \fi
+  \else
+    \@expandtwoargs\in@{\@backslashchar}{\@tempa}
+    \ifin@ % is \ in #1?
+      \ifM at fromCharmFile
+        \M at ForbiddenCharmFile{\@backslashchar}
+      \else
+        \M at ForbiddenCharmLine{\@backslashchar}
+      \fi
+    \else
+      \directlua{mathfont:add_to_charm("\@tempa")}
+    \fi
+  \fi
+  \endgroup}
+\protected\def\CharmFile#1{%
+  \begingroup
+  \M at fromCharmFiletrue
+  \immediate\openin\M at Charm{#1}
+  \def\@next{%
+    \read\M at Charm to \@tempa
+    \CharmLine\@tempa
+    \ifeof\M at Charm\else % if file has more lines?
+      \expandafter\@next
+    \fi}
+  \@next
+  \immediate\closein\M at Charm
+  \M at fromCharmFilefalse
+  \endgroup}
+\directlua{
+mathfont = {}
+function mathfont:new_type_a(index, next, data)
+  self[index] = {}
+  self[index].type = "a"
+  self[index].next = next
+  self[index].left_stretch = data[1] / 1000
+  self[index].right_stretch = data[2] / 1000
+  self[index].top_accent_stretch = data[3] / 1000
+  self[index].bot_accent_stretch = data[4] / 1000
+end
+function mathfont:new_type_e(index, smash, next, data)
+  local v = \string# next
+  self[index] = {}
+  self[index].type = "e"
+  self[index].smash = smash
+  self[index].next = next
+  self[index].total_variants = v
+  self[index].data = {}
+  for i = 1, v, 1 do
+    self[index].data[i] = {}
+    self[index].data[i].x = data[2*i-1] / 1000
+    self[index].data[i].y = data[2*i] / 1000
+  end
+  self[index].top_accent_stretch = data[2*v+1] / 1000
+  self[index].bot_accent_stretch = data[2*v+2] / 1000
+end
+function mathfont:new_type_u(index, data)
+  self[index] = {}
+  self[index].type = "u"
+  self[index].top_accent_stretch = data[1] / 1000
+  self[index].bot_accent_stretch = data[2] / 1000
+end
+function mathfont.parse_charm(charm_input)
+  local split_string = {}
+  local charm_string = charm_input
+  local temp_string = ""
+  local i = 1
+  while string.find(charm_string, " ") or string.find(charm_string, ",") do
+    local length = string.len(charm_string)
+    local first_space = string.find(charm_string, " ") or length
+    local first_comma = string.find(charm_string, ",") or length
+    local sep = first_space
+    if first_comma < first_space then
+      sep = first_comma
+    end
+    temp_string = string.sub(charm_string, 1, sep-1)
+    charm_string = string.sub(charm_string, sep+1)
+    if temp_string \noexpand~= "" then
+      if tonumber(temp_string) then % if a number, append number
+        split_string[i] = tonumber(temp_string)
+        i = i+1
+      elseif temp_string == "*" then % if asterisk, append asterisk
+        split_string[i] = temp_string
+        i = i+1
+      else % if neither, raise error
+        error(\M at number@ssert)
+      end
+    end
+  end
+  temp_string = charm_string
+  if temp_string \noexpand~= "" then
+    if tonumber(temp_string) then % if a number, append number
+      split_string[i] = tonumber(temp_string)
+    elseif temp_string == "*" then % if asterisk, append asterisk
+      split_string[i] = temp_string
+    else % if neither, raise error
+      error(\M at number@ssert)
+    end
+  end
+  local index = split_string[1]
+  if index == "*" then
+    error(\M at index@ssert)
+  end
+  local rounded = index - (index \@percentchar 1) % subtract decimal portion
+  local max = 1114111
+  assert(index == rounded and index >= 0 and index <= max, \M at index@ssert)
+  return split_string
+end
+function mathfont:add_to_charm(charm_string)
+  local charm_metrics = self.parse_charm(charm_string)
+  local index = charm_metrics[1]
+  local number_of_entries = \string# charm_metrics
+  if not self[index] then
+    self:new_type_u(index, {0, 0})
+  end
+  if self[index].type == "a" then
+    local entries_needed = 5
+    assert(number_of_entries >= entries_needed, \M at entries@ssert)
+    if charm_metrics[2] \noexpand~= "*" then
+      self[index].left_stretch = charm_metrics[2] / 1000
+    end
+    if charm_metrics[3] \noexpand~= "*" then
+      self[index].right_stretch = charm_metrics[3] / 1000
+    end
+    if charm_metrics[4] \noexpand~= "*" then
+      self[index].top_accent_stretch = charm_metrics[4] / 1000
+    end
+    if charm_metrics[5] \noexpand~= "*" then
+      self[index].bot_accent_stretch = charm_metrics[5] / 1000
+    end
+  elseif self[index].type == "e" then
+    local tot_variants = self[index].total_variants
+    local entries_needed = 2 * tot_variants + 3
+    assert(number_of_entries >= entries_needed, \M at entries@ssert)
+    for i = 1, tot_variants, 1 do
+      if charm_metrics[2*i] \noexpand~= "*" then
+        self[index].data[i].x = charm_metrics[2*i] / 1000
+      end
+      if charm_metrics[2*i+1] \noexpand~= "*" then
+        self[index].data[i].y = charm_metrics[2*i+1] / 1000
+      end
+    end
+    if charm_metrics[2*tot_variants+2] \noexpand~= "*" then
+      self[index].top_accent_stretch = charm_metrics[2*tot_variants+2] / 1000
+    end
+    if charm_metrics[2*tot_variants+3] \noexpand~= "*" then
+      self[index].bot_accent_stretch = charm_metrics[2*tot_variants+3] / 1000
+    end
+  elseif self[index].type == "u" then
+    local entries_needed = 3
+    assert(number_of_entries >= entries_needed, \M at entries@ssert)
+    if charm_metrics[2] \noexpand~= "*" then
+      self[index].top_accent_stretch = charm_metrics[2] / 1000
+    end
+    if charm_metrics[3] \noexpand~= "*" then
+      self[index].bot_accent_stretch = charm_metrics[3] / 1000
+    end
+  end
+end
+function mathfont.make_hex_value(integer)
+  if integer == 0 then
+    return "0000"
+  end
+  if integer == 1 then
+    return "0001"
+  end
+  local hex_digits = "0123456789ABCDEF" % for reference
+  local hex_string = ""
+  local curr_val = integer
+  local remainder = 0
+  local i = 0
+  while 16^i <= curr_val do
+    i = i+1
+  end
+  for j = i-1, 0, -1 do
+    remainder = curr_val \@percentchar (16^j)
+    curr_val = (curr_val - remainder) / (16^j)
+    hex_string = hex_string .. string.sub(hex_digits, curr_val+1, curr_val+1)
+    curr_val = remainder
+  end
+  if \string# hex_string < 4 then
+    for i = \string# hex_string, 4, 1 do
+      hex_string = "0" .. hex_string
+    end
+  end
+  return hex_string
+end
+function mathfont.glyph_info(char)
+  local glyph_width = char.width or 0
+  local glyph_height = char.height or 0
+  local glyph_depth = char.depth or 0
+  local glyph_italic = char.italic or 0
+  return glyph_width, glyph_height, glyph_depth, glyph_italic
+end
+function mathfont:smash_glyph(index, fontdata)
+  local smash_table = {}
+  smash_table.width = 0
+  smash_table.height = 0
+  smash_table.depth = 0
+  smash_table.commands = {{"char", index}}
+  return smash_table
+end
+function mathfont.empty(arg)
+end
+function mathfont.make_a_commands(index, offset)
+  local c_1 = {"right", offset}
+  local c_2 = {"char", index}
+  return {c_1, c_2}
+end
+function mathfont:make_a_table(index, charm_data, fontdata)
+  local a_table = {}
+  local char = fontdata.characters[index] or {}
+  local slant = fontdata.parameters.slant / 65536 or 0
+  local left_stretch = charm_data.left_stretch
+  local right_stretch = charm_data.right_stretch
+  local width, height, depth, italic = self.glyph_info(char)
+  width = width + italic
+  local offset = width * left_stretch
+  a_table.width = width * (1 + left_stretch + right_stretch)
+  a_table.height = height
+  a_table.depth = depth
+  a_table.italic = italic
+  a_table.unicode = index
+  a_table.tounicode = self.make_hex_value(index)
+  local top_base = (0.5 + left_stretch) * width + 0.5 * slant * height
+  local bot_base = (0.5 + left_stretch) * width - 0.5 * slant * height
+  local top_accent_shift = charm_data.top_accent_stretch * width
+  local bot_accent_shift = charm_data.bot_accent_stretch * width
+  a_table.top_accent = top_base + top_accent_shift
+  a_table.bot_accent = bot_base + bot_accent_shift
+  a_table.commands = self.make_a_commands(index, offset)
+  a_table.mathkern = {}
+  a_table.mathkern.top_right = {{height = 0, kern = -italic}}
+  a_table.mathkern.bottom_right = {{height = 0, kern = -italic}}
+  a_table.mathkern.top_left = {{height = 0, kern = 0}}
+  a_table.mathkern.bottom_left = {{height = 0, kern = 0}}
+  return a_table
+end
+function mathfont:modify_e_base(index, fontdata)
+  local char = fontdata.characters[index] or {}
+  local width, height, depth, italic = self.glyph_info(char)
+  char.width = width + italic
+  if index == 8730 then
+    local horizontal_scale = tex.getcount("M at surd@horizontal at factor") / 1000
+    local vertical_scale = tex.getcount("M at surd@vertical at factor") / 1000
+    char.width = horizontal_scale * char.width
+    char.height = vertical_scale * height
+  end
+  if index == 8747 then
+    local scale_factor = tex.getcount("M at integral@italic at factor") / 1000
+    char.italic = scale_factor * width
+  end
+end
+function mathfont.make_e_commands(index, h_stretch, v_stretch)
+  local c_1 = {"pdf", "origin", string.format(
+    "q \@percentchar s 0 0 \@percentchar s 0 0 cm", h_stretch, v_stretch)}
+  local c_2 = {"char", index}
+  local c_3 = {"pdf", "origin", "Q"}
+  return {c_1, c_2, c_3}
+end
+function mathfont:make_e_table(index, charm_data, fontdata)
+  local e_table = {}
+  local char = fontdata.characters[index] or {}
+  local slant = fontdata.parameters.slant / 65536
+  local tounicode = self.make_hex_value(index)
+  local smash_index = charm_data.smash
+  local width, height, depth, italic = self.glyph_info(char)
+  for i = 1, charm_data.total_variants, 1 do
+    local h_stretch = charm_data.data[i].x
+    local v_stretch = charm_data.data[i].y
+    local new_width = width * h_stretch
+    local new_height = height * v_stretch
+    local new_depth = depth * v_stretch
+    local new_italic = italic * h_stretch
+    e_table[i] = {}
+    e_table[i].width = new_width
+    e_table[i].height = new_height
+    e_table[i].depth = new_depth
+    e_table[i].italic = new_italic
+    e_table[i].unicode = index
+    e_table[i].tounicode = tounicode
+    local base_top_accent = 0.5 * new_width + 0.5 * slant * new_height
+    local base_bot_accent = 0.5 * new_width - 0.5 * slant * new_height
+    local top_accent_shift = charm_data.top_accent_stretch * new_width
+    local bot_accent_shift = charm_data.bot_accent_stretch * new_width
+    e_table[i].top_accent = base_top_accent + top_accent_shift
+    e_table[i].bot_accent = base_bot_accent + bot_accent_shift
+    e_table[i].commands =
+      self.make_e_commands(smash_index, h_stretch, v_stretch)
+    if i < charm_data.total_variants then
+      e_table[i].next = charm_data.next[i+1]
+    end
+  end
+  return e_table
+end
+function mathfont:make_u_table(index, charm_data, fontdata)
+  local u_table = fontdata.characters[index] or {}
+  local slant = fontdata.parameters.slant / 65536 or 0
+  local width, height, depth, italic = self.glyph_info(u_table)
+  local new_width = width + italic
+  u_table.width = new_width
+  local base_top_accent = 0.5 * new_width + 0.5 * slant * height
+  local base_bot_accent = 0.5 * new_width - 0.5 * slant * height
+  local top_accent_shift = charm_data.top_accent_stretch * new_width
+  local bot_accent_shift = charm_data.bot_accent_stretch * new_width
+  u_table.top_accent = base_top_accent + top_accent_shift
+  u_table.bot_accent = base_bot_accent + bot_accent_shift
+  u_table.mathkern = {}
+  u_table.mathkern.top_right = {{height = 0, kern = -italic}}
+  u_table.mathkern.bottom_right = {{height = 0, kern = -italic}}
+  u_table.mathkern.top_left = {{height = 0, kern = 0}}
+  u_table.mathkern.bottom_left = {{height = 0, kern = 0}}
+  return u_table
+end
+function mathfont.make_fake_angle(index, smash, fontdata)
+  local temp = {}
+  local lparen = fontdata.characters[40] or {}
+  local lparen_height = lparen.height or 0
+  local lparen_depth = lparen.depth or 0
+  local glyph = fontdata.characters[index] or {}
+  local glyph_height = glyph.height or 0
+  local base_height = 0.9 * glyph_height
+  local factor = 0
+  if glyph_height \noexpand~= 0 then
+    factor = (lparen_height + lparen_depth) / base_height
+  end
+  local shift = 0.1 * glyph_height * factor + lparen_depth
+  temp.height = lparen_height
+  temp.depth = lparen_depth
+  temp.width = glyph.width or 0
+  temp.italic = glyph.italic or 0
+  temp.top_accent = glyph.top_accent or 0.5 * temp.width
+  temp.bot_accent = glyph.bot_accent or 0.5 * temp.width
+  temp.commands = {
+    {"down", shift},
+    {"pdf", "origin", string.format("q 1 0 0 \@percentchar s 0 0 cm", factor)},
+    {"char", smash},
+    {"pdf", "origin", "Q"},
+    {"down", -shift}}
+  return temp
+end
+function mathfont.set_nomath_true(fontdata)
+  fontdata.nomath = false
+  fontdata.oldmath = false
+end
+function mathfont.apply_charm_info(fontdata)
+  local chars = fontdata.characters or {}
+  chars[1044538] = mathfont:smash_glyph(8249, fontdata) % \lguil
+  chars[1044539] = mathfont:smash_glyph(8250, fontdata) % \rguil
+  chars[1044540] = mathfont:smash_glyph(171, fontdata) % \llguil
+  chars[1044541] = mathfont:smash_glyph(187, fontdata) % \rrguil
+  chars[1044508] = mathfont.make_fake_angle(8249, 1044538, fontdata)
+  chars[1044509] = mathfont.make_fake_angle(8250, 1044539, fontdata)
+  chars[1044510] = mathfont.make_fake_angle(171, 1044540, fontdata)
+  chars[1044511] = mathfont.make_fake_angle(187, 1044541, fontdata)
+  if not chars[8711] then
+    chars[8710] = chars[8710] or {}
+    chars[1044508] = mathfont:smash_glyph(8710, fontdata)
+    chars[8711] = {}
+    chars[8711].width = chars[8710].width or 0
+    chars[8711].height = chars[8710].height or 0
+    chars[8711].depth = chars[8710].depth or 0
+    chars[8711].italic = chars[8710].italic or 0
+    chars[8711].top_accent = chars[8710].top_accent or 0.5 * chars[8711].width
+    chars[8711].bot_accent = chars[8710].bot_accent or 0.5 * chars[8711].width
+    chars[8711].unicode = 8711
+    chars[8711].tounicode = mathfont.make_hex_value(8711)
+    chars[8711].commands = {
+      {"down", -chars[8711].height},
+      {"pdf", "origin", "q 1 0 0 -1 0 0 cm"},
+      {"char", 1044508},
+      {"pdf", "origin", "Q"},
+      {"down", chars[8711].height}}
+  end
+  for index, info in pairs(mathfont) do
+    if type(info) == "table" then
+      if info.type == "a" then
+        chars[info.next] = mathfont:make_a_table(index, info, fontdata)
+      elseif info.type == "e" then
+        local smash = info.smash
+        chars[index] = chars[index] or {}
+        chars[index].next = info.next[1]
+        mathfont:modify_e_base(index, fontdata)
+        chars[smash] = mathfont:smash_glyph(index, fontdata)
+        local variants_table = mathfont:make_e_table(index, info, fontdata)
+        for i = 1, info.total_variants, 1 do
+          chars[info.next[i]] = variants_table[i]
+        end
+      elseif info.type == "u" then
+        chars[index] = mathfont:make_u_table(index, info, fontdata)
+      end
+    end
+  end
+end
+function mathfont.math_constants(fontdata)
+  fontdata.MathConstants = fontdata.MathConstants or {}
+  local size = fontdata.size or 0
+  local ex = fontdata.parameters.x_height or 0
+  local em = fontdata.parameters.quad or 0
+  local A_height = 0
+  local y_depth = 0
+  if fontdata.characters[65] then
+    A_height = fontdata.characters[65].height or 0 % A
+  end
+  if fontdata.characters[121] then
+    y_depth = fontdata.characters[121].depth or 0 % y
+  end
+  local axis = 0
+  local rule_thickness = 0
+  local dim = "FractionRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    local scale_factor = tex.getcount("M at rule@thickness at factor") / 1000
+    rule_thickness = (size / 18) * scale_factor
+    fontdata.MathConstants[dim] = rule_thickness
+  else
+    rule_thickness = fontdata.MathConstants[dim]
+  end
+  local dim = "AxisHeight"
+  if fontdata.MathConstants[dim] then
+    axis = fontdata.MathConstants[dim]
+  else
+    if fontdata.characters[45] then
+      axis = fontdata.characters[45].height - 0.5 * rule_thickness
+    else
+      axis = 0.8 * ex
+    end
+    fontdata.MathConstants[dim] = axis
+  end
+  local xi_9 = 2 * rule_thickness              % upper limit minimum clearance
+  local xi_10 = xi_9 + 0.35 * y_depth          % upper limit attempt placement
+  local xi_11 = xi_10                          % lower limit minimum clearance
+  local xi_12 = xi_10 + 0.35 * (A_height + ex) % lower limit attempt placement
+  local sigma_8 = axis + 1.5 * rule_thickness + y_depth + 0.1 * A_height
+  local sigma_9 = (axis + 1.35 * rule_thickness + 0.7 * y_depth +
+    0.07 * A_height)
+  local sigma_10 = sigma_9
+  local sigma_11 = (-axis + 1.5  * rule_thickness + 0.5 * y_depth +
+    1.1 * A_height)
+  local sigma_12 = (-axis + 1.35 * rule_thickness + 0.35 * y_depth +
+    0.77 * A_height)
+  local sigma_13 = 0.6 * A_height     % attempted superscript height
+  local sigma_15 = 0.5 * A_height     % attempted superscript for \cramped
+  local sigma_16 = 1.1 * y_depth      % attempted subscript lower
+  if sigma_16 < 0.2 * A_height then
+    sigma_16 = 0.2 * A_height
+  end
+  local sigma_17 = sigma_16           % sigma_16 when superscript present
+  local sigma_18 = 0.5 * A_height     % superscript lower for boxed subformula
+  local sigma_19 = 0.1 * A_height     % subscript lower for boxed subformula
+  local dim = "DisplayOperatorMinHeight"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 1.8 * A_height
+  end
+  local dim = "FractionDelimiterDisplayStyleSize"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * size
+  end
+  local dim = "FractionDelimiterSize"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 1.3 * size
+  end
+  local dim = "FractionDenominatorDisplayStyleShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_11
+  end
+  local dim = "FractionDenominatorShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_12
+  end
+  local dim = "FractionDenominatorDisplayStyleGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness + 0.5 * y_depth
+  end
+  local dim = "FractionDenominatorGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness + 0.35 * y_depth
+  end
+  local dim = "FractionNumeratorDisplayStyleShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_8
+  end
+  local dim = "FractionNumeratorShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_9
+  end
+  local dim = "FractionNumeratorDisplayStyleGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "FractionNumeratorGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "SkewedFractionHorizontalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0.5 * em
+  end
+  local dim = "SkewedFractionVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = ex
+  end
+  local dim = "UpperLimitBaselineRiseMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_11
+  end
+  local dim = "UpperLimitGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_9
+  end
+  local dim = "LowerLimitBaselineDropMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_12
+  end
+  local dim = "LowerLimitGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_10
+  end
+  local dim = "StretchStackGapBelowMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_10
+  end
+  local dim = "StretchStackTopShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_11
+  end
+  local dim = "StretchStackGapAboveMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_9
+  end
+  local dim = "StretchStackBottomShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = xi_12
+  end
+  local dim = "OverbarExtraAscender"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "OverbarRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "OverbarVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * rule_thickness
+  end
+  local dim = "RadicalExtraAscender"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "RadicalRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "RadicalDisplayStyleVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * rule_thickness
+  end
+  local dim = "RadicalVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "RadicalKernBeforeDegree"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = (5/18) * em
+  end
+  local dim = "RadicalKernAfterDegree"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = (10/18) * em
+  end
+  local dim = "RadicalDegreeBottomRaisePercent"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 60
+  end
+  local dim = "SpaceAfterScript"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0.1 * em
+  end
+  local dim = "StackBottomDisplayStyleShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_11
+  end
+  local dim = "StackBottomShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_12
+  end
+  local dim = "StackTopDisplayStyleShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_8
+  end
+  local dim = "StackTopShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_10
+  end
+  local dim = "StackDisplayStyleGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 5 * rule_thickness + 0.5 * y_depth
+  end
+  local dim = "StackGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 3 * rule_thickness + 0.35 * y_depth
+  end
+  local dim = "SubscriptShiftDown"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_16
+  end
+  local dim = "SubscriptBaselineDropMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_19
+  end
+  local dim = "SubscriptShiftDownWithSuperscript"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_17
+  end
+  local dim = "SubscriptTopMax"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0.5 * A_height
+  end
+  local dim = "SubSuperscriptGapMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "SuperscriptBottomMin"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_15 - 0.7 * y_depth
+  end
+  local dim = "SuperscriptBaselineDropMax"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_18
+  end
+  local dim = "SuperscriptShiftUp"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_13
+  end
+  local dim = "SuperscriptShiftUpCramped"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = sigma_15
+  end
+  local dim = "SuperscriptBottomMaxWithSubscript"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = -sigma_16 + 0.7 * A_height + rule_thickness
+  end
+  local dim = "UnderbarExtraDescender"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "UnderbarRuleThickness"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = rule_thickness
+  end
+  local dim = "UnderbarVerticalGap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 2 * rule_thickness
+  end
+  local dim = "MinConnectorOverlap"
+  if not fontdata.MathConstants[dim] then
+    fontdata.MathConstants[dim] = 0
+  end
+end
+luatexbase.create_callback("mathfont.inspect_font", "simple", mathfont.empty)
+luatexbase.create_callback("mathfont.pre_adjust", "simple", mathfont.empty)
+luatexbase.create_callback("mathfont.disable_nomath", "simple",
+  mathfont.set_nomath_true)
+luatexbase.create_callback("mathfont.add_math_constants", "simple",
+  mathfont.math_constants)
+luatexbase.create_callback("mathfont.fix_character_metrics", "simple",
+  mathfont.apply_charm_info)
+luatexbase.create_callback("mathfont.post_adjust", "simple", mathfont.empty)
+function mathfont.info(msg)
+  texio.write_nl("log", "Package mathfont Info: " .. msg)
+end
+function mathfont.get_font_name(fontdata)
+  return fontdata.fullname or fontdata.psname or fontdata.name or "<??>"
+end
+function mathfont.adjust_font(fontdata)
+  luatexbase.call_callback("mathfont.inspect_font", fontdata)
+  if fontdata.nomath then
+    mathfont.info("Adjusting font " .. mathfont.get_font_name(fontdata) .. ".")
+    luatexbase.call_callback("mathfont.pre_adjust", fontdata)
+    luatexbase.call_callback("mathfont.disable_nomath", fontdata)
+    luatexbase.call_callback("mathfont.add_math_constants", fontdata)
+    luatexbase.call_callback("mathfont.fix_character_metrics", fontdata)
+    luatexbase.call_callback("mathfont.post_adjust", fontdata)
+  else
+    mathfont.info("No changes made to " ..
+      mathfont.get_font_name(fontdata) .. ".")
+  end
+end
+luatexbase.add_to_callback("luaotfload.patch_font", mathfont.adjust_font,
+  "mathfont.adjust_font")
+mathfont:new_type_a(97, 1044480, {50, 50, -50, 0}) % a
+mathfont:new_type_a(98, 1044481, {50, 50, -50, 0}) % b
+mathfont:new_type_a(99, 1044482, {50, 50, 0, 0}) % c
+mathfont:new_type_a(100, 1044483, {50, -50, -50, 0}) % d
+mathfont:new_type_a(101, 1044484, {50, 50, 0, 0}) % e
+mathfont:new_type_a(102, 1044485, {200, 0, 0, 0}) % f
+mathfont:new_type_a(103, 1044486, {100, 50, -50, 0}) % g
+mathfont:new_type_a(104, 1044487, {50, 0, -50, 0}) % h
+mathfont:new_type_a(105, 1044488, {50, 100, -100, 0}) % i
+mathfont:new_type_a(106, 1044489, {400, 50, -50, 0}) % j
+mathfont:new_type_a(107, 1044490, {50, 50, -100, 0}) % k
+mathfont:new_type_a(108, 1044491, {100, 150, -100, 0}) % l
+mathfont:new_type_a(109, 1044492, {50, 0, 0, 0}) % m
+mathfont:new_type_a(110, 1044493, {50, 0, 0, 0}) % n
+mathfont:new_type_a(111, 1044494, {50, 0, 0, 0}) % o
+mathfont:new_type_a(112, 1044495, {200, 50, -50, 0}) % p
+mathfont:new_type_a(113, 1044496, {50, 0, -50, 0}) % q
+mathfont:new_type_a(114, 1044497, {100, 100, -50, 0}) % r
+mathfont:new_type_a(115, 1044498, {50, 50, -50, 0}) % s
+mathfont:new_type_a(116, 1044499, {50, 50, -50, 0}) % t
+mathfont:new_type_a(117, 1044500, {0, 50, 0, 0}) % u
+mathfont:new_type_a(118, 1044501, {0, 50, -50, 0}) % v
+mathfont:new_type_a(119, 1044502, {0, 50, 0, 0}) % w
+mathfont:new_type_a(120, 1044503, {50, 0, -50, 0}) % x
+mathfont:new_type_a(121, 1044504, {150, 50, -50, 0}) % y
+mathfont:new_type_a(122, 1044505, {100, 50, -100, 0}) % z
+mathfont:new_type_a(305, 1044506, {100, 100, -150, 0}) % \imath
+mathfont:new_type_a(567, 1044507, {700, 50, -150, 0}) % \jmath
+mathfont:new_type_a(65, 1044512, {50, 0, 150, 0}) % A
+mathfont:new_type_a(66, 1044513, {50, 0, 0, 0}) % B
+mathfont:new_type_a(67, 1044514, {0, 0, 0, 0}) % C
+mathfont:new_type_a(68, 1044515, {50, 0, -50, 0}) % D
+mathfont:new_type_a(69, 1044516, {50, 0, 0, 0}) % E
+mathfont:new_type_a(70, 1044517, {50, 0, 0, 0}) % F
+mathfont:new_type_a(71, 1044518, {0, 0, 0, 0}) % G
+mathfont:new_type_a(72, 1044519, {50, 0, -50, 0}) % H
+mathfont:new_type_a(73, 1044520, {100, 0, 0, 0}) % I
+mathfont:new_type_a(74, 1044521, {50, 0, 100, 0}) % J
+mathfont:new_type_a(75, 1044522, {50, 0, 0, 0}) % K
+mathfont:new_type_a(76, 1044523, {50, 0, -180, 0}) % L
+mathfont:new_type_a(77, 1044524, {50, 0, -50, 0}) % M
+mathfont:new_type_a(78, 1044525, {50, 0, -50, 0}) % N
+mathfont:new_type_a(79, 1044526, {0, 0, 0, 0}) % O
+mathfont:new_type_a(80, 1044527, {0, 0, -50, 0}) % P
+mathfont:new_type_a(81, 1044528, {0, 50, 0, 0}) % Q
+mathfont:new_type_a(82, 1044529, {50, 0, -50, 0}) % R
+mathfont:new_type_a(83, 1044530, {0, 0, -50, 0}) % S
+mathfont:new_type_a(84, 1044531, {0, 0, -50, 0}) % T
+mathfont:new_type_a(85, 1044532, {0, 0, -50, 0}) % U
+mathfont:new_type_a(86, 1044533, {0, 50, 0, 0}) % V
+mathfont:new_type_a(87, 1044534, {0, 50, -50, 0}) % W
+mathfont:new_type_a(88, 1044535, {50, 0, 0, 0}) % X
+mathfont:new_type_a(89, 1044536, {0, 0, -50, 0}) % Y
+mathfont:new_type_a(90, 1044537, {50, 0, -50, 0}) % Z
+mathfont:new_type_u(945, {0, 0}) % \alpha
+mathfont:new_type_u(946, {0, 0}) % \beta
+mathfont:new_type_u(947, {-50, 0}) % \gamma
+mathfont:new_type_u(948, {0, 0}) % \delta
+mathfont:new_type_u(1013, {50, 0}) % \epsilon
+mathfont:new_type_u(950, {0, 0}) % \zeta
+mathfont:new_type_u(951, {-50, 0}) % \eta
+mathfont:new_type_u(952, {0, 0}) % \theta
+mathfont:new_type_u(953, {-50, 0}) % \iota
+mathfont:new_type_u(954, {0, 0}) % \kappa
+mathfont:new_type_u(955, {-150, 0}) % lambda
+mathfont:new_type_u(956, {0, 0}) % \mu
+mathfont:new_type_u(957, {-50, 0}) % \nu
+mathfont:new_type_u(958, {0, 0}) % \xi
+mathfont:new_type_u(959, {0, 0}) % \omicron
+mathfont:new_type_u(960, {-100, 0}) % \pi
+mathfont:new_type_u(961, {-50, 0}) % \rho
+mathfont:new_type_u(963, {-100, 0}) % \sigma
+mathfont:new_type_u(964, {-100, 0}) % \tau
+mathfont:new_type_u(965, {-50, 0}) % \upsilon
+mathfont:new_type_u(981, {0, 0}) % \phi
+mathfont:new_type_u(967, {-50, 0}) % \chi
+mathfont:new_type_u(968, {-50, 0}) % \psi
+mathfont:new_type_u(969, {0, 0}) % \omega
+mathfont:new_type_u(976, {0, 0}) % \varbeta
+mathfont:new_type_u(949, {-50, 0}) % \varepsilon
+mathfont:new_type_u(977, {50, 0}) % \vartheta
+mathfont:new_type_u(1009, {-50, 0}) % \varrho
+mathfont:new_type_u(962, {-50, 0}) % \varsigma
+mathfont:new_type_u(966, {0, 0}) % \varphi
+mathfont:new_type_u(913, {0, 0}) % \Alpha
+mathfont:new_type_u(914, {0, 0}) % \Beta
+mathfont:new_type_u(915, {0, 0}) % \Gamma
+mathfont:new_type_u(916, {0, 0}) % \Delta
+mathfont:new_type_u(917, {0, 0}) % \Epsilon
+mathfont:new_type_u(918, {0, 0}) % \Zeta
+mathfont:new_type_u(919, {0, 0}) % \Eta
+mathfont:new_type_u(920, {0, 0}) % \Theta
+mathfont:new_type_u(921, {0, 0}) % \Iota
+mathfont:new_type_u(922, {0, 0}) % \Kappa
+mathfont:new_type_u(923, {0, 0}) % \Lambda
+mathfont:new_type_u(924, {0, 0}) % \Mu
+mathfont:new_type_u(925, {0, 0}) % \Nu
+mathfont:new_type_u(926, {0, 0}) % \Xi
+mathfont:new_type_u(927, {0, 0}) % \Omicron
+mathfont:new_type_u(928, {0, 0}) % \Pi
+mathfont:new_type_u(929, {0, 0}) % \Rho
+mathfont:new_type_u(931, {0, 0}) % \Sigma
+mathfont:new_type_u(932, {0, 0}) % \Tau
+mathfont:new_type_u(933, {0, 0}) % \Upsilon
+mathfont:new_type_u(934, {0, 0}) % \Phi
+mathfont:new_type_u(935, {0, 0}) % \Chi
+mathfont:new_type_u(936, {0, 0}) % \Psi
+mathfont:new_type_u(937, {0, 0}) % \Omega
+mathfont:new_type_u(1012, {0, 0}) % \varTheta
+local delim_glyphs = {40, % (
+  41, % )
+  47, % /
+  91, % [
+  92, % \
+  93, % ]
+  123, % {
+  125, % }
+  8249, % \lguil
+  8250, % \rguil
+  171, % \llguil
+  187, % \rrguil
+  1044508, % \fakelangle
+  1044509, % \fakerangle
+  1044510, % \fakellangle
+  1044511} % \fakerrangle
+local big_op_glyphs = {33, % !
+  35, % #
+  36, % $
+  37, % %
+  38, % &
+  43, % +
+  63, % ?
+  64, % @
+  167, % \S
+  215, % \times
+  247, % \div
+  8719, % \prod
+  8721, % \sum
+  8720, % \coprod
+  8897, % \bigvee
+  8896, % \bigwedge
+  8899, % \bigcup
+  8898, % \bigcap
+  10753, % \bigoplus
+  10754, % \bigotimes
+  10752, % \bigodot
+  10757, % \bigsqcap
+  10758} % \bigsqcup
+local vert_glyphs = {124, 8730} % | and \surd
+local int_glyphs = {8747, % \intop
+  8748, % \iint
+  8749, % \iiint
+  8750, % \oint
+  8751, % \oiint
+  8752} % \oiiint
+local smash = 1044544
+local delim_scale = {}
+local big_op_scale = {}
+local vert_scale = {}
+local int_scale = {}
+for i = 1, 15, 1 do
+  delim_scale[2*i-1] = 1000 + 100*i % horizontal - delimiters
+  delim_scale[2*i] = 1000 + 500*i   % vertical - delimiters
+  vert_scale[2*i-1] = 1000
+  vert_scale[2*i] = 1000 + 500*i    % vertical - vertically scaled chars
+  big_op_scale[2*i-1] = 1000 + 100*i   % horizontal - big operators
+  big_op_scale[2*i] = 1000 + 100*i     % vertical - big operators
+  int_scale[2*i-1] = 1000 + 500*i     % horizontal - integral sign
+  int_scale[2*i] = 1000 + 1500*i      % vertical - integral sign
+end
+delim_scale[31] = 0
+delim_scale[32] = 0
+big_op_scale[31] = 0
+big_op_scale[32] = 0
+vert_scale[31] = 0
+vert_scale[32] = 0
+int_scale[31] = 0
+int_scale[32] = 0
+function mathfont:add_extensible_variants(first_smash, glyph_list, scale_list)
+  local variants = (\string# scale_list - 2) / 2
+  local curr_smash = first_smash
+  for i = 1, \string# glyph_list, 1 do
+    local curr_char = glyph_list[i]
+    local curr_slots = {}
+    for j = 1, variants, 1 do
+      curr_slots[j] = curr_smash + j
+    end
+    self:new_type_e(curr_char, curr_smash, curr_slots, scale_list)
+    smash = smash + variants + 1
+    curr_smash = smash
+  end
+end
+mathfont:add_extensible_variants(smash, delim_glyphs, delim_scale)
+mathfont:add_extensible_variants(smash, big_op_glyphs, big_op_scale)
+mathfont:add_extensible_variants(smash, vert_glyphs, vert_scale)
+mathfont:add_extensible_variants(smash, int_glyphs, int_scale)
+}
+\fi % matches previous \ifM at adjust@font
+\ifM at adjust@font
+  \def\M at upper@set{%
+    \edef\M at upper@font{M\M at uppershape\@tempa}
+    \DeclareMathSymbol{A}{\mathalpha}{\M at upper@font}{1044512}
+    \DeclareMathSymbol{B}{\mathalpha}{\M at upper@font}{1044513}
+    \DeclareMathSymbol{C}{\mathalpha}{\M at upper@font}{1044514}
+    \DeclareMathSymbol{D}{\mathalpha}{\M at upper@font}{1044515}
+    \DeclareMathSymbol{E}{\mathalpha}{\M at upper@font}{1044516}
+    \DeclareMathSymbol{F}{\mathalpha}{\M at upper@font}{1044517}
+    \DeclareMathSymbol{G}{\mathalpha}{\M at upper@font}{1044518}
+    \DeclareMathSymbol{H}{\mathalpha}{\M at upper@font}{1044519}
+    \DeclareMathSymbol{I}{\mathalpha}{\M at upper@font}{1044520}
+    \DeclareMathSymbol{J}{\mathalpha}{\M at upper@font}{1044521}
+    \DeclareMathSymbol{K}{\mathalpha}{\M at upper@font}{1044522}
+    \DeclareMathSymbol{L}{\mathalpha}{\M at upper@font}{1044523}
+    \DeclareMathSymbol{M}{\mathalpha}{\M at upper@font}{1044524}
+    \DeclareMathSymbol{N}{\mathalpha}{\M at upper@font}{1044525}
+    \DeclareMathSymbol{O}{\mathalpha}{\M at upper@font}{1044526}
+    \DeclareMathSymbol{P}{\mathalpha}{\M at upper@font}{1044527}
+    \DeclareMathSymbol{Q}{\mathalpha}{\M at upper@font}{1044528}
+    \DeclareMathSymbol{R}{\mathalpha}{\M at upper@font}{1044529}
+    \DeclareMathSymbol{S}{\mathalpha}{\M at upper@font}{1044530}
+    \DeclareMathSymbol{T}{\mathalpha}{\M at upper@font}{1044531}
+    \DeclareMathSymbol{U}{\mathalpha}{\M at upper@font}{1044532}
+    \DeclareMathSymbol{V}{\mathalpha}{\M at upper@font}{1044533}
+    \DeclareMathSymbol{W}{\mathalpha}{\M at upper@font}{1044534}
+    \DeclareMathSymbol{X}{\mathalpha}{\M at upper@font}{1044535}
+    \DeclareMathSymbol{Y}{\mathalpha}{\M at upper@font}{1044536}
+    \DeclareMathSymbol{Z}{\mathalpha}{\M at upper@font}{1044537}}
+\else
+  \def\M at upper@set{%
+    \edef\M at upper@font{M\M at uppershape\@tempa}
+    \DeclareMathSymbol{A}{\mathalpha}{\M at upper@font}{`A}
+    \DeclareMathSymbol{B}{\mathalpha}{\M at upper@font}{`B}
+    \DeclareMathSymbol{C}{\mathalpha}{\M at upper@font}{`C}
+    \DeclareMathSymbol{D}{\mathalpha}{\M at upper@font}{`D}
+    \DeclareMathSymbol{E}{\mathalpha}{\M at upper@font}{`E}
+    \DeclareMathSymbol{F}{\mathalpha}{\M at upper@font}{`F}
+    \DeclareMathSymbol{G}{\mathalpha}{\M at upper@font}{`G}
+    \DeclareMathSymbol{H}{\mathalpha}{\M at upper@font}{`H}
+    \DeclareMathSymbol{I}{\mathalpha}{\M at upper@font}{`I}
+    \DeclareMathSymbol{J}{\mathalpha}{\M at upper@font}{`J}
+    \DeclareMathSymbol{K}{\mathalpha}{\M at upper@font}{`K}
+    \DeclareMathSymbol{L}{\mathalpha}{\M at upper@font}{`L}
+    \DeclareMathSymbol{M}{\mathalpha}{\M at upper@font}{`M}
+    \DeclareMathSymbol{N}{\mathalpha}{\M at upper@font}{`N}
+    \DeclareMathSymbol{O}{\mathalpha}{\M at upper@font}{`O}
+    \DeclareMathSymbol{P}{\mathalpha}{\M at upper@font}{`P}
+    \DeclareMathSymbol{Q}{\mathalpha}{\M at upper@font}{`Q}
+    \DeclareMathSymbol{R}{\mathalpha}{\M at upper@font}{`R}
+    \DeclareMathSymbol{S}{\mathalpha}{\M at upper@font}{`S}
+    \DeclareMathSymbol{T}{\mathalpha}{\M at upper@font}{`T}
+    \DeclareMathSymbol{U}{\mathalpha}{\M at upper@font}{`U}
+    \DeclareMathSymbol{V}{\mathalpha}{\M at upper@font}{`V}
+    \DeclareMathSymbol{W}{\mathalpha}{\M at upper@font}{`W}
+    \DeclareMathSymbol{X}{\mathalpha}{\M at upper@font}{`X}
+    \DeclareMathSymbol{Y}{\mathalpha}{\M at upper@font}{`Y}
+    \DeclareMathSymbol{Z}{\mathalpha}{\M at upper@font}{`Z}}
+\fi
+\ifM at adjust@font
+  \def\M at lower@set{%
+    \edef\M at lower@font{M\M at lowershape\@tempa}
+    \DeclareMathSymbol{a}{\mathalpha}{\M at lower@font}{1044480}
+    \DeclareMathSymbol{b}{\mathalpha}{\M at lower@font}{1044481}
+    \DeclareMathSymbol{c}{\mathalpha}{\M at lower@font}{1044482}
+    \DeclareMathSymbol{d}{\mathalpha}{\M at lower@font}{1044483}
+    \DeclareMathSymbol{e}{\mathalpha}{\M at lower@font}{1044484}
+    \DeclareMathSymbol{f}{\mathalpha}{\M at lower@font}{1044485}
+    \DeclareMathSymbol{g}{\mathalpha}{\M at lower@font}{1044486}
+    \DeclareMathSymbol{h}{\mathalpha}{\M at lower@font}{1044487}
+    \DeclareMathSymbol{i}{\mathalpha}{\M at lower@font}{1044488}
+    \DeclareMathSymbol{j}{\mathalpha}{\M at lower@font}{1044489}
+    \DeclareMathSymbol{k}{\mathalpha}{\M at lower@font}{1044490}
+    \DeclareMathSymbol{l}{\mathalpha}{\M at lower@font}{1044491}
+    \DeclareMathSymbol{m}{\mathalpha}{\M at lower@font}{1044492}
+    \DeclareMathSymbol{n}{\mathalpha}{\M at lower@font}{1044493}
+    \DeclareMathSymbol{o}{\mathalpha}{\M at lower@font}{1044494}
+    \DeclareMathSymbol{p}{\mathalpha}{\M at lower@font}{1044495}
+    \DeclareMathSymbol{q}{\mathalpha}{\M at lower@font}{1044496}
+    \DeclareMathSymbol{r}{\mathalpha}{\M at lower@font}{1044497}
+    \DeclareMathSymbol{s}{\mathalpha}{\M at lower@font}{1044498}
+    \DeclareMathSymbol{t}{\mathalpha}{\M at lower@font}{1044499}
+    \DeclareMathSymbol{u}{\mathalpha}{\M at lower@font}{1044500}
+    \DeclareMathSymbol{v}{\mathalpha}{\M at lower@font}{1044501}
+    \DeclareMathSymbol{w}{\mathalpha}{\M at lower@font}{1044502}
+    \DeclareMathSymbol{x}{\mathalpha}{\M at lower@font}{1044503}
+    \DeclareMathSymbol{y}{\mathalpha}{\M at lower@font}{1044504}
+    \DeclareMathSymbol{z}{\mathalpha}{\M at lower@font}{1044505}
+    \DeclareMathSymbol{\imath}{\mathalpha}{\M at lower@font}{1044506}
+    \DeclareMathSymbol{\jmath}{\mathalpha}{\M at lower@font}{1044507}
+    \DeclareMathSymbol{\hbar}{\mathord}{\M at lower@font}{"127}}
+\else
+  \def\M at lower@set{%
+    \edef\M at lower@font{M\M at lowershape\@tempa}
+    \DeclareMathSymbol{a}{\mathalpha}{\M at lower@font}{`a}
+    \DeclareMathSymbol{b}{\mathalpha}{\M at lower@font}{`b}
+    \DeclareMathSymbol{c}{\mathalpha}{\M at lower@font}{`c}
+    \DeclareMathSymbol{d}{\mathalpha}{\M at lower@font}{`d}
+    \DeclareMathSymbol{e}{\mathalpha}{\M at lower@font}{`e}
+    \DeclareMathSymbol{f}{\mathalpha}{\M at lower@font}{`f}
+    \DeclareMathSymbol{g}{\mathalpha}{\M at lower@font}{`g}
+    \DeclareMathSymbol{h}{\mathalpha}{\M at lower@font}{`h}
+    \DeclareMathSymbol{i}{\mathalpha}{\M at lower@font}{`i}
+    \DeclareMathSymbol{j}{\mathalpha}{\M at lower@font}{`j}
+    \DeclareMathSymbol{k}{\mathalpha}{\M at lower@font}{`k}
+    \DeclareMathSymbol{l}{\mathalpha}{\M at lower@font}{`l}
+    \DeclareMathSymbol{m}{\mathalpha}{\M at lower@font}{`m}
+    \DeclareMathSymbol{n}{\mathalpha}{\M at lower@font}{`n}
+    \DeclareMathSymbol{o}{\mathalpha}{\M at lower@font}{`o}
+    \DeclareMathSymbol{p}{\mathalpha}{\M at lower@font}{`p}
+    \DeclareMathSymbol{q}{\mathalpha}{\M at lower@font}{`q}
+    \DeclareMathSymbol{r}{\mathalpha}{\M at lower@font}{`r}
+    \DeclareMathSymbol{s}{\mathalpha}{\M at lower@font}{`s}
+    \DeclareMathSymbol{t}{\mathalpha}{\M at lower@font}{`t}
+    \DeclareMathSymbol{u}{\mathalpha}{\M at lower@font}{`u}
+    \DeclareMathSymbol{v}{\mathalpha}{\M at lower@font}{`v}
+    \DeclareMathSymbol{w}{\mathalpha}{\M at lower@font}{`w}
+    \DeclareMathSymbol{x}{\mathalpha}{\M at lower@font}{`x}
+    \DeclareMathSymbol{y}{\mathalpha}{\M at lower@font}{`y}
+    \DeclareMathSymbol{z}{\mathalpha}{\M at lower@font}{`z}
+    \DeclareMathSymbol{\imath}{\mathalpha}{\M at lower@font}{"131}
+    \DeclareMathSymbol{\jmath}{\mathalpha}{\M at lower@font}{"237}
+    \DeclareMathSymbol{\hbar}{\mathord}{\M at lower@font}{"127}}
+\fi
 \def\M at diacritics@set{%
-  \edef\M at diacritics{M\@diacriticsshape\the\M at count}
-  \DeclareMathAccent{\acute}{\mathalpha}{\M at diacritics}{"B4}
-  \DeclareMathAccent{\aacute}{\mathalpha}{\M at diacritics}{"2DD}
-  \DeclareMathAccent{\dot}{\mathalpha}{\M at diacritics}{"2D9}
-  \DeclareMathAccent{\ddot}{\mathalpha}{\M at diacritics}{"A8}
-  \DeclareMathAccent{\grave}{\mathalpha}{\M at diacritics}{"60}
-  \DeclareMathAccent{\breve}{\mathalpha}{\M at diacritics}{"2D8}
-  \DeclareMathAccent{\hat}{\mathalpha}{\M at diacritics}{"2C6}
-  \DeclareMathAccent{\check}{\mathalpha}{\M at diacritics}{"2C7}
-  \DeclareMathAccent{\bar}{\mathalpha}{\M at diacritics}{"AF}
-  \DeclareMathAccent{\mathring}{\mathalpha}{\M at diacritics}{"2DA}
-  \DeclareMathAccent{\tilde}{\mathalpha}{\M at diacritics}{"2DC}}
+  \edef\M at diacritics@font{M\M at diacriticsshape\@tempa}
+  \DeclareMathAccent{\acute}{\mathalpha}{\M at diacritics@font}{"B4}
+  \DeclareMathAccent{\aacute}{\mathalpha}{\M at diacritics@font}{"2DD}
+  \DeclareMathAccent{\dot}{\mathalpha}{\M at diacritics@font}{"2D9}
+  \DeclareMathAccent{\ddot}{\mathalpha}{\M at diacritics@font}{"A8}
+  \DeclareMathAccent{\grave}{\mathalpha}{\M at diacritics@font}{"60}
+  \DeclareMathAccent{\breve}{\mathalpha}{\M at diacritics@font}{"2D8}
+  \DeclareMathAccent{\hat}{\mathalpha}{\M at diacritics@font}{"2C6}
+  \DeclareMathAccent{\check}{\mathalpha}{\M at diacritics@font}{"2C7}
+  \DeclareMathAccent{\bar}{\mathalpha}{\M at diacritics@font}{"2C9}
+  \DeclareMathAccent{\mathring}{\mathalpha}{\M at diacritics@font}{"2DA}
+  \DeclareMathAccent{\tilde}{\mathalpha}{\M at diacritics@font}{"2DC}}
 \def\M at greekupper@set{%
-  \edef\M at greekupper{M\@greekuppershape\the\M at count}
-  \DeclareMathSymbol{\Alpha}{\mathalpha}{\M at greekupper}{"391}
-  \DeclareMathSymbol{\Beta}{\mathalpha}{\M at greekupper}{"392}
-  \DeclareMathSymbol{\Gamma}{\mathalpha}{\M at greekupper}{"393}
-  \DeclareMathSymbol{\Delta}{\mathalpha}{\M at greekupper}{"394}
-  \DeclareMathSymbol{\Epsilon}{\mathalpha}{\M at greekupper}{"395}
-  \DeclareMathSymbol{\Zeta}{\mathalpha}{\M at greekupper}{"396}
-  \DeclareMathSymbol{\Eta}{\mathalpha}{\M at greekupper}{"397}
-  \DeclareMathSymbol{\Theta}{\mathalpha}{\M at greekupper}{"398}
-  \DeclareMathSymbol{\Iota}{\mathalpha}{\M at greekupper}{"399}
-  \DeclareMathSymbol{\Kappa}{\mathalpha}{\M at greekupper}{"39A}
-  \DeclareMathSymbol{\Lambda}{\mathalpha}{\M at greekupper}{"39B}
-  \DeclareMathSymbol{\Mu}{\mathalpha}{\M at greekupper}{"39C}
-  \DeclareMathSymbol{\Nu}{\mathalpha}{\M at greekupper}{"39D}
-  \DeclareMathSymbol{\Xi}{\mathalpha}{\M at greekupper}{"39E}
-  \DeclareMathSymbol{\Omicron}{\mathalpha}{\M at greekupper}{"39F}
-  \DeclareMathSymbol{\Pi}{\mathalpha}{\M at greekupper}{"3A0}
-  \DeclareMathSymbol{\Rho}{\mathalpha}{\M at greekupper}{"3A1}
-  \DeclareMathSymbol{\Sigma}{\mathalpha}{\M at greekupper}{"3A3}
-  \DeclareMathSymbol{\Tau}{\mathalpha}{\M at greekupper}{"3A4}
-  \DeclareMathSymbol{\Upsilon}{\mathalpha}{\M at greekupper}{"3A5}
-  \DeclareMathSymbol{\Phi}{\mathalpha}{\M at greekupper}{"3A6}
-  \DeclareMathSymbol{\Chi}{\mathalpha}{\M at greekupper}{"3A7}
-  \DeclareMathSymbol{\Psi}{\mathalpha}{\M at greekupper}{"3A8}
-  \DeclareMathSymbol{\Omega}{\mathalpha}{\M at greekupper}{"3A9}
-  \DeclareMathSymbol{\varTheta}{\mathalpha}{\M at greekupper}{"3F4}}
+  \edef\M at greekupper@font{M\M at greekuppershape\@tempa}
+  \DeclareMathSymbol{\Alpha}{\mathalpha}{\M at greekupper@font}{"391}
+  \DeclareMathSymbol{\Beta}{\mathalpha}{\M at greekupper@font}{"392}
+  \DeclareMathSymbol{\Gamma}{\mathalpha}{\M at greekupper@font}{"393}
+  \DeclareMathSymbol{\Delta}{\mathalpha}{\M at greekupper@font}{"394}
+  \DeclareMathSymbol{\Epsilon}{\mathalpha}{\M at greekupper@font}{"395}
+  \DeclareMathSymbol{\Zeta}{\mathalpha}{\M at greekupper@font}{"396}
+  \DeclareMathSymbol{\Eta}{\mathalpha}{\M at greekupper@font}{"397}
+  \DeclareMathSymbol{\Theta}{\mathalpha}{\M at greekupper@font}{"398}
+  \DeclareMathSymbol{\Iota}{\mathalpha}{\M at greekupper@font}{"399}
+  \DeclareMathSymbol{\Kappa}{\mathalpha}{\M at greekupper@font}{"39A}
+  \DeclareMathSymbol{\Lambda}{\mathalpha}{\M at greekupper@font}{"39B}
+  \DeclareMathSymbol{\Mu}{\mathalpha}{\M at greekupper@font}{"39C}
+  \DeclareMathSymbol{\Nu}{\mathalpha}{\M at greekupper@font}{"39D}
+  \DeclareMathSymbol{\Xi}{\mathalpha}{\M at greekupper@font}{"39E}
+  \DeclareMathSymbol{\Omicron}{\mathalpha}{\M at greekupper@font}{"39F}
+  \DeclareMathSymbol{\Pi}{\mathalpha}{\M at greekupper@font}{"3A0}
+  \DeclareMathSymbol{\Rho}{\mathalpha}{\M at greekupper@font}{"3A1}
+  \DeclareMathSymbol{\Sigma}{\mathalpha}{\M at greekupper@font}{"3A3}
+  \DeclareMathSymbol{\Tau}{\mathalpha}{\M at greekupper@font}{"3A4}
+  \DeclareMathSymbol{\Upsilon}{\mathalpha}{\M at greekupper@font}{"3A5}
+  \DeclareMathSymbol{\Phi}{\mathalpha}{\M at greekupper@font}{"3A6}
+  \DeclareMathSymbol{\Chi}{\mathalpha}{\M at greekupper@font}{"3A7}
+  \DeclareMathSymbol{\Psi}{\mathalpha}{\M at greekupper@font}{"3A8}
+  \DeclareMathSymbol{\Omega}{\mathalpha}{\M at greekupper@font}{"3A9}
+  \DeclareMathSymbol{\varTheta}{\mathalpha}{\M at greekupper@font}{"3F4}
+  \ifM at adjust@font
+    \ifM at symbols\else
+      \DeclareMathSymbol{\increment}{\mathord}{\M at greekupper@font}{"2206}
+      \DeclareMathSymbol{\nabla}{\mathord}{\M at greekupper@font}{"2207}
+    \fi
+  \else
+    \ifM at symbols\else
+      \DeclareMathSymbol{\increment}{\mathord}{\M at greekupper@font}{"2206}
+    \fi
+    \ifM at extsymbols\else
+      \DeclareMathSymbol{\nabla}{\mathord}{\M at greekupper@font}{"2207}
+    \fi
+  \fi}
 \def\M at greeklower@set{%
-  \edef\M at greeklower{M\@greeklowershape\the\M at count}
-  \DeclareMathSymbol{\alpha}{\mathalpha}{\M at greeklower}{"3B1}
-  \DeclareMathSymbol{\beta}{\mathalpha}{\M at greeklower}{"3B2}
-  \DeclareMathSymbol{\gamma}{\mathalpha}{\M at greeklower}{"3B3}
-  \DeclareMathSymbol{\delta}{\mathalpha}{\M at greeklower}{"3B4}
-  \DeclareMathSymbol{\epsilon}{\mathalpha}{\M at greeklower}{"3F5}
-  \DeclareMathSymbol{\zeta}{\mathalpha}{\M at greeklower}{"3B6}
-  \DeclareMathSymbol{\eta}{\mathalpha}{\M at greeklower}{"3B7}
-  \DeclareMathSymbol{\theta}{\mathalpha}{\M at greeklower}{"3B8}
-  \DeclareMathSymbol{\iota}{\mathalpha}{\M at greeklower}{"3B9}
-  \DeclareMathSymbol{\kappa}{\mathalpha}{\M at greeklower}{"3BA}
-  \DeclareMathSymbol{\lambda}{\mathalpha}{\M at greeklower}{"3BB}
-  \DeclareMathSymbol{\mu}{\mathalpha}{\M at greeklower}{"3BC}
-  \DeclareMathSymbol{\nu}{\mathalpha}{\M at greeklower}{"3BD}
-  \DeclareMathSymbol{\xi}{\mathalpha}{\M at greeklower}{"3BE}
-  \DeclareMathSymbol{\omicron}{\mathalpha}{\M at greeklower}{"3BF}
-  \DeclareMathSymbol{\pi}{\mathalpha}{\M at greeklower}{"3C0}
-  \DeclareMathSymbol{\rho}{\mathalpha}{\M at greeklower}{"3C1}
-  \DeclareMathSymbol{\sigma}{\mathalpha}{\M at greeklower}{"3C3}
-  \DeclareMathSymbol{\tau}{\mathalpha}{\M at greeklower}{"3C4}
-  \DeclareMathSymbol{\upsilon}{\mathalpha}{\M at greeklower}{"3C5}
-  \DeclareMathSymbol{\phi}{\mathalpha}{\M at greeklower}{"3D5}
-  \DeclareMathSymbol{\chi}{\mathalpha}{\M at greeklower}{"3C7}
-  \DeclareMathSymbol{\psi}{\mathalpha}{\M at greeklower}{"3C8}
-  \DeclareMathSymbol{\omega}{\mathalpha}{\M at greeklower}{"3C9}
-  \DeclareMathSymbol{\varbeta}{\mathalpha}{\M at greeklower}{"3D0}
-  \DeclareMathSymbol{\varepsilon}{\mathalpha}{\M at greeklower}{"3B5}
-  \DeclareMathSymbol{\vartheta}{\mathalpha}{\M at greeklower}{"3D1}
-  \DeclareMathSymbol{\varrho}{\mathalpha}{\M at greeklower}{"3F1}
-  \DeclareMathSymbol{\varsigma}{\mathalpha}{\M at greeklower}{"3C2}
-  \DeclareMathSymbol{\varphi}{\mathalpha}{\M at greeklower}{"3C6}}
+  \edef\M at greeklower@font{M\M at greeklowershape\@tempa}
+  \DeclareMathSymbol{\alpha}{\mathalpha}{\M at greeklower@font}{"3B1}
+  \DeclareMathSymbol{\beta}{\mathalpha}{\M at greeklower@font}{"3B2}
+  \DeclareMathSymbol{\gamma}{\mathalpha}{\M at greeklower@font}{"3B3}
+  \DeclareMathSymbol{\delta}{\mathalpha}{\M at greeklower@font}{"3B4}
+  \DeclareMathSymbol{\epsilon}{\mathalpha}{\M at greeklower@font}{"3B5}
+  \DeclareMathSymbol{\zeta}{\mathalpha}{\M at greeklower@font}{"3B6}
+  \DeclareMathSymbol{\eta}{\mathalpha}{\M at greeklower@font}{"3B7}
+  \DeclareMathSymbol{\theta}{\mathalpha}{\M at greeklower@font}{"3B8}
+  \DeclareMathSymbol{\iota}{\mathalpha}{\M at greeklower@font}{"3B9}
+  \DeclareMathSymbol{\kappa}{\mathalpha}{\M at greeklower@font}{"3BA}
+  \DeclareMathSymbol{\lambda}{\mathalpha}{\M at greeklower@font}{"3BB}
+  \DeclareMathSymbol{\mu}{\mathalpha}{\M at greeklower@font}{"3BC}
+  \DeclareMathSymbol{\nu}{\mathalpha}{\M at greeklower@font}{"3BD}
+  \DeclareMathSymbol{\xi}{\mathalpha}{\M at greeklower@font}{"3BE}
+  \DeclareMathSymbol{\omicron}{\mathalpha}{\M at greeklower@font}{"3BF}
+  \DeclareMathSymbol{\pi}{\mathalpha}{\M at greeklower@font}{"3C0}
+  \DeclareMathSymbol{\rho}{\mathalpha}{\M at greeklower@font}{"3C1}
+  \DeclareMathSymbol{\sigma}{\mathalpha}{\M at greeklower@font}{"3C3}
+  \DeclareMathSymbol{\tau}{\mathalpha}{\M at greeklower@font}{"3C4}
+  \DeclareMathSymbol{\upsilon}{\mathalpha}{\M at greeklower@font}{"3C5}
+  \DeclareMathSymbol{\phi}{\mathalpha}{\M at greeklower@font}{"3C6}
+  \DeclareMathSymbol{\chi}{\mathalpha}{\M at greeklower@font}{"3C7}
+  \DeclareMathSymbol{\psi}{\mathalpha}{\M at greeklower@font}{"3C8}
+  \DeclareMathSymbol{\omega}{\mathalpha}{\M at greeklower@font}{"3C9}
+  \DeclareMathSymbol{\varbeta}{\mathalpha}{\M at greeklower@font}{"3D0}
+  \DeclareMathSymbol{\varepsilon}{\mathalpha}{\M at greeklower@font}{"3F5}
+  \DeclareMathSymbol{\varkappa}{\mathalpha}{\M at greeklower@font}{"3F0}
+  \DeclareMathSymbol{\vartheta}{\mathalpha}{\M at greeklower@font}{"3D1}
+  \DeclareMathSymbol{\varrho}{\mathalpha}{\M at greeklower@font}{"3F1}
+  \DeclareMathSymbol{\varsigma}{\mathalpha}{\M at greeklower@font}{"3C2}
+  \DeclareMathSymbol{\varphi}{\mathalpha}{\M at greeklower@font}{"3D5}}
 \def\M at agreekupper@set{%
-  \edef\M at agreekupper{M\@agreekuppershape\the\M at count}
-  \DeclareMathSymbol{\Heta}{\mathalpha}{\M at agreekupper}{"370}
-  \DeclareMathSymbol{\Sampi}{\mathalpha}{\M at agreekupper}{"3E0}
-  \DeclareMathSymbol{\Digamma}{\mathalpha}{\M at agreekupper}{"3DC}
-  \DeclareMathSymbol{\Koppa}{\mathalpha}{\M at agreekupper}{"3D8}
-  \DeclareMathSymbol{\Stigma}{\mathalpha}{\M at agreekupper}{"3DA}
-  \DeclareMathSymbol{\Sho}{\mathalpha}{\M at agreekupper}{"3F7}
-  \DeclareMathSymbol{\San}{\mathalpha}{\M at agreekupper}{"3FA}
-  \DeclareMathSymbol{\varSampi}{\mathalpha}{\M at agreekupper}{"372}
-  \DeclareMathSymbol{\varDigamma}{\mathalpha}{\M at agreekupper}{"376}
-  \DeclareMathSymbol{\varKoppa}{\mathalpha}{\M at agreekupper}{"3DE}}
+  \edef\M at agreekupper@font{M\M at agreekuppershape\@tempa}
+  \DeclareMathSymbol{\Heta}{\mathalpha}{\M at agreekupper@font}{"370}
+  \DeclareMathSymbol{\Sampi}{\mathalpha}{\M at agreekupper@font}{"3E0}
+  \DeclareMathSymbol{\Digamma}{\mathalpha}{\M at agreekupper@font}{"3DC}
+  \DeclareMathSymbol{\Koppa}{\mathalpha}{\M at agreekupper@font}{"3D8}
+  \DeclareMathSymbol{\Stigma}{\mathalpha}{\M at agreekupper@font}{"3DA}
+  \DeclareMathSymbol{\Sho}{\mathalpha}{\M at agreekupper@font}{"3F7}
+  \DeclareMathSymbol{\San}{\mathalpha}{\M at agreekupper@font}{"3FA}
+  \DeclareMathSymbol{\varSampi}{\mathalpha}{\M at agreekupper@font}{"372}
+  \DeclareMathSymbol{\varDigamma}{\mathalpha}{\M at agreekupper@font}{"376}
+  \DeclareMathSymbol{\varKoppa}{\mathalpha}{\M at agreekupper@font}{"3DE}}
 \def\M at agreeklower@set{%
-  \edef\M at agreeklower{M\@agreeklowershape\the\M at count}
-  \DeclareMathSymbol{\heta}{\mathalpha}{\M at agreeklower}{"371}
-  \DeclareMathSymbol{\sampi}{\mathalpha}{\M at agreeklower}{"3E1}
-  \DeclareMathSymbol{\digamma}{\mathalpha}{\M at agreeklower}{"3DD}
-  \DeclareMathSymbol{\koppa}{\mathalpha}{\M at agreeklower}{"3D9}
-  \DeclareMathSymbol{\stigma}{\mathalpha}{\M at agreeklower}{"3DB}
-  \DeclareMathSymbol{\sho}{\mathalpha}{\M at agreeklower}{"3F8}
-  \DeclareMathSymbol{\san}{\mathalpha}{\M at agreeklower}{"3FB}
-  \DeclareMathSymbol{\varsampi}{\mathalpha}{\M at agreeklower}{"373}
-  \DeclareMathSymbol{\vardigamma}{\mathalpha}{\M at agreeklower}{"377}
-  \DeclareMathSymbol{\varkoppa}{\mathalpha}{\M at agreeklower}{"3DF}}
+  \edef\M at agreeklower@font{M\M at agreeklowershape\@tempa}
+  \DeclareMathSymbol{\heta}{\mathalpha}{\M at agreeklower@font}{"371}
+  \DeclareMathSymbol{\sampi}{\mathalpha}{\M at agreeklower@font}{"3E1}
+  \DeclareMathSymbol{\digamma}{\mathalpha}{\M at agreeklower@font}{"3DD}
+  \DeclareMathSymbol{\koppa}{\mathalpha}{\M at agreeklower@font}{"3D9}
+  \DeclareMathSymbol{\stigma}{\mathalpha}{\M at agreeklower@font}{"3DB}
+  \DeclareMathSymbol{\sho}{\mathalpha}{\M at agreeklower@font}{"3F8}
+  \DeclareMathSymbol{\san}{\mathalpha}{\M at agreeklower@font}{"3FB}
+  \DeclareMathSymbol{\varsampi}{\mathalpha}{\M at agreeklower@font}{"373}
+  \DeclareMathSymbol{\vardigamma}{\mathalpha}{\M at agreeklower@font}{"377}
+  \DeclareMathSymbol{\varkoppa}{\mathalpha}{\M at agreeklower@font}{"3DF}}
 \def\M at cyrillicupper@set{%
-  \edef\M at cyrillicupper{M\@cyrillicuppershape\the\M at count}
-  \DeclareMathSymbol{\cyrA}{\mathalpha}{\M at cyrillicupper}{"410}
-  \DeclareMathSymbol{\cyrBe}{\mathalpha}{\M at cyrillicupper}{"411}
-  \DeclareMathSymbol{\cyrVe}{\mathalpha}{\M at cyrillicupper}{"412}
-  \DeclareMathSymbol{\cyrGhe}{\mathalpha}{\M at cyrillicupper}{"413}
-  \DeclareMathSymbol{\cyrDe}{\mathalpha}{\M at cyrillicupper}{"414}
-  \DeclareMathSymbol{\cyrIe}{\mathalpha}{\M at cyrillicupper}{"415}
-  \DeclareMathSymbol{\cyrZhe}{\mathalpha}{\M at cyrillicupper}{"416}
-  \DeclareMathSymbol{\cyrZe}{\mathalpha}{\M at cyrillicupper}{"417}
-  \DeclareMathSymbol{\cyrI}{\mathalpha}{\M at cyrillicupper}{"418}
-  \DeclareMathSymbol{\cyrKa}{\mathalpha}{\M at cyrillicupper}{"41A}
-  \DeclareMathSymbol{\cyrEl}{\mathalpha}{\M at cyrillicupper}{"41B}
-  \DeclareMathSymbol{\cyrEm}{\mathalpha}{\M at cyrillicupper}{"41C}
-  \DeclareMathSymbol{\cyrEn}{\mathalpha}{\M at cyrillicupper}{"41D}
-  \DeclareMathSymbol{\cyrO}{\mathalpha}{\M at cyrillicupper}{"41E}
-  \DeclareMathSymbol{\cyrPe}{\mathalpha}{\M at cyrillicupper}{"41F}
-  \DeclareMathSymbol{\cyrEr}{\mathalpha}{\M at cyrillicupper}{"420}
-  \DeclareMathSymbol{\cyrEs}{\mathalpha}{\M at cyrillicupper}{"421}
-  \DeclareMathSymbol{\cyrTe}{\mathalpha}{\M at cyrillicupper}{"422}
-  \DeclareMathSymbol{\cyrU}{\mathalpha}{\M at cyrillicupper}{"423}
-  \DeclareMathSymbol{\cyrEf}{\mathalpha}{\M at cyrillicupper}{"424}
-  \DeclareMathSymbol{\cyrHa}{\mathalpha}{\M at cyrillicupper}{"425}
-  \DeclareMathSymbol{\cyrTse}{\mathalpha}{\M at cyrillicupper}{"426}
-  \DeclareMathSymbol{\cyrChe}{\mathalpha}{\M at cyrillicupper}{"427}
-  \DeclareMathSymbol{\cyrSha}{\mathalpha}{\M at cyrillicupper}{"428}
-  \DeclareMathSymbol{\cyrShcha}{\mathalpha}{\M at cyrillicupper}{"429}
-  \DeclareMathSymbol{\cyrHard}{\mathalpha}{\M at cyrillicupper}{"42A}
-  \DeclareMathSymbol{\cyrYeru}{\mathalpha}{\M at cyrillicupper}{"42B}
-  \DeclareMathSymbol{\cyrSoft}{\mathalpha}{\M at cyrillicupper}{"42C}
-  \DeclareMathSymbol{\cyrE}{\mathalpha}{\M at cyrillicupper}{"42D}
-  \DeclareMathSymbol{\cyrYu}{\mathalpha}{\M at cyrillicupper}{"42E}
-  \DeclareMathSymbol{\cyrYa}{\mathalpha}{\M at cyrillicupper}{"42F}
-  \DeclareMathSymbol{\cyrvarI}{\mathalpha}{\M at cyrillicupper}{"419}}
+  \edef\M at cyrillicupper@font{M\M at cyrillicuppershape\@tempa}
+  \DeclareMathSymbol{\cyrA}{\mathalpha}{\M at cyrillicupper@font}{"410}
+  \DeclareMathSymbol{\cyrBe}{\mathalpha}{\M at cyrillicupper@font}{"411}
+  \DeclareMathSymbol{\cyrVe}{\mathalpha}{\M at cyrillicupper@font}{"412}
+  \DeclareMathSymbol{\cyrGhe}{\mathalpha}{\M at cyrillicupper@font}{"413}
+  \DeclareMathSymbol{\cyrDe}{\mathalpha}{\M at cyrillicupper@font}{"414}
+  \DeclareMathSymbol{\cyrIe}{\mathalpha}{\M at cyrillicupper@font}{"415}
+  \DeclareMathSymbol{\cyrZhe}{\mathalpha}{\M at cyrillicupper@font}{"416}
+  \DeclareMathSymbol{\cyrZe}{\mathalpha}{\M at cyrillicupper@font}{"417}
+  \DeclareMathSymbol{\cyrI}{\mathalpha}{\M at cyrillicupper@font}{"418}
+  \DeclareMathSymbol{\cyrKa}{\mathalpha}{\M at cyrillicupper@font}{"41A}
+  \DeclareMathSymbol{\cyrEl}{\mathalpha}{\M at cyrillicupper@font}{"41B}
+  \DeclareMathSymbol{\cyrEm}{\mathalpha}{\M at cyrillicupper@font}{"41C}
+  \DeclareMathSymbol{\cyrEn}{\mathalpha}{\M at cyrillicupper@font}{"41D}
+  \DeclareMathSymbol{\cyrO}{\mathalpha}{\M at cyrillicupper@font}{"41E}
+  \DeclareMathSymbol{\cyrPe}{\mathalpha}{\M at cyrillicupper@font}{"41F}
+  \DeclareMathSymbol{\cyrEr}{\mathalpha}{\M at cyrillicupper@font}{"420}
+  \DeclareMathSymbol{\cyrEs}{\mathalpha}{\M at cyrillicupper@font}{"421}
+  \DeclareMathSymbol{\cyrTe}{\mathalpha}{\M at cyrillicupper@font}{"422}
+  \DeclareMathSymbol{\cyrU}{\mathalpha}{\M at cyrillicupper@font}{"423}
+  \DeclareMathSymbol{\cyrEf}{\mathalpha}{\M at cyrillicupper@font}{"424}
+  \DeclareMathSymbol{\cyrHa}{\mathalpha}{\M at cyrillicupper@font}{"425}
+  \DeclareMathSymbol{\cyrTse}{\mathalpha}{\M at cyrillicupper@font}{"426}
+  \DeclareMathSymbol{\cyrChe}{\mathalpha}{\M at cyrillicupper@font}{"427}
+  \DeclareMathSymbol{\cyrSha}{\mathalpha}{\M at cyrillicupper@font}{"428}
+  \DeclareMathSymbol{\cyrShcha}{\mathalpha}{\M at cyrillicupper@font}{"429}
+  \DeclareMathSymbol{\cyrHard}{\mathalpha}{\M at cyrillicupper@font}{"42A}
+  \DeclareMathSymbol{\cyrYeru}{\mathalpha}{\M at cyrillicupper@font}{"42B}
+  \DeclareMathSymbol{\cyrSoft}{\mathalpha}{\M at cyrillicupper@font}{"42C}
+  \DeclareMathSymbol{\cyrE}{\mathalpha}{\M at cyrillicupper@font}{"42D}
+  \DeclareMathSymbol{\cyrYu}{\mathalpha}{\M at cyrillicupper@font}{"42E}
+  \DeclareMathSymbol{\cyrYa}{\mathalpha}{\M at cyrillicupper@font}{"42F}
+  \DeclareMathSymbol{\cyrvarI}{\mathalpha}{\M at cyrillicupper@font}{"419}}
 \def\M at cyrilliclower@set{%
-  \edef\M at cyrilliclower{M\@cyrilliclowershape\the\M at count}
-  \DeclareMathSymbol{\cyra}{\mathalpha}{\M at cyrilliclower}{"430}
-  \DeclareMathSymbol{\cyrbe}{\mathalpha}{\M at cyrilliclower}{"431}
-  \DeclareMathSymbol{\cyrve}{\mathalpha}{\M at cyrilliclower}{"432}
-  \DeclareMathSymbol{\cyrghe}{\mathalpha}{\M at cyrilliclower}{"433}
-  \DeclareMathSymbol{\cyrde}{\mathalpha}{\M at cyrilliclower}{"434}
-  \DeclareMathSymbol{\cyrie}{\mathalpha}{\M at cyrilliclower}{"435}
-  \DeclareMathSymbol{\cyrzhe}{\mathalpha}{\M at cyrilliclower}{"436}
-  \DeclareMathSymbol{\cyrze}{\mathalpha}{\M at cyrilliclower}{"437}
-  \DeclareMathSymbol{\cyri}{\mathalpha}{\M at cyrilliclower}{"438}
-  \DeclareMathSymbol{\cyrka}{\mathalpha}{\M at cyrilliclower}{"43A}
-  \DeclareMathSymbol{\cyrel}{\mathalpha}{\M at cyrilliclower}{"43B}
-  \DeclareMathSymbol{\cyrem}{\mathalpha}{\M at cyrilliclower}{"43C}
-  \DeclareMathSymbol{\cyren}{\mathalpha}{\M at cyrilliclower}{"43D}
-  \DeclareMathSymbol{\cyro}{\mathalpha}{\M at cyrilliclower}{"43E}
-  \DeclareMathSymbol{\cyrpe}{\mathalpha}{\M at cyrilliclower}{"43F}
-  \DeclareMathSymbol{\cyrer}{\mathalpha}{\M at cyrilliclower}{"440}
-  \DeclareMathSymbol{\cyres}{\mathalpha}{\M at cyrilliclower}{"441}
-  \DeclareMathSymbol{\cyrte}{\mathalpha}{\M at cyrilliclower}{"442}
-  \DeclareMathSymbol{\cyru}{\mathalpha}{\M at cyrilliclower}{"443}
-  \DeclareMathSymbol{\cyref}{\mathalpha}{\M at cyrilliclower}{"444}
-  \DeclareMathSymbol{\cyrha}{\mathalpha}{\M at cyrilliclower}{"445}
-  \DeclareMathSymbol{\cyrtse}{\mathalpha}{\M at cyrilliclower}{"446}
-  \DeclareMathSymbol{\cyrche}{\mathalpha}{\M at cyrilliclower}{"447}
-  \DeclareMathSymbol{\cyrsha}{\mathalpha}{\M at cyrilliclower}{"448}
-  \DeclareMathSymbol{\cyrshcha}{\mathalpha}{\M at cyrilliclower}{"449}
-  \DeclareMathSymbol{\cyrhard}{\mathalpha}{\M at cyrilliclower}{"44A}
-  \DeclareMathSymbol{\cyryeru}{\mathalpha}{\M at cyrilliclower}{"44B}
-  \DeclareMathSymbol{\cyrsoft}{\mathalpha}{\M at cyrilliclower}{"44C}
-  \DeclareMathSymbol{\cyre}{\mathalpha}{\M at cyrilliclower}{"44D}
-  \DeclareMathSymbol{\cyryu}{\mathalpha}{\M at cyrilliclower}{"44E}
-  \DeclareMathSymbol{\cyrya}{\mathalpha}{\M at cyrilliclower}{"44F}
-  \DeclareMathSymbol{\cyrvari}{\mathalpha}{\M at cyrilliclower}{"439}}
+  \edef\M at cyrilliclower@font{M\M at cyrilliclowershape\@tempa}
+  \DeclareMathSymbol{\cyra}{\mathalpha}{\M at cyrilliclower@font}{"430}
+  \DeclareMathSymbol{\cyrbe}{\mathalpha}{\M at cyrilliclower@font}{"431}
+  \DeclareMathSymbol{\cyrve}{\mathalpha}{\M at cyrilliclower@font}{"432}
+  \DeclareMathSymbol{\cyrghe}{\mathalpha}{\M at cyrilliclower@font}{"433}
+  \DeclareMathSymbol{\cyrde}{\mathalpha}{\M at cyrilliclower@font}{"434}
+  \DeclareMathSymbol{\cyrie}{\mathalpha}{\M at cyrilliclower@font}{"435}
+  \DeclareMathSymbol{\cyrzhe}{\mathalpha}{\M at cyrilliclower@font}{"436}
+  \DeclareMathSymbol{\cyrze}{\mathalpha}{\M at cyrilliclower@font}{"437}
+  \DeclareMathSymbol{\cyri}{\mathalpha}{\M at cyrilliclower@font}{"438}
+  \DeclareMathSymbol{\cyrka}{\mathalpha}{\M at cyrilliclower@font}{"43A}
+  \DeclareMathSymbol{\cyrel}{\mathalpha}{\M at cyrilliclower@font}{"43B}
+  \DeclareMathSymbol{\cyrem}{\mathalpha}{\M at cyrilliclower@font}{"43C}
+  \DeclareMathSymbol{\cyren}{\mathalpha}{\M at cyrilliclower@font}{"43D}
+  \DeclareMathSymbol{\cyro}{\mathalpha}{\M at cyrilliclower@font}{"43E}
+  \DeclareMathSymbol{\cyrpe}{\mathalpha}{\M at cyrilliclower@font}{"43F}
+  \DeclareMathSymbol{\cyrer}{\mathalpha}{\M at cyrilliclower@font}{"440}
+  \DeclareMathSymbol{\cyres}{\mathalpha}{\M at cyrilliclower@font}{"441}
+  \DeclareMathSymbol{\cyrte}{\mathalpha}{\M at cyrilliclower@font}{"442}
+  \DeclareMathSymbol{\cyru}{\mathalpha}{\M at cyrilliclower@font}{"443}
+  \DeclareMathSymbol{\cyref}{\mathalpha}{\M at cyrilliclower@font}{"444}
+  \DeclareMathSymbol{\cyrha}{\mathalpha}{\M at cyrilliclower@font}{"445}
+  \DeclareMathSymbol{\cyrtse}{\mathalpha}{\M at cyrilliclower@font}{"446}
+  \DeclareMathSymbol{\cyrche}{\mathalpha}{\M at cyrilliclower@font}{"447}
+  \DeclareMathSymbol{\cyrsha}{\mathalpha}{\M at cyrilliclower@font}{"448}
+  \DeclareMathSymbol{\cyrshcha}{\mathalpha}{\M at cyrilliclower@font}{"449}
+  \DeclareMathSymbol{\cyrhard}{\mathalpha}{\M at cyrilliclower@font}{"44A}
+  \DeclareMathSymbol{\cyryeru}{\mathalpha}{\M at cyrilliclower@font}{"44B}
+  \DeclareMathSymbol{\cyrsoft}{\mathalpha}{\M at cyrilliclower@font}{"44C}
+  \DeclareMathSymbol{\cyre}{\mathalpha}{\M at cyrilliclower@font}{"44D}
+  \DeclareMathSymbol{\cyryu}{\mathalpha}{\M at cyrilliclower@font}{"44E}
+  \DeclareMathSymbol{\cyrya}{\mathalpha}{\M at cyrilliclower@font}{"44F}
+  \DeclareMathSymbol{\cyrvari}{\mathalpha}{\M at cyrilliclower@font}{"439}}
 \def\M at hebrew@set{%
-  \edef\M at hebrew{M\@hebrewshape\the\M at count}
-  \DeclareMathSymbol{\aleph}{\mathalpha}{\M at hebrew}{"5D0}
-  \DeclareMathSymbol{\beth}{\mathalpha}{\M at hebrew}{"5D1}
-  \DeclareMathSymbol{\gimel}{\mathalpha}{\M at hebrew}{"5D2}
-  \DeclareMathSymbol{\daleth}{\mathalpha}{\M at hebrew}{"5D3}
-  \DeclareMathSymbol{\he}{\mathalpha}{\M at hebrew}{"5D4}
-  \DeclareMathSymbol{\vav}{\mathalpha}{\M at hebrew}{"5D5}
-  \DeclareMathSymbol{\zayin}{\mathalpha}{\M at hebrew}{"5D6}
-  \DeclareMathSymbol{\het}{\mathalpha}{\M at hebrew}{"5D7}
-  \DeclareMathSymbol{\tet}{\mathalpha}{\M at hebrew}{"5D8}
-  \DeclareMathSymbol{\yod}{\mathalpha}{\M at hebrew}{"5D9}
-  \DeclareMathSymbol{\kaf}{\mathalpha}{\M at hebrew}{"5DB}
-  \DeclareMathSymbol{\lamed}{\mathalpha}{\M at hebrew}{"5DC}
-  \DeclareMathSymbol{\mem}{\mathalpha}{\M at hebrew}{"5DE}
-  \DeclareMathSymbol{\nun}{\mathalpha}{\M at hebrew}{"5E0}
-  \DeclareMathSymbol{\samekh}{\mathalpha}{\M at hebrew}{"5E1}
-  \DeclareMathSymbol{\ayin}{\mathalpha}{\M at hebrew}{"5E2}
-  \DeclareMathSymbol{\pe}{\mathalpha}{\M at hebrew}{"5E4}
-  \DeclareMathSymbol{\tsadi}{\mathalpha}{\M at hebrew}{"5E6}
-  \DeclareMathSymbol{\qof}{\mathalpha}{\M at hebrew}{"5E7}
-  \DeclareMathSymbol{\resh}{\mathalpha}{\M at hebrew}{"5E8}
-  \DeclareMathSymbol{\shin}{\mathalpha}{\M at hebrew}{"5E9}
-  \DeclareMathSymbol{\tav}{\mathalpha}{\M at hebrew}{"5EA}
-  \DeclareMathSymbol{\varkaf}{\mathalpha}{\M at hebrew}{"5DA}
-  \DeclareMathSymbol{\varmem}{\mathalpha}{\M at hebrew}{"5DD}
-  \DeclareMathSymbol{\varnun}{\mathalpha}{\M at hebrew}{"5DF}
-  \DeclareMathSymbol{\varpe}{\mathalpha}{\M at hebrew}{"5E3}
-  \DeclareMathSymbol{\vartsadi}{\mathalpha}{\M at hebrew}{"5E5}}
+  \edef\M at hebrew@font{M\M at hebrewshape\@tempa}
+  \DeclareMathSymbol{\aleph}{\mathalpha}{\M at hebrew@font}{"5D0}
+  \DeclareMathSymbol{\beth}{\mathalpha}{\M at hebrew@font}{"5D1}
+  \DeclareMathSymbol{\gimel}{\mathalpha}{\M at hebrew@font}{"5D2}
+  \DeclareMathSymbol{\daleth}{\mathalpha}{\M at hebrew@font}{"5D3}
+  \DeclareMathSymbol{\he}{\mathalpha}{\M at hebrew@font}{"5D4}
+  \DeclareMathSymbol{\vav}{\mathalpha}{\M at hebrew@font}{"5D5}
+  \DeclareMathSymbol{\zayin}{\mathalpha}{\M at hebrew@font}{"5D6}
+  \DeclareMathSymbol{\het}{\mathalpha}{\M at hebrew@font}{"5D7}
+  \DeclareMathSymbol{\tet}{\mathalpha}{\M at hebrew@font}{"5D8}
+  \DeclareMathSymbol{\yod}{\mathalpha}{\M at hebrew@font}{"5D9}
+  \DeclareMathSymbol{\kaf}{\mathalpha}{\M at hebrew@font}{"5DB}
+  \DeclareMathSymbol{\lamed}{\mathalpha}{\M at hebrew@font}{"5DC}
+  \DeclareMathSymbol{\mem}{\mathalpha}{\M at hebrew@font}{"5DE}
+  \DeclareMathSymbol{\nun}{\mathalpha}{\M at hebrew@font}{"5E0}
+  \DeclareMathSymbol{\samekh}{\mathalpha}{\M at hebrew@font}{"5E1}
+  \DeclareMathSymbol{\ayin}{\mathalpha}{\M at hebrew@font}{"5E2}
+  \DeclareMathSymbol{\pe}{\mathalpha}{\M at hebrew@font}{"5E4}
+  \DeclareMathSymbol{\tsadi}{\mathalpha}{\M at hebrew@font}{"5E6}
+  \DeclareMathSymbol{\qof}{\mathalpha}{\M at hebrew@font}{"5E7}
+  \DeclareMathSymbol{\resh}{\mathalpha}{\M at hebrew@font}{"5E8}
+  \DeclareMathSymbol{\shin}{\mathalpha}{\M at hebrew@font}{"5E9}
+  \DeclareMathSymbol{\tav}{\mathalpha}{\M at hebrew@font}{"5EA}
+  \DeclareMathSymbol{\varkaf}{\mathalpha}{\M at hebrew@font}{"5DA}
+  \DeclareMathSymbol{\varmem}{\mathalpha}{\M at hebrew@font}{"5DD}
+  \DeclareMathSymbol{\varnun}{\mathalpha}{\M at hebrew@font}{"5DF}
+  \DeclareMathSymbol{\varpe}{\mathalpha}{\M at hebrew@font}{"5E3}
+  \DeclareMathSymbol{\vartsadi}{\mathalpha}{\M at hebrew@font}{"5E5}}
 \def\M at digits@set{%
-  \edef\M at digits{M\@digitsshape\the\M at count}
-  \DeclareMathSymbol{0}{\mathalpha}{\M at digits}{`0}
-  \DeclareMathSymbol{1}{\mathalpha}{\M at digits}{`1}
-  \DeclareMathSymbol{2}{\mathalpha}{\M at digits}{`2}
-  \DeclareMathSymbol{3}{\mathalpha}{\M at digits}{`3}
-  \DeclareMathSymbol{4}{\mathalpha}{\M at digits}{`4}
-  \DeclareMathSymbol{5}{\mathalpha}{\M at digits}{`5}
-  \DeclareMathSymbol{6}{\mathalpha}{\M at digits}{`6}
-  \DeclareMathSymbol{7}{\mathalpha}{\M at digits}{`7}
-  \DeclareMathSymbol{8}{\mathalpha}{\M at digits}{`8}
-  \DeclareMathSymbol{9}{\mathalpha}{\M at digits}{`9}}
+  \edef\M at digits@font{M\M at digitsshape\@tempa}
+  \DeclareMathSymbol{0}{\mathalpha}{\M at digits@font}{`0}
+  \DeclareMathSymbol{1}{\mathalpha}{\M at digits@font}{`1}
+  \DeclareMathSymbol{2}{\mathalpha}{\M at digits@font}{`2}
+  \DeclareMathSymbol{3}{\mathalpha}{\M at digits@font}{`3}
+  \DeclareMathSymbol{4}{\mathalpha}{\M at digits@font}{`4}
+  \DeclareMathSymbol{5}{\mathalpha}{\M at digits@font}{`5}
+  \DeclareMathSymbol{6}{\mathalpha}{\M at digits@font}{`6}
+  \DeclareMathSymbol{7}{\mathalpha}{\M at digits@font}{`7}
+  \DeclareMathSymbol{8}{\mathalpha}{\M at digits@font}{`8}
+  \DeclareMathSymbol{9}{\mathalpha}{\M at digits@font}{`9}}
 \def\M at operator@set{%
-  \edef\operator at font{\noexpand\mathgroup
-    \expandafter\noexpand\csname symM\@operatorshape\the\M at count\endcsname}}
+  \ifM at adjust@font
+    \edef\M at operator@num{\number\csname symM\M at operatorshape\@tempa\endcsname}
+    \def\M at default@latin at operator{%
+      \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
+      \Umathcode`D=7+\M at operator@num+`D\relax
+      \Umathcode`E=7+\M at operator@num+`E\relax
+      \Umathcode`F=7+\M at operator@num+`F\relax
+      \Umathcode`G=7+\M at operator@num+`G\relax
+      \Umathcode`H=7+\M at operator@num+`H\relax
+      \Umathcode`I=7+\M at operator@num+`I\relax
+      \Umathcode`J=7+\M at operator@num+`J\relax
+      \Umathcode`K=7+\M at operator@num+`K\relax
+      \Umathcode`L=7+\M at operator@num+`L\relax
+      \Umathcode`M=7+\M at operator@num+`M\relax
+      \Umathcode`N=7+\M at operator@num+`N\relax
+      \Umathcode`O=7+\M at operator@num+`O\relax
+      \Umathcode`P=7+\M at operator@num+`P\relax
+      \Umathcode`Q=7+\M at operator@num+`Q\relax
+      \Umathcode`R=7+\M at operator@num+`R\relax
+      \Umathcode`S=7+\M at operator@num+`S\relax
+      \Umathcode`T=7+\M at operator@num+`T\relax
+      \Umathcode`U=7+\M at operator@num+`U\relax
+      \Umathcode`V=7+\M at operator@num+`V\relax
+      \Umathcode`W=7+\M at operator@num+`W\relax
+      \Umathcode`X=7+\M at operator@num+`X\relax
+      \Umathcode`Y=7+\M at operator@num+`Y\relax
+      \Umathcode`Z=7+\M at operator@num+`Z\relax
+      \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
+      \Umathcode`d=7+\M at operator@num+`d\relax
+      \Umathcode`e=7+\M at operator@num+`e\relax
+      \Umathcode`f=7+\M at operator@num+`f\relax
+      \Umathcode`g=7+\M at operator@num+`g\relax
+      \Umathcode`h=7+\M at operator@num+`h\relax
+      \Umathcode`i=7+\M at operator@num+`i\relax
+      \Umathcode`j=7+\M at operator@num+`j\relax
+      \Umathcode`k=7+\M at operator@num+`k\relax
+      \Umathcode`l=7+\M at operator@num+`l\relax
+      \Umathcode`m=7+\M at operator@num+`m\relax
+      \Umathcode`n=7+\M at operator@num+`n\relax
+      \Umathcode`o=7+\M at operator@num+`o\relax
+      \Umathcode`p=7+\M at operator@num+`p\relax
+      \Umathcode`q=7+\M at operator@num+`q\relax
+      \Umathcode`r=7+\M at operator@num+`r\relax
+      \Umathcode`s=7+\M at operator@num+`s\relax
+      \Umathcode`t=7+\M at operator@num+`t\relax
+      \Umathcode`u=7+\M at operator@num+`u\relax
+      \Umathcode`v=7+\M at operator@num+`v\relax
+      \Umathcode`w=7+\M at operator@num+`w\relax
+      \Umathcode`x=7+\M at operator@num+`x\relax
+      \Umathcode`y=7+\M at operator@num+`y\relax
+      \Umathcode`z=7+\M at operator@num+`z\relax
+      \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
+  \fi
+  \xdef\operator at font{\noexpand\mathgroup
+      \csname symM\M at operatorshape\@tempa\endcsname\M at default@latin at operator}}
+\ifM at adjust@font
+  \def\M at delimiters@set{%
+    \edef\M at delimiters@font{M\M at delimitersshape\@tempa}
+    \DeclareMathSymbol{(}{\mathopen}{\M at delimiters@font}{"28}
+    \DeclareMathSymbol{)}{\mathclose}{\M at delimiters@font}{"29}
+    \DeclareMathSymbol{[}{\mathopen}{\M at delimiters@font}{"5B}
+    \DeclareMathSymbol{]}{\mathclose}{\M at delimiters@font}{"5D}
+    \ifM at symbols\else
+      \DeclareMathSymbol{|}{\mathord}{\M at delimiters@font}{"7C}
+    \fi
+    \DeclareMathSymbol{\leftbrace}{\mathopen}{\M at delimiters@font}{"7B}
+    \DeclareMathSymbol{\rightbrace}{\mathclose}{\M at delimiters@font}{"7D}
+    \global\Udelcode40=+\csname sym\M at delimiters@font\endcsname+40\relax % (
+    \global\Udelcode41=+\csname sym\M at delimiters@font\endcsname+41\relax % )
+    \global\Udelcode47=+\csname sym\M at delimiters@font\endcsname+47\relax % /
+    \global\Udelcode91=+\csname sym\M at delimiters@font\endcsname+91\relax % [
+    \global\Udelcode93=+\csname sym\M at delimiters@font\endcsname+93\relax % ]
+    \global\Udelcode124=+\csname sym\M at delimiters@font\endcsname+124\relax % |
+    \global\let\vert=|
+    \protected\gdef\backslash{\ifmmode\mathbackslash\else\textbackslash\fi}
+    \protected\xdef\mathbackslash{%
+      \Udelimiter+2+\number\csname sym\M at delimiters@font\endcsname
+        +92\relax} % \
+    \protected\xdef\lbrace{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +123\relax} % {
+    \protected\xdef\rbrace{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +125\relax} % }
+    \protected\xdef\lguil{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +8249\relax} % single left guilement
+    \protected\xdef\rguil{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +8250\relax} % single right guilement
+    \protected\xdef\llguil{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +171\relax} % double left guilement
+    \protected\xdef\rrguil{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +187\relax} % double right guilement
+    \protected\xdef\fakelangle{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +1044508\relax} % fake left angle
+    \protected\xdef\fakerangle{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +1044509\relax} % fake right angle
+    \protected\xdef\fakellangle{%
+      \Udelimiter+4+\number\csname sym\M at delimiters@font\endcsname
+        +1044510\relax} % fake double left angle
+    \protected\xdef\fakerrangle{%
+      \Udelimiter+5+\number\csname sym\M at delimiters@font\endcsname
+        +1044511\relax} % fake double right angle
+    }
+\else
+  \def\M at delimiters@set{%
+    \edef\M at delimiters@font{M\M at delimitersshape\@tempa}
+    \DeclareMathSymbol{(}{\mathopen}{\M at delimiters@font}{"28}
+    \DeclareMathSymbol{)}{\mathclose}{\M at delimiters@font}{"29}
+    \DeclareMathSymbol{[}{\mathopen}{\M at delimiters@font}{"5B}
+    \DeclareMathSymbol{]}{\mathclose}{\M at delimiters@font}{"5D}
+    \DeclareMathSymbol{\lguil}{\mathopen}{\M at delimiters@font}{"2039}
+    \DeclareMathSymbol{\rguil}{\mathclose}{\M at delimiters@font}{"203A}
+    \DeclareMathSymbol{\llguil}{\mathopen}{\M at delimiters@font}{"AB}
+    \DeclareMathSymbol{\rrguil}{\mathclose}{\M at delimiters@font}{"BB}
+    \DeclareMathSymbol{\leftbrace}{\mathopen}{\M at delimiters@font}{"7B}
+    \DeclareMathSymbol{\rightbrace}{\mathclose}{\M at delimiters@font}{"7D}}
+\fi
+\ifM at adjust@font
+  \def\M at radical@set{%
+    \edef\M at radical@font{M\M at radicalshape\@tempa}
+    \DeclareMathSymbol{\surd}{\mathord}{\M at radical@font}{"221A}
+    \xdef\@sqrts at gn##1{%
+      \Uradical+\number\csname sym\M at radical@font\endcsname+8730\relax{##1}}
+    \gdef\r@@t##1##2{%
+      \setbox\z@\hbox{$\m at th##1\sqrtsign{##2}$}%
+      \setbox\surdbox\hbox{$\m at th##1\@sqrts at gn{%
+        \hbox{\vphantom{$\m at th##1##2$}}}$}
+      \dimen@\ht\surdbox
+      \advance\dimen@\dp\surdbox
+      \dimen@=0.6\dimen@
+      \advance\dimen at -\dp\surdbox
+      \ifdim\wd\rootbox<0.6\wd\surdbox
+        \kern0.6\wd\surdbox
+      \else
+        \kern\wd\rootbox
+      \fi
+      \raise\dimen@\hbox{\llap{\copy\rootbox}}
+      \kern-0.6\wd\surdbox
+      \box\z@}
+    \gdef\sqrtsign##1{\@sqrts at gn{\mkern\radicandoffset##1}}}
+\else
+  \def\M at radical@set{%
+    \edef\M at radical@font{M\@radicalshape\@tempa}
+    \DeclareMathSymbol{\surd}{\mathord}{\M at radical@font}{"221A}}
+\fi
+\def\M at bigops@set{%
+  \edef\M at bigops@font{M\M at bigopsshape\@tempa}
+  \let\sum\@undefined
+  \let\prod\@undefined
+  \DeclareMathSymbol{\sum}{\mathop}{\M at bigops@font}{"2211}
+  \DeclareMathSymbol{\prod}{\mathop}{\M at bigops@font}{"220F}
+  \DeclareMathSymbol{\intop}{\mathop}{\M at bigops@font}{"222B}}
+\def\M at extbigops@set{%
+  \edef\M at extbigops@font{M\M at extbigopsshape\@tempa}
+  \let\coprod\@undefined
+  \let\bigvee\@undefined
+  \let\bigwedge\@undefined
+  \let\bigcup\@undefined
+  \let\bigcap\@undefined
+  \let\bigoplus\@undefined
+  \let\bigotimes\@undefined
+  \let\bigodot\@undefined
+  \let\bigsqcup\@undefined
+  \DeclareMathSymbol{\coprod}{\mathop}{\M at extbigops@font}{"2210}
+  \DeclareMathSymbol{\bigvee}{\mathop}{\M at extbigops@font}{"22C1}
+  \DeclareMathSymbol{\bigwedge}{\mathop}{\M at extbigops@font}{"22C0}
+  \DeclareMathSymbol{\bigcup}{\mathop}{\M at extbigops@font}{"22C3}
+  \DeclareMathSymbol{\bigcap}{\mathop}{\M at extbigops@font}{"22C2}
+  \DeclareMathSymbol{\iintop}{\mathop}{\M at extbigops@font}{"222C}
+    \protected\gdef\iint{\iintop\nolimits}
+  \DeclareMathSymbol{\iiintop}{\mathop}{\M at extbigops@font}{"222D}
+    \protected\gdef\iiint{\iiintop\nolimits}
+  \DeclareMathSymbol{\ointop}{\mathop}{\M at extbigops@font}{"222E}
+    \protected\gdef\oint{\ointop\nolimits}
+  \DeclareMathSymbol{\oiintop}{\mathop}{\M at extbigops@font}{"222F}
+    \protected\gdef\oiint{\oiintop\nolimits}
+  \DeclareMathSymbol{\oiiintop}{\mathop}{\M at extbigops@font}{"2230}
+    \protected\gdef\oiiint{\oiiintop\nolimits}
+  \DeclareMathSymbol{\bigoplus}{\mathop}{\M at extbigops@font}{"2A01}
+  \DeclareMathSymbol{\bigotimes}{\mathop}{\M at extbigops@font}{"2A02}
+  \DeclareMathSymbol{\bigodot}{\mathop}{\M at extbigops@font}{"2A00}
+  \DeclareMathSymbol{\bigsqcap}{\mathop}{\M at extbigops@font}{"2A05}
+  \DeclareMathSymbol{\bigsqcup}{\mathop}{\M at extbigops@font}{"2A06}}
 \def\M at symbols@set{%
-  \edef\M at symbols{M\@symbolsshape\the\M at count}
+  \edef\M at symbols@font{M\M at symbolsshape\@tempa}
   \let\colon\@undefined
   \let\mathellipsis\@undefined
-  \DeclareMathSymbol{.}{\mathord}{\M at symbols}{"2E}
-  \DeclareMathSymbol{@}{\mathord}{\M at symbols}{"40}
-  \DeclareMathSymbol{\mathhash}{\mathord}{\M at symbols}{"23}
-  \DeclareMathSymbol{\mathdollar}{\mathord}{\M at symbols}{"24}
-  \DeclareMathSymbol{\mathpercent}{\mathord}{\M at symbols}{"25}
-  \DeclareMathSymbol{\mathand}{\mathord}{\M at symbols}{"26}
-  \DeclareMathSymbol{\mathparagraph}{\mathord}{\M at symbols}{"B6}
-  \DeclareMathSymbol{\mathsection}{\mathord}{\M at symbols}{"A7}
-  \DeclareMathSymbol{\mathsterling}{\mathord}{\M at symbols}{"A3}
-  \DeclareMathSymbol{|}{\mathord}{\M at symbols}{"7C}
-  \DeclareMathSymbol{\neg}{\mathord}{\M at symbols}{"AC}
-  \DeclareMathSymbol{\infty}{\mathord}{\M at symbols}{"221E}
-  \DeclareMathSymbol{\partial}{\mathord}{\M at symbols}{"2202}
-  \DeclareMathSymbol{\mathbackslash}{\mathord}{\M at symbols}{"5C}
-  \DeclareMathSymbol{\degree}{\mathord}{\M at symbols}{"B0}
-  \DeclareMathSymbol{\increment}{\mathord}{\M at symbols}{"2206}
-  \DeclareMathSymbol{\hbar}{\mathord}{\M at symbols}{"127}
-  \DeclareMathSymbol{'}{\mathord}{\M at symbols}{"2032}
-  \DeclareMathSymbol{"}{\mathord}{\M at symbols}{"2033}
-  \DeclareMathSymbol{\comma}{\mathord}{\M at symbols}{"2C}
-  \DeclareMathSymbol{+}{\mathbin}{\M at symbols}{"2B}
-  \DeclareMathSymbol{-}{\mathbin}{\M at symbols}{"2212}
-  \DeclareMathSymbol{*}{\mathbin}{\M at symbols}{"2A}
-  \DeclareMathSymbol{\times}{\mathbin}{\M at symbols}{"D7}
-  \DeclareMathSymbol{/}{\mathbin}{\M at symbols}{"2215}
-  \DeclareMathSymbol{\div}{\mathbin}{\M at symbols}{"F7}
-  \DeclareMathSymbol{\pm}{\mathbin}{\M at symbols}{"B1}
-  \DeclareMathSymbol{\bullet}{\mathbin}{\M at symbols}{"2022}
-  \DeclareMathSymbol{\dagger}{\mathbin}{\M at symbols}{"2020}
-  \DeclareMathSymbol{\ddagger}{\mathbin}{\M at symbols}{"2021}
-  \DeclareMathSymbol{\cdot}{\mathbin}{\M at symbols}{"2219}
-  \DeclareMathSymbol{\setminus}{\mathbin}{\M at symbols}{"5C}
-  \DeclareMathSymbol{=}{\mathrel}{\M at symbols}{"3D}
-  \DeclareMathSymbol{<}{\mathrel}{\M at symbols}{"3C}
-  \DeclareMathSymbol{>}{\mathrel}{\M at symbols}{"3E}
-  \DeclareMathSymbol{\leq}{\mathrel}{\M at symbols}{"2264}
-  \DeclareMathSymbol{\geq}{\mathrel}{\M at symbols}{"2265}
-  \DeclareMathSymbol{\sim}{\mathrel}{\M at symbols}{"7E}
-  \DeclareMathSymbol{\approx}{\mathrel}{\M at symbols}{"2248}
-  \DeclareMathSymbol{\equiv}{\mathrel}{\M at symbols}{"2261}
-  \DeclareMathSymbol{\mid}{\mathrel}{\M at symbols}{"7C}
-  \DeclareMathSymbol{\parallel}{\mathrel}{\M at symbols}{"2016}
-  \DeclareMathSymbol{:}{\mathrel}{\M at symbols}{"3A}
-  \DeclareMathSymbol{?}{\mathclose}{\M at symbols}{"3F}
-  \DeclareMathSymbol{!}{\mathclose}{\M at symbols}{"21}
-  \DeclareMathSymbol{,}{\mathpunct}{\M at symbols}{"2C}
-  \DeclareMathSymbol{;}{\mathpunct}{\M at symbols}{"3B}
-  \DeclareMathSymbol{\colon}{\mathpunct}{\M at symbols}{"3A}
-  \DeclareMathSymbol{\mathellipsis}{\mathinner}{\M at symbols}{"2026}
-  \DeclareRobustCommand\#{\ifmmode\mathhash\else\char"23\relax\fi}
-  \DeclareRobustCommand\%{\ifmmode\mathpercent\else\char"25\relax\fi}
-  \DeclareRobustCommand\&{\ifmmode\mathand\else\char"26\relax\fi}
+  \DeclareMathSymbol{.}{\mathord}{\M at symbols@font}{"2E}
+  \DeclareMathSymbol{@}{\mathord}{\M at symbols@font}{"40}
+  \DeclareMathSymbol{'}{\mathord}{\M at symbols@font}{"2032}
+  \DeclareMathSymbol{\prime}{\mathord}{\M at symbols@font}{"2032}
+  \DeclareMathSymbol{"}{\mathord}{\M at symbols@font}{"2033}
+  \DeclareMathSymbol{\mathhash}{\mathord}{\M at symbols@font}{"23}
+  \DeclareMathSymbol{\mathdollar}{\mathord}{\M at symbols@font}{"24}
+  \DeclareMathSymbol{\mathpercent}{\mathord}{\M at symbols@font}{"25}
+  \DeclareMathSymbol{\mathand}{\mathord}{\M at symbols@font}{"26}
+  \DeclareMathSymbol{\mathparagraph}{\mathord}{\M at symbols@font}{"B6}
+  \DeclareMathSymbol{\mathsection}{\mathord}{\M at symbols@font}{"A7}
+  \DeclareMathSymbol{\mathsterling}{\mathord}{\M at symbols@font}{"A3}
+  \DeclareMathSymbol{\neg}{\mathord}{\M at symbols@font}{"AC}
+  \DeclareMathSymbol{|}{\mathord}{\M at symbols@font}{"7C}
+  \DeclareMathSymbol{\infty}{\mathord}{\M at symbols@font}{"221E}
+  \DeclareMathSymbol{\partial}{\mathord}{\M at symbols@font}{"2202}
+  \DeclareMathSymbol{\degree}{\mathord}{\M at symbols@font}{"B0}
+  \DeclareMathSymbol{\increment}{\mathord}{\M at symbols@font}{"2206}
+  \DeclareMathSymbol{\comma}{\mathord}{\M at symbols@font}{"2C}
+  \DeclareMathSymbol{+}{\mathbin}{\M at symbols@font}{"2B}
+  \DeclareMathSymbol{-}{\mathbin}{\M at symbols@font}{"2212}
+  \DeclareMathSymbol{*}{\mathbin}{\M at symbols@font}{"2A}
+  \DeclareMathSymbol{\times}{\mathbin}{\M at symbols@font}{"D7}
+  \DeclareMathSymbol{/}{\mathbin}{\M at symbols@font}{"2F}
+  \DeclareMathSymbol{\fractionslash}{\mathbin}{\M at symbols@font}{"2215}
+  \DeclareMathSymbol{\div}{\mathbin}{\M at symbols@font}{"F7}
+  \DeclareMathSymbol{\pm}{\mathbin}{\M at symbols@font}{"B1}
+  \DeclareMathSymbol{\bullet}{\mathbin}{\M at symbols@font}{"2022}
+  \DeclareMathSymbol{\dagger}{\mathbin}{\M at symbols@font}{"2020}
+  \DeclareMathSymbol{\ddagger}{\mathbin}{\M at symbols@font}{"2021}
+  \DeclareMathSymbol{\cdot}{\mathbin}{\M at symbols@font}{"2219}
+  \DeclareMathSymbol{\setminus}{\mathbin}{\M at symbols@font}{"5C}
+  \DeclareMathSymbol{=}{\mathrel}{\M at symbols@font}{"3D}
+  \DeclareMathSymbol{<}{\mathrel}{\M at symbols@font}{"3C}
+  \DeclareMathSymbol{>}{\mathrel}{\M at symbols@font}{"3E}
+  \DeclareMathSymbol{\leq}{\mathrel}{\M at symbols@font}{"2264}
+  \DeclareMathSymbol{\geq}{\mathrel}{\M at symbols@font}{"2265}
+  \DeclareMathSymbol{\sim}{\mathrel}{\M at symbols@font}{"7E}
+  \DeclareMathSymbol{\approx}{\mathrel}{\M at symbols@font}{"2248}
+  \DeclareMathSymbol{\equiv}{\mathrel}{\M at symbols@font}{"2261}
+  \DeclareMathSymbol{\mid}{\mathrel}{\M at symbols@font}{"7C}
+  \DeclareMathSymbol{\parallel}{\mathrel}{\M at symbols@font}{"2016}
+  \DeclareMathSymbol{:}{\mathrel}{\M at symbols@font}{"3A}
+  \DeclareMathSymbol{?}{\mathclose}{\M at symbols@font}{"3F}
+  \DeclareMathSymbol{!}{\mathclose}{\M at symbols@font}{"21}
+  \DeclareMathSymbol{,}{\mathpunct}{\M at symbols@font}{"2C}
+  \DeclareMathSymbol{;}{\mathpunct}{\M at symbols@font}{"3B}
+  \DeclareMathSymbol{\colon}{\mathord}{\M at symbols@font}{"3A}
+  \DeclareMathSymbol{\mathellipsis}{\mathinner}{\M at symbols@font}{"2026}
+  \protected\gdef\#{\ifmmode\mathhash\else\char"23\relax\fi}
+  \protected\gdef\%{\ifmmode\mathpercent\else\char"25\relax\fi}
+  \protected\gdef\&{\ifmmode\mathand\else\char"26\relax\fi}
   \DeclareMathSymbol{\@relbar}{\mathbin}{symbols}{"00}
   \DeclareMathSymbol{\@Relbar}{\mathrel}{operators}{"3D}
   \DeclareMathSymbol{\@verticalbar}{\mathord}{symbols}{"6A}
-  \DeclareRobustCommand\relbar{\mathrel{\smash\@relbar}}
-  \DeclareRobustCommand\Relbar{\mathrel{\@Relbar}}
-  \DeclareRobustCommand\models{\mathrel{\@verticalbar}\joinrel\Relbar}}
+  \ifM at extsymbols\else
+    \protected\gdef\simeq{\mathrel{\mathpalette\stack at flatrel{{-}{\sim}}}}
+    \protected\gdef\cong{\mathrel{\mathpalette\stack at flatrel{{=}{\sim}}}}
+  \fi
+  \protected\gdef\relbar{\mathrel{\smash\@relbar}}
+  \protected\gdef\Relbar{\mathrel{\@Relbar}}
+  \protected\gdef\models{\mathrel{\@verticalbar}\joinrel\Relbar}
+  \ifM at adjust@font
+    \DeclareMathSymbol{\bigat}{\mathop}{\M at symbols@font}{"40}
+    \DeclareMathSymbol{\bighash}{\mathop}{\M at symbols@font}{"23}
+    \DeclareMathSymbol{\bigdollar}{\mathop}{\M at symbols@font}{"24}
+    \DeclareMathSymbol{\bigpercent}{\mathop}{\M at symbols@font}{"25}
+    \DeclareMathSymbol{\bigand}{\mathop}{\M at symbols@font}{"26}
+    \DeclareMathSymbol{\bigplus}{\mathop}{\M at symbols@font}{"2B}
+    \DeclareMathSymbol{\bigp}{\mathop}{\M at symbols@font}{"21}
+    \DeclareMathSymbol{\bigq}{\mathop}{\M at symbols@font}{"3F}
+    \DeclareMathSymbol{\bigS}{\mathop}{\M at symbols@font}{"A7}
+    \DeclareMathSymbol{\bigtimes}{\mathop}{\M at symbols@font}{"D7}
+    \DeclareMathSymbol{\bigdiv}{\mathop}{\M at symbols@font}{"F7}
+    \DeclareMathSymbol{\nabla}{\mathord}{\M at symbols@font}{"2207}
+  \fi}
 \def\M at extsymbols@set{%
-  \edef\M at extsymbols{M\@extsymbolsshape\the\M at count}
+  \edef\M at extsymbols@font{M\M at extsymbolsshape\@tempa}
   \let\angle\@undefined
+  \let\simeq\@undefined
   \let\sqsubset\@undefined
   \let\sqsupset\@undefined
   \let\bowtie\@undefined
@@ -1064,183 +2668,177 @@
   \let\doteq\@undefined
   \let\neq\@undefined
   \let\ng\@undefined
-  \DeclareMathSymbol{\wp}{\mathord}{\M at extsymbols}{"2118}
-  \DeclareMathSymbol{\Re}{\mathord}{\M at extsymbols}{"211C}
-  \DeclareMathSymbol{\Im}{\mathord}{\M at extsymbols}{"2111}
-  \DeclareMathSymbol{\ell}{\mathord}{\M at extsymbols}{"2113}
-  \DeclareMathSymbol{\forall}{\mathord}{\M at extsymbols}{"2200}
-  \DeclareMathSymbol{\exists}{\mathord}{\M at extsymbols}{"2203}
-  \DeclareMathSymbol{\emptyset}{\mathord}{\M at extsymbols}{"2205}
-  \DeclareMathSymbol{\nabla}{\mathord}{\M at extsymbols}{"2207}
-  \DeclareMathSymbol{\in}{\mathord}{\M at extsymbols}{"2208}
-  \DeclareMathSymbol{\ni}{\mathord}{\M at extsymbols}{"220B}
-  \DeclareMathSymbol{\mp}{\mathord}{\M at extsymbols}{"2213}
-  \DeclareMathSymbol{\angle}{\mathord}{\M at extsymbols}{"2220}
-  \DeclareMathSymbol{\top}{\mathord}{\M at extsymbols}{"22A4}
-  \DeclareMathSymbol{\bot}{\mathord}{\M at extsymbols}{"22A5}
-  \DeclareMathSymbol{\vdash}{\mathord}{\M at extsymbols}{"22A2}
-  \DeclareMathSymbol{\dashv}{\mathord}{\M at extsymbols}{"22A3}
-  \DeclareMathSymbol{\flat}{\mathord}{\M at extsymbols}{"266D}
-  \DeclareMathSymbol{\natural}{\mathord}{\M at extsymbols}{"266E}
-  \DeclareMathSymbol{\sharp}{\mathord}{\M at extsymbols}{"266F}
-  \DeclareMathSymbol{\fflat}{\mathord}{\M at extsymbols}{"1D12B}
-  \DeclareMathSymbol{\ssharp}{\mathord}{\M at extsymbols}{"1D12A}
-  \DeclareMathSymbol{\bclubsuit}{\mathord}{\M at extsymbols}{"2663}
-    \let\clubsuit\bclubsuit
-  \DeclareMathSymbol{\bdiamondsuit}{\mathord}{\M at extsymbols}{"2666}
-  \DeclareMathSymbol{\bheartsuit}{\mathord}{\M at extsymbols}{"2665}
-  \DeclareMathSymbol{\bspadesuit}{\mathord}{\M at extsymbols}{"2660}
-    \let\spadesuit\bspadesuit
-  \DeclareMathSymbol{\wclubsuit}{\mathord}{\M at extsymbols}{"2667}
-  \DeclareMathSymbol{\wdiamondsuit}{\mathord}{\M at extsymbols}{"2662}
-    \let\diamondsuit\wdiamondsuit
-  \DeclareMathSymbol{\wheartsuit}{\mathord}{\M at extsymbols}{"2661}
-    \let\heartsuit\wheartsuit
-  \DeclareMathSymbol{\wspadesuit}{\mathord}{\M at extsymbols}{"2664}
-  \DeclareMathSymbol{\wedge}{\mathbin}{\M at extsymbols}{"2227}
-  \DeclareMathSymbol{\vee}{\mathbin}{\M at extsymbols}{"2228}
-  \DeclareMathSymbol{\cap}{\mathord}{\M at extsymbols}{"2229}
-  \DeclareMathSymbol{\cup}{\mathbin}{\M at extsymbols}{"222A}
-  \DeclareMathSymbol{\sqcap}{\mathbin}{\M at extsymbols}{"2293}
-  \DeclareMathSymbol{\sqcup}{\mathbin}{\M at extsymbols}{"2294}
-  \DeclareMathSymbol{\amalg}{\mathbin}{\M at extsymbols}{"2A3F}
-  \DeclareMathSymbol{\wr}{\mathbin}{\M at extsymbols}{"2240}
-  \DeclareMathSymbol{\ast}{\mathbin}{\M at extsymbols}{"2217}
-  \DeclareMathSymbol{\star}{\mathbin}{\M at extsymbols}{"22C6}
-  \DeclareMathSymbol{\diamond}{\mathbin}{\M at extsymbols}{"22C4}
-  \DeclareMathSymbol{\varcdot}{\mathbin}{\M at extsymbols}{"22C5}
-  \DeclareMathSymbol{\varsetminus}{\mathbin}{\M at extsymbols}{"2216}
-  \DeclareMathSymbol{\oplus}{\mathbin}{\M at extsymbols}{"2295}
-  \DeclareMathSymbol{\otimes}{\mathbin}{\M at extsymbols}{"2297}
-  \DeclareMathSymbol{\ominus}{\mathbin}{\M at extsymbols}{"2296}
-  \DeclareMathSymbol{\odiv}{\mathbin}{\M at extsymbols}{"2A38}
-  \DeclareMathSymbol{\oslash}{\mathbin}{\M at extsymbols}{"2298}
-  \DeclareMathSymbol{\odot}{\mathbin}{\M at extsymbols}{"2299}
-  \DeclareMathSymbol{\sqplus}{\mathbin}{\M at extsymbols}{"229E}
-  \DeclareMathSymbol{\sqtimes}{\mathbin}{\M at extsymbols}{"22A0}
-  \DeclareMathSymbol{\sqminus}{\mathbin}{\M at extsymbols}{"229F}
-  \DeclareMathSymbol{\sqdot}{\mathbin}{\M at extsymbols}{"22A1}
-  \DeclareMathSymbol{\in}{\mathrel}{\M at extsymbols}{"2208}
-  \DeclareMathSymbol{\ni}{\mathrel}{\M at extsymbols}{"220B}
-  \DeclareMathSymbol{\subset}{\mathrel}{\M at extsymbols}{"2282}
-  \DeclareMathSymbol{\supset}{\mathrel}{\M at extsymbols}{"2283}
-  \DeclareMathSymbol{\subseteq}{\mathrel}{\M at extsymbols}{"2286}
-  \DeclareMathSymbol{\supseteq}{\mathrel}{\M at extsymbols}{"2287}
-  \DeclareMathSymbol{\sqsubset}{\mathrel}{\M at extsymbols}{"228F}
-  \DeclareMathSymbol{\sqsupset}{\mathrel}{\M at extsymbols}{"2290}
-  \DeclareMathSymbol{\sqsubseteq}{\mathrel}{\M at extsymbols}{"2291}
-  \DeclareMathSymbol{\sqsupseteq}{\mathrel}{\M at extsymbols}{"2292}
-  \DeclareMathSymbol{\triangleleft}{\mathrel}{\M at extsymbols}{"22B2}
-  \DeclareMathSymbol{\triangleright}{\mathrel}{\M at extsymbols}{"22B3}
-  \DeclareMathSymbol{\trianglelefteq}{\mathrel}{\M at extsymbols}{"22B4}
-  \DeclareMathSymbol{\trianglerighteq}{\mathrel}{\M at extsymbols}{"22B5}
-  \DeclareMathSymbol{\propto}{\mathrel}{\M at extsymbols}{"221D}
-  \DeclareMathSymbol{\bowtie}{\mathrel}{\M at extsymbols}{"22C8}
-  \DeclareMathSymbol{\hourglass}{\mathrel}{\M at extsymbols}{"29D6}
-  \DeclareMathSymbol{\therefore}{\mathrel}{\M at extsymbols}{"2234}
-  \DeclareMathSymbol{\because}{\mathrel}{\M at extsymbols}{"2235}
-  \DeclareMathSymbol{\ratio}{\mathrel}{\M at extsymbols}{"2236}
-  \DeclareMathSymbol{\proportion}{\mathrel}{\M at extsymbols}{"2237}
-  \DeclareMathSymbol{\ll}{\mathrel}{\M at extsymbols}{"226A}
-  \DeclareMathSymbol{\gg}{\mathrel}{\M at extsymbols}{"226B}
-  \DeclareMathSymbol{\lll}{\mathrel}{\M at extsymbols}{"22D8}
-  \DeclareMathSymbol{\ggg}{\mathrel}{\M at extsymbols}{"22D9}
-  \DeclareMathSymbol{\leqq}{\mathrel}{\M at extsymbols}{"2266}
-  \DeclareMathSymbol{\geqq}{\mathrel}{\M at extsymbols}{"2267}
-  \DeclareMathSymbol{\lapprox}{\mathrel}{\M at extsymbols}{"2A85}
-  \DeclareMathSymbol{\gapprox}{\mathrel}{\M at extsymbols}{"2A86}
-  \DeclareMathSymbol{\simeq}{\mathrel}{\M at extsymbols}{"2243}
-  \DeclareMathSymbol{\eqsim}{\mathrel}{\M at extsymbols}{"2242}
-  \DeclareMathSymbol{\simeqq}{\mathrel}{\M at extsymbols}{"2245}
-    \let\cong\simeqq
-  \DeclareMathSymbol{\approxeq}{\mathrel}{\M at extsymbols}{"224A}
-  \DeclareMathSymbol{\sssim}{\mathrel}{\M at extsymbols}{"224B}
-  \DeclareMathSymbol{\seq}{\mathrel}{\M at extsymbols}{"224C}
-  \DeclareMathSymbol{\doteq}{\mathrel}{\M at extsymbols}{"2250}
-  \DeclareMathSymbol{\coloneq}{\mathrel}{\M at extsymbols}{"2254}
-  \DeclareMathSymbol{\eqcolon}{\mathrel}{\M at extsymbols}{"2255}
-  \DeclareMathSymbol{\ringeq}{\mathrel}{\M at extsymbols}{"2257}
-  \DeclareMathSymbol{\arceq}{\mathrel}{\M at extsymbols}{"2258}
-  \DeclareMathSymbol{\wedgeeq}{\mathrel}{\M at extsymbols}{"2259}
-  \DeclareMathSymbol{\veeeq}{\mathrel}{\M at extsymbols}{"225A}
-  \DeclareMathSymbol{\stareq}{\mathrel}{\M at extsymbols}{"225B}
-  \DeclareMathSymbol{\triangleeq}{\mathrel}{\M at extsymbols}{"225C}
-  \DeclareMathSymbol{\defeq}{\mathrel}{\M at extsymbols}{"225D}
-  \DeclareMathSymbol{\qeq}{\mathrel}{\M at extsymbols}{"225F}
-  \DeclareMathSymbol{\lsim}{\mathrel}{\M at extsymbols}{"2272}
-  \DeclareMathSymbol{\gsim}{\mathrel}{\M at extsymbols}{"2273}
-  \DeclareMathSymbol{\prec}{\mathrel}{\M at extsymbols}{"227A}
-  \DeclareMathSymbol{\succ}{\mathrel}{\M at extsymbols}{"227B}
-  \DeclareMathSymbol{\preceq}{\mathrel}{\M at extsymbols}{"227C}
-  \DeclareMathSymbol{\succeq}{\mathrel}{\M at extsymbols}{"227D}
-  \DeclareMathSymbol{\preceqq}{\mathrel}{\M at extsymbols}{"2AB3}
-  \DeclareMathSymbol{\succeqq}{\mathrel}{\M at extsymbols}{"2AB4}
-  \DeclareMathSymbol{\precsim}{\mathrel}{\M at extsymbols}{"227E}
-  \DeclareMathSymbol{\succsim}{\mathrel}{\M at extsymbols}{"227F}
-  \DeclareMathSymbol{\precapprox}{\mathrel}{\M at extsymbols}{"2AB7}
-  \DeclareMathSymbol{\succapprox}{\mathrel}{\M at extsymbols}{"2AB8}
-  \DeclareMathSymbol{\precprec}{\mathrel}{\M at extsymbols}{"2ABB}
-  \DeclareMathSymbol{\succsucc}{\mathrel}{\M at extsymbols}{"2ABC}
-  \DeclareMathSymbol{\asymp}{\mathrel}{\M at extsymbols}{"224D}
-  \DeclareMathSymbol{\nin}{\mathrel}{\M at extsymbols}{"2209}
-  \DeclareMathSymbol{\nni}{\mathrel}{\M at extsymbols}{"220C}
-  \DeclareMathSymbol{\nsubset}{\mathrel}{\M at extsymbols}{"2284}
-  \DeclareMathSymbol{\nsupset}{\mathrel}{\M at extsymbols}{"2285}
-  \DeclareMathSymbol{\nsubseteq}{\mathrel}{\M at extsymbols}{"2288}
-  \DeclareMathSymbol{\nsupseteq}{\mathrel}{\M at extsymbols}{"2289}
-  \DeclareMathSymbol{\subsetneq}{\mathrel}{\M at extsymbols}{"228A}
-  \DeclareMathSymbol{\supsetneq}{\mathrel}{\M at extsymbols}{"228B}
-  \DeclareMathSymbol{\nsqsubseteq}{\mathrel}{\M at extsymbols}{"22E2}
-  \DeclareMathSymbol{\nsqsupseteq}{\mathrel}{\M at extsymbols}{"22E3}
-  \DeclareMathSymbol{\sqsubsetneq}{\mathrel}{\M at extsymbols}{"22E4}
-  \DeclareMathSymbol{\sqsupsetneq}{\mathrel}{\M at extsymbols}{"22E5}
-  \DeclareMathSymbol{\neq}{\mathrel}{\M at extsymbols}{"2260}
-  \DeclareMathSymbol{\nl}{\mathrel}{\M at extsymbols}{"226E}
-  \DeclareMathSymbol{\ng}{\mathrel}{\M at extsymbols}{"226F}
-  \DeclareMathSymbol{\nleq}{\mathrel}{\M at extsymbols}{"2270}
-  \DeclareMathSymbol{\ngeq}{\mathrel}{\M at extsymbols}{"2271}
-  \DeclareMathSymbol{\lneq}{\mathrel}{\M at extsymbols}{"2A87}
-  \DeclareMathSymbol{\gneq}{\mathrel}{\M at extsymbols}{"2A88}
-  \DeclareMathSymbol{\lneqq}{\mathrel}{\M at extsymbols}{"2268}
-  \DeclareMathSymbol{\gneqq}{\mathrel}{\M at extsymbols}{"2269}
-  \DeclareMathSymbol{\ntriangleleft}{\mathrel}{\M at extsymbols}{"22EA}
-  \DeclareMathSymbol{\ntriangleright}{\mathrel}{\M at extsymbols}{"22EB}
-  \DeclareMathSymbol{\ntrianglelefteq}{\mathrel}{\M at extsymbols}{"22EC}
-  \DeclareMathSymbol{\ntrianglerighteq}{\mathrel}{\M at extsymbols}{"22ED}
-  \DeclareMathSymbol{\nsim}{\mathrel}{\M at extsymbols}{"2241}
-  \DeclareMathSymbol{\napprox}{\mathrel}{\M at extsymbols}{"2249}
-  \DeclareMathSymbol{\nsimeq}{\mathrel}{\M at extsymbols}{"2244}
-  \DeclareMathSymbol{\nsimeqq}{\mathrel}{\M at extsymbols}{"2247}
-  \DeclareMathSymbol{\simneqq}{\mathrel}{\M at extsymbols}{"2246}
-  \DeclareMathSymbol{\nlsim}{\mathrel}{\M at extsymbols}{"2274}
-  \DeclareMathSymbol{\ngsim}{\mathrel}{\M at extsymbols}{"2275}
-  \DeclareMathSymbol{\lnsim}{\mathrel}{\M at extsymbols}{"22E6}
-  \DeclareMathSymbol{\gnsim}{\mathrel}{\M at extsymbols}{"22E7}
-  \DeclareMathSymbol{\lnapprox}{\mathrel}{\M at extsymbols}{"2A89}
-  \DeclareMathSymbol{\gnapprox}{\mathrel}{\M at extsymbols}{"2A8A}
-  \DeclareMathSymbol{\nprec}{\mathrel}{\M at extsymbols}{"2280}
-  \DeclareMathSymbol{\nsucc}{\mathrel}{\M at extsymbols}{"2281}
-  \DeclareMathSymbol{\npreceq}{\mathrel}{\M at extsymbols}{"22E0}
-  \DeclareMathSymbol{\nsucceq}{\mathrel}{\M at extsymbols}{"22E1}
-  \DeclareMathSymbol{\precneq}{\mathrel}{\M at extsymbols}{"2AB1}
-  \DeclareMathSymbol{\succneq}{\mathrel}{\M at extsymbols}{"2AB2}
-  \DeclareMathSymbol{\precneqq}{\mathrel}{\M at extsymbols}{"2AB5}
-  \DeclareMathSymbol{\succneqq}{\mathrel}{\M at extsymbols}{"2AB6}
-  \DeclareMathSymbol{\precnsim}{\mathrel}{\M at extsymbols}{"22E8}
-  \DeclareMathSymbol{\succnsim}{\mathrel}{\M at extsymbols}{"22E9}
-  \DeclareMathSymbol{\precnapprox}{\mathrel}{\M at extsymbols}{"2AB9}
-  \DeclareMathSymbol{\succnapprox}{\mathrel}{\M at extsymbols}{"2ABA}
-  \DeclareMathSymbol{\nequiv}{\mathrel}{\M at extsymbols}{"2262}}
-\def\M at delimiters@set{%
-  \edef\M at delimiters{M\@delimitersshape\the\M at count}
-  \DeclareMathSymbol{(}{\mathopen}{\M at delimiters}{"28}
-  \DeclareMathSymbol{)}{\mathclose}{\M at delimiters}{"29}
-  \DeclareMathSymbol{[}{\mathopen}{\M at delimiters}{"5B}
-  \DeclareMathSymbol{]}{\mathclose}{\M at delimiters}{"5D}
-  \DeclareMathSymbol{\leftbrace}{\mathopen}{\M at delimiters}{"7B}
-  \DeclareMathSymbol{\rightbrace}{\mathclose}{\M at delimiters}{"7D}}
+  \DeclareMathSymbol{\wp}{\mathord}{\M at extsymbols@font}{"2118}
+  \DeclareMathSymbol{\Re}{\mathord}{\M at extsymbols@font}{"211C}
+  \DeclareMathSymbol{\Im}{\mathord}{\M at extsymbols@font}{"2111}
+  \DeclareMathSymbol{\ell}{\mathord}{\M at extsymbols@font}{"2113}
+  \DeclareMathSymbol{\forall}{\mathord}{\M at extsymbols@font}{"2200}
+  \DeclareMathSymbol{\exists}{\mathord}{\M at extsymbols@font}{"2203}
+  \DeclareMathSymbol{\emptyset}{\mathord}{\M at extsymbols@font}{"2205}
+  \DeclareMathSymbol{\in}{\mathord}{\M at extsymbols@font}{"2208}
+  \DeclareMathSymbol{\ni}{\mathord}{\M at extsymbols@font}{"220B}
+  \DeclareMathSymbol{\mp}{\mathord}{\M at extsymbols@font}{"2213}
+  \DeclareMathSymbol{\angle}{\mathord}{\M at extsymbols@font}{"2220}
+  \DeclareMathSymbol{\top}{\mathord}{\M at extsymbols@font}{"22A4}
+  \DeclareMathSymbol{\bot}{\mathord}{\M at extsymbols@font}{"22A5}
+  \DeclareMathSymbol{\vdash}{\mathord}{\M at extsymbols@font}{"22A2}
+  \DeclareMathSymbol{\dashv}{\mathord}{\M at extsymbols@font}{"22A3}
+  \DeclareMathSymbol{\flat}{\mathord}{\M at extsymbols@font}{"266D}
+  \DeclareMathSymbol{\natural}{\mathord}{\M at extsymbols@font}{"266E}
+  \DeclareMathSymbol{\sharp}{\mathord}{\M at extsymbols@font}{"266F}
+  \DeclareMathSymbol{\fflat}{\mathord}{\M at extsymbols@font}{"1D12B}
+  \DeclareMathSymbol{\ssharp}{\mathord}{\M at extsymbols@font}{"1D12A}
+  \DeclareMathSymbol{\bclubsuit}{\mathord}{\M at extsymbols@font}{"2663}
+  \DeclareMathSymbol{\bdiamondsuit}{\mathord}{\M at extsymbols@font}{"2666}
+  \DeclareMathSymbol{\bheartsuit}{\mathord}{\M at extsymbols@font}{"2665}
+  \DeclareMathSymbol{\bspadesuit}{\mathord}{\M at extsymbols@font}{"2660}
+  \DeclareMathSymbol{\wclubsuit}{\mathord}{\M at extsymbols@font}{"2667}
+  \DeclareMathSymbol{\wdiamondsuit}{\mathord}{\M at extsymbols@font}{"2662}
+  \DeclareMathSymbol{\wheartsuit}{\mathord}{\M at extsymbols@font}{"2661}
+  \DeclareMathSymbol{\wspadesuit}{\mathord}{\M at extsymbols@font}{"2664}
+    \global\let\spadesuit\bspadesuit
+    \global\let\heartsuit\wheartsuit
+    \global\let\diamondsuit\wdiamondsuit
+    \global\let\clubsuit\bclubsuit
+  \DeclareMathSymbol{\wedge}{\mathbin}{\M at extsymbols@font}{"2227}
+  \DeclareMathSymbol{\vee}{\mathbin}{\M at extsymbols@font}{"2228}
+  \DeclareMathSymbol{\cap}{\mathord}{\M at extsymbols@font}{"2229}
+  \DeclareMathSymbol{\cup}{\mathbin}{\M at extsymbols@font}{"222A}
+  \DeclareMathSymbol{\sqcap}{\mathbin}{\M at extsymbols@font}{"2293}
+  \DeclareMathSymbol{\sqcup}{\mathbin}{\M at extsymbols@font}{"2294}
+  \DeclareMathSymbol{\amalg}{\mathbin}{\M at extsymbols@font}{"2A3F}
+  \DeclareMathSymbol{\wr}{\mathbin}{\M at extsymbols@font}{"2240}
+  \DeclareMathSymbol{\ast}{\mathbin}{\M at extsymbols@font}{"2217}
+  \DeclareMathSymbol{\star}{\mathbin}{\M at extsymbols@font}{"22C6}
+  \DeclareMathSymbol{\diamond}{\mathbin}{\M at extsymbols@font}{"22C4}
+  \DeclareMathSymbol{\varcdot}{\mathbin}{\M at extsymbols@font}{"22C5}
+  \DeclareMathSymbol{\varsetminus}{\mathbin}{\M at extsymbols@font}{"2216}
+  \DeclareMathSymbol{\oplus}{\mathbin}{\M at extsymbols@font}{"2295}
+  \DeclareMathSymbol{\otimes}{\mathbin}{\M at extsymbols@font}{"2297}
+  \DeclareMathSymbol{\ominus}{\mathbin}{\M at extsymbols@font}{"2296}
+  \DeclareMathSymbol{\odiv}{\mathbin}{\M at extsymbols@font}{"2A38}
+  \DeclareMathSymbol{\oslash}{\mathbin}{\M at extsymbols@font}{"2298}
+  \DeclareMathSymbol{\odot}{\mathbin}{\M at extsymbols@font}{"2299}
+  \DeclareMathSymbol{\sqplus}{\mathbin}{\M at extsymbols@font}{"229E}
+  \DeclareMathSymbol{\sqtimes}{\mathbin}{\M at extsymbols@font}{"22A0}
+  \DeclareMathSymbol{\sqminus}{\mathbin}{\M at extsymbols@font}{"229F}
+  \DeclareMathSymbol{\sqdot}{\mathbin}{\M at extsymbols@font}{"22A1}
+  \DeclareMathSymbol{\in}{\mathrel}{\M at extsymbols@font}{"2208}
+  \DeclareMathSymbol{\ni}{\mathrel}{\M at extsymbols@font}{"220B}
+  \DeclareMathSymbol{\subset}{\mathrel}{\M at extsymbols@font}{"2282}
+  \DeclareMathSymbol{\supset}{\mathrel}{\M at extsymbols@font}{"2283}
+  \DeclareMathSymbol{\subseteq}{\mathrel}{\M at extsymbols@font}{"2286}
+  \DeclareMathSymbol{\supseteq}{\mathrel}{\M at extsymbols@font}{"2287}
+  \DeclareMathSymbol{\sqsubset}{\mathrel}{\M at extsymbols@font}{"228F}
+  \DeclareMathSymbol{\sqsupset}{\mathrel}{\M at extsymbols@font}{"2290}
+  \DeclareMathSymbol{\sqsubseteq}{\mathrel}{\M at extsymbols@font}{"2291}
+  \DeclareMathSymbol{\sqsupseteq}{\mathrel}{\M at extsymbols@font}{"2292}
+  \DeclareMathSymbol{\triangleleft}{\mathrel}{\M at extsymbols@font}{"22B2}
+  \DeclareMathSymbol{\triangleright}{\mathrel}{\M at extsymbols@font}{"22B3}
+  \DeclareMathSymbol{\trianglelefteq}{\mathrel}{\M at extsymbols@font}{"22B4}
+  \DeclareMathSymbol{\trianglerighteq}{\mathrel}{\M at extsymbols@font}{"22B5}
+  \DeclareMathSymbol{\propto}{\mathrel}{\M at extsymbols@font}{"221D}
+  \DeclareMathSymbol{\bowtie}{\mathrel}{\M at extsymbols@font}{"22C8}
+  \DeclareMathSymbol{\hourglass}{\mathrel}{\M at extsymbols@font}{"29D6}
+  \DeclareMathSymbol{\therefore}{\mathrel}{\M at extsymbols@font}{"2234}
+  \DeclareMathSymbol{\because}{\mathrel}{\M at extsymbols@font}{"2235}
+  \DeclareMathSymbol{\ratio}{\mathrel}{\M at extsymbols@font}{"2236}
+  \DeclareMathSymbol{\proportion}{\mathrel}{\M at extsymbols@font}{"2237}
+  \DeclareMathSymbol{\ll}{\mathrel}{\M at extsymbols@font}{"226A}
+  \DeclareMathSymbol{\gg}{\mathrel}{\M at extsymbols@font}{"226B}
+  \DeclareMathSymbol{\lll}{\mathrel}{\M at extsymbols@font}{"22D8}
+  \DeclareMathSymbol{\ggg}{\mathrel}{\M at extsymbols@font}{"22D9}
+  \DeclareMathSymbol{\leqq}{\mathrel}{\M at extsymbols@font}{"2266}
+  \DeclareMathSymbol{\geqq}{\mathrel}{\M at extsymbols@font}{"2267}
+  \DeclareMathSymbol{\lapprox}{\mathrel}{\M at extsymbols@font}{"2A85}
+  \DeclareMathSymbol{\gapprox}{\mathrel}{\M at extsymbols@font}{"2A86}
+  \DeclareMathSymbol{\simeq}{\mathrel}{\M at extsymbols@font}{"2243}
+  \DeclareMathSymbol{\eqsim}{\mathrel}{\M at extsymbols@font}{"2242}
+  \DeclareMathSymbol{\simeqq}{\mathrel}{\M at extsymbols@font}{"2245}
+    \global\let\cong\simeqq
+  \DeclareMathSymbol{\approxeq}{\mathrel}{\M at extsymbols@font}{"224A}
+  \DeclareMathSymbol{\sssim}{\mathrel}{\M at extsymbols@font}{"224B}
+  \DeclareMathSymbol{\seq}{\mathrel}{\M at extsymbols@font}{"224C}
+  \DeclareMathSymbol{\doteq}{\mathrel}{\M at extsymbols@font}{"2250}
+  \DeclareMathSymbol{\coloneq}{\mathrel}{\M at extsymbols@font}{"2254}
+  \DeclareMathSymbol{\eqcolon}{\mathrel}{\M at extsymbols@font}{"2255}
+  \DeclareMathSymbol{\ringeq}{\mathrel}{\M at extsymbols@font}{"2257}
+  \DeclareMathSymbol{\arceq}{\mathrel}{\M at extsymbols@font}{"2258}
+  \DeclareMathSymbol{\wedgeeq}{\mathrel}{\M at extsymbols@font}{"2259}
+  \DeclareMathSymbol{\veeeq}{\mathrel}{\M at extsymbols@font}{"225A}
+  \DeclareMathSymbol{\stareq}{\mathrel}{\M at extsymbols@font}{"225B}
+  \DeclareMathSymbol{\triangleeq}{\mathrel}{\M at extsymbols@font}{"225C}
+  \DeclareMathSymbol{\defeq}{\mathrel}{\M at extsymbols@font}{"225D}
+  \DeclareMathSymbol{\qeq}{\mathrel}{\M at extsymbols@font}{"225F}
+  \DeclareMathSymbol{\lsim}{\mathrel}{\M at extsymbols@font}{"2272}
+  \DeclareMathSymbol{\gsim}{\mathrel}{\M at extsymbols@font}{"2273}
+  \DeclareMathSymbol{\prec}{\mathrel}{\M at extsymbols@font}{"227A}
+  \DeclareMathSymbol{\succ}{\mathrel}{\M at extsymbols@font}{"227B}
+  \DeclareMathSymbol{\preceq}{\mathrel}{\M at extsymbols@font}{"227C}
+  \DeclareMathSymbol{\succeq}{\mathrel}{\M at extsymbols@font}{"227D}
+  \DeclareMathSymbol{\preceqq}{\mathrel}{\M at extsymbols@font}{"2AB3}
+  \DeclareMathSymbol{\succeqq}{\mathrel}{\M at extsymbols@font}{"2AB4}
+  \DeclareMathSymbol{\precsim}{\mathrel}{\M at extsymbols@font}{"227E}
+  \DeclareMathSymbol{\succsim}{\mathrel}{\M at extsymbols@font}{"227F}
+  \DeclareMathSymbol{\precapprox}{\mathrel}{\M at extsymbols@font}{"2AB7}
+  \DeclareMathSymbol{\succapprox}{\mathrel}{\M at extsymbols@font}{"2AB8}
+  \DeclareMathSymbol{\precprec}{\mathrel}{\M at extsymbols@font}{"2ABB}
+  \DeclareMathSymbol{\succsucc}{\mathrel}{\M at extsymbols@font}{"2ABC}
+  \DeclareMathSymbol{\asymp}{\mathrel}{\M at extsymbols@font}{"224D}
+  \DeclareMathSymbol{\nin}{\mathrel}{\M at extsymbols@font}{"2209}
+  \DeclareMathSymbol{\nni}{\mathrel}{\M at extsymbols@font}{"220C}
+  \DeclareMathSymbol{\nsubset}{\mathrel}{\M at extsymbols@font}{"2284}
+  \DeclareMathSymbol{\nsupset}{\mathrel}{\M at extsymbols@font}{"2285}
+  \DeclareMathSymbol{\nsubseteq}{\mathrel}{\M at extsymbols@font}{"2288}
+  \DeclareMathSymbol{\nsupseteq}{\mathrel}{\M at extsymbols@font}{"2289}
+  \DeclareMathSymbol{\subsetneq}{\mathrel}{\M at extsymbols@font}{"228A}
+  \DeclareMathSymbol{\supsetneq}{\mathrel}{\M at extsymbols@font}{"228B}
+  \DeclareMathSymbol{\nsqsubseteq}{\mathrel}{\M at extsymbols@font}{"22E2}
+  \DeclareMathSymbol{\nsqsupseteq}{\mathrel}{\M at extsymbols@font}{"22E3}
+  \DeclareMathSymbol{\sqsubsetneq}{\mathrel}{\M at extsymbols@font}{"22E4}
+  \DeclareMathSymbol{\sqsupsetneq}{\mathrel}{\M at extsymbols@font}{"22E5}
+  \DeclareMathSymbol{\neq}{\mathrel}{\M at extsymbols@font}{"2260}
+  \DeclareMathSymbol{\nl}{\mathrel}{\M at extsymbols@font}{"226E}
+  \DeclareMathSymbol{\ng}{\mathrel}{\M at extsymbols@font}{"226F}
+  \DeclareMathSymbol{\nleq}{\mathrel}{\M at extsymbols@font}{"2270}
+  \DeclareMathSymbol{\ngeq}{\mathrel}{\M at extsymbols@font}{"2271}
+  \DeclareMathSymbol{\lneq}{\mathrel}{\M at extsymbols@font}{"2A87}
+  \DeclareMathSymbol{\gneq}{\mathrel}{\M at extsymbols@font}{"2A88}
+  \DeclareMathSymbol{\lneqq}{\mathrel}{\M at extsymbols@font}{"2268}
+  \DeclareMathSymbol{\gneqq}{\mathrel}{\M at extsymbols@font}{"2269}
+  \DeclareMathSymbol{\ntriangleleft}{\mathrel}{\M at extsymbols@font}{"22EA}
+  \DeclareMathSymbol{\ntriangleright}{\mathrel}{\M at extsymbols@font}{"22EB}
+  \DeclareMathSymbol{\ntrianglelefteq}{\mathrel}{\M at extsymbols@font}{"22EC}
+  \DeclareMathSymbol{\ntrianglerighteq}{\mathrel}{\M at extsymbols@font}{"22ED}
+  \DeclareMathSymbol{\nsim}{\mathrel}{\M at extsymbols@font}{"2241}
+  \DeclareMathSymbol{\napprox}{\mathrel}{\M at extsymbols@font}{"2249}
+  \DeclareMathSymbol{\nsimeq}{\mathrel}{\M at extsymbols@font}{"2244}
+  \DeclareMathSymbol{\nsimeqq}{\mathrel}{\M at extsymbols@font}{"2247}
+  \DeclareMathSymbol{\simneqq}{\mathrel}{\M at extsymbols@font}{"2246}
+  \DeclareMathSymbol{\nlsim}{\mathrel}{\M at extsymbols@font}{"2274}
+  \DeclareMathSymbol{\ngsim}{\mathrel}{\M at extsymbols@font}{"2275}
+  \DeclareMathSymbol{\lnsim}{\mathrel}{\M at extsymbols@font}{"22E6}
+  \DeclareMathSymbol{\gnsim}{\mathrel}{\M at extsymbols@font}{"22E7}
+  \DeclareMathSymbol{\lnapprox}{\mathrel}{\M at extsymbols@font}{"2A89}
+  \DeclareMathSymbol{\gnapprox}{\mathrel}{\M at extsymbols@font}{"2A8A}
+  \DeclareMathSymbol{\nprec}{\mathrel}{\M at extsymbols@font}{"2280}
+  \DeclareMathSymbol{\nsucc}{\mathrel}{\M at extsymbols@font}{"2281}
+  \DeclareMathSymbol{\npreceq}{\mathrel}{\M at extsymbols@font}{"22E0}
+  \DeclareMathSymbol{\nsucceq}{\mathrel}{\M at extsymbols@font}{"22E1}
+  \DeclareMathSymbol{\precneq}{\mathrel}{\M at extsymbols@font}{"2AB1}
+  \DeclareMathSymbol{\succneq}{\mathrel}{\M at extsymbols@font}{"2AB2}
+  \DeclareMathSymbol{\precneqq}{\mathrel}{\M at extsymbols@font}{"2AB5}
+  \DeclareMathSymbol{\succneqq}{\mathrel}{\M at extsymbols@font}{"2AB6}
+  \DeclareMathSymbol{\precnsim}{\mathrel}{\M at extsymbols@font}{"22E8}
+  \DeclareMathSymbol{\succnsim}{\mathrel}{\M at extsymbols@font}{"22E9}
+  \DeclareMathSymbol{\precnapprox}{\mathrel}{\M at extsymbols@font}{"2AB9}
+  \DeclareMathSymbol{\succnapprox}{\mathrel}{\M at extsymbols@font}{"2ABA}
+  \DeclareMathSymbol{\nequiv}{\mathrel}{\M at extsymbols@font}{"2262}
+  \ifM at adjust@font\else
+    \DeclareMathSymbol{\nabla}{\mathord}{\M at extsymbols@font}{"2207}
+  \fi}
 \def\M at arrows@set{%
-  \edef\M at arrows{M\@arrowsshape\the\M at count}
+  \edef\M at arrows@font{M\M at arrowsshape\@tempa}
   \let\uparrow\@undefined
   \let\Uparrow\@undefined
   \let\downarrow\@undefined
@@ -1256,450 +2854,412 @@
   \let\Longleftarrow\@undefined
   \let\Longleftrightarrow\@undefined
   \let\rightleftharpoons\@undefined
-  \DeclareMathSymbol{\rightarrow}{\mathrel}{\M at arrows}{"2192}
-    \let\to\rightarrow
-  \DeclareMathSymbol{\nrightarrow}{\mathrel}{\M at arrows}{"219B}
-  \DeclareMathSymbol{\Rightarrow}{\mathrel}{\M at arrows}{"21D2}
-  \DeclareMathSymbol{\nRightarrow}{\mathrel}{\M at arrows}{"21CF}
-  \DeclareMathSymbol{\Rrightarrow}{\mathrel}{\M at arrows}{"21DB}
-  \DeclareMathSymbol{\longrightarrow}{\mathrel}{\M at arrows}{"27F6}
-  \DeclareMathSymbol{\Longrightarrow}{\mathrel}{\M at arrows}{"27F9}
-  \DeclareMathSymbol{\rightbararrow}{\mathrel}{\M at arrows}{"21A6}
-    \let\mapsto\rightbararrow
-  \DeclareMathSymbol{\Rightbararrow}{\mathrel}{\M at arrows}{"2907}
-  \DeclareMathSymbol{\longrightbararrow}{\mathrel}{\M at arrows}{"27FC}
-    \let\longmapsto\longrightbararrow
-  \DeclareMathSymbol{\Longrightbararrow}{\mathrel}{\M at arrows}{"27FE}
-  \DeclareMathSymbol{\hookrightarrow}{\mathrel}{\M at arrows}{"21AA}
-  \DeclareMathSymbol{\rightdasharrow}{\mathrel}{\M at arrows}{"21E2}
-  \DeclareMathSymbol{\rightharpoonup}{\mathrel}{\M at arrows}{"21C0}
-  \DeclareMathSymbol{\rightharpoondown}{\mathrel}{\M at arrows}{"21C1}
-  \DeclareMathSymbol{\rightarrowtail}{\mathrel}{\M at arrows}{"21A3}
-  \DeclareMathSymbol{\rightoplusarrow}{\mathrel}{\M at arrows}{"27F4}
-  \DeclareMathSymbol{\rightwavearrow}{\mathrel}{\M at arrows}{"219D}
-  \DeclareMathSymbol{\rightsquigarrow}{\mathrel}{\M at arrows}{"21DD}
-  \DeclareMathSymbol{\longrightsquigarrow}{\mathrel}{\M at arrows}{"27FF}
-  \DeclareMathSymbol{\looparrowright}{\mathrel}{\M at arrows}{"21AC}
-  \DeclareMathSymbol{\curvearrowright}{\mathrel}{\M at arrows}{"293B}
-  \DeclareMathSymbol{\circlearrowright}{\mathrel}{\M at arrows}{"21BB}
-  \DeclareMathSymbol{\twoheadrightarrow}{\mathrel}{\M at arrows}{"21A0}
-  \DeclareMathSymbol{\rightarrowtobar}{\mathrel}{\M at arrows}{"21E5}
-  \DeclareMathSymbol{\rightwhitearrow}{\mathrel}{\M at arrows}{"21E8}
-  \DeclareMathSymbol{\rightrightarrows}{\mathrel}{\M at arrows}{"21C9}
-  \DeclareMathSymbol{\rightrightrightarrows}{\mathrel}{\M at arrows}{"21F6}
-  \DeclareMathSymbol{\leftarrow}{\mathrel}{\M at arrows}{"2190}
-    \let\from\leftarrow
-  \DeclareMathSymbol{\nleftarrow}{\mathrel}{\M at arrows}{"219A}
-  \DeclareMathSymbol{\Leftarrow}{\mathrel}{\M at arrows}{"21D0}
-  \DeclareMathSymbol{\nLeftarrow}{\mathrel}{\M at arrows}{"21CD}
-  \DeclareMathSymbol{\Lleftarrow}{\mathrel}{\M at arrows}{"21DA}
-  \DeclareMathSymbol{\longleftarrow}{\mathrel}{\M at arrows}{"27F5}
-  \DeclareMathSymbol{\Longleftarrow}{\mathrel}{\M at arrows}{"27F8}
-  \DeclareMathSymbol{\leftbararrow}{\mathrel}{\M at arrows}{"21A4}
-    \let\mapsfrom\leftbararrow
-  \DeclareMathSymbol{\Leftbararrow}{\mathrel}{\M at arrows}{"2906}
-  \DeclareMathSymbol{\longleftbararrow}{\mathrel}{\M at arrows}{"27FB}
-    \let\longmapsfrom\longleftbararrow
-  \DeclareMathSymbol{\Longleftbararrow}{\mathrel}{\M at arrows}{"27FD}
-  \DeclareMathSymbol{\hookleftarrow}{\mathrel}{\M at arrows}{"21A9}
-  \DeclareMathSymbol{\leftdasharrow}{\mathrel}{\M at arrows}{"21E0}
-  \DeclareMathSymbol{\leftharpoonup}{\mathrel}{\M at arrows}{"21C0}
-  \DeclareMathSymbol{\leftharpoondown}{\mathrel}{\M at arrows}{"21C1}
-  \DeclareMathSymbol{\leftarrowtail}{\mathrel}{\M at arrows}{"21A2}
-  \DeclareMathSymbol{\leftoplusarrow}{\mathrel}{\M at arrows}{"2B32}
-  \DeclareMathSymbol{\leftwavearrow}{\mathrel}{\M at arrows}{"219C}
-  \DeclareMathSymbol{\leftsquigarrow}{\mathrel}{\M at arrows}{"21DC}
-  \DeclareMathSymbol{\longleftsquigarrow}{\mathrel}{\M at arrows}{"2B33}
-  \DeclareMathSymbol{\looparrowleft}{\mathrel}{\M at arrows}{"21AB}
-  \DeclareMathSymbol{\curvearrowleft}{\mathrel}{\M at arrows}{"293A}
-  \DeclareMathSymbol{\circlearrowleft}{\mathrel}{\M at arrows}{"21BA}
-  \DeclareMathSymbol{\twoheadleftarrow}{\mathrel}{\M at arrows}{"219E}
-  \DeclareMathSymbol{\leftarrowtobar}{\mathrel}{\M at arrows}{"21E4}
-  \DeclareMathSymbol{\leftwhitearrow}{\mathrel}{\M at arrows}{"21E6}
-  \DeclareMathSymbol{\leftleftarrows}{\mathrel}{\M at arrows}{"21C7}
-  \DeclareMathSymbol{\leftleftleftarrows}{\mathrel}{\M at arrows}{"2B31}
-  \DeclareMathSymbol{\leftrightarrow}{\mathrel}{\M at arrows}{"2194}
-  \DeclareMathSymbol{\Leftrightarrow}{\mathrel}{\M at arrows}{"21D4}
-  \DeclareMathSymbol{\nLeftrightarrow}{\mathrel}{\M at arrows}{"21CE}
-  \DeclareMathSymbol{\longleftrightarrow}{\mathrel}{\M at arrows}{"27F7}
-  \DeclareMathSymbol{\Longleftrightarrow}{\mathrel}{\M at arrows}{"27FA}
-  \DeclareMathSymbol{\leftrightwavearrow}{\mathrel}{\M at arrows}{"21AD}
-  \DeclareMathSymbol{\leftrightarrows}{\mathrel}{\M at arrows}{"21C6}
-  \DeclareMathSymbol{\leftrightharpoons}{\mathrel}{\M at arrows}{"21CB}
-  \DeclareMathSymbol{\leftrightarrowstobar}{\mathrel}{\M at arrows}{"21B9}
-  \DeclareMathSymbol{\rightleftarrows}{\mathrel}{\M at arrows}{"21C4}
-  \DeclareMathSymbol{\rightleftharpoons}{\mathrel}{\M at arrows}{"21CC}
-  \DeclareMathSymbol{\uparrow}{\mathrel}{\M at arrows}{"2191}
-  \DeclareMathSymbol{\Uparrow}{\mathrel}{\M at arrows}{"21D1}
-  \DeclareMathSymbol{\Uuparrow}{\mathrel}{\M at arrows}{"290A}
-  \DeclareMathSymbol{\upbararrow}{\mathrel}{\M at arrows}{"21A5}
-  \DeclareMathSymbol{\updasharrow}{\mathrel}{\M at arrows}{"21E1}
-  \DeclareMathSymbol{\upharpoonleft}{\mathrel}{\M at arrows}{"21BF}
-  \DeclareMathSymbol{\upharpoonright}{\mathrel}{\M at arrows}{"21BE}
-  \DeclareMathSymbol{\twoheaduparrow}{\mathrel}{\M at arrows}{"219F}
-  \DeclareMathSymbol{\uparrowtobar}{\mathrel}{\M at arrows}{"2912}
-  \DeclareMathSymbol{\upwhitearrow}{\mathrel}{\M at arrows}{"21E7}
-  \DeclareMathSymbol{\upwhitebararrow}{\mathrel}{\M at arrows}{"21EA}
-  \DeclareMathSymbol{\upuparrows}{\mathrel}{\M at arrows}{"21C8}
-  \DeclareMathSymbol{\downarrow}{\mathrel}{\M at arrows}{"2193}
-  \DeclareMathSymbol{\Downarrow}{\mathrel}{\M at arrows}{"21D3}
-  \DeclareMathSymbol{\Ddownarrow}{\mathrel}{\M at arrows}{"290B}
-  \DeclareMathSymbol{\downbararrow}{\mathrel}{\M at arrows}{"21A7}
-  \DeclareMathSymbol{\downdasharrow}{\mathrel}{\M at arrows}{"21E3}
-  \DeclareMathSymbol{\zigzagarrow}{\mathrel}{\M at arrows}{"21AF}
-    \let\lightningboltarrow\zigzagarrow
-  \DeclareMathSymbol{\downharpoonleft}{\mathrel}{\M at arrows}{"21C3}
-  \DeclareMathSymbol{\downharpoonright}{\mathrel}{\M at arrows}{"21C2}
-  \DeclareMathSymbol{\twoheaddownarrow}{\mathrel}{\M at arrows}{"21A1}
-  \DeclareMathSymbol{\downarrowtobar}{\mathrel}{\M at arrows}{"2913}
-  \DeclareMathSymbol{\downwhitearrow}{\mathrel}{\M at arrows}{"21E9}
-  \DeclareMathSymbol{\downdownarrows}{\mathrel}{\M at arrows}{"21CA}
-  \DeclareMathSymbol{\updownarrow}{\mathrel}{\M at arrows}{"2195}
-  \DeclareMathSymbol{\Updownarrow}{\mathrel}{\M at arrows}{"21D5}
-  \DeclareMathSymbol{\updownarrows}{\mathrel}{\M at arrows}{"21C5}
-  \DeclareMathSymbol{\downuparrows}{\mathrel}{\M at arrows}{"21F5}
-  \DeclareMathSymbol{\updownharpoons}{\mathrel}{\M at arrows}{"296E}
-  \DeclareMathSymbol{\downupharpoons}{\mathrel}{\M at arrows}{"296F}
-  \DeclareMathSymbol{\nearrow}{\mathrel}{\M at arrows}{"2197}
-  \DeclareMathSymbol{\Nearrow}{\mathrel}{\M at arrows}{"21D7}
-  \DeclareMathSymbol{\nwarrow}{\mathrel}{\M at arrows}{"2196}
-  \DeclareMathSymbol{\Nwarrow}{\mathrel}{\M at arrows}{"21D6}
-  \DeclareMathSymbol{\searrow}{\mathrel}{\M at arrows}{"2198}
-  \DeclareMathSymbol{\Searrow}{\mathrel}{\M at arrows}{"21D8}
-  \DeclareMathSymbol{\swarrow}{\mathrel}{\M at arrows}{"2199}
-  \DeclareMathSymbol{\Swarrow}{\mathrel}{\M at arrows}{"21D9}
-  \DeclareMathSymbol{\nwsearrow}{\mathrel}{\M at arrows}{"2921}
-  \DeclareMathSymbol{\neswarrow}{\mathrel}{\M at arrows}{"2922}
-  \DeclareMathSymbol{\lcirclearrow}{\mathrel}{\M at arrows}{"27F2}
-  \DeclareMathSymbol{\rcirclearrow}{\mathrel}{\M at arrows}{"27F3}}
-\def\M at bigops@set{%
-  \edef\M at bigops{M\@bigopsshape\the\M at count}
-  \let\sum\@undefined
-  \let\prod\@undefined
-  \DeclareMathSymbol{\sum}{\mathop}{\M at bigops}{"2211}
-  \DeclareMathSymbol{\prod}{\mathop}{\M at bigops}{"220F}
-  \DeclareMathSymbol{\intop}{\mathop}{\M at bigops}{"222B}}
-\def\M at extbigops@set{%
-  \edef\M at extbigops{M\@extbigopsshape\the\M at count}
-  \let\coprod\@undefined
-  \let\bigvee\@undefined
-  \let\bigwedge\@undefined
-  \let\bigcup\@undefined
-  \let\bigcap\@undefined
-  \let\bigoplus\@undefined
-  \let\bigotimes\@undefined
-  \let\bigodot\@undefined
-  \let\bigsqcup\@undefined
-  \DeclareMathSymbol{\coprod}{\mathop}{\M at extbigops}{"2210}
-  \DeclareMathSymbol{\bigvee}{\mathop}{\M at extbigops}{"22C1}
-  \DeclareMathSymbol{\bigwedge}{\mathop}{\M at extbigops}{"22C0}
-  \DeclareMathSymbol{\bigcup}{\mathop}{\M at extbigops}{"22C3}
-  \DeclareMathSymbol{\bigcap}{\mathord}{\M at extbigops}{"22C2}
-  \DeclareMathSymbol{\iintop}{\mathop}{\M at extbigops}{"222C}
-    \def\iint{\iintop\nolimits}
-  \DeclareMathSymbol{\iiintop}{\mathop}{\M at extbigops}{"222D}
-    \def\iiint{\iiintop\nolimits}
-  \DeclareMathSymbol{\ointop}{\mathop}{\M at extbigops}{"222E}
-    \def\oint{\ointop\nolimits}
-  \DeclareMathSymbol{\oiintop}{\mathop}{\M at extbigops}{"222F}
-    \def\oiint{\oiintop\nolimits}
-  \DeclareMathSymbol{\oiiintop}{\mathop}{\M at extbigops}{"2230}
-    \def\oiiint{\oiiintop\nolimits}
-  \DeclareMathSymbol{\bigoplus}{\mathop}{\M at extbigops}{"2A01}
-  \DeclareMathSymbol{\bigotimes}{\mathop}{\M at extbigops}{"2A02}
-  \DeclareMathSymbol{\bigodot}{\mathop}{\M at extbigops}{"2A00}
-  \DeclareMathSymbol{\bigsqcap}{\mathop}{\M at extbigops}{"2A05}
-  \DeclareMathSymbol{\bigsqcup}{\mathop}{\M at extbigops}{"2A06}}
+  \DeclareMathSymbol{\rightarrow}{\mathrel}{\M at arrows@font}{"2192}
+    \global\let\to\rightarrow
+  \DeclareMathSymbol{\nrightarrow}{\mathrel}{\M at arrows@font}{"219B}
+  \DeclareMathSymbol{\Rightarrow}{\mathrel}{\M at arrows@font}{"21D2}
+  \DeclareMathSymbol{\nRightarrow}{\mathrel}{\M at arrows@font}{"21CF}
+  \DeclareMathSymbol{\Rrightarrow}{\mathrel}{\M at arrows@font}{"21DB}
+  \DeclareMathSymbol{\longrightarrow}{\mathrel}{\M at arrows@font}{"27F6}
+  \DeclareMathSymbol{\Longrightarrow}{\mathrel}{\M at arrows@font}{"27F9}
+  \DeclareMathSymbol{\rightbararrow}{\mathrel}{\M at arrows@font}{"21A6}
+    \global\let\mapsto\rightbararrow
+  \DeclareMathSymbol{\Rightbararrow}{\mathrel}{\M at arrows@font}{"2907}
+  \DeclareMathSymbol{\longrightbararrow}{\mathrel}{\M at arrows@font}{"27FC}
+    \global\let\longmapsto\longrightbararrow
+  \DeclareMathSymbol{\Longrightbararrow}{\mathrel}{\M at arrows@font}{"27FE}
+  \DeclareMathSymbol{\hookrightarrow}{\mathrel}{\M at arrows@font}{"21AA}
+  \DeclareMathSymbol{\rightdasharrow}{\mathrel}{\M at arrows@font}{"21E2}
+  \DeclareMathSymbol{\rightharpoonup}{\mathrel}{\M at arrows@font}{"21C0}
+  \DeclareMathSymbol{\rightharpoondown}{\mathrel}{\M at arrows@font}{"21C1}
+  \DeclareMathSymbol{\rightarrowtail}{\mathrel}{\M at arrows@font}{"21A3}
+  \DeclareMathSymbol{\rightoplusarrow}{\mathrel}{\M at arrows@font}{"27F4}
+  \DeclareMathSymbol{\rightwavearrow}{\mathrel}{\M at arrows@font}{"219D}
+  \DeclareMathSymbol{\rightsquigarrow}{\mathrel}{\M at arrows@font}{"21DD}
+  \DeclareMathSymbol{\longrightsquigarrow}{\mathrel}{\M at arrows@font}{"27FF}
+  \DeclareMathSymbol{\looparrowright}{\mathrel}{\M at arrows@font}{"21AC}
+  \DeclareMathSymbol{\curvearrowright}{\mathrel}{\M at arrows@font}{"293B}
+  \DeclareMathSymbol{\circlearrowright}{\mathrel}{\M at arrows@font}{"21BB}
+  \DeclareMathSymbol{\twoheadrightarrow}{\mathrel}{\M at arrows@font}{"21A0}
+  \DeclareMathSymbol{\rightarrowtobar}{\mathrel}{\M at arrows@font}{"21E5}
+  \DeclareMathSymbol{\rightwhitearrow}{\mathrel}{\M at arrows@font}{"21E8}
+  \DeclareMathSymbol{\rightrightarrows}{\mathrel}{\M at arrows@font}{"21C9}
+  \DeclareMathSymbol{\rightrightrightarrows}{\mathrel}{\M at arrows@font}{"21F6}
+  \DeclareMathSymbol{\leftarrow}{\mathrel}{\M at arrows@font}{"2190}
+    \global\let\from\leftarrow
+  \DeclareMathSymbol{\nleftarrow}{\mathrel}{\M at arrows@font}{"219A}
+  \DeclareMathSymbol{\Leftarrow}{\mathrel}{\M at arrows@font}{"21D0}
+  \DeclareMathSymbol{\nLeftarrow}{\mathrel}{\M at arrows@font}{"21CD}
+  \DeclareMathSymbol{\Lleftarrow}{\mathrel}{\M at arrows@font}{"21DA}
+  \DeclareMathSymbol{\longleftarrow}{\mathrel}{\M at arrows@font}{"27F5}
+  \DeclareMathSymbol{\Longleftarrow}{\mathrel}{\M at arrows@font}{"27F8}
+  \DeclareMathSymbol{\leftbararrow}{\mathrel}{\M at arrows@font}{"21A4}
+    \global\let\mapsfrom\leftbararrow
+  \DeclareMathSymbol{\Leftbararrow}{\mathrel}{\M at arrows@font}{"2906}
+  \DeclareMathSymbol{\longleftbararrow}{\mathrel}{\M at arrows@font}{"27FB}
+    \global\let\longmapsfrom\longleftbararrow
+  \DeclareMathSymbol{\Longleftbararrow}{\mathrel}{\M at arrows@font}{"27FD}
+  \DeclareMathSymbol{\hookleftarrow}{\mathrel}{\M at arrows@font}{"21A9}
+  \DeclareMathSymbol{\leftdasharrow}{\mathrel}{\M at arrows@font}{"21E0}
+  \DeclareMathSymbol{\leftharpoonup}{\mathrel}{\M at arrows@font}{"21BC}
+  \DeclareMathSymbol{\leftharpoondown}{\mathrel}{\M at arrows@font}{"21BD}
+  \DeclareMathSymbol{\leftarrowtail}{\mathrel}{\M at arrows@font}{"21A2}
+  \DeclareMathSymbol{\leftoplusarrow}{\mathrel}{\M at arrows@font}{"2B32}
+  \DeclareMathSymbol{\leftwavearrow}{\mathrel}{\M at arrows@font}{"219C}
+  \DeclareMathSymbol{\leftsquigarrow}{\mathrel}{\M at arrows@font}{"21DC}
+  \DeclareMathSymbol{\longleftsquigarrow}{\mathrel}{\M at arrows@font}{"2B33}
+  \DeclareMathSymbol{\looparrowleft}{\mathrel}{\M at arrows@font}{"21AB}
+  \DeclareMathSymbol{\curvearrowleft}{\mathrel}{\M at arrows@font}{"293A}
+  \DeclareMathSymbol{\circlearrowleft}{\mathrel}{\M at arrows@font}{"21BA}
+  \DeclareMathSymbol{\twoheadleftarrow}{\mathrel}{\M at arrows@font}{"219E}
+  \DeclareMathSymbol{\leftarrowtobar}{\mathrel}{\M at arrows@font}{"21E4}
+  \DeclareMathSymbol{\leftwhitearrow}{\mathrel}{\M at arrows@font}{"21E6}
+  \DeclareMathSymbol{\leftleftarrows}{\mathrel}{\M at arrows@font}{"21C7}
+  \DeclareMathSymbol{\leftleftleftarrows}{\mathrel}{\M at arrows@font}{"2B31}
+  \DeclareMathSymbol{\leftrightarrow}{\mathrel}{\M at arrows@font}{"2194}
+  \DeclareMathSymbol{\Leftrightarrow}{\mathrel}{\M at arrows@font}{"21D4}
+  \DeclareMathSymbol{\nLeftrightarrow}{\mathrel}{\M at arrows@font}{"21CE}
+  \DeclareMathSymbol{\longleftrightarrow}{\mathrel}{\M at arrows@font}{"27F7}
+  \DeclareMathSymbol{\Longleftrightarrow}{\mathrel}{\M at arrows@font}{"27FA}
+  \DeclareMathSymbol{\leftrightwavearrow}{\mathrel}{\M at arrows@font}{"21AD}
+  \DeclareMathSymbol{\leftrightarrows}{\mathrel}{\M at arrows@font}{"21C6}
+  \DeclareMathSymbol{\leftrightharpoons}{\mathrel}{\M at arrows@font}{"21CB}
+  \DeclareMathSymbol{\leftrightarrowstobar}{\mathrel}{\M at arrows@font}{"21B9}
+  \DeclareMathSymbol{\rightleftarrows}{\mathrel}{\M at arrows@font}{"21C4}
+  \DeclareMathSymbol{\rightleftharpoons}{\mathrel}{\M at arrows@font}{"21CC}
+  \DeclareMathSymbol{\uparrow}{\mathrel}{\M at arrows@font}{"2191}
+  \DeclareMathSymbol{\Uparrow}{\mathrel}{\M at arrows@font}{"21D1}
+  \DeclareMathSymbol{\Uuparrow}{\mathrel}{\M at arrows@font}{"290A}
+  \DeclareMathSymbol{\upbararrow}{\mathrel}{\M at arrows@font}{"21A5}
+  \DeclareMathSymbol{\updasharrow}{\mathrel}{\M at arrows@font}{"21E1}
+  \DeclareMathSymbol{\upharpoonleft}{\mathrel}{\M at arrows@font}{"21BF}
+  \DeclareMathSymbol{\upharpoonright}{\mathrel}{\M at arrows@font}{"21BE}
+  \DeclareMathSymbol{\twoheaduparrow}{\mathrel}{\M at arrows@font}{"219F}
+  \DeclareMathSymbol{\uparrowtobar}{\mathrel}{\M at arrows@font}{"2912}
+  \DeclareMathSymbol{\upwhitearrow}{\mathrel}{\M at arrows@font}{"21E7}
+  \DeclareMathSymbol{\upwhitebararrow}{\mathrel}{\M at arrows@font}{"21EA}
+  \DeclareMathSymbol{\upuparrows}{\mathrel}{\M at arrows@font}{"21C8}
+  \DeclareMathSymbol{\downarrow}{\mathrel}{\M at arrows@font}{"2193}
+  \DeclareMathSymbol{\Downarrow}{\mathrel}{\M at arrows@font}{"21D3}
+  \DeclareMathSymbol{\Ddownarrow}{\mathrel}{\M at arrows@font}{"290B}
+  \DeclareMathSymbol{\downbararrow}{\mathrel}{\M at arrows@font}{"21A7}
+  \DeclareMathSymbol{\downdasharrow}{\mathrel}{\M at arrows@font}{"21E3}
+  \DeclareMathSymbol{\zigzagarrow}{\mathrel}{\M at arrows@font}{"21AF}
+    \global\let\lightningboltarrow\zigzagarrow
+  \DeclareMathSymbol{\downharpoonleft}{\mathrel}{\M at arrows@font}{"21C3}
+  \DeclareMathSymbol{\downharpoonright}{\mathrel}{\M at arrows@font}{"21C2}
+  \DeclareMathSymbol{\twoheaddownarrow}{\mathrel}{\M at arrows@font}{"21A1}
+  \DeclareMathSymbol{\downarrowtobar}{\mathrel}{\M at arrows@font}{"2913}
+  \DeclareMathSymbol{\downwhitearrow}{\mathrel}{\M at arrows@font}{"21E9}
+  \DeclareMathSymbol{\downdownarrows}{\mathrel}{\M at arrows@font}{"21CA}
+  \DeclareMathSymbol{\updownarrow}{\mathrel}{\M at arrows@font}{"2195}
+  \DeclareMathSymbol{\Updownarrow}{\mathrel}{\M at arrows@font}{"21D5}
+  \DeclareMathSymbol{\updownarrows}{\mathrel}{\M at arrows@font}{"21C5}
+  \DeclareMathSymbol{\downuparrows}{\mathrel}{\M at arrows@font}{"21F5}
+  \DeclareMathSymbol{\updownharpoons}{\mathrel}{\M at arrows@font}{"296E}
+  \DeclareMathSymbol{\downupharpoons}{\mathrel}{\M at arrows@font}{"296F}
+  \DeclareMathSymbol{\nearrow}{\mathrel}{\M at arrows@font}{"2197}
+  \DeclareMathSymbol{\Nearrow}{\mathrel}{\M at arrows@font}{"21D7}
+  \DeclareMathSymbol{\nwarrow}{\mathrel}{\M at arrows@font}{"2196}
+  \DeclareMathSymbol{\Nwarrow}{\mathrel}{\M at arrows@font}{"21D6}
+  \DeclareMathSymbol{\searrow}{\mathrel}{\M at arrows@font}{"2198}
+  \DeclareMathSymbol{\Searrow}{\mathrel}{\M at arrows@font}{"21D8}
+  \DeclareMathSymbol{\swarrow}{\mathrel}{\M at arrows@font}{"2199}
+  \DeclareMathSymbol{\Swarrow}{\mathrel}{\M at arrows@font}{"21D9}
+  \DeclareMathSymbol{\nwsearrow}{\mathrel}{\M at arrows@font}{"2921}
+  \DeclareMathSymbol{\neswarrow}{\mathrel}{\M at arrows@font}{"2922}
+  \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{M\@bbshape\the\M at count}
-  \DeclareMathSymbol{\M at bb@A}{\mathord}{\M at bb}{"1D538}
-  \DeclareMathSymbol{\M at bb@B}{\mathord}{\M at bb}{"1D539}
-  \DeclareMathSymbol{\M at bb@C}{\mathord}{\M at bb}{"2102}
-  \DeclareMathSymbol{\M at bb@D}{\mathord}{\M at bb}{"1D53B}
-  \DeclareMathSymbol{\M at bb@E}{\mathord}{\M at bb}{"1D53C}
-  \DeclareMathSymbol{\M at bb@F}{\mathord}{\M at bb}{"1D53D}
-  \DeclareMathSymbol{\M at bb@G}{\mathord}{\M at bb}{"1D53E}
-  \DeclareMathSymbol{\M at bb@H}{\mathord}{\M at bb}{"210D}
-  \DeclareMathSymbol{\M at bb@I}{\mathord}{\M at bb}{"1D540}
-  \DeclareMathSymbol{\M at bb@J}{\mathord}{\M at bb}{"1D541}
-  \DeclareMathSymbol{\M at bb@K}{\mathord}{\M at bb}{"1D542}
-  \DeclareMathSymbol{\M at bb@L}{\mathord}{\M at bb}{"1D543}
-  \DeclareMathSymbol{\M at bb@M}{\mathord}{\M at bb}{"1D544}
-  \DeclareMathSymbol{\M at bb@N}{\mathord}{\M at bb}{"2115}
-  \DeclareMathSymbol{\M at bb@O}{\mathord}{\M at bb}{"1D546}
-  \DeclareMathSymbol{\M at bb@P}{\mathord}{\M at bb}{"2119}
-  \DeclareMathSymbol{\M at bb@Q}{\mathord}{\M at bb}{"211A}
-  \DeclareMathSymbol{\M at bb@R}{\mathord}{\M at bb}{"211D}
-  \DeclareMathSymbol{\M at bb@S}{\mathord}{\M at bb}{"1D54A}
-  \DeclareMathSymbol{\M at bb@T}{\mathord}{\M at bb}{"1D54B}
-  \DeclareMathSymbol{\M at bb@U}{\mathord}{\M at bb}{"1D54C}
-  \DeclareMathSymbol{\M at bb@V}{\mathord}{\M at bb}{"1D54D}
-  \DeclareMathSymbol{\M at bb@W}{\mathord}{\M at bb}{"1D54E}
-  \DeclareMathSymbol{\M at bb@X}{\mathord}{\M at bb}{"1D54F}
-  \DeclareMathSymbol{\M at bb@Y}{\mathord}{\M at bb}{"1D550}
-  \DeclareMathSymbol{\M at bb@Z}{\mathord}{\M at bb}{"2124}
-  \DeclareMathSymbol{\M at bb@a}{\mathord}{\M at bb}{"1D552}
-  \DeclareMathSymbol{\M at bb@b}{\mathord}{\M at bb}{"1D553}
-  \DeclareMathSymbol{\M at bb@c}{\mathord}{\M at bb}{"1D554}
-  \DeclareMathSymbol{\M at bb@d}{\mathord}{\M at bb}{"1D555}
-  \DeclareMathSymbol{\M at bb@e}{\mathord}{\M at bb}{"1D556}
-  \DeclareMathSymbol{\M at bb@f}{\mathord}{\M at bb}{"1D557}
-  \DeclareMathSymbol{\M at bb@g}{\mathord}{\M at bb}{"1D558}
-  \DeclareMathSymbol{\M at bb@h}{\mathord}{\M at bb}{"1D559}
-  \DeclareMathSymbol{\M at bb@i}{\mathord}{\M at bb}{"1D55A}
-  \DeclareMathSymbol{\M at bb@j}{\mathord}{\M at bb}{"1D55B}
-  \DeclareMathSymbol{\M at bb@k}{\mathord}{\M at bb}{"1D55C}
-  \DeclareMathSymbol{\M at bb@l}{\mathord}{\M at bb}{"1D55D}
-  \DeclareMathSymbol{\M at bb@m}{\mathord}{\M at bb}{"1D55E}
-  \DeclareMathSymbol{\M at bb@n}{\mathord}{\M at bb}{"1D55F}
-  \DeclareMathSymbol{\M at bb@o}{\mathord}{\M at bb}{"1D560}
-  \DeclareMathSymbol{\M at bb@p}{\mathord}{\M at bb}{"1D561}
-  \DeclareMathSymbol{\M at bb@q}{\mathord}{\M at bb}{"1D562}
-  \DeclareMathSymbol{\M at bb@r}{\mathord}{\M at bb}{"1D563}
-  \DeclareMathSymbol{\M at bb@s}{\mathord}{\M at bb}{"1D564}
-  \DeclareMathSymbol{\M at bb@t}{\mathord}{\M at bb}{"1D565}
-  \DeclareMathSymbol{\M at bb@u}{\mathord}{\M at bb}{"1D566}
-  \DeclareMathSymbol{\M at bb@v}{\mathord}{\M at bb}{"1D567}
-  \DeclareMathSymbol{\M at bb@w}{\mathord}{\M at bb}{"1D568}
-  \DeclareMathSymbol{\M at bb@x}{\mathord}{\M at bb}{"1D569}
-  \DeclareMathSymbol{\M at bb@y}{\mathord}{\M at bb}{"1D56A}
-  \DeclareMathSymbol{\M at bb@z}{\mathord}{\M at bb}{"1D56B}
+  \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}{"1D7D8}
+    {\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}{"1D7D9}
+    {\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}{"1D7DA}
+    {\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}{"1D7DB}
+    {\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}{"1D7DC}
+    {\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}{"1D7DD}
+    {\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}{"1D7DE}
+    {\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}{"1D7DF}
+    {\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}{"1D7E0}
+    {\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}{"1D7E1}}
+    {\csname M at bb@9\endcsname}{\mathord}{\M at bb@font}{"1D7E1}}
 \def\M at cal@set{%
-  \edef\M at cal{M\@calshape\the\M at count}
-  \DeclareMathSymbol{\M at cal@A}{\mathord}{\M at cal}{"1D49C}
-  \DeclareMathSymbol{\M at cal@B}{\mathord}{\M at cal}{"212C}
-  \DeclareMathSymbol{\M at cal@C}{\mathord}{\M at cal}{"1D49E}
-  \DeclareMathSymbol{\M at cal@D}{\mathord}{\M at cal}{"1D49F}
-  \DeclareMathSymbol{\M at cal@E}{\mathord}{\M at cal}{"2130}
-  \DeclareMathSymbol{\M at cal@F}{\mathord}{\M at cal}{"2131}
-  \DeclareMathSymbol{\M at cal@G}{\mathord}{\M at cal}{"1D4A2}
-  \DeclareMathSymbol{\M at cal@H}{\mathord}{\M at cal}{"210B}
-  \DeclareMathSymbol{\M at cal@I}{\mathord}{\M at cal}{"2110}
-  \DeclareMathSymbol{\M at cal@J}{\mathord}{\M at cal}{"1D4A5}
-  \DeclareMathSymbol{\M at cal@K}{\mathord}{\M at cal}{"1D4A6}
-  \DeclareMathSymbol{\M at cal@L}{\mathord}{\M at cal}{"2112}
-  \DeclareMathSymbol{\M at cal@M}{\mathord}{\M at cal}{"2133}
-  \DeclareMathSymbol{\M at cal@N}{\mathord}{\M at cal}{"1D4A9}
-  \DeclareMathSymbol{\M at cal@O}{\mathord}{\M at cal}{"1D4AA}
-  \DeclareMathSymbol{\M at cal@P}{\mathord}{\M at cal}{"1D4AB}
-  \DeclareMathSymbol{\M at cal@Q}{\mathord}{\M at cal}{"1D4AC}
-  \DeclareMathSymbol{\M at cal@R}{\mathord}{\M at cal}{"211B}
-  \DeclareMathSymbol{\M at cal@S}{\mathord}{\M at cal}{"1D4AE}
-  \DeclareMathSymbol{\M at cal@T}{\mathord}{\M at cal}{"1D4AF}
-  \DeclareMathSymbol{\M at cal@U}{\mathord}{\M at cal}{"1D4B0}
-  \DeclareMathSymbol{\M at cal@V}{\mathord}{\M at cal}{"1D4B1}
-  \DeclareMathSymbol{\M at cal@W}{\mathord}{\M at cal}{"1D4B2}
-  \DeclareMathSymbol{\M at cal@X}{\mathord}{\M at cal}{"1D4B3}
-  \DeclareMathSymbol{\M at cal@Y}{\mathord}{\M at cal}{"1D4B4}
-  \DeclareMathSymbol{\M at cal@Z}{\mathord}{\M at cal}{"1D4B5}
-  \DeclareMathSymbol{\M at cal@a}{\mathord}{\M at cal}{"1D4B6}
-  \DeclareMathSymbol{\M at cal@b}{\mathord}{\M at cal}{"1D4B7}
-  \DeclareMathSymbol{\M at cal@c}{\mathord}{\M at cal}{"1D4B8}
-  \DeclareMathSymbol{\M at cal@d}{\mathord}{\M at cal}{"1D4B9}
-  \DeclareMathSymbol{\M at cal@e}{\mathord}{\M at cal}{"212F}
-  \DeclareMathSymbol{\M at cal@f}{\mathord}{\M at cal}{"1D4BB}
-  \DeclareMathSymbol{\M at cal@g}{\mathord}{\M at cal}{"210A}
-  \DeclareMathSymbol{\M at cal@h}{\mathord}{\M at cal}{"1D4BD}
-  \DeclareMathSymbol{\M at cal@i}{\mathord}{\M at cal}{"1D4BE}
-  \DeclareMathSymbol{\M at cal@j}{\mathord}{\M at cal}{"1D4BF}
-  \DeclareMathSymbol{\M at cal@k}{\mathord}{\M at cal}{"1D4C0}
-  \DeclareMathSymbol{\M at cal@l}{\mathord}{\M at cal}{"1D4C1}
-  \DeclareMathSymbol{\M at cal@m}{\mathord}{\M at cal}{"1D4C2}
-  \DeclareMathSymbol{\M at cal@n}{\mathord}{\M at cal}{"1D4C3}
-  \DeclareMathSymbol{\M at cal@o}{\mathord}{\M at cal}{"2134}
-  \DeclareMathSymbol{\M at cal@p}{\mathord}{\M at cal}{"1D4C5}
-  \DeclareMathSymbol{\M at cal@q}{\mathord}{\M at cal}{"1D4C6}
-  \DeclareMathSymbol{\M at cal@r}{\mathord}{\M at cal}{"1D4C7}
-  \DeclareMathSymbol{\M at cal@s}{\mathord}{\M at cal}{"1D4C8}
-  \DeclareMathSymbol{\M at cal@t}{\mathord}{\M at cal}{"1D4C9}
-  \DeclareMathSymbol{\M at cal@u}{\mathord}{\M at cal}{"1D4CA}
-  \DeclareMathSymbol{\M at cal@v}{\mathord}{\M at cal}{"1D4CB}
-  \DeclareMathSymbol{\M at cal@w}{\mathord}{\M at cal}{"1D4CC}
-  \DeclareMathSymbol{\M at cal@x}{\mathord}{\M at cal}{"1D4CD}
-  \DeclareMathSymbol{\M at cal@y}{\mathord}{\M at cal}{"1D4CE}
-  \DeclareMathSymbol{\M at cal@z}{\mathord}{\M at cal}{"1D4CF}}
+  \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}}
 \def\M at frak@set{%
-  \edef\M at frak{M\@frakshape\the\M at count}
-  \DeclareMathSymbol{\M at frak@A}{\mathord}{\M at frak}{"1D504}
-  \DeclareMathSymbol{\M at frak@B}{\mathord}{\M at frak}{"1D505}
-  \DeclareMathSymbol{\M at frak@C}{\mathord}{\M at frak}{"212D}
-  \DeclareMathSymbol{\M at frak@D}{\mathord}{\M at frak}{"1D507}
-  \DeclareMathSymbol{\M at frak@E}{\mathord}{\M at frak}{"1D508}
-  \DeclareMathSymbol{\M at frak@F}{\mathord}{\M at frak}{"1D509}
-  \DeclareMathSymbol{\M at frak@G}{\mathord}{\M at frak}{"1D50A}
-  \DeclareMathSymbol{\M at frak@H}{\mathord}{\M at frak}{"210C}
-  \DeclareMathSymbol{\M at frak@I}{\mathord}{\M at frak}{"2111}
-  \DeclareMathSymbol{\M at frak@J}{\mathord}{\M at frak}{"1D50D}
-  \DeclareMathSymbol{\M at frak@K}{\mathord}{\M at frak}{"1D50E}
-  \DeclareMathSymbol{\M at frak@L}{\mathord}{\M at frak}{"1D50F}
-  \DeclareMathSymbol{\M at frak@M}{\mathord}{\M at frak}{"1D510}
-  \DeclareMathSymbol{\M at frak@N}{\mathord}{\M at frak}{"1D511}
-  \DeclareMathSymbol{\M at frak@O}{\mathord}{\M at frak}{"1D512}
-  \DeclareMathSymbol{\M at frak@P}{\mathord}{\M at frak}{"1D513}
-  \DeclareMathSymbol{\M at frak@Q}{\mathord}{\M at frak}{"1D514}
-  \DeclareMathSymbol{\M at frak@R}{\mathord}{\M at frak}{"212C}
-  \DeclareMathSymbol{\M at frak@S}{\mathord}{\M at frak}{"1D516}
-  \DeclareMathSymbol{\M at frak@T}{\mathord}{\M at frak}{"1D517}
-  \DeclareMathSymbol{\M at frak@U}{\mathord}{\M at frak}{"1D518}
-  \DeclareMathSymbol{\M at frak@V}{\mathord}{\M at frak}{"1D519}
-  \DeclareMathSymbol{\M at frak@W}{\mathord}{\M at frak}{"1D51A}
-  \DeclareMathSymbol{\M at frak@X}{\mathord}{\M at frak}{"1D51B}
-  \DeclareMathSymbol{\M at frak@Y}{\mathord}{\M at frak}{"1D51C}
-  \DeclareMathSymbol{\M at frak@Z}{\mathord}{\M at frak}{"2128}
-  \DeclareMathSymbol{\M at frak@a}{\mathord}{\M at frak}{"1D51E}
-  \DeclareMathSymbol{\M at frak@b}{\mathord}{\M at frak}{"1D51F}
-  \DeclareMathSymbol{\M at frak@c}{\mathord}{\M at frak}{"1D520}
-  \DeclareMathSymbol{\M at frak@d}{\mathord}{\M at frak}{"1D521}
-  \DeclareMathSymbol{\M at frak@e}{\mathord}{\M at frak}{"1D522}
-  \DeclareMathSymbol{\M at frak@f}{\mathord}{\M at frak}{"1D523}
-  \DeclareMathSymbol{\M at frak@g}{\mathord}{\M at frak}{"1D524}
-  \DeclareMathSymbol{\M at frak@h}{\mathord}{\M at frak}{"1D525}
-  \DeclareMathSymbol{\M at frak@i}{\mathord}{\M at frak}{"1D526}
-  \DeclareMathSymbol{\M at frak@j}{\mathord}{\M at frak}{"1D527}
-  \DeclareMathSymbol{\M at frak@k}{\mathord}{\M at frak}{"1D528}
-  \DeclareMathSymbol{\M at frak@l}{\mathord}{\M at frak}{"1D529}
-  \DeclareMathSymbol{\M at frak@m}{\mathord}{\M at frak}{"1D52A}
-  \DeclareMathSymbol{\M at frak@n}{\mathord}{\M at frak}{"1D52B}
-  \DeclareMathSymbol{\M at frak@o}{\mathord}{\M at frak}{"1D52C}
-  \DeclareMathSymbol{\M at frak@p}{\mathord}{\M at frak}{"1D52D}
-  \DeclareMathSymbol{\M at frak@q}{\mathord}{\M at frak}{"1D52E}
-  \DeclareMathSymbol{\M at frak@r}{\mathord}{\M at frak}{"1D52F}
-  \DeclareMathSymbol{\M at frak@s}{\mathord}{\M at frak}{"1D530}
-  \DeclareMathSymbol{\M at frak@t}{\mathord}{\M at frak}{"1D531}
-  \DeclareMathSymbol{\M at frak@u}{\mathord}{\M at frak}{"1D532}
-  \DeclareMathSymbol{\M at frak@v}{\mathord}{\M at frak}{"1D533}
-  \DeclareMathSymbol{\M at frak@w}{\mathord}{\M at frak}{"1D534}
-  \DeclareMathSymbol{\M at frak@x}{\mathord}{\M at frak}{"1D535}
-  \DeclareMathSymbol{\M at frak@y}{\mathord}{\M at frak}{"1D536}
-  \DeclareMathSymbol{\M at frak@z}{\mathord}{\M at frak}{"1D537}}
+  \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}}
 \def\M at bcal@set{%
-  \edef\M at bcal{M\@bcalshape\the\M at count}
-  \DeclareMathSymbol{\M at bcal@A}{\mathord}{\M at bcal}{"1D4D0}
-  \DeclareMathSymbol{\M at bcal@B}{\mathord}{\M at bcal}{"1D4D1}
-  \DeclareMathSymbol{\M at bcal@C}{\mathord}{\M at bcal}{"1D4D2}
-  \DeclareMathSymbol{\M at bcal@D}{\mathord}{\M at bcal}{"1D4D3}
-  \DeclareMathSymbol{\M at bcal@E}{\mathord}{\M at bcal}{"1D4D4}
-  \DeclareMathSymbol{\M at bcal@F}{\mathord}{\M at bcal}{"1D4D5}
-  \DeclareMathSymbol{\M at bcal@G}{\mathord}{\M at bcal}{"1D4D6}
-  \DeclareMathSymbol{\M at bcal@H}{\mathord}{\M at bcal}{"1D4D7}
-  \DeclareMathSymbol{\M at bcal@I}{\mathord}{\M at bcal}{"1D4D8}
-  \DeclareMathSymbol{\M at bcal@J}{\mathord}{\M at bcal}{"1D4D9}
-  \DeclareMathSymbol{\M at bcal@K}{\mathord}{\M at bcal}{"1D4DA}
-  \DeclareMathSymbol{\M at bcal@L}{\mathord}{\M at bcal}{"1D4DB}
-  \DeclareMathSymbol{\M at bcal@M}{\mathord}{\M at bcal}{"1D4DC}
-  \DeclareMathSymbol{\M at bcal@N}{\mathord}{\M at bcal}{"1D4DD}
-  \DeclareMathSymbol{\M at bcal@O}{\mathord}{\M at bcal}{"1D4DE}
-  \DeclareMathSymbol{\M at bcal@P}{\mathord}{\M at bcal}{"1D4DF}
-  \DeclareMathSymbol{\M at bcal@Q}{\mathord}{\M at bcal}{"1D4E0}
-  \DeclareMathSymbol{\M at bcal@R}{\mathord}{\M at bcal}{"1D4E1}
-  \DeclareMathSymbol{\M at bcal@S}{\mathord}{\M at bcal}{"1D4E2}
-  \DeclareMathSymbol{\M at bcal@T}{\mathord}{\M at bcal}{"1D4E3}
-  \DeclareMathSymbol{\M at bcal@U}{\mathord}{\M at bcal}{"1D4E4}
-  \DeclareMathSymbol{\M at bcal@V}{\mathord}{\M at bcal}{"1D4E5}
-  \DeclareMathSymbol{\M at bcal@W}{\mathord}{\M at bcal}{"1D4E6}
-  \DeclareMathSymbol{\M at bcal@X}{\mathord}{\M at bcal}{"1D4E7}
-  \DeclareMathSymbol{\M at bcal@Y}{\mathord}{\M at bcal}{"1D4E8}
-  \DeclareMathSymbol{\M at bcal@Z}{\mathord}{\M at bcal}{"1D4E9}
-  \DeclareMathSymbol{\M at bcal@a}{\mathord}{\M at bcal}{"1D4EA}
-  \DeclareMathSymbol{\M at bcal@b}{\mathord}{\M at bcal}{"1D4EB}
-  \DeclareMathSymbol{\M at bcal@c}{\mathord}{\M at bcal}{"1D4EC}
-  \DeclareMathSymbol{\M at bcal@d}{\mathord}{\M at bcal}{"1D4ED}
-  \DeclareMathSymbol{\M at bcal@e}{\mathord}{\M at bcal}{"1D4EE}
-  \DeclareMathSymbol{\M at bcal@f}{\mathord}{\M at bcal}{"1D4EF}
-  \DeclareMathSymbol{\M at bcal@g}{\mathord}{\M at bcal}{"1D4F0}
-  \DeclareMathSymbol{\M at bcal@h}{\mathord}{\M at bcal}{"1D4F1}
-  \DeclareMathSymbol{\M at bcal@i}{\mathord}{\M at bcal}{"1D4F2}
-  \DeclareMathSymbol{\M at bcal@j}{\mathord}{\M at bcal}{"1D4F3}
-  \DeclareMathSymbol{\M at bcal@k}{\mathord}{\M at bcal}{"1D4F4}
-  \DeclareMathSymbol{\M at bcal@l}{\mathord}{\M at bcal}{"1D4F5}
-  \DeclareMathSymbol{\M at bcal@m}{\mathord}{\M at bcal}{"1D4F6}
-  \DeclareMathSymbol{\M at bcal@n}{\mathord}{\M at bcal}{"1D4F7}
-  \DeclareMathSymbol{\M at bcal@o}{\mathord}{\M at bcal}{"1D4F8}
-  \DeclareMathSymbol{\M at bcal@p}{\mathord}{\M at bcal}{"1D4F9}
-  \DeclareMathSymbol{\M at bcal@q}{\mathord}{\M at bcal}{"1D4FA}
-  \DeclareMathSymbol{\M at bcal@r}{\mathord}{\M at bcal}{"1D4FB}
-  \DeclareMathSymbol{\M at bcal@s}{\mathord}{\M at bcal}{"1D4FC}
-  \DeclareMathSymbol{\M at bcal@t}{\mathord}{\M at bcal}{"1D4FD}
-  \DeclareMathSymbol{\M at bcal@u}{\mathord}{\M at bcal}{"1D4FE}
-  \DeclareMathSymbol{\M at bcal@v}{\mathord}{\M at bcal}{"1D4FF}
-  \DeclareMathSymbol{\M at bcal@w}{\mathord}{\M at bcal}{"1D500}
-  \DeclareMathSymbol{\M at bcal@x}{\mathord}{\M at bcal}{"1D501}
-  \DeclareMathSymbol{\M at bcal@y}{\mathord}{\M at bcal}{"1D502}
-  \DeclareMathSymbol{\M at bcal@z}{\mathord}{\M at bcal}{"1D503}}
+  \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}}
 \def\M at bfrak@set{%
-  \edef\M at bfrak{M\@bfrakshape\the\M at count}
-  \DeclareMathSymbol{\M at bfrak@A}{\mathord}{\M at bfrak}{"1D56C}
-  \DeclareMathSymbol{\M at bfrak@B}{\mathord}{\M at bfrak}{"1D56D}
-  \DeclareMathSymbol{\M at bfrak@C}{\mathord}{\M at bfrak}{"1D56E}
-  \DeclareMathSymbol{\M at bfrak@D}{\mathord}{\M at bfrak}{"1D56F}
-  \DeclareMathSymbol{\M at bfrak@E}{\mathord}{\M at bfrak}{"1D570}
-  \DeclareMathSymbol{\M at bfrak@F}{\mathord}{\M at bfrak}{"1D571}
-  \DeclareMathSymbol{\M at bfrak@G}{\mathord}{\M at bfrak}{"1D572}
-  \DeclareMathSymbol{\M at bfrak@H}{\mathord}{\M at bfrak}{"1D573}
-  \DeclareMathSymbol{\M at bfrak@I}{\mathord}{\M at bfrak}{"1D574}
-  \DeclareMathSymbol{\M at bfrak@J}{\mathord}{\M at bfrak}{"1D575}
-  \DeclareMathSymbol{\M at bfrak@K}{\mathord}{\M at bfrak}{"1D576}
-  \DeclareMathSymbol{\M at bfrak@L}{\mathord}{\M at bfrak}{"1D577}
-  \DeclareMathSymbol{\M at bfrak@M}{\mathord}{\M at bfrak}{"1D578}
-  \DeclareMathSymbol{\M at bfrak@N}{\mathord}{\M at bfrak}{"1D579}
-  \DeclareMathSymbol{\M at bfrak@O}{\mathord}{\M at bfrak}{"1D57A}
-  \DeclareMathSymbol{\M at bfrak@P}{\mathord}{\M at bfrak}{"1D57B}
-  \DeclareMathSymbol{\M at bfrak@Q}{\mathord}{\M at bfrak}{"1D57C}
-  \DeclareMathSymbol{\M at bfrak@R}{\mathord}{\M at bfrak}{"1D57D}
-  \DeclareMathSymbol{\M at bfrak@S}{\mathord}{\M at bfrak}{"1D57E}
-  \DeclareMathSymbol{\M at bfrak@T}{\mathord}{\M at bfrak}{"1D57F}
-  \DeclareMathSymbol{\M at bfrak@U}{\mathord}{\M at bfrak}{"1D580}
-  \DeclareMathSymbol{\M at bfrak@V}{\mathord}{\M at bfrak}{"1D581}
-  \DeclareMathSymbol{\M at bfrak@W}{\mathord}{\M at bfrak}{"1D582}
-  \DeclareMathSymbol{\M at bfrak@X}{\mathord}{\M at bfrak}{"1D583}
-  \DeclareMathSymbol{\M at bfrak@Y}{\mathord}{\M at bfrak}{"1D584}
-  \DeclareMathSymbol{\M at bfrak@Z}{\mathord}{\M at bfrak}{"1D585}
-  \DeclareMathSymbol{\M at bfrak@a}{\mathord}{\M at bfrak}{"1D586}
-  \DeclareMathSymbol{\M at bfrak@b}{\mathord}{\M at bfrak}{"1D587}
-  \DeclareMathSymbol{\M at bfrak@c}{\mathord}{\M at bfrak}{"1D588}
-  \DeclareMathSymbol{\M at bfrak@d}{\mathord}{\M at bfrak}{"1D589}
-  \DeclareMathSymbol{\M at bfrak@e}{\mathord}{\M at bfrak}{"1D58A}
-  \DeclareMathSymbol{\M at bfrak@f}{\mathord}{\M at bfrak}{"1D58B}
-  \DeclareMathSymbol{\M at bfrak@g}{\mathord}{\M at bfrak}{"1D58C}
-  \DeclareMathSymbol{\M at bfrak@h}{\mathord}{\M at bfrak}{"1D58D}
-  \DeclareMathSymbol{\M at bfrak@i}{\mathord}{\M at bfrak}{"1D58E}
-  \DeclareMathSymbol{\M at bfrak@j}{\mathord}{\M at bfrak}{"1D58F}
-  \DeclareMathSymbol{\M at bfrak@k}{\mathord}{\M at bfrak}{"1D590}
-  \DeclareMathSymbol{\M at bfrak@l}{\mathord}{\M at bfrak}{"1D591}
-  \DeclareMathSymbol{\M at bfrak@m}{\mathord}{\M at bfrak}{"1D592}
-  \DeclareMathSymbol{\M at bfrak@n}{\mathord}{\M at bfrak}{"1D593}
-  \DeclareMathSymbol{\M at bfrak@o}{\mathord}{\M at bfrak}{"1D594}
-  \DeclareMathSymbol{\M at bfrak@p}{\mathord}{\M at bfrak}{"1D595}
-  \DeclareMathSymbol{\M at bfrak@q}{\mathord}{\M at bfrak}{"1D596}
-  \DeclareMathSymbol{\M at bfrak@r}{\mathord}{\M at bfrak}{"1D597}
-  \DeclareMathSymbol{\M at bfrak@s}{\mathord}{\M at bfrak}{"1D598}
-  \DeclareMathSymbol{\M at bfrak@t}{\mathord}{\M at bfrak}{"1D599}
-  \DeclareMathSymbol{\M at bfrak@u}{\mathord}{\M at bfrak}{"1D59A}
-  \DeclareMathSymbol{\M at bfrak@v}{\mathord}{\M at bfrak}{"1D59B}
-  \DeclareMathSymbol{\M at bfrak@w}{\mathord}{\M at bfrak}{"1D59C}
-  \DeclareMathSymbol{\M at bfrak@x}{\mathord}{\M at bfrak}{"1D59D}
-  \DeclareMathSymbol{\M at bfrak@y}{\mathord}{\M at bfrak}{"1D59E}
-  \DeclareMathSymbol{\M at bfrak@z}{\mathord}{\M at bfrak}{"1D59F}}
+  \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}}
 \endinput
 %%
 %% End of file `mathfont.sty'.



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