texlive[65205] Master/texmf-dist: mathfont (5dec22)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 5 22:24:23 CET 2022


Revision: 65205
          http://tug.org/svn/texlive?view=revision&revision=65205
Author:   karl
Date:     2022-12-05 22:24:22 +0100 (Mon, 05 Dec 2022)
Log Message:
-----------
mathfont (5dec22)

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

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/README.txt	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/README.txt	2022-12-05 21:24:22 UTC (rev 65205)
@@ -1,7 +1,7 @@
-LaTeX package mathfont version 2.2 installation information,
+LaTeX package mathfont version 2.2a installation information,
 released December 2022.
 
-This file is README.txt from version 2.2 of the free and
+This file is README.txt from version 2.2a 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
@@ -14,8 +14,8 @@
 MacTeX distribution or use a package manager such as tlmgr.
 
 To install mathfont manually, you need to generate the
-package file mathfont.sty from mathfont.dtx. You can do
-this in two ways:
+package file mathfont.sty from mathfont_code.dtx. You can
+do this in two ways:
 
   (1) Running Plain TeX on mathfont_code.dtx will create
       mathfont.sty as well as several other tex files

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

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_doc_patch.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `doc')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_equations.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `equations')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 

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

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_cormorant.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `cormorant')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 
@@ -58,8 +59,18 @@
 %% 
 %% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_cormorant.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, typeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -66,14 +77,9 @@
 \usepackage{amsmath}
 \DeclareMathOperator{\Res}{Res}
 \usepackage{mathfont}
-\DeclareFontFamily{TU}{Cormorant}{}
-\DeclareFontShape{TU}{Cormorant}{m}{n}
-  {<->"Cormorant Medium:\M at otf@features;-liga"}{}
-\DeclareFontShape{TU}{Cormorant}{m}{it}
-  {<->"Cormorant Medium Italic:\M at otf@features"}{}
 \mathfont[greeklower=upright,greekupper]{Crimson}
 \mathfont[diacritics]{Bona Nova}
-\setfont{Cormorant}
+\setfont{Cormorant:-liga}
 \RuleThicknessFactor{600}
 \DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
 \DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
@@ -80,7 +86,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax

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

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_kelvinch.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `kelvinch')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 
@@ -58,8 +59,18 @@
 %% 
 %% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_kelvinch.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, typeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -73,7 +84,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax

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

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_roboto.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `roboto')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 
@@ -58,8 +59,18 @@
 %% 
 %% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_roboto.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, typeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -77,7 +88,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax

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

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_example_typey.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `typey')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 
@@ -58,8 +59,18 @@
 %% 
 %% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_typey.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, retypeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -72,6 +83,7 @@
 %% it has no bold fontface---we use embolden from luaotflaod
 %% to make a fake bold
 
+\makeatletter
 \DeclareFontFamily{TU}{Typey}{}
 \DeclareFontShape{TU}{Typey}{m}{n}
   {<->"Typey McTypeface:\M at otf@features"}{}
@@ -93,6 +105,8 @@
   {<->"Typey McTypeface:\M at otf@features;embolden=6;mode=base"}{}
 \DeclareFontShape{TU}{Typey-base}{\bfdefault}{\itdefault}
   {<->"Typey McTypeface/I:\M at otf@features;embolden=6;mode=base"}{}
+\makeatother
+
 \setfont{Typey}
 \mathfont[]{STIXGeneral}
 \DeclareSymbolFont{Mroman2}{TU}{STIXGeneral}{m}{n}
@@ -102,7 +116,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_heading.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `heading')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 
@@ -59,8 +60,11 @@
 %% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 
+\csname count@\endcsname\catcode`\@
+\makeatletter
+
 \def\packagedate{December 2022}
-\def\packageversion{2.2}
+\def\packageversion{2.2a}
 
 
 \let\@@section\section
@@ -148,7 +152,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}. 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\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 Shyam Sundar, Adrian Vollmer, 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}
@@ -180,6 +184,9 @@
 \bigskip\bigskip\nointerlineskip
 \centerline{\vrule height 0.5pt width 2.5in}\bigskip\medskip
 \fi
+
+\catcode`\@\count@
+
 \endinput
 %%
 %% End of file `mathfont_heading.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	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_symbol_list.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `chars')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 

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

Modified: trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/doc/latex/mathfont/mathfont_user_guide.tex	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `user')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 
@@ -90,13 +91,13 @@
 \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}.
+Handling fonts in \TeX\ and \LaTeX\ is a notoriously difficult task because fonts are complicated.\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}. Because unicode text fonts outnumber unicode math fonts, I hope that my package will expand the set of possibilities for typesetting math in \LaTeX.
 
 \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.
+Loading fonts for math typesetting is more complicated than for regular text. First, selecting fonts for math mode, both in plain \TeX\ and in the \textsc{nfss}, involves additional macros above and beyond what we need to load text fonts. Second, \TeX\ expects fonts for math to contain extra information for formatting 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 well-known example. (Compare \fbox{$f$} and \fbox{\texttt{f}}.) 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 5 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.} Although \textsf{mathfont} tries its best to get your fonts right, it may run into trouble when picking fonts to load. If this happens, you should declare your font family and shapes in the \textsc{nfss} before setting any fonts with \textsf{mathfont}.
 
-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.
+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{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.
 
@@ -289,7 +290,7 @@
 \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.
+Finally, advanced users who want to interact with the font adjustment process directly should use the six callbacks in Table~\ref{Callbacks}. When \textsf{luaotfload} 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 or you really know what you're doing. Otherwise, you risk breaking the package. See |mathfont_code.pdf| for more information.
 
 \end{document}
 \endinput

Modified: trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/source/latex/mathfont/mathfont_code.dtx	2022-12-05 21:24:22 UTC (rev 65205)
@@ -1,10 +1,11 @@
 % \iffalse     ---!!! FIRST META-COMMENT !!!---
 % 
 % 
-% This file is mathfont_code.dtx from version 2.2 of the
-% free and open-source LaTeX package "mathfont," to be 
-% used with the XeTeX or LuaTeX engines. Running Plain
-% TeX mathfont_code.dtx will produce the following files:
+% This file is mathfont_code.dtx from version 2.2a of the
+% free and open-source LaTeX package "mathfont," released
+% December 2022, to be used with the XeTeX or LuaTeX engines.
+% Running Plain TeX mathfont_code.dtx will produce the
+% following files:
 % 
 %   (1) the package file mathfont.sty;
 % 
@@ -41,9 +42,10 @@
 % \iffalse     ---!!! SECOND META-COMMENT !!!---
 % 
 % 
-% This file is from version 2.2 of the free and open-source
-% LaTeX package "mathfont," to be used with the XeTeX or
-% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+% This file is from version 2.2a of the free and open-source
+% LaTeX package "mathfont," released December 2022, to be used
+% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+% is recommended.)
 % 
 % Copyright 2018-2022 by Conrad Kosowsky
 % 
@@ -151,9 +153,10 @@
 \askforoverwritefalse
 \preamble
 
-This file is from version 2.2 of the free and open-source
-LaTeX package "mathfont," to be used with the XeTeX or
-LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+This file is from version 2.2a of the free and open-source
+LaTeX package "mathfont," released December 2022, to be used
+with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+is recommended.)
 
 Copyright 2018-2022 by Conrad Kosowsky
 
@@ -281,7 +284,7 @@
 % \fi
 % 
 % 
-% \CheckSum{6615}
+% \CheckSum{6619}
 % \init at checksum
 % 
 % 
@@ -390,7 +393,7 @@
 % First and foremost, the package needs to declare itself.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mathfont}[2022/12/04 v. 2.2 Package mathfont]
+\ProvidesPackage{mathfont}[2022/12/05 v. 2.2a Package mathfont]
 %    \end{macrocode}
 % We specify conditionals that we will use later in handling options and setup.
 %    \begin{macrocode}
@@ -1469,11 +1472,11 @@
       \def\@tempb{#1}
       \def\@tempc{upright}
       \ifx\@tempb\@tempc
-        \let\@tempc\shapedefault
+        \let\m at th@const at nts@font at sh@pe\shapedefault
       \else
         \def\@tempc{italic}
         \ifx\@tempb\@tempc
-          \let\@tempc\itdefault
+          \let\m at th@const at nts@font at sh@pe\itdefault
         \else
           \M at BadMathConstantsFontTypeError{#1}
         \fi
@@ -1480,7 +1483,7 @@
       \fi
       \ifcsname symM#1\csname M at fontid@\@tempa\endcsname\endcsname\else
         \DeclareSymbolFont{M#1\csname M at fontid@\@tempa\endcsname}
-          {TU}{\@tempa}{\mddefault}{\@tempc}
+          {TU}{\@tempa}{\mddefault}{\m at th@const at nts@font at sh@pe}
       \fi
       \let\m at th@const at nts@font\@tempa
 %    \end{macrocode}
@@ -1495,8 +1498,10 @@
           \csname symM#1\csname M at fontid@\m at th@const at nts@font\endcsname
             \expandafter
           \endcsname % expands to \symMupright<id>
-          \csname TU/\m at th@const at nts@font/\seriesdefault/\@tempc
-            \endcsname % expands to \TU/<nfss family name>/m/<shape>
+          \csname TU/\m at th@const at nts@font
+                    /\seriesdefault
+                    /\m at th@const at nts@font at sh@pe\endcsname
+          % above \csname expands to \TU/<nfss family name>/m/<shape>
         \globaldefs\@ne
         \expandafter\@gobbletwo\math at fonts % gobble to avoid infinite loop
         \endgroup}
@@ -1613,13 +1618,18 @@
     \else
       \directlua{
       local num = tonumber("\@tempa")
+      local bool = 0 % keep track if \@tempa is (int >= 0)
       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")
+            bool = 1
           end
         end
+      end
+      tex.print("\@backslashchar\@backslashchar endgroup")
+      if bool == 1 then
+        tex.print("\@backslashchar\@backslashchar csname M at arg@goodtrue%
+        \@backslashchar\@backslashchar endcsname")
       end}
     \fi
   \fi}
@@ -4693,10 +4703,16 @@
 % 
 % \version{2.2}{December 2022\strut}
 % \item changed the easter egg text
-% \item updated patch for |\DeclareSymbolFont| to work with changes to the kernel
+% \item updated patch for |\DeclareSymbolFont| to work with changes to the kernel (eliminated |\M at p@tch at decl@re| error message)
 % \item calling Plain \TeX\ on \texttt{mathfont\_code.dtx} produces sty file and no pdf file
 % 
+% \version{2.2a}{December 2022\strut}
+% \item bug fix for |\mathconstantsfont|
+% \item bug fix for |\M at check@int|
+% \item removed |\makeatletter| from example files
+% \item added |doc2| option to |ltxdoc| in \texttt{mathfont\_code.dtx}
 % 
+% 
 % \egroup
 % \end{multicols*}
 % 
@@ -4742,16 +4758,15 @@
 \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}.
+Handling fonts in \TeX\ and \LaTeX\ is a notoriously difficult task because fonts are complicated.\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}. Because unicode text fonts outnumber unicode math fonts, I hope that my package will expand the set of possibilities for typesetting math in \LaTeX. 
 
 
 \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. 
+Loading fonts for math typesetting is more complicated than for regular text. First, selecting fonts for math mode, both in plain \TeX\ and in the \textsc{nfss}, involves additional macros above and beyond what we need to load text fonts. Second, \TeX\ expects fonts for math to contain extra information for formatting 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 well-known example. (Compare \fbox{$f$} and \fbox{\texttt{f}}.) 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 5 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.} Although \textsf{mathfont} tries its best to get your fonts right, it may run into trouble when picking fonts to load. If this happens, you should declare your font family and shapes in the \textsc{nfss} before setting any fonts with \textsf{mathfont}.
 
+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{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.
 
-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}
@@ -4955,10 +4970,9 @@
 \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.
+Finally, advanced users who want to interact with the font adjustment process directly should use the six callbacks in Table~\ref{Callbacks}. When \textsf{luaotfload} 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 or you really know what you're doing. Otherwise, you risk breaking the package. See |mathfont_code.pdf| for more information.
 
 
-
 \end{document}
 %</user>
 %<*chars>
@@ -5890,8 +5904,18 @@
 \end{multicols}
 %</equations>
 %<*cormorant>
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_cormorant.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, typeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -5898,14 +5922,9 @@
 \usepackage{amsmath}
 \DeclareMathOperator{\Res}{Res}
 \usepackage{mathfont}
-\DeclareFontFamily{TU}{Cormorant}{}
-\DeclareFontShape{TU}{Cormorant}{m}{n}
-  {<->"Cormorant Medium:\M at otf@features;-liga"}{}
-\DeclareFontShape{TU}{Cormorant}{m}{it}
-  {<->"Cormorant Medium Italic:\M at otf@features"}{}
 \mathfont[greeklower=upright,greekupper]{Crimson}
 \mathfont[diacritics]{Bona Nova}
-\setfont{Cormorant}
+\setfont{Cormorant:-liga}
 \RuleThicknessFactor{600}
 \DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
 \DeclareMathSymbol{\nabla}{\mathord}{Mupright0}{"2207}
@@ -5912,7 +5931,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax
@@ -5928,8 +5947,18 @@
 \end{document}
 %</cormorant>
 %<*kelvinch>
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_kelvinch.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, typeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -5943,7 +5972,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax
@@ -5958,8 +5987,18 @@
 \end{document}
 %</kelvinch>
 %<*roboto>
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_roboto.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, typeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -5977,7 +6016,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax
@@ -5993,8 +6032,18 @@
 \end{document}
 %</roboto>
 %<*typey>
+\ifx\directlua\undefined
+  \PackageError{mathfont}
+  {\MessageBreak
+  LuaLaTeX is recommended for\MessageBreak
+  mathfont_example_typey.tex}
+  {It's recommended that you typset this file\MessageBreak
+  with LuaTeX. You can use a different engine\MessageBreak
+  if you want, but things will turn out weird.\MessageBreak
+  To resolve this error, retypeset this file\MessageBreak
+  with LuaLaTeX.}
+\fi
 \documentclass[12pt]{article}
-\makeatletter
 \usepackage[margin=1in]{geometry}
 \usepackage{innerscript}
 \usepackage{multicol}
@@ -6007,6 +6056,7 @@
 %% it has no bold fontface---we use embolden from luaotflaod
 %% to make a fake bold
 
+\makeatletter
 \DeclareFontFamily{TU}{Typey}{}
 \DeclareFontShape{TU}{Typey}{m}{n}
   {<->"Typey McTypeface:\M at otf@features"}{}
@@ -6028,6 +6078,8 @@
   {<->"Typey McTypeface:\M at otf@features;embolden=6;mode=base"}{}
 \DeclareFontShape{TU}{Typey-base}{\bfdefault}{\itdefault}
   {<->"Typey McTypeface/I:\M at otf@features;embolden=6;mode=base"}{}
+\makeatother
+
 \setfont{Typey}
 \mathfont[]{STIXGeneral}
 \DeclareSymbolFont{Mroman2}{TU}{STIXGeneral}{m}{n}
@@ -6037,7 +6089,7 @@
 \parindent=0pt\relax
 \begin{document}
 
-\let\footnote\@gobble
+\def\footnote#1{}
 \def\showabstract{0}
 \let\textsf\relax
 \let\ttfamily\relax
@@ -6054,14 +6106,15 @@
 %</typey>
 %<*heading>
 
+\csname count@\endcsname\catcode`\@
+\makeatletter
+
 % package date and edition
 \def\packagedate{December 2022}
-\def\packageversion{2.2}
+\def\packageversion{2.2a}
 
 % header and footer commands
 
-
-
 \let\@@section\section
 \def\section{\@ifstar\star at sect\no at star@sect}
 \def\star at sect#1{\@@section*{#1}\section at name{#1}}
@@ -6151,7 +6204,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}. 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\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 Shyam Sundar, Adrian Vollmer, 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}
@@ -6184,6 +6237,9 @@
 \bigskip\bigskip\nointerlineskip
 \centerline{\vrule height 0.5pt width 2.5in}\bigskip\medskip
 \fi
+
+\catcode`\@\count@
+
 %</heading>
 %<*doc>
 

Modified: trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty	2022-12-05 21:23:48 UTC (rev 65204)
+++ trunk/Master/texmf-dist/tex/latex/mathfont/mathfont.sty	2022-12-05 21:24:22 UTC (rev 65205)
@@ -6,9 +6,10 @@
 %%
 %% mathfont_code.dtx  (with options: `package')
 %% 
-%% This file is from version 2.2 of the free and open-source
-%% LaTeX package "mathfont," to be used with the XeTeX or
-%% LuaTeX engines. (As of version 2.0, LuaTeX is recommended.)
+%% This file is from version 2.2a of the free and open-source
+%% LaTeX package "mathfont," released December 2022, to be used
+%% with the XeTeX or LuaTeX engines. (As of version 2.0, LuaTeX
+%% is recommended.)
 %% 
 %% Copyright 2018-2022 by Conrad Kosowsky
 %% 
@@ -59,7 +60,7 @@
 %% For more information, see mathfont_code.dtx. Happy TeXing!
 %% 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mathfont}[2022/12/04 v. 2.2 Package mathfont]
+\ProvidesPackage{mathfont}[2022/12/05 v. 2.2a 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?
@@ -797,11 +798,11 @@
       \def\@tempb{#1}
       \def\@tempc{upright}
       \ifx\@tempb\@tempc
-        \let\@tempc\shapedefault
+        \let\m at th@const at nts@font at sh@pe\shapedefault
       \else
         \def\@tempc{italic}
         \ifx\@tempb\@tempc
-          \let\@tempc\itdefault
+          \let\m at th@const at nts@font at sh@pe\itdefault
         \else
           \M at BadMathConstantsFontTypeError{#1}
         \fi
@@ -808,7 +809,7 @@
       \fi
       \ifcsname symM#1\csname M at fontid@\@tempa\endcsname\endcsname\else
         \DeclareSymbolFont{M#1\csname M at fontid@\@tempa\endcsname}
-          {TU}{\@tempa}{\mddefault}{\@tempc}
+          {TU}{\@tempa}{\mddefault}{\m at th@const at nts@font at sh@pe}
       \fi
       \let\m at th@const at nts@font\@tempa
       \protected\def\M at SetMathConstants{%
@@ -818,8 +819,10 @@
           \csname symM#1\csname M at fontid@\m at th@const at nts@font\endcsname
             \expandafter
           \endcsname % expands to \symMupright<id>
-          \csname TU/\m at th@const at nts@font/\seriesdefault/\@tempc
-            \endcsname % expands to \TU/<nfss family name>/m/<shape>
+          \csname TU/\m at th@const at nts@font
+                    /\seriesdefault
+                    /\m at th@const at nts@font at sh@pe\endcsname
+          % above \csname expands to \TU/<nfss family name>/m/<shape>
         \globaldefs\@ne
         \expandafter\@gobbletwo\math at fonts % gobble to avoid infinite loop
         \endgroup}
@@ -904,13 +907,18 @@
     \else
       \directlua{
       local num = tonumber("\@tempa")
+      local bool = 0 % keep track if \@tempa is (int >= 0)
       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")
+            bool = 1
           end
         end
+      end
+      tex.print("\@backslashchar\@backslashchar endgroup")
+      if bool == 1 then
+        tex.print("\@backslashchar\@backslashchar csname M at arg@goodtrue%
+        \@backslashchar\@backslashchar endcsname")
       end}
     \fi
   \fi}



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