texlive[72612] Master/texmf-dist: mathastext (21oct24)
commits+karl at tug.org
commits+karl at tug.org
Mon Oct 21 22:25:08 CEST 2024
Revision: 72612
https://tug.org/svn/texlive?view=revision&revision=72612
Author: karl
Date: 2024-10-21 22:25:07 +0200 (Mon, 21 Oct 2024)
Log Message:
-----------
mathastext (21oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/mathastext/ChangeLog.md
trunk/Master/texmf-dist/doc/latex/mathastext/README.md
trunk/Master/texmf-dist/doc/latex/mathastext/mathastext.pdf
trunk/Master/texmf-dist/doc/latex/mathastext/mathastext.tex
trunk/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
trunk/Master/texmf-dist/tex/latex/mathastext/mathastext.sty
Modified: trunk/Master/texmf-dist/doc/latex/mathastext/ChangeLog.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathastext/ChangeLog.md 2024-10-21 20:24:53 UTC (rev 72611)
+++ trunk/Master/texmf-dist/doc/latex/mathastext/ChangeLog.md 2024-10-21 20:25:07 UTC (rev 72612)
@@ -1,6 +1,33 @@
MATHASTEXT CHANGE LOG
=====================
+1.4c \[2024/10/21\]
+----
+
+* Fix a regression at `1.4`: under `XeLaTeX`: loading `mathastext`
+ caused an error if `unicode-math` and its `\setmathfont` had been
+ used prior ("Extended mathchar used as mathchar" in relation to the
+ minus sign character). Thanks to Michael Roland for report.
+
+ Keep in mind though that the documentation (see 1.4.15 Unicode engines) has
+ always said that the package "is expected to be most definitely
+ incompatible with unicode-math".
+
+* Fix another regression at `1.4`, related to the same code and also avoided
+ with `everymath` option, but showing with
+ all engines. It caused `\MTnonlettersdonotobeymathxx`, if used, to reset
+ the minus sign to its status as prior to the loading of `mathastext`,
+ whereas it should have used the (by default) mathversion dependent one
+ (which defaults to the en-dash in the font encoding as stored by `mathastext` in
+ the extended math version).
+
+* `\Relbar` and `\relbar` redeclarations (needed as they are used by `LaTeX`
+ for arrows, and the equal and minus signs if picked from the text font may not
+ work well in-there) are now done via `\DeclareRobustCommand` also with
+ package `amsmath` to match the current behavior of the latter. Note though
+ that they will use the equal and minus signs as in place at package loading
+ time, the documentation does say that `mathastext` should be loaded last.
+
1.4b \[2024/07/27\]
----
@@ -72,8 +99,8 @@
tex.sx `user691586` for report. This is currently the sole remaining
usage of `\everymath/\everydisplay`.
-* Bugfix: an optional feature related to `\{` and `\}` was broken since an
- upstream LaTeX change at its 2020-02-02 release.
+* Bugfix: `\MTexplicitbracesobeymathxx` (which is related to `\{` and `\}`)
+ was without effect since an upstream LaTeX change at its 2020-02-02 release.
* With option symbolmisc, those math symbol macros formerly defined via
`\DeclareRobustCommand` are now declared via `\protected\def`.
Modified: trunk/Master/texmf-dist/doc/latex/mathastext/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathastext/README.md 2024-10-21 20:24:53 UTC (rev 72611)
+++ trunk/Master/texmf-dist/doc/latex/mathastext/README.md 2024-10-21 20:25:07 UTC (rev 72612)
@@ -14,7 +14,7 @@
Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
- Source: mathastext.dtx 1.4b 2024/07/27
+ Source: mathastext.dtx 1.4c 2024/10/21
DESCRIPTION
@@ -82,6 +82,33 @@
RECENT CHANGES
==============
+1.4c \[2024/10/21\]
+----
+
+* Fix a regression at `1.4`: under `XeLaTeX`: loading `mathastext`
+ caused an error if `unicode-math` and its `\setmathfont` had been
+ used prior ("Extended mathchar used as mathchar" in relation to the
+ minus sign character). Thanks to Michael Roland for report.
+
+ Keep in mind though that the documentation (see 1.4.15 Unicode engines) has
+ always said that the package "is expected to be most definitely
+ incompatible with unicode-math".
+
+* Fix another regression at `1.4`, related to the same code and also avoided
+ with `everymath` option, but showing with
+ all engines. It caused `\MTnonlettersdonotobeymathxx`, if used, to reset
+ the minus sign to its status as prior to the loading of `mathastext`,
+ whereas it should have used the (by default) mathversion dependent one
+ (which defaults to the en-dash in the font encoding as stored by `mathastext` in
+ the extended math version).
+
+* `\Relbar` and `\relbar` redeclarations (needed as they are used by `LaTeX`
+ for arrows, and the equal and minus signs if picked from the text font may not
+ work well in-there) are now done via `\DeclareRobustCommand` also with
+ package `amsmath` to match the current behavior of the latter. Note though
+ that they will use the equal and minus signs as in place at package loading
+ time, the documentation does say that `mathastext` should be loaded last.
+
1.4b \[2024/07/27\]
----
@@ -153,8 +180,8 @@
tex.sx `user691586` for report. This is currently the sole remaining
usage of `\everymath/\everydisplay`.
-* Bugfix: an optional feature related to `\{` and `\}` was broken since an
- upstream LaTeX change at its 2020-02-02 release.
+* Bugfix: `\MTexplicitbracesobeymathxx` (which is related to `\{` and `\}`)
+ was without effect since an upstream LaTeX change at its 2020-02-02 release.
* With option symbolmisc, those math symbol macros formerly defined via
`\DeclareRobustCommand` are now declared via `\protected\def`.
@@ -174,54 +201,3 @@
extent improved. But there may be some occasions where obsolete statements will
be found having the legacy `\everymath/\everydisplay` situation as background.
-1.3zb \[2023/12/29\]
------
-
-* Update to the `frenchmath*` option to maintain compatibility
- with the [frenchmath](https://ctan.org/pkg/frenchmath)
- package whose release 2.7 (2023/12/23) has replaced
- the ncccomma package by the decimalcomma package.
-
-* The `frenchmath+` option holds the former meaning of `frenchmath*`.
-
-* Option `decimalcomma` to load the eponymous package by Antoine
- Missier. This is tacitly done by `frenchmath*`.
-
-* No more messages sent to the console output during loading,
- only info messages going into the log, and using (more or less)
- the official LaTeX interface: after close to 13 years of development
- of this package it was perhaps finally the time to do it.
-
-* Documentation improvements. Close to 13 years after the
- birth of the package, and as it nowadays rarely wakes up from
- dormancy, this was almost last chance to try to improve a few
- things.
-
-1.3za \[2023/12/20\]
------
-
-* Under `LGRgreek` and `LGRgreeks` options, new math alphabets
- `\mathgreekupbold` and `\mathgreekitbold`.
-
-* New options `LGRgreek+` and `LGRgreeks+`.
-
- Thanks to Holger Gerhardt for feature request and code ideas.
- Please find and read the relevant documentation in the PDF.
-
-* The meaning of `defaultalphabets` and related individual
- options such as `defaultbf` has been modified (reverted to pre
- `1.15f` release): even under these options, the package always
- creates `\mathnormalbold`, `\Mathnormal`, `\Mathrm`, `\Mathbf`
- etc..., commands. This may break documents which used these
- options in order to reserve these command names. This was done
- with some hesitancy, but for the sake of internal logical
- coherence.
-
-* Fix an obscure bug with no real consequences regarding
- interaction of `subdued` with `LGRgreek` and `\MTgreekfont`.
- See the `LGRgreek` documentation in the complete list of
- options for details.
-
-* Fix long-standing hyperlink problems in the documentation:
- blue color words should now all be functioning hyperlinks.
-
Modified: trunk/Master/texmf-dist/doc/latex/mathastext/mathastext.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/mathastext/mathastext.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mathastext/mathastext.tex 2024-10-21 20:24:53 UTC (rev 72611)
+++ trunk/Master/texmf-dist/doc/latex/mathastext/mathastext.tex 2024-10-21 20:25:07 UTC (rev 72612)
@@ -1,9 +1,9 @@
-\def\MSTpkgdate {2024/07/27}
-\def\MSTpkgversion {1.4b}
+\def\MSTpkgdate {2024/10/21}
+\def\MSTpkgversion {1.4c}
%%----------------------------------------------------------------
%% Package: mathastext
%% Info: Use the text font in math mode (JFB)
-%% Version: 1.4b 2024/07/27
+%% Version: 1.4c 2024/10/21
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
%% Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
%% <jfbu at free dot fr>
Modified: trunk/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/mathastext/mathastext.dtx 2024-10-21 20:24:53 UTC (rev 72611)
+++ trunk/Master/texmf-dist/source/latex/mathastext/mathastext.dtx 2024-10-21 20:25:07 UTC (rev 72612)
@@ -2,8 +2,8 @@
% N.B.: this dtx file does NOT use \DocInput, it only uses docstrip.
% The LaTeX source of the documentation is NOT prefixed with %'s.
%<*dtx>
-\def\dtxtimestamp {Time-stamp: <26-07-2024 at 11:21:35 CEST>}
-\def\docdate{2024/07/27}
+\def\dtxtimestamp {Time-stamp: <21-10-2024 at 14:03:00 CEST>}
+\def\docdate{2024/10/21}
% To extract run etex on this file, then to build documentation run
% latexmk on mathastext.tex then dvipdfmx on the dvi.
% For more information see http://jf.burnol.free.fr/v13/INSTALL.txt
@@ -11,8 +11,8 @@
% due to usage of \xA7 (<A7>) as an active character.
%</dtx>
%<*drv>
-\def\MSTpkgdate {2024/07/27}
-\def\MSTpkgversion {1.4b}
+\def\MSTpkgdate {2024/10/21}
+\def\MSTpkgversion {1.4c}
%</drv>
%<*dtx>
\iffalse % meta-comment
@@ -34,7 +34,7 @@
Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
- Source: mathastext.dtx 1.4b 2024/07/27
+ Source: mathastext.dtx 1.4c 2024/10/21
%</readme>
%<*dtx>
@@ -44,7 +44,7 @@
%%----------------------------------------------------------------
%% Package: mathastext
%% Info: Use the text font in math mode (JFB)
-%% Version: 1.4b 2024/07/27
+%% Version: 1.4c 2024/10/21
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
%% Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
%% <jfbu at free dot fr>
@@ -193,6 +193,33 @@
%</changelog>
%<*readme|changelog>
+1.4c \[2024/10/21\]
+----
+
+* Fix a regression at `1.4`: under `XeLaTeX`: loading `mathastext`
+ caused an error if `unicode-math` and its `\setmathfont` had been
+ used prior ("Extended mathchar used as mathchar" in relation to the
+ minus sign character). Thanks to Michael Roland for report.
+
+ Keep in mind though that the documentation (see 1.4.15 Unicode engines) has
+ always said that the package "is expected to be most definitely
+ incompatible with unicode-math".
+
+* Fix another regression at `1.4`, related to the same code and also avoided
+ with `everymath` option, but showing with
+ all engines. It caused `\MTnonlettersdonotobeymathxx`, if used, to reset
+ the minus sign to its status as prior to the loading of `mathastext`,
+ whereas it should have used the (by default) mathversion dependent one
+ (which defaults to the en-dash in the font encoding as stored by `mathastext` in
+ the extended math version).
+
+* `\Relbar` and `\relbar` redeclarations (needed as they are used by `LaTeX`
+ for arrows, and the equal and minus signs if picked from the text font may not
+ work well in-there) are now done via `\DeclareRobustCommand` also with
+ package `amsmath` to match the current behavior of the latter. Note though
+ that they will use the equal and minus signs as in place at package loading
+ time, the documentation does say that `mathastext` should be loaded last.
+
1.4b \[2024/07/27\]
----
@@ -264,8 +291,8 @@
tex.sx `user691586` for report. This is currently the sole remaining
usage of `\everymath/\everydisplay`.
-* Bugfix: an optional feature related to `\{` and `\}` was broken since an
- upstream LaTeX change at its 2020-02-02 release.
+* Bugfix: `\MTexplicitbracesobeymathxx` (which is related to `\{` and `\}`)
+ was without effect since an upstream LaTeX change at its 2020-02-02 release.
* With option symbolmisc, those math symbol macros formerly defined via
`\DeclareRobustCommand` are now declared via `\protected\def`.
@@ -285,6 +312,8 @@
extent improved. But there may be some occasions where obsolete statements will
be found having the legacy `\everymath/\everydisplay` situation as background.
+%</readme|changelog>
+%<*changelog>
1.3zb \[2023/12/29\]
-----
@@ -336,8 +365,6 @@
* Fix long-standing hyperlink problems in the documentation:
blue color words should now all be functioning hyperlinks.
-%</readme|changelog>
-%<*changelog>
1.3z \[2023/09/01\]
----
@@ -1423,7 +1450,7 @@
{\normalfont\LARGE The \mst package}\\
\textsc{\small Jean-Fran\xE7ois Burnol}\par
\footnotesize \ttfamily \frenchspacing
- jfbu (at) free (dot) fr\par
+ \fbox{contact: jfbu (at) free (dot) fr}\par
\let\thefootnote\empty
Package version: \MSTpkgversion\ (\MSTpkgdate)%
\footnote{Documentation generated from the
@@ -4267,7 +4294,7 @@
\mstcmd{MTlettershape}\marg{sh}.%
%
\footnote{These commands exist also with
- long names: \csb{Mathastextencoding},
+ long names: \cs{Mathastextencoding},
etc\dots{} The same applies to the other commands
mentioned in this section.}
%
@@ -4789,7 +4816,7 @@
(even in the preamble).
At \mstrelease{1.4}\RLNote{changed:}{\mstrelease{1.4}} \mst checks at
- |\begin{document}| (or each time \xA7\MTaciveasterisk\xA7 is made use of) if
+ |\begin{document}| (or each time \xA7\MTactiveasterisk\xA7 is made use of) if
* is a Babel shorthand (which I far as I know is the case of no
language) or is already mathematically active. In the latter case the
* is not modified in math mode; and it is not modified either if
@@ -4988,11 +5015,23 @@
it will have to be coded |$a^{!}$|. Hence, by default, the package does
\xA7\MTnonlettersdonotobeymathxx\xA7.
-\item \mstcmd{MTexplicitbracesobeymathxx}: extends an earlier \xA7\MTnonlettersobeymathxx\xA7
- to also treat \verb|\{| and \verb|\}|. But then |\left\{|, |\right\}| must
- be coded |\left\lbrace|, |\right\rbrace| rather. There is also
- \mstcmd{MTexplicitbracesdonotobeymathxx}.
+\item \mstcmd{MTexplicitbracesobeymathxx}: does \xA7\MTnonlettersobeymathxx\xA7 and
+ extends it to also apply to \verb|\{| and \verb|\}|. Note that then |\left\{|,
+ |\right\}| must be coded |\left\lbrace|, |\right\rbrace| rather. There is
+ also \mstcmd{MTexplicitbracesdonotobeymathxx}.
+ {\footnotesize
+ If under the \xA7everymath\xA7 option, it is needed to issue explicitly
+ \xA7\MTnonlettersobeymathxx\xA7 in addition to \xA7\MTexplicitbracesobeymathxx\xA7.
+
+ Whether or not with \xA7everymath\xA7, if the command is issued while in
+ \xA7subdued\xA7 normal or bold, it has no effect immediately, but if switching
+ later to a non-\xA7subdued\xA7 math version via \xA7\MTversion\xA7, a
+ \xA7\MTnonlettersobeymathxx\xA7 issued then will automatically apply also to
+ \verb|\{| and \verb|\}|.
+ \par
+ }
+
\item \RightNote{\mstrelease{1.3j}}\mstcmd{MTeverymathdefault}: this hook is executed by
\csb{MTversion}\marg{version\_name} (but if under option |subdued|
and switching to the \emph{normal} or \emph{bold} math version its default
@@ -5789,7 +5828,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2020/02/02]
\ProvidesPackage {mathastext}
- [2024/07/27 v1.4b Use the text font in math mode (JFB)]
+ [2024/10/21 v1.4c Use the text font in math mode (JFB)]
% \end{macrocode}
% \mstrelease{1.3zb} avoids writing \mst info messages also to console output, only log file.
% Make prefix occupy 20 not 25 characters for alignment with \texttt{LaTeX Font Info},
@@ -5846,33 +5885,32 @@
\newif\ifmst at XeOrLua
\ifmst at LuaTeX\mst at XeOrLuatrue\fi
\ifmst at XeTeX \mst at XeOrLuatrue\fi
+% \begin{macrocode}
% \end{macrocode}
% \mstrelease{1.4}. I only checked this is correct with TL2024.
% The macro will be used with |#1| a catcode 11 or 12 token or a one character
% control sequence such as |\#|.
+%
+% \mstrelease{1.4c} add some definitions to avoid separate branches for
+% non-Unicode vs Unicode.
% \begin{macrocode}
\ifmst at XeTeX
- \def\mst at OnlyIfNotMathActive#1{%
- \ifnum\mst at Umathcodenum`#1="1FFFFF
- \expandafter\@gobble
- \else\expandafter\@firstofone
- \fi
- }
-\else\ifmst at LuaTeX
- \def\mst at OnlyIfNotMathActive#1{%
- \ifnum\mst at Umathcodenum`#1="1000000
- \expandafter\@gobble
- \else\expandafter\@firstofone
- \fi
- }
+ \def\mst at activemathcodenum@space{"1FFFFF }%
+ \let\mst at mathcodenum\mst at Umathcodenum
\else
- \def\mst at OnlyIfNotMathActive#1{%
- \ifnum\mathcode`#1="8000
- \expandafter\@gobble
- \else\expandafter\@firstofone
- \fi
- }
+\ifmst at LuaTeX
+ \def\mst at activemathcodenum@space{"1000000 }%
+ \let\mst at mathcodenum\mst at Umathcodenum
+\else
+ \def\mst at activemathcodenum@space{"8000 }%
+ \let\mst at mathcodenum\mathcode
\fi\fi
+\def\mst at OnlyIfNotMathActive#1{%
+ \ifnum\mst at mathcodenum`#1=\mst at activemathcodenum@space
+ \expandafter\@gobble
+ \else\expandafter\@firstofone
+ \fi
+}
% \end{macrocode}
% \mstrelease{1.2}: all inner macros of \mst now starts with |\mst@| for a cleaner
% name-space.
@@ -6349,8 +6387,10 @@
}%
% \end{macrocode}
% The ``undo'' is needed at \mstrelease{1.4} (but not if |everymath|).
+% The \mstrelease{1.4c} uses with Unicode \cs{Umathcodenum} in
+% \cs{mst at mathdeactivate} and not \cs{mathcode} hence no |"8000| here.
% \begin{macrocode}
-\def\mst at undo@mathactivateprime{\mst at mathdeactivate#1{"8000}}%
+\def\mst at undo@mathactivateprime{\mst at mathdeactivate#1{\mst at activemathcodenum@space}}%
}\expandafter\mst at tmp\string'
\def\mst at active@math at prime{\sp\bgroup\mskip\mst at prime@muskip\prim at s}
\ifmst at everymath
@@ -6470,7 +6510,7 @@
\let\mst at savedresetMathstrut@\resetMathstrut@
% \end{macrocode}
% The |\ifx\mst at the\the| is true iff \cs{MTnonlettersobeymathxx} was used in preamble
-% (last compared to \cs{MTnonlettersdonotobeymathxx}).
+% (and after possibly some \cs{MTnonlettersdonotobeymathxx}).
% Setting \cs{mst at the} to \cs{@gobble} here wiil cause \cs{MTnonlettersobeymathxx}
% to indeed modify \cs{resetMathstrut@} (and it resets \cs{mst at the} to \cs{the} for
% its behavior in \cs{everymath}).
@@ -6794,7 +6834,7 @@
% here using an \cs{ifmmode}. And we store the original meaning of the
% active variant of the token to reset it when ``undoing''.
%
-% Careful not to do it twice in a row... (but this means \cs{mst at deactivate}
+% Careful not to do it twice in a row... (but this means \cs{mst at mathdeactivate}
% might not revert to a user custom redefinition done in-between but to a
% prior one; although if the character is made active the second
% \cs{mst at mathactivate} would not have been done).
@@ -6836,11 +6876,19 @@
% The \cs{mst at mathdeactivate} is active (sic) only in the non |everymath|
% situation. It will restore a previously existing active meaning if it has
% been changed.
+%
+% The \mstrelease{1.4c} uses \cs{Umathcodenum} here with Unicode engines (the
+% actual conditions why this became necessary were related to the minus
+% character which however does not use \cs{mst at mathdeactivate} anyway at time
+% of finishing the \mstrelease{1.4c} updates). The \cs{string} thing with
+% \texttt{-} is due to some old paranoia for which I see no underlying reason
+% (why on earth would \texttt{-} be catcode active here?), but maintaining it.
+% For |#1=-| the |#2| is empty and unused.
% \begin{macrocode}
\ifmst at everymath
\else
\def\mst at mathdeactivate#1#2{%
- \mathcode`#1=#2\relax
+ \if#1\string-\else\mst at mathcodenum`#1=#2\relax\fi
\@ifundefined{active at char#1}
{\@ifundefined{mst at prioractivemeaning@#1}
{}%
@@ -6927,10 +6975,21 @@
% \end{macrocode}
% We need to automatize some safeguards related to \cs{mst at do@activecase} when
% deactivating.
+%
+% \mstrelease{1.4c} fixes two problems of \mstrelease{1.4} code. First a bug
+% due to \XeLaTeX\ diverging implementation of \cs{mathcode} compared to
+% \LuaLaTeX (or rather vice versa), second the fact that the mathcode here is
+% the one at package loading time, which for most non-letter characters was
+% fine because it had been set by \mst, but for the minus character it was too
+% early.
+%
+% The generic \cs{mst at addtodo@nonletters} can not be used with \texttt{-},
+% some specific code is used, see \cs{mst at nonsubduedminus}.
% \begin{macrocode}
- \def\mst at addtodo@nonletters#1#2#3{\mst at do@nonletters\expandafter
+ \def\mst at addtodo@nonletters#1#2#3{%
+ \mst at do@nonletters\expandafter
{\the\mst at do@nonletters\mst at mathactivate#1#2#3}%
- \edef\mst at tmp{\noexpand\mst at mathdeactivate#1{\the\mathcode`#1}}%
+ \edef\mst at tmp{\noexpand\mst at mathdeactivate#1{\the\mst at mathcodenum`#1}}%
\mst at undo@nonletters\expandafter\expandafter\expandafter
{\expandafter\mst at tmp\the\mst at undo@nonletters}%
}%
@@ -7004,6 +7063,19 @@
\let\mst at the\the
}%
}%
+% \end{macrocode}
+% The next one gets executed (even if not used by user) via
+% \cs{MTeverymathoff}, which itself is done automatically at begin document if
+% in \texttt{subdued} mode. The mechanism of \texttt{subdued} mode is to
+% reassign the \texttt{mtoperatorfont} and \texttt{mtletterfont} to the fonts
+% used by default in the normal math version. The reassignment of mathcodes
+% is needed in case a priori \cs{MTnonlettersobeymathxx} made some characters math
+% active. Normally the slots as defined by \mst match default slots. The
+% case of minus character is special as it by default with legacy \TeX\ fonts
+% and encodings will try to be the EN DASH, whose slot depends on the
+% encoding. The used mathcode's for the minus sign are thus stored by \mst,
+% but under the shape of \cs{(U)mathchar} control sequences.
+% \begin{macrocode}
\renewcommand*\MTnonlettersdonotobeymathxx{%
\the\mst at undo@nonletters
\ifx\mst at the\@gobble
@@ -7154,7 +7226,7 @@
% \item seems I simply don't understand what the amsmath code does with
% \cs{std at minus}. It is used in \cs{relbar} and it escapes me why
% \cs{newmcodes@} would ever want to redefine it, and more importantly why
-% on earth it tests the mathcode of |-| for that ? yes, \cs{std at minus} is
+% on earth it tests the mathcode of |-| for that? yes, \cs{std at minus} is
% defined (at begin document) using the mathcode of |-|, but what's the
% connexion to \cs{newmcodes@} ?? Any way \mst defines \cs{relbar} with
% \cs{mst at minus@sign}. Thus I just drop this conditional.
@@ -8349,7 +8421,7 @@
% \begin{macrocode}
\AtBeginDocument{%
\let\mst at orig@abd at ast\ast
- \edef\MTnormalasterisk{\noexpand\mst at mathdeactivate*{\the\mathcode`\*}%
+ \edef\MTnormalasterisk{\noexpand\mst at mathdeactivate*{\the\mst at mathcodenum`\*}%
\let\noexpand\ast\noexpand\mst at orig@abd at ast}%
\def\MTactiveasterisk{\def\ast{\mst at ast}%
\mst at mathactivate*{}\mst at ast
@@ -8585,12 +8657,23 @@
% \mstrelease{1.3v} |2019/09/19|: \LaTeX{} of |2019-10-01| defines \cs{leftarrowfill}
% and \cs{rightarrowfill} as robust macros, so we do the same.
%
-% I need to put amsmath under surveillance to check if it decides to
+% I need to put \ctanpkg{amsmath} under surveillance to check if it decides to
% robustify \cs{relbar} at some point, now that the \LaTeX\ team has
% taken over maintenance.
%
% |2019/09/16| Use \cs{protected} for \cs{right\textbar{}leftarrowfill} in the non
% \cs{DeclareRobustCommand} branch?
+%
+% \mstrelease{1.4c} |2024/10/20|: I didn't actually put
+% \ctanpkg{amsmath} under surveillance because I had other things to do with
+% my life. But it appears indeed that \cs{relbar} (and \cs{Relbar}) are now
+% robust also if \ctanpkg{amsmath} is loaded, so I follow suit here.
+%
+% MEMO: the minus character used in \cs{relbar} has its mathcode from the
+% \mst loading time. This is not the same as the minus in subdued mode
+% which fetches its mathcode only at begin document. But anyhow the \mst
+% documentation insists the package should be loaded last among packages
+% modifying math mode rendering.
% \begin{macrocode}
\ifmst at nominus
\else
@@ -8605,7 +8688,7 @@
\mathchardef\mst at minus@sign=\mathcode`\-\relax
\fi
\@ifpackageloaded{amsmath}
- {\def\relbar{\mathrel{\mathpalette\mathsm at sh\mst at minus@sign}}}
+ {\DeclareRobustCommand\relbar{\mathrel{\mathpalette\mathsm at sh\mst at minus@sign}}}
{\DeclareRobustCommand\relbar{\mathrel{\smash\mst at minus@sign}}}
\DeclareRobustCommand\rightarrowfill{$\m at th\mathord{\relbar}\mkern-7mu%
\cleaders\hbox{$\mkern-2mu\relbar\mkern-2mu$}\hfill
@@ -8648,11 +8731,11 @@
% change. This means also that |\MTversion| and not |\mathversion|
% must be used for good functioning.
%
-% \mstrelease{1.3u} improves the handling of the minus sign by letting it be compatible
-% with math versions (and not only with the with subdued mechanism but all
-% math versions) having varying font encodings, even possibly classic 8bit
-% font encoding mixed with TU encoding for Unicode engines. For this it is
-% needed to work around a feature of XeTeX/LuaLaTeX, here is original comment:
+% \mstrelease{1.3u} improves the handling of the minus sign by letting it be
+% compatible with math versions (and not only follow the subdued mechanism)
+% having varying font encodings, even possibly classic 8bit font encoding
+% mixed with TU encoding for Unicode engines. For this it is needed to work
+% around a feature (read: bug) of \XeTeX/\LuaLaTeX, here is original comment:
%
% \begin{quotation}
% afaict it is
@@ -8661,9 +8744,34 @@
% This is counter-intuitive and breaks expectations.
% \end{quotation}
%
-% But the \mstrelease{1.3u} mechanism with \cs{mst at UmathchardefWorkAround@i} introduced a
-% bug which showed under option |noendash| (hence also |symboldelimiters|) with
-% Unicode engines. Fixed at \mstrelease{1.3w}.
+% A \mstrelease{1.3u} mechanism used a \cs{mst at UmathchardefWorkAround@i} (a
+% bug which showed under option |noendash|, hence also |symboldelimiters|, with
+% Unicode engines was fixed at \mstrelease{1.3w}). Unfortunately at
+% \mstrelease{1.4c} we still have to use it because a core deficiency with
+% math primitives in \XeTeX/\LuaTeX\ is still there (breakage of natural
+% expectations based on \TeX\ original syntax paradigm; search for
+% words such as "painful" in the text next or prior to this location).
+% The macro was renamed \cs{mst at ParseUmathchardef}.
+%
+% The next macros are used by \cs{Mathastext} and \cs{MTDeclareVersion} to
+% define \cs{mathchar} or \cs{Umathchar} control sequences which are named
+% \cs{mst at minus@mv}\meta{mathversion} and
+% \cs{mst at varfam@minus at mv}\meta{mathversion} which are math version dependent.
+% The \cs{mst at minus} was added to complement \cs{mst at varfam@minus} at
+% \mstrelease{1.4c}.
+%
+% As far as the author can tell now (at \mstrelease{1.4c}) this naming scheme
+% is due to the need to recover the \cs{textendash} or \cs{textemdash} slots
+% in the math version dependent text font (``legacy \TeX'', i.e. non Unicode)
+% encoding, and each math version can have its own font encoding.
+%
+% Sadly, due to blatant deficiencies of the Unicode engines math primitives,
+% it is only via a detour that we can fetch the extended math code defined by a
+% \cs{Umathchardef} and we have to know it was not via a \cs{mathchardef}.
+% Real pain.
+%
+% The \cs{mst at subduedminus} is defined only at begin document and fetches
+% there what will be the subdued mathcode of \texttt{-}.
% \begin{macrocode}
\let\mst at subduedminus\empty
\let\mst at nonsubduedminus\empty
@@ -8695,35 +8803,96 @@
\DeclareMathSymbol{#1}{\mathbin}{\mst at font@tbu}{"2D}%
\DeclareMathSymbol{#2}{\mathalpha}{\mst at font@tbu}{"2D}%
}%
-\def\mst at varfam@minus{\@nameuse{mst at varfam@minus at mv\math at version}}%
+\def\mst at varfam@minus{\csname mst at varfam@minus at mv\math at version\endcsname}%
+\def\mst at minus{\csname mst at minus@mv\math at version\endcsname}%
+% \end{macrocode}
+% \mstrelease{1.4c} fixes a \mstrelease{1.4} bug:
+% \cs{MTnonlettersdonotobeymathxx} (i.e.\@ not with \texttt{everymath} option)
+% restored the minus to have the mathcode in place at package loading time,
+% which was wrong.
+%
+% The correct mathcode, which is possibly math version dependent, is stored in
+% some \cs{mathchar} or \cs{Umathchar} and can be set via
+% \cs{mst at nonsubduedminus} execution. We can not use
+% \cs{mst at addtodo@nonletters} with \texttt{-} here (except under
+% \texttt{everymath}). We need special coding to use \cs{mst at nonsubduedminus}
+% or \cs{mst at subduedminus}.
+%
+% It is very painful troubles with \XeTeX/\LuaTeX\ once we have a
+% \cs{Umathchardef} to re-assign its extended mathcode to a character token;
+% we can't have syntax common with non-Unicode engine or cases where the
+% control sequence was actually defined via \cs{mathchardef}. Hence there are
+% some unnatural complications. What a pain.
+% \begin{macrocode}
\ifmst at nominus\else
- \expandafter\mst at addtodo@nonletters\string-\mathbin\mst at varfam@minus
+ \ifmst at everymath
+ \expandafter\mst at addtodo@nonletters\string-\mathbin\mst at varfam@minus
+ \else
+% \end{macrocode}
+% I have absolutely no idea why I was paranoid about \texttt{-} catcode (as for
+% other characters) but I feel even at \mstrelease{1.4c} I have to maintain
+% the tradition.
+% \begin{macrocode}
+ \def\mst at tmp#1{%
+ \mst at do@nonletters\expandafter{\the\mst at do@nonletters
+ \mst at mathactivate#1\mathbin\mst at varfam@minus}%
+% \end{macrocode}
+% At \mstrelease{1.4c}, \cs{mst at mathdeactivate} adds a check to whether
+% its first argument is \texttt{-} and then does not do itself the
+% mathcode things (which are the matter of
+% either \cs{mst at nonsubduedminus} or \cs{mst at subduedminus}) but only
+% the other stuffs relative to restoration of a previous meaning for
+% the catcode active character.
+% \begin{macrocode}
+ \mst at undo@nonletters\expandafter{\the\mst at undo@nonletters
+ \mst at mathdeactivate#1{}%
+ \mst at nonmathactiveminus}%
+ }\expandafter\mst at tmp\string-%
+% \end{macrocode}
+% We have to go through these things because \cs{MTnonlettersdonotobeymathxx}
+% which executes \cs{mst at undo@nonletters} is done via \cs{MTeverymathoff}
+% which is part of the handling of \texttt{subdued} normal and bold math.
+% \begin{macrocode}
+ \def\mst at nonmathactiveminus{%
+ \ifmst at subdued
+ \ifx\math at version\mst at normalversionname\mst at subduedminus\else
+ \ifx\math at version\mst at boldversionname \mst at subduedminus\else
+ \mst at nonsubduedminus\fi\fi
+ \else
+ \mst at nonsubduedminus
+ \fi}%
+ \fi
+% \end{macrocode}
+% I have no time to test extensively but it seems in 2024 that we still have
+% this blatant deficiency of \LuaTeX/\XeTeX\ with regards to
+% \cs{Umathchardef}: we can't use \cs{Umathcode} or \cs{Umathcodenum} with
+% them. This is obviously a strong disappointment upon which I lamented
+% already here in 2019 and much earlier certainly as it has plagued my life
+% eversince I added support for Unicode engines to \mst.
+%
+% ATTENTION: Defining \cs{mst at tmp@enc} is mandatory for
+% \cs{mst at OneifUniEnc} to work correctly...
+%
+% If neither \texttt{endash} nor \texttt{emdash} is true we will have
+% to redefine this macro next.
+% \begin{macrocode}
\def\mst at nonsubduedminus{%
\edef\mst at tmp@enc{\csname mst at encoding@\math at version\endcsname}%
\if1\mst at OneifUniEnc
\mst at Umathcode`\-=\expandafter
- \mst at UmathchardefWorkAround@i
+ \mst at ParseUmathchardef
\csname mst at minus@mv\math at version\endcsname
\relax
\else
- \mathcode`\-=\@nameuse{mst at minus@mv\math at version}%
+ \mathcode`\-=\mst at minus
\fi
- }%
-% \end{macrocode}
-% The above works only if the \cs{mst at minus@mv<name>} was really
-% defined via \cs{Umathchardef}. If it was defined via \cs{DeclareMathSymbol}
-% then it is a \cs{mathchar}, not a \cs{Umathchar}. At least currently (2019).
-% So we need to correct the definition of \cs{mst at nonsubduedminus}.
-% \begin{macrocode}
+ }%
+ \def\mst at ParseUmathchardef{\expandafter\mst at ParseUmathchardef@i\meaning}%
+ \def\mst at ParseUmathchardef@i#1"{"}%
\ifmst at endash\else\ifmst at emdash\else
- \def\mst at nonsubduedminus{%
- \mathcode`\-=\@nameuse{mst at minus@mv\math at version}%
- }%
+ \def\mst at nonsubduedminus{\mathcode`\-=\mst at minus}%
\fi\fi
\fi
-\def\mst at UmathchardefWorkAround@i
- {\expandafter\mst at UmathchardefWorkAround@ii\meaning}%
-\def\mst at UmathchardefWorkAround@ii#1"{"}%
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% \begin{macro}{\mst at hbar@mvnormal}
@@ -8775,6 +8944,10 @@
\fi
\def\mst at mathrlap{\mathpalette\mst at mathrlapinternal}
\def\mst at mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}}
+% \end{macrocode}
+% ATTENTION! The definition of \cs{mst at tmp@enc} is mandatory for
+% \cs{mst at OneifUniEnc} to work correctly...
+% \begin{macrocode}
\def\mst at dothe@hbarstuff#1#2#3{%
\edef\mst at tmp@enc{#3}%
\if1\mst at OneifUniEnc
@@ -8807,9 +8980,15 @@
\else
\mathchardef\mst at equal@sign=\mathcode`\=\relax
\fi
-\@ifpackageloaded{amsmath}
-{\def\Relbar{\mathrel\mst at equal@sign}}
-{\DeclareRobustCommand\Relbar{\mathrel{\mst at equal@sign}}}
+% \end{macrocode}
+% \mstrelease{1.4c} makes \cs{Relbar} robust also with \ctanpkg{amsmath} (the original
+% wasn't robust in the past). We can now use same definition whether or not
+% \ctanpkg{amsmath} is loaded.
+%
+% MEMO: the character ``equal'' used in \cs{Relbar} has its mathcode frozen at
+% \mst loading time.
+% \begin{macrocode}
+\DeclareRobustCommand\Relbar{\mathrel\mst at equal@sign}
\DeclareMathSymbol{=}{\mathrel}{\mst at font@tbu}{"3D}
\DeclareMathSymbol{\mst at varfam@equal}{\mathalpha}{\mst at font@tbu}{"3D}
% \end{macrocode}
@@ -9062,7 +9241,23 @@
\newcommand*{\MTexplicitbracesobeymathxx}{\let\mst at dobraces\@firstofone}
\newcommand*{\MTexplicitbracesdonotobeymathxx}{\let\mst at dobraces\@gobble}
% \end{macrocode}
-% Extras for \mstrelease{1.4} are needed:
+% Extras for \mstrelease{1.4} are needed.
+%
+% MEMO: The coding for \cs{MTexplicitbracesobeymathxx} in this non
+% \texttt{everymath} (default) branch is lazy, as it causes execution
+% of full \cs{MTnonlettersobeymathxx}, but it logically maintains the
+% pre-\mstrelease{1.4} situation, which activates the braces only
+% as part of the global \cs{mst at do@nonletters}. Advantage also is
+% that in \texttt{subdued} it is a no-op because \cs{MTnonlettersobeymathxx}
+% is. But, if issued while in the \texttt{subdued} normal math version, if
+% after switching to another math version user employs
+% \cs{MTnonlettersobeymathxx}, then the effect of
+% \cs{MTexplicitbracesobeymathxx} will be seen. This is the same behavior
+% as under \texttt{everymath} option.
+%
+% But contrarily to \texttt{everymath} situation, in a non-\texttt{subdued}
+% math version, it is not needed to explicitly use \cs{MTnonlettersobeymathxx}
+% prior to \cs{MTexplicitbracesobeymathxx}, the latter implies the former.
% \begin{macrocode}
\ifmst at everymath
\else
@@ -10729,7 +10924,7 @@
% but there is a \cs{MTeverymathoff} done next in the \emph{normal} and
% \emph{bold} version. It does \cs{MTicinmath} and \cs{MTmathactivedigits}
% which however are no-ops (only partly for the former, and for the latter
-% always anyhow if no option |activedigits|) in subdude mode.
+% always anyhow if no option |activedigits|) in subdued mode.
% \begin{macrocode}
\MTmathoperatorsobeymathxx
\MTeverymathdefault
@@ -10771,11 +10966,17 @@
%
% \mstrelease{1.3u} extends this further to allow per-math-version meanings
% for them.
+%
+% \mstrelease{1.4c} removes usage here of \cs{mst at subduedminus} (which anyhow is empty
+% under \texttt{everymath}) because \cs{MTeverymathoff} does
+% \cs{MTnonlettersdonotobeymathxx} which executes the \cs{mst at undo@nonletters}
+% \cs{toks} hence ends up executing \cs{mst at subduedminus}. On second thoughts
+% not so sure good idea to have removed it because documentation mentions
+% \cs{MTeverymathoff} and sadly suggests redefining it for some effects.
% \begin{macrocode}
\mst at subduedhbar
\mst at subduedinodot
\mst at subduedmathaccents
- \mst at subduedminus
\else
\ifx\math at version\mst at boldversionname
\mst at restorealphabets
@@ -10788,7 +10989,6 @@
\mst at subduedhbar
\mst at subduedinodot
\mst at subduedmathaccents
- \mst at subduedminus
\else
\mst at setalphabets
% \end{macrocode}
@@ -11126,7 +11326,7 @@
\mst at infoline{Other characters (digits, ...) and \string\log-like names will be}%
\mst at infoline{typeset with the \mst at shape@normal\space shape.}%
\fi
- \fi
+ \fi % not subdued
\ifmst at nohbar\else
\mst at infoline{\string\hbar}%
\mst at dothe@hbarstuff
@@ -11143,7 +11343,30 @@
\mst at dothe@mathaccentsstuff{normal}\mst at encoding@normal
\fi
\ifmst at nominus\else
- \mst at infoline{minus as endash}%
+ \ifmst at subdued
+ \mst at infoline{minus is kept as is in subdued normal and bold math versions}%
+ \else
+ \mst at infoline{minus either as endash, Unicode minus, emdash or hyphen}%
+% \end{macrocode}
+% If \texttt{subdued} the \cs{mst at minus@mvnormal} etc... as defined via the
+% \cs{mst at dothe@endashstuff} et al.\@ would never end up being used in their
+% respective \emph{normal} and \emph{bold} versions, because the actual
+% mathcode assignment to \texttt{-} will proceed via \cs{mst at subduedminus}
+% which simply uses the mathcode in place at |\begin{document}|. And
+% \cs{MTnonlettersobeymathxx} is a no-op in \texttt{subdued} math versions.
+% And (at \mstrelease{1.4c}) \cs{MTnonlettersdonotobeymathxx} (which is
+% executed via \cs{MTeverymathoff}) will do (via \cs{mst at undo@nonletters})
+% \cs{mst at subduedminus} in these math versions (see \cs{mst at nonmathactiveminus}).
+%
+% With \texttt{everymath} option the mathcode assignment is done similarly on
+% entering the math version (either \cs{mst at subduedminus} or
+% \cs{mst at nonsubduedminus}) or when using mathematically active character via
+% \cs{mst at the}\cs{mst at do@nonletters} done at \cs{everymath}. And \cs{mst at the}
+% is set to \cs{@gobble} in subdued math versions.
+%
+% So at \mstrelease{1.4c} the execution of this code was made conditional on
+% not being in \texttt{subdued} mode.
+% \begin{macrocode}
\ifmst at endash
\mst at dothe@endashstuff\mst at minus@mvnormal\mst at varfam@minus at mvnormal
\mst at encoding@normal
@@ -11161,7 +11384,8 @@
\let\mst at varfam@minus at mvbold\mst at varfam@minus at mvnormal
\fi
\fi
- \fi
+ \fi % not subdued
+ \fi % not nominus
% \end{macrocode}
% \mstrelease{1.3zb} moves this info line last and also explicitly mentions |italic| or
% |frenchmath| (here and at some other locations above).
@@ -11311,7 +11535,8 @@
% \end{macro}
% \let\temp~
% \def~{\rlap}
-% \begin{macro}{Things to do last ~{``at begin document''}}
+% \begin{macro}{Things to do last}
+% \begin{macro}{``at begin document''}
% \let~\temp
%
% \mstrelease{1.4} has a significant change here that mathematical
@@ -11373,13 +11598,16 @@
\expandafter\let\csname mst at original@\@tempa\space\expandafter\endcsname
\csname \@tempa\space\endcsname
}%
- \ifmst at XeOrLua
- \edef\mst at subduedminus
- {\mst at Umathcodenum`\noexpand\-=\the\mst at Umathcodenum`\-\relax}%
- \else
- \edef\mst at subduedminus{\mathcode`\noexpand\-=\the\mathcode`\-\relax}%
- \fi
+% \end{macrocode}
+% \mstrelease{1.4c} has \cs{mst at mathcodenum} which is either alias of
+% \cs{Umathcodenum} or of \cs{mathcode}.
+% \begin{macrocode}
+ \edef\mst at subduedminus{\mst at mathcodenum`\noexpand\-=\the\mst at mathcodenum`\-\relax}%
\ifmst at subdued
+% \end{macrocode}
+% This \cs{MTeverymathoff} does \cs{MTnonlettersdonotobeymathxx}, which has
+% been already set to its final definition.
+% \begin{macrocode}
\MTeverymathoff
\MTresetnewmcodes
\MTnoicinmath
@@ -11399,7 +11627,7 @@
% As we are now in \cs{AtBeginDocument} we try to be careful not to overwrite
% \cs{MTicinmath}, \cs{MTnoicinmath}, \cs{MTicalsoinmathxx}, ... if issued by
% the user in the preamble, though. And we do not execute
-% \cs{MTmathactiveletters}, it is issued by the package at loading time in
+% \cs{MTmathactiveletters}, it is issued by \mst at loading time in
% order to allow user to cancel it if desired from inside the preamble.
% \begin{macrocode}
\ifx\mst at itcorr\@undefined
@@ -11419,7 +11647,7 @@
}%
\AtEndOfPackage{\AtBeginDocument{\ifmst at subdued\else\mst at nonsubduedmathaccents\fi}}%
% \end{macrocode}
-% \end{macro}
+% \end{macro}\end{macro}
% \begin{macro}{subdued}
% \mstrelease{1.15}: The subdued code was initiated in May 2011. I returned to
% |mathastext| on Sep 24, 2012, and decided to complete what I had started
Modified: trunk/Master/texmf-dist/tex/latex/mathastext/mathastext.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mathastext/mathastext.sty 2024-10-21 20:24:53 UTC (rev 72611)
+++ trunk/Master/texmf-dist/tex/latex/mathastext/mathastext.sty 2024-10-21 20:25:07 UTC (rev 72612)
@@ -23,7 +23,7 @@
%%----------------------------------------------------------------
%% Package: mathastext
%% Info: Use the text font in math mode (JFB)
-%% Version: 1.4b 2024/07/27
+%% Version: 1.4c 2024/10/21
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
%% Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
%% <jfbu at free dot fr>
@@ -33,7 +33,7 @@
%%----------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[2020/02/02]
\ProvidesPackage {mathastext}
- [2024/07/27 v1.4b Use the text font in math mode (JFB)]
+ [2024/10/21 v1.4c Use the text font in math mode (JFB)]
\def\mst at infoline#1{\immediate\write\m at ne
{(\space\space\space mathastext:\space\space\space) #1}}
\immediate\write\m at ne{}
@@ -73,27 +73,22 @@
\ifmst at LuaTeX\mst at XeOrLuatrue\fi
\ifmst at XeTeX \mst at XeOrLuatrue\fi
\ifmst at XeTeX
- \def\mst at OnlyIfNotMathActive#1{%
- \ifnum\mst at Umathcodenum`#1="1FFFFF
- \expandafter\@gobble
- \else\expandafter\@firstofone
- \fi
- }
-\else\ifmst at LuaTeX
- \def\mst at OnlyIfNotMathActive#1{%
- \ifnum\mst at Umathcodenum`#1="1000000
- \expandafter\@gobble
- \else\expandafter\@firstofone
- \fi
- }
+ \def\mst at activemathcodenum@space{"1FFFFF }%
+ \let\mst at mathcodenum\mst at Umathcodenum
\else
- \def\mst at OnlyIfNotMathActive#1{%
- \ifnum\mathcode`#1="8000
- \expandafter\@gobble
- \else\expandafter\@firstofone
- \fi
- }
+\ifmst at LuaTeX
+ \def\mst at activemathcodenum@space{"1000000 }%
+ \let\mst at mathcodenum\mst at Umathcodenum
+\else
+ \def\mst at activemathcodenum@space{"8000 }%
+ \let\mst at mathcodenum\mathcode
\fi\fi
+\def\mst at OnlyIfNotMathActive#1{%
+ \ifnum\mst at mathcodenum`#1=\mst at activemathcodenum@space
+ \expandafter\@gobble
+ \else\expandafter\@firstofone
+ \fi
+}
\def\mst at oti{OT1}
\def\mst at tu{TU}
\def\mst at OneifUniEnc{\ifx\mst at tmp@enc\mst at tu1\else0\fi}
@@ -308,7 +303,7 @@
\mst@@mathactivate #1{}{\mst at active@math at prime}%
\fi
}%
-\def\mst at undo@mathactivateprime{\mst at mathdeactivate#1{"8000}}%
+\def\mst at undo@mathactivateprime{\mst at mathdeactivate#1{\mst at activemathcodenum@space}}%
}\expandafter\mst at tmp\string'
\def\mst at active@math at prime{\sp\bgroup\mskip\mst at prime@muskip\prim at s}
\ifmst at everymath
@@ -416,7 +411,7 @@
\ifmst at everymath
\else
\def\mst at mathdeactivate#1#2{%
- \mathcode`#1=#2\relax
+ \if#1\string-\else\mst at mathcodenum`#1=#2\relax\fi
\@ifundefined{active at char#1}
{\@ifundefined{mst at prioractivemeaning@#1}
{}%
@@ -452,9 +447,10 @@
{\the\mst at do@nonletters\mst at mathactivate#1#2#3}%
}%
\else
- \def\mst at addtodo@nonletters#1#2#3{\mst at do@nonletters\expandafter
+ \def\mst at addtodo@nonletters#1#2#3{%
+ \mst at do@nonletters\expandafter
{\the\mst at do@nonletters\mst at mathactivate#1#2#3}%
- \edef\mst at tmp{\noexpand\mst at mathdeactivate#1{\the\mathcode`#1}}%
+ \edef\mst at tmp{\noexpand\mst at mathdeactivate#1{\the\mst at mathcodenum`#1}}%
\mst at undo@nonletters\expandafter\expandafter\expandafter
{\expandafter\mst at tmp\the\mst at undo@nonletters}%
}%
@@ -1092,7 +1088,7 @@
}%
\AtBeginDocument{%
\let\mst at orig@abd at ast\ast
- \edef\MTnormalasterisk{\noexpand\mst at mathdeactivate*{\the\mathcode`\*}%
+ \edef\MTnormalasterisk{\noexpand\mst at mathdeactivate*{\the\mst at mathcodenum`\*}%
\let\noexpand\ast\noexpand\mst at orig@abd at ast}%
\def\MTactiveasterisk{\def\ast{\mst at ast}%
\mst at mathactivate*{}\mst at ast
@@ -1197,7 +1193,7 @@
\mathchardef\mst at minus@sign=\mathcode`\-\relax
\fi
\@ifpackageloaded{amsmath}
- {\def\relbar{\mathrel{\mathpalette\mathsm at sh\mst at minus@sign}}}
+ {\DeclareRobustCommand\relbar{\mathrel{\mathpalette\mathsm at sh\mst at minus@sign}}}
{\DeclareRobustCommand\relbar{\mathrel{\smash\mst at minus@sign}}}
\DeclareRobustCommand\rightarrowfill{$\m at th\mathord{\relbar}\mkern-7mu%
\cleaders\hbox{$\mkern-2mu\relbar\mkern-2mu$}\hfill
@@ -1236,29 +1232,45 @@
\DeclareMathSymbol{#1}{\mathbin}{\mst at font@tbu}{"2D}%
\DeclareMathSymbol{#2}{\mathalpha}{\mst at font@tbu}{"2D}%
}%
-\def\mst at varfam@minus{\@nameuse{mst at varfam@minus at mv\math at version}}%
+\def\mst at varfam@minus{\csname mst at varfam@minus at mv\math at version\endcsname}%
+\def\mst at minus{\csname mst at minus@mv\math at version\endcsname}%
\ifmst at nominus\else
- \expandafter\mst at addtodo@nonletters\string-\mathbin\mst at varfam@minus
+ \ifmst at everymath
+ \expandafter\mst at addtodo@nonletters\string-\mathbin\mst at varfam@minus
+ \else
+ \def\mst at tmp#1{%
+ \mst at do@nonletters\expandafter{\the\mst at do@nonletters
+ \mst at mathactivate#1\mathbin\mst at varfam@minus}%
+ \mst at undo@nonletters\expandafter{\the\mst at undo@nonletters
+ \mst at mathdeactivate#1{}%
+ \mst at nonmathactiveminus}%
+ }\expandafter\mst at tmp\string-%
+ \def\mst at nonmathactiveminus{%
+ \ifmst at subdued
+ \ifx\math at version\mst at normalversionname\mst at subduedminus\else
+ \ifx\math at version\mst at boldversionname \mst at subduedminus\else
+ \mst at nonsubduedminus\fi\fi
+ \else
+ \mst at nonsubduedminus
+ \fi}%
+ \fi
\def\mst at nonsubduedminus{%
\edef\mst at tmp@enc{\csname mst at encoding@\math at version\endcsname}%
\if1\mst at OneifUniEnc
\mst at Umathcode`\-=\expandafter
- \mst at UmathchardefWorkAround@i
+ \mst at ParseUmathchardef
\csname mst at minus@mv\math at version\endcsname
\relax
\else
- \mathcode`\-=\@nameuse{mst at minus@mv\math at version}%
+ \mathcode`\-=\mst at minus
\fi
- }%
+ }%
+ \def\mst at ParseUmathchardef{\expandafter\mst at ParseUmathchardef@i\meaning}%
+ \def\mst at ParseUmathchardef@i#1"{"}%
\ifmst at endash\else\ifmst at emdash\else
- \def\mst at nonsubduedminus{%
- \mathcode`\-=\@nameuse{mst at minus@mv\math at version}%
- }%
+ \def\mst at nonsubduedminus{\mathcode`\-=\mst at minus}%
\fi\fi
\fi
-\def\mst at UmathchardefWorkAround@i
- {\expandafter\mst at UmathchardefWorkAround@ii\meaning}%
-\def\mst at UmathchardefWorkAround@ii#1"{"}%
\let\mst at subduedhbar\@empty
\let\mst at nonsubduedhbar\@empty
\ifmst at nohbar\else
@@ -1293,9 +1305,7 @@
\else
\mathchardef\mst at equal@sign=\mathcode`\=\relax
\fi
-\@ifpackageloaded{amsmath}
-{\def\Relbar{\mathrel\mst at equal@sign}}
-{\DeclareRobustCommand\Relbar{\mathrel{\mst at equal@sign}}}
+\DeclareRobustCommand\Relbar{\mathrel\mst at equal@sign}
\DeclareMathSymbol{=}{\mathrel}{\mst at font@tbu}{"3D}
\DeclareMathSymbol{\mst at varfam@equal}{\mathalpha}{\mst at font@tbu}{"3D}
\mst at infoline{adding \string= \string; and \string+ to \string\nfss at catcodes}
@@ -2574,7 +2584,6 @@
\mst at subduedhbar
\mst at subduedinodot
\mst at subduedmathaccents
- \mst at subduedminus
\else
\ifx\math at version\mst at boldversionname
\mst at restorealphabets
@@ -2587,7 +2596,6 @@
\mst at subduedhbar
\mst at subduedinodot
\mst at subduedmathaccents
- \mst at subduedminus
\else
\mst at setalphabets
\expandafter\let\csname ifmst at greek@upper at up\expandafter\endcsname
@@ -2814,7 +2822,7 @@
\mst at infoline{Other characters (digits, ...) and \string\log-like names will be}%
\mst at infoline{typeset with the \mst at shape@normal\space shape.}%
\fi
- \fi
+ \fi % not subdued
\ifmst at nohbar\else
\mst at infoline{\string\hbar}%
\mst at dothe@hbarstuff
@@ -2831,7 +2839,10 @@
\mst at dothe@mathaccentsstuff{normal}\mst at encoding@normal
\fi
\ifmst at nominus\else
- \mst at infoline{minus as endash}%
+ \ifmst at subdued
+ \mst at infoline{minus is kept as is in subdued normal and bold math versions}%
+ \else
+ \mst at infoline{minus either as endash, Unicode minus, emdash or hyphen}%
\ifmst at endash
\mst at dothe@endashstuff\mst at minus@mvnormal\mst at varfam@minus at mvnormal
\mst at encoding@normal
@@ -2849,7 +2860,8 @@
\let\mst at varfam@minus at mvbold\mst at varfam@minus at mvnormal
\fi
\fi
- \fi
+ \fi % not subdued
+ \fi % not nominus
\ifmst at subdued
\mst at infoline{Subdued `normal\string' and `bold\string' math versions.}%
\fi
@@ -2950,12 +2962,7 @@
\expandafter\let\csname mst at original@\@tempa\space\expandafter\endcsname
\csname \@tempa\space\endcsname
}%
- \ifmst at XeOrLua
- \edef\mst at subduedminus
- {\mst at Umathcodenum`\noexpand\-=\the\mst at Umathcodenum`\-\relax}%
- \else
- \edef\mst at subduedminus{\mathcode`\noexpand\-=\the\mathcode`\-\relax}%
- \fi
+ \edef\mst at subduedminus{\mst at mathcodenum`\noexpand\-=\the\mst at mathcodenum`\-\relax}%
\ifmst at subdued
\MTeverymathoff
\MTresetnewmcodes
More information about the tex-live-commits
mailing list.