summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-03 22:19:08 +0000
committerKarl Berry <karl@freefriends.org>2016-05-03 22:19:08 +0000
commit7b948f621af5b04be4a7eaf082edf4820995322e (patch)
treee534487a03ea416c3bdecb21960ef301c2566aa2
parent9849726424e71240cf80ee4c9c8faf5869688aa1 (diff)
mathastext (3may16)
git-svn-id: svn://tug.org/texlive/trunk@40875 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/mathastext/README.md16
-rw-r--r--Master/texmf-dist/doc/latex/mathastext/mathastext.pdfbin439711 -> 445172 bytes
-rw-r--r--Master/texmf-dist/doc/latex/mathastext/mathastexttestalphabets.pdfbin42240 -> 42278 bytes
-rw-r--r--Master/texmf-dist/source/latex/mathastext/mathastext.dtx180
-rw-r--r--Master/texmf-dist/source/latex/mathastext/mathastext.ins6
-rw-r--r--Master/texmf-dist/tex/latex/mathastext/mathastext.sty61
6 files changed, 208 insertions, 55 deletions
diff --git a/Master/texmf-dist/doc/latex/mathastext/README.md b/Master/texmf-dist/doc/latex/mathastext/README.md
index d590d4d13b5..974efddbcb4 100644
--- a/Master/texmf-dist/doc/latex/mathastext/README.md
+++ b/Master/texmf-dist/doc/latex/mathastext/README.md
@@ -14,7 +14,7 @@ The Author of this Work is Jean-Francois Burnol
Copyright (C) 2011-2016 Jean-Francois Burnol (`jfbu at free dot fr`)
- Source: mathastext.dtx 1.3n 2016/04/22
+ Source: mathastext.dtx 1.3o 2016/05/03
> cumulative Change Log at bottom of this file.
@@ -124,10 +124,22 @@ This produces the documentation without the source code.
CHANGE LOG
==========
+1.3o \[2016/05/03\]
+----
+
+* `mathastext` fixes an issue related to a feature of `LuaLaTeX` and
+ `luaotfload` that OpenType fonts are declared in one of two modes:
+ `node` and `base`, and only the latter is functional in math mode. But
+ by default text fonts are declared in mode `node`. Thus `mathastext`
+ now intervenes to make it so that the font it declares in math mode
+ will use mode `basic`. This fixes issues with for example old style
+ figures being used while the text font used lining figures (or vice
+ versa, depending on the font). But see the code comments for more.
+
1.3n \[2016/04/22\]
----
-* at long last, `mathastext` takes take properly of annoying and perplexing
+* at long last, `mathastext` takes care properly of annoying and perplexing
amsmath's `\newmcodes@`. The very recent change in `amsopn.sty` finally
made it compatible with Unicode engines, but anyhow, `mathastext` must do
its own patch to use the correct font. All of this taking into account
diff --git a/Master/texmf-dist/doc/latex/mathastext/mathastext.pdf b/Master/texmf-dist/doc/latex/mathastext/mathastext.pdf
index 05dc2f525d8..0d5732d3cc5 100644
--- a/Master/texmf-dist/doc/latex/mathastext/mathastext.pdf
+++ b/Master/texmf-dist/doc/latex/mathastext/mathastext.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/mathastext/mathastexttestalphabets.pdf b/Master/texmf-dist/doc/latex/mathastext/mathastexttestalphabets.pdf
index f226ff12caa..e19ea706bec 100644
--- a/Master/texmf-dist/doc/latex/mathastext/mathastexttestalphabets.pdf
+++ b/Master/texmf-dist/doc/latex/mathastext/mathastexttestalphabets.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/mathastext/mathastext.dtx b/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
index 45f3128358f..92ed2c8ddf3 100644
--- a/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
+++ b/Master/texmf-dist/source/latex/mathastext/mathastext.dtx
@@ -1,15 +1,13 @@
-% -*- coding: iso-latin-1; -*-
+% -*- coding: iso-latin-1; time-stamp-format: "%02d-%02m-%:y at %02H:%02M:%02S %Z" -*-
% N.B.: this dtx file does NOT use \DocInput (only docstrip), the
% LaTeX source of the documentation is NOT prefixed with % signs.
%<*dtx>
-{\def\dtxtimestamp {Time-stamp: <22-04-2016 18:31:31 CEST>}%
- \def\getdtxtimestamp #1 <#2 #3 #4>{#2 at #3 #4}%
- \xdef\dtxtimestamp {\expandafter\getdtxtimestamp\dtxtimestamp }}%
-\def\docdate{2016/04/22}
+\def\dtxtimestamp {Time-stamp: <03-05-2016 at 10:53:00 CEST>}%
+\def\docdate{2016/05/03}
%</dtx>
%<*drv|ins>
-\def\MSTpkgdate {2016/04/22}
-\def\MSTpkgversion {1.3n}
+\def\MSTpkgdate {2016/05/03}
+\def\MSTpkgversion {1.3o}
%</drv|ins>
%<*dtx>
\iffalse % meta-comment
@@ -31,7 +29,7 @@ The Author of this Work is Jean-Francois Burnol
Copyright (C) 2011-2016 Jean-Francois Burnol (`jfbu at free dot fr`)
- Source: mathastext.dtx 1.3n 2016/04/22
+ Source: mathastext.dtx 1.3o 2016/05/03
%</readme>
%<*dtx>
@@ -47,7 +45,7 @@ not include the documented source code then, in contrast to 1a)+1b) method
%%----------------------------------------------------------------
%% Package: mathastext
%% Info: Use the text font in math mode (JFB)
-%% Version: 1.3n 2016/04/22
+%% Version: 1.3o 2016/05/03
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
%% Copyright (C) 2011-2016 Jean-Francois Burnol <jfbu at free dot fr>
%% Examples of use of mathastext:
@@ -237,10 +235,23 @@ This produces the documentation without the source code.
CHANGE LOG
==========
+1.3o \[2016/05/03\]
+----
+
+* `mathastext` fixes an issue related to a feature of `LuaLaTeX` and
+ `luaotfload` that OpenType fonts are declared in one of two modes:
+ `node` and `base`, and only the latter is functional in math mode. But
+ by default text fonts are declared in mode `node`. Thus `mathastext`
+ now intervenes to make it so that the font it declares in math mode
+ will use mode `basic`. This fixes issues with for example old style
+ figures being used while the text font used lining figures (or vice
+ versa, depending on the font). But see the code comments for more.
+
+
1.3n \[2016/04/22\]
----
-* at long last, `mathastext` takes take properly of annoying and perplexing
+* at long last, `mathastext` takes care properly of annoying and perplexing
amsmath's `\newmcodes@`. The very recent change in `amsopn.sty` finally
made it compatible with Unicode engines, but anyhow, `mathastext` must do
its own patch to use the correct font. All of this taking into account
@@ -1392,7 +1403,7 @@ LGRgreek]{mathastext}
\let\thefootnote\empty
Package version: \MSTpkgversion\ (\MSTpkgdate)%
\footnote{Documentation generated from the
- source file with timestamp ``\dtxtimestamp''.}\par
+ source file with \dtxtimestamp.}\par
\end{center}
\setcounter{footnote}{0}
@@ -1473,20 +1484,28 @@ See \autoref{sec:changelog} for the detailed change log.
\begin{description}[leftmargin=0.5em]
+
+\item [Changes for release |1.3o| of |2016/05/03|]
+\begin{itemize}[noitemsep]
+\item \mst fixes an issue related to a feature of Lua\LaTeX\ and
+ |luaotfload| that OpenType fonts are declared in one of two modes:
+ |node| and |base|, and only the latter is functional in math mode. But
+ by default text fonts are declared in mode |node|. Thus \mst
+ now intervenes to make it so that the font it declares in math mode
+ will use mode |basic|. This fixes issues with for example old style
+ figures being used while the text font used lining figures (or vice
+ versa, depending on the font). But see the code comments for more.
+\end{itemize}
+
\item [Changes for release |1.3n| of |2016/04/22|]
\begin{itemize}[noitemsep]
-\item at long last, \mst takes take properly of annoying and perplexing
+\item at long last, \mst takes care properly of annoying and perplexing
amsmath's |\newmcodes@|. The very recent change in |amsopn.sty| finally
made it compatible with Unicode engines, but anyhow, \mst must do
its own patch to use the correct font. All of this taking into account
the various options passed to the package. Lots of trouble for a tiny thing.
\end{itemize}
-\item [Changes for release |1.3m| of |2016/04/02|]
-\begin{itemize}[noitemsep]
-\item minor code maintenance.
-\end{itemize}
-
\item [Changes for release |1.3l| of |2016/01/29|]
\begin{itemize}[noitemsep]
\item compatibility with fontspec's switch from |EU1/EU2| to
@@ -1495,8 +1514,7 @@ See \autoref{sec:changelog} for the detailed change log.
\item [Changes for release |1.3j| of |2016/01/15|]
\begin{itemize}[noitemsep]
-\item renamed and modified recent |1.3i|'s \cs{MTactivemathoff} into
- §\MTeverymathoff§. Added §\MTeverymathdefault§.
+\item §\MTeverymathoff§ (renamed) and added §\MTeverymathdefault§.
\item §subdued§ mode is a bit stronger: also the asterisk reverts to the
default (if it was modified due to option §asterisk§), the added extra
@@ -3545,6 +3563,7 @@ by \mst to the \cs{everymath} and \cs{everydisplay} token list variables.
\MTeasynonlettersobeymathxx
\MTicinmath % this does \MTmathactiveletters, hence also skips from
% \MTsetmathskips are obeyed.
+ \MTfixfonts % only operant under LuaLaTeX.
\end{verbatim}
{\footnotesize Notice that under |subdued| option, switching to the
\emph{normal} or \emph{bold} version does \csb{MTeverymathoff} which
@@ -3562,7 +3581,8 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
\item \RightNote{New! (1.3j)}§\MTeverymathoff§: does §\MTnormalasterisk§,
§\MTnormalprime§, §\MTnonlettersdonotobeymathxx§,
- §\MTeasynonlettersdonotobeymathxx§ and §\MTmathstandardletters§.
+ §\MTeasynonlettersdonotobeymathxx§, §\MTmathstandardletters§ and
+ §\MTdonotfixfonts§.
{\footnotesize \RightNote{New! (1.3i)}The commands
|\url/\nolinkurl| of package |hyperref| and |url| from |url.sty| (which
@@ -3579,6 +3599,21 @@ actions as they are not related to \cs{everymath} and \cs{everydisplay}.\par}
\csb{MTnormalforall}.
\par}
+\item \RightNote{New! (1.3o)}§\MTfixfonts§: this is a Lua\LaTeX{} only macro.
+ It instructs \mst when entering math mode to fix some issues with
+ OpenType features such as Lining Figures not being applied in math mode when
+ one uses text fonts there. Done automatically by the package (except in
+ §subdued§ mode for |normal| and |bold|).
+
+% pas envie de perdre mon temps lŕ-dessus. D'ailleurs peut-ętre déjŕ pour
+% commencer bm ne fonctionne pas avec fontes OpenType.
+
+% Notice (not tested) that package |bm| is presumably not compatible.
+
+\item \RightNote{New! (1.3o)}§\MTdonotfixfonts§: cancels the job of
+ |\MTfixfonts|. Done automatically in §subdued§ mode when in the |normal| or
+ |bold| math version. Only operant in Lua\LaTeX{}.
+
\end{enumerate}
\subsubsection{Commands usable everywhere}\label{sec:cmds}
@@ -4127,7 +4162,7 @@ Numerous examples will be found there:\\
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage {mathastext}
- [2016/04/22 v1.3n Use the text font in math mode (JFB)]
+ [2016/05/03 v1.3o Use the text font in math mode (JFB)]
% \end{macrocode}
% Testing for \XeTeX\ and \LuaLaTeX.
%
@@ -4896,7 +4931,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
% undefined. We thus add \cs{MTnoicinmath} to the subdued initialization.
%
% Attention |1.3n| needs here \cs{mst@originalnewmcodes@}, itself defined at
-% begin document. Thus we have wrappd the whole thing in \cs{AtEndOfPackage}.
+% begin document. Thus we have wrapped the whole thing in \cs{AtEndOfPackage}.
% \begin{macrocode}
\ifmst@subdued
\MTeverymathoff
@@ -5141,7 +5176,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
% pain as there is no immediate way to get hexadecimal digit. And |wipet|
% will not read this as this is a \LaTeX\ package, and I don't see why I
% should bother making |wipet| happy.
-% \item Some hesitation about what to under option |symboldelimiters|. I
+% \item Some hesitation about what to do under option |symboldelimiters|. I
% temporarily used |\symmtpsymbol|, except for the right quote and for the
% hyphen, but finally I drop that and use |\symmtoperatorfont| always.
% (after testing how it looked like).
@@ -5155,8 +5190,8 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\else
\ifmst@XeOrLua
\AtBeginDocument {%
- \@ifpackageloaded{amsmath}
- {\edef\mst@newmcodes@{%
+ \ifx\newmcodes@\@undefined\else
+ \edef\mst@newmcodes@{%
\mst@Umathcode `\noexpand\' 0 \symmtoperatorfont 39\relax
\ifmst@asterisk
\mst@Umathcode `\noexpand\* 0 \symmtoperatorfont 42\relax
@@ -5177,13 +5212,12 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\fi
}%
\let\mst@originalnewmcodes@\newmcodes@
- }%
- {}%
+ \fi
}
\else
\AtBeginDocument {%
- \@ifpackageloaded{amsmath}
- {\edef\mst@newmcodes@{%
+ \ifx\newmcodes@\@undefined\else
+ \edef\mst@newmcodes@{%
\mathcode`\noexpand\' \the\numexpr\symmtoperatorfont*\@cclvi+39\relax
\mathcode`\noexpand\*
\the\numexpr\ifmst@asterisk\symmtoperatorfont*\@cclvi\fi+42\relax
@@ -5198,9 +5232,8 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\the\numexpr\unless\ifmst@noparen\symmtoperatorfont*\@cclvi\fi+47\relax\relax
}%
\let\mst@originalnewmcodes@\newmcodes@
- }%
- {}%
- }
+ \fi
+ }
\fi
\fi\fi
\newcommand*\MTresetnewmcodes{\ifx\mst@originalnewmcodes@\undefined\else
@@ -5361,6 +5394,78 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\DeclareSymbolFont{mtletterfont}{\mst@enc}{\mst@fam}{\mst@ser}{\mst@ltsh}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\mst@fixmathfonts}
+% There is a long-standing issue
+% \url{https://github.com/lualatex/luaotfload/issues/204} on Lua\LaTeX{} not
+% applying OpenType features in math mode (this impacts |\url| macro too, as
+% it uses math mode.) Lua\TeX{} has two modes for handling of OpenType
+% fonts, the default in text being to use the |node| mode, and this mode is
+% non-working in math, thus \mst needs to force use of |base| mode. Else one
+% sees old style figures where one does not expect them, or the opposite,
+% depending on the default font feature, see for example \url{http://tex.stackexchange.com/questions/208688/oldstylefigure-issue-with-lualatex-and-mathastext/277628}
+%
+% Once we know the cause, the fix is relatively easy. I will go for the
+% |\everymath| way, because I don't want to dwelve at all with the details
+% of \LaTeX's handling of math fonts, of size changes, of math versions
+% etc... perhaps in the future \LaTeX{} will fix the issue upstream by modifying
+% \cs{DeclareSymbolFont} under Lua\LaTeX{} + |luaotfload| regime, then the
+% present patch by \mst will be unneeded. Naturally, here we care only about
+% the two maths fonts used by \mst: |mtoperatorfont| and |mtletterfont|.
+%
+% For the |\url| situation, I have posted a patch at:
+% \url{http://tex.stackexchange.com/questions/264206/cant-get-oldstyle-figures-in-url-with-lualatex}.
+%
+% Not all is resolved, as I comment at
+% \url{http://tex.stackexchange.com/a/307585/4686} and at
+% \url{https://github.com/lualatex/luaotfload/issues/204#issuecomment-216465680}
+% that with |TeX Gyre Termes| for example I can not get simultaneously Old
+% Style and Tabular Figures to work in math mode, although the font name as
+% constructed by my patch (which is like the code below, only simpler as we
+% only have to consider |\textfont0|) is the correct one. Similarly with
+% |Vollkorn|: I can then not get the two features |lnum| and |tnum| to work
+% simultaneously when specified with |mode=base|. It does work with
+% |mode=node| but this mode ``does not work in math mode.''
+%
+% Done for |1.3o| of |2016/05/03|.
+% \begin{macrocode}
+\begingroup
+\catcode`N 12
+\catcode`O 12
+\catcode`D 12
+\catcode`E 12
+\lowercase{\gdef\mst@fixmathfonts@ #1=NODE;#2#3\relax #4\@empty #5}%
+ {\ifx#2\empty\else\font\mst@mathfont=#1=base;#2#3\relax#5=\mst@mathfont\fi}
+\lowercase{\gdef\mst@fixmathfonts
+{\expandafter\mst@fixmathfonts@
+ \fontname\textfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
+ {\textfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptscriptfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptscriptfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\textfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
+ {\textfont\symmtletterfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptfont\symmtletterfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptscriptfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptscriptfont\symmtletterfont}%
+ }%
+}%
+\endgroup
+\ifmst@LuaTeX
+ \everymath\expandafter{\the\everymath\mst@@fixmathfonts}%
+ \everydisplay\expandafter{\the\everydisplay\mst@@fixmathfonts}%
+\fi
+\newcommand*\MTfixfonts{\let\mst@@fixmathfonts\mst@fixmathfonts}%
+\newcommand*\MTdonotfixfonts{\let\mst@@fixmathfonts\empty}%
+\MTfixfonts
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\Mathnormal}
% \begin{macro}{\Mathrm}
% \begin{macro}{\Mathbf}
@@ -6506,9 +6611,6 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\AtBeginDocument{% Unicode engines and font
\mst@Umathcode`\-=2 \symmtoperatorfont "2013\relax
\mst@Umathchardef\mst@varfam@minus=7 \symmtoperatorfont "2013\relax
- % \mst@Umathcode `\-=7 \symmtoperatorfont "2013\relax
- % \mst@Umathcharnumdef\mst@varfam@minus\mst@Umathcodenum`\-
- % \mst@Umathcode `\-=2 \symmtoperatorfont "2013\relax
}
\else
\ifx\mst@tmp@enc\mst@ti % T1
@@ -7635,6 +7737,8 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
% |1.3j 2016/01/15| renamed the macro from |\MTactivemathoff| to
% |\MTeverymathoff|, as it is not exclusively a matter of math active
% characters due to |\MTeasynonlettersdonotobeymathxx|.
+%
+% |1.3o 2016/05/03| adds \cs{MTdonotfixfonts}. Lua\LaTeX\ only.
% \begin{macrocode}
\newcommand*\MTeverymathoff {%
\MTnormalasterisk
@@ -7642,6 +7746,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\MTnonlettersdonotobeymathxx
\MTeasynonlettersdonotobeymathxx
\MTmathstandardletters
+ \MTdonotfixfonts
}%
\AtBeginDocument {%
\@ifpackageloaded{hyperref}
@@ -7674,12 +7779,15 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
% And user can employ \cs{MTnormalexists}, etc..., from inside the preamble,
% it will not be overruled (as it is delayed at begin document to after \mst
% dealings).
+%
+% |1.3o 2016/04/02| adds \cs{MTfixfonts}. Lua\LaTeX\ only.
% \begin{macrocode}
\newcommand*\MTeverymathdefault {%
\MTactiveasterisk
\MTprimedoesskip
\MTeasynonlettersobeymathxx
\MTicinmath
+ \MTfixfonts
}%
\endinput
% \end{macrocode}
@@ -7704,7 +7812,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
Grave accent \` Left brace \{ Vertical bar \|
Right brace \} Tilde \~}
-\CheckSum{5406}
+\CheckSum{5521}
\makeatletter\check@checksum\makeatother
\Finale
%%
diff --git a/Master/texmf-dist/source/latex/mathastext/mathastext.ins b/Master/texmf-dist/source/latex/mathastext/mathastext.ins
index 9d565c77410..a4af625d162 100644
--- a/Master/texmf-dist/source/latex/mathastext/mathastext.ins
+++ b/Master/texmf-dist/source/latex/mathastext/mathastext.ins
@@ -1,9 +1,9 @@
-\def\MSTpkgdate {2016/04/22}
-\def\MSTpkgversion {1.3n}
+\def\MSTpkgdate {2016/05/03}
+\def\MSTpkgversion {1.3o}
%%----------------------------------------------------------------
%% Package: mathastext
%% Info: Use the text font in math mode (JFB)
-%% Version: 1.3n 2016/04/22
+%% Version: 1.3o 2016/05/03
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
%% Copyright (C) 2011-2016 Jean-Francois Burnol <jfbu at free dot fr>
%% Examples of use of mathastext:
diff --git a/Master/texmf-dist/tex/latex/mathastext/mathastext.sty b/Master/texmf-dist/tex/latex/mathastext/mathastext.sty
index 0e660de160e..41cad53044c 100644
--- a/Master/texmf-dist/tex/latex/mathastext/mathastext.sty
+++ b/Master/texmf-dist/tex/latex/mathastext/mathastext.sty
@@ -23,7 +23,7 @@
%%----------------------------------------------------------------
%% Package: mathastext
%% Info: Use the text font in math mode (JFB)
-%% Version: 1.3n 2016/04/22
+%% Version: 1.3o 2016/05/03
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
%% Copyright (C) 2011-2016 Jean-Francois Burnol <jfbu at free dot fr>
%% Examples of use of mathastext:
@@ -32,7 +32,7 @@
%%----------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage {mathastext}
- [2016/04/22 v1.3n Use the text font in math mode (JFB)]
+ [2016/05/03 v1.3o Use the text font in math mode (JFB)]
\let\mst@Umathcharnumdef\Umathcharnumdef
\let\mst@Umathcodenum \Umathcodenum
\let\mst@Umathcode \Umathcode
@@ -443,8 +443,8 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\else
\ifmst@XeOrLua
\AtBeginDocument {%
- \@ifpackageloaded{amsmath}
- {\edef\mst@newmcodes@{%
+ \ifx\newmcodes@\@undefined\else
+ \edef\mst@newmcodes@{%
\mst@Umathcode `\noexpand\' 0 \symmtoperatorfont 39\relax
\ifmst@asterisk
\mst@Umathcode `\noexpand\* 0 \symmtoperatorfont 42\relax
@@ -465,13 +465,12 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\fi
}%
\let\mst@originalnewmcodes@\newmcodes@
- }%
- {}%
+ \fi
}
\else
\AtBeginDocument {%
- \@ifpackageloaded{amsmath}
- {\edef\mst@newmcodes@{%
+ \ifx\newmcodes@\@undefined\else
+ \edef\mst@newmcodes@{%
\mathcode`\noexpand\' \the\numexpr\symmtoperatorfont*\@cclvi+39\relax
\mathcode`\noexpand\*
\the\numexpr\ifmst@asterisk\symmtoperatorfont*\@cclvi\fi+42\relax
@@ -486,9 +485,8 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\the\numexpr\unless\ifmst@noparen\symmtoperatorfont*\@cclvi\fi+47\relax\relax
}%
\let\mst@originalnewmcodes@\newmcodes@
- }%
- {}%
- }
+ \fi
+ }
\fi
\fi\fi
\newcommand*\MTresetnewmcodes{\ifx\mst@originalnewmcodes@\undefined\else
@@ -542,6 +540,42 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
{\def\operator@font{\mathgroup\symmtoperatorfont}}
\MTmathoperatorsobeymathxx
\DeclareSymbolFont{mtletterfont}{\mst@enc}{\mst@fam}{\mst@ser}{\mst@ltsh}
+\begingroup
+\catcode`N 12
+\catcode`O 12
+\catcode`D 12
+\catcode`E 12
+\lowercase{\gdef\mst@fixmathfonts@ #1=NODE;#2#3\relax #4\@empty #5}%
+ {\ifx#2\empty\else\font\mst@mathfont=#1=base;#2#3\relax#5=\mst@mathfont\fi}
+\lowercase{\gdef\mst@fixmathfonts
+{\expandafter\mst@fixmathfonts@
+ \fontname\textfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
+ {\textfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptscriptfont\symmtoperatorfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptscriptfont\symmtoperatorfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\textfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
+ {\textfont\symmtletterfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptfont\symmtletterfont}%
+ \expandafter\mst@fixmathfonts@
+ \fontname\scriptscriptfont\symmtletterfont\relax\relax=NODE;\empty\relax\@empty
+ {\scriptscriptfont\symmtletterfont}%
+ }%
+}%
+\endgroup
+\ifmst@LuaTeX
+ \everymath\expandafter{\the\everymath\mst@@fixmathfonts}%
+ \everydisplay\expandafter{\the\everydisplay\mst@@fixmathfonts}%
+\fi
+\newcommand*\MTfixfonts{\let\mst@@fixmathfonts\mst@fixmathfonts}%
+\newcommand*\MTdonotfixfonts{\let\mst@@fixmathfonts\empty}%
+\MTfixfonts
\let\mst@alph@omicron\mathnormal
\@ifpackageloaded{fourier}{\ifsloped\else\let\mst@alph@omicron\mathrm\fi}{}
\DeclareSymbolFontAlphabet{\Mathnormal}{mtletterfont}
@@ -1216,9 +1250,6 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\AtBeginDocument{% Unicode engines and font
\mst@Umathcode`\-=2 \symmtoperatorfont "2013\relax
\mst@Umathchardef\mst@varfam@minus=7 \symmtoperatorfont "2013\relax
- % \mst@Umathcode `\-=7 \symmtoperatorfont "2013\relax
- % \mst@Umathcharnumdef\mst@varfam@minus\mst@Umathcodenum`\-
- % \mst@Umathcode `\-=2 \symmtoperatorfont "2013\relax
}
\else
\ifx\mst@tmp@enc\mst@ti % T1
@@ -2015,6 +2046,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\MTnonlettersdonotobeymathxx
\MTeasynonlettersdonotobeymathxx
\MTmathstandardletters
+ \MTdonotfixfonts
}%
\AtBeginDocument {%
\@ifpackageloaded{hyperref}
@@ -2026,6 +2058,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\MTprimedoesskip
\MTeasynonlettersobeymathxx
\MTicinmath
+ \MTfixfonts
}%
\endinput
%%