From c8c5e8a45b2c390e1ebcaa37d2b124adf6d568ac Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 15 Jan 2016 22:59:50 +0000 Subject: mathastext (15jan16) git-svn-id: svn://tug.org/texlive/trunk@39394 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/mathastext/mathastext.sty | 138 ++++++++++++--------- 1 file changed, 79 insertions(+), 59 deletions(-) (limited to 'Master/texmf-dist/tex/latex/mathastext') diff --git a/Master/texmf-dist/tex/latex/mathastext/mathastext.sty b/Master/texmf-dist/tex/latex/mathastext/mathastext.sty index 5e1c1846206..1ac6747058b 100644 --- a/Master/texmf-dist/tex/latex/mathastext/mathastext.sty +++ b/Master/texmf-dist/tex/latex/mathastext/mathastext.sty @@ -23,16 +23,16 @@ %%---------------------------------------------------------------- %% Package: mathastext %% Info: Use the text font in math mode (jfB) -%% Version: 1.3i 2016/01/06 +%% Version: 1.3j 2016/01/15 %% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt) -%% Copyright (C) 2011-2015 Jean-Francois Burnol +%% Copyright (C) 2011-2016 Jean-Francois Burnol %% Examples of use of mathastext: %% http://jf.burnol.free.fr/mathastext.html %% http://jf.burnol.free.fr/showcase.html %%---------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} \ProvidesPackage {mathastext} - [2016/01/06 v1.3i Use the text font in math mode (jfB)] + [2016/01/15 v1.3j Use the text font in math mode (jfB)] \let\mst@Umathcharnumdef\Umathcharnumdef \let\mst@Umathcodenum \Umathcodenum \let\mst@Umathcode \Umathcode @@ -206,23 +206,42 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} \def\mst@exists@skip{1mu} \def\mst@forall@skip{.6667mu} \ifmst@italic\ifmst@frenchmath\else - \def\mst@exists@skip{0mu}\def\mst@forall@skip{0mu}\def\mst@prime@skip{0mu} + \def\mst@exists@skip{0mu} + \def\mst@forall@skip{0mu} + \def\mst@prime@skip {0mu} \fi\fi -\AtEndOfPackage{% must be at end of code -\let\mst@stdexists\exists -\let\mst@stdforall\forall -\renewcommand\exists{\mst@stdexists\mskip\mst@exists@muskip} -\renewcommand\forall{\mst@stdforall\mskip\mst@forall@muskip} -} +\def\mst@exists{\mst@stdexists\mskip\mst@exists@muskip} +\def\mst@forall{\mst@stdforall\mskip\mst@forall@muskip} +\AtBeginDocument{% + \let\mst@stdexists\exists + \let\mst@stdforall\forall + \def\MTnormalexists {\let\exists\mst@stdexists }% + \def\MTexistsdoesskip {\let\exists\mst@exists }% + \def\MTnormalforall {\let\forall\mst@stdforall }% + \def\MTforalldoesskip {\let\forall\mst@forall }% + \ifmst@subdued + \else + \MTexistsdoesskip + \MTforalldoesskip + \fi +}% +\newcommand*\MTnormalexists {\AtBeginDocument {\MTnormalexists }} +\newcommand*\MTexistsdoesskip {\AtBeginDocument {\MTexistsdoesskip }} +\newcommand*\MTnormalforall {\AtBeginDocument {\MTnormalforall }} +\newcommand*\MTforalldoesskip {\AtBeginDocument {\MTforalldoesskip }} \newmuskip\mst@prime@muskip %% v 1.2 \def\mst@prime@skip{.5mu} \ifmst@italic\ifmst@frenchmath\else\def\mst@prime@skip{0mu}\fi\fi \def\mst@active@math@prime{\sp\bgroup\mskip\mst@prime@muskip\prim@s} {\catcode`\'=12 \gdef\mst@@modifyprime{\mst@mathactivate'{}\mst@active@math@prime}} -\newcommand*\MTnormalprime{\let\mst@modifyprime\relax} -\newcommand*\MTactiveprime{\let\mst@modifyprime\mst@@modifyprime} -\MTactiveprime +\newcommand*\MTnormalprime{\let\mst@modifyprime\@empty } +\newcommand*\MTprimedoesskip {\let\mst@modifyprime\mst@@modifyprime} +\ifmst@subdued + \MTnormalprime +\else + \MTprimedoesskip +\fi \AtBeginDocument{% \everymath\expandafter {\the\everymath \mst@modifyprime \MTnormalprime}% @@ -291,6 +310,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} \newcommand*\MTeasynonlettersobeymathxx{\let\mst@theeasy\the} \MTeasynonlettersobeymathxx \newcommand*\MTmathactiveletters{\let\mst@thef\the \let\mst@theF\the} +\ifmst@subdued\else\MTmathactiveletters\fi \newcommand*\MTmathactiveLetters{\let\mst@theF\the} \newcommand*\MTmathstandardletters{\let\mst@thef\@gobble \let\mst@theF\@gobble} \newcommand*\MTicinmath{% @@ -300,22 +320,40 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} \newcommand*\MTICinmath{% \MTmathactiveLetters \def\mst@ITcorr{\ifnum\fam=\m@ne\/\fi}} -\newcommand*\MTnoicinmath{\def\mst@itcorr{}\def\mst@ITcorr{}} -\newcommand*\MTnoICinmath{\def\mst@ITcorr{}} +\newcommand*\MTnoicinmath{\let\mst@itcorr\@empty\let\mst@ITcorr\@empty} +\newcommand*\MTnoICinmath{\let\mst@ITcorr\@empty} \newcommand*\MTicalsoinmathxx{% \ifx\mst@itcorr\@empty\else\def\mst@itcorr{\/}\fi \ifx\mst@ITcorr\@empty\else\def\mst@ITcorr{\/}\fi} \AtBeginDocument{% -\everymath\expandafter{\the\everymath + \everymath\expandafter{\the\everymath \mst@the\mst@do@nonletters \let\mst@the\@gobble \mst@theeasy\mst@do@easynonletters \let\mst@theeasy\@gobble \mst@thef\mst@do@az \let\mst@thef\@gobble \mst@theF\mst@do@AZ \let\mst@theF\@gobble}% -\everydisplay\expandafter{\the\everydisplay + \everydisplay\expandafter{\the\everydisplay \mst@the\mst@do@nonletters \let\mst@the\@gobble \mst@theeasy\mst@do@easynonletters \let\mst@theeasy\@gobble \mst@thef\mst@do@az \let\mst@thef\@gobble \mst@theF\mst@do@AZ \let\mst@theF\@gobble}% + \ifmst@subdued + \MTeverymathoff + \MTmathoperatorsdonotobeymathxx + \else + \ifx\mst@itcorr\@undefined + \def\mst@itcorr{\ifnum\fam=\m@ne\/\fi}% + \@for\mst@tmp:=it,sl\do + {\ifx\mst@tmp\mst@ltshape@normal\let\mst@itcorr\@empty\fi }% + \fi + \ifx\mst@ITcorr\@undefined + \let\mst@ITcorr\mst@itcorr + \ifmst@frenchmath + \def\mst@ITcorr{\ifnum\fam=\m@ne\/\fi}% + \@for\mst@tmp:=it,sl\do + {\ifx\mst@tmp\mst@shape@normal\let\mst@ITcorr\@empty\fi }% + \fi + \fi + \fi } \newcommand*\MTsetmathskips[3]{% \@namedef{mst@before#1}{\ifnum\fam=\m@ne\mskip#2\relax\fi }% @@ -632,18 +670,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} \edef\mst@exists@skip@bold{\mst@exists@skip}% \edef\mst@forall@skip@bold{\mst@forall@skip}% \edef\mst@prime@skip@bold{\mst@prime@skip}% - \MTicinmath % does \MTmathactiveletters, \MTnoicinmath only cancels ics - \@for\mst@tmp:=it,sl\do{\ifx\mst@tmp\mst@ltshape@normal\MTnoicinmath\fi}% - \ifmst@frenchmath - \MTICinmath - \@for\mst@tmp:=it,sl\do{\ifx\mst@tmp\mst@shape@normal\MTnoICinmath\fi}% - \fi \ifmst@subdued - \MTeasynonlettersdonotobeymathxx - \MTnonlettersdonotobeymathxx - \MTmathoperatorsdonotobeymathxx - \MTmathstandardletters % prior to 1.3, was \MTnoicinmath - \ifmst@asterisk\let\mst@doasterisk\relax\fi \def\mst@exists@skip@normal{0mu}% \def\mst@forall@skip@normal{0mu}% \def\mst@prime@skip@normal{0mu}% @@ -923,56 +950,43 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} \MTversion@@ {#2}% } \newcommand*\MTversion@@ [1]{% + \MTexistsdoesskip + \MTforalldoesskip + \MTprimedoesskip \edef\mst@tmp{#1}% -%% v1.15e: muskips \expandafter \mst@exists@muskip\csname mst@exists@skip@\mst@tmp\endcsname\relax \expandafter \mst@forall@muskip\csname mst@forall@skip@\mst@tmp\endcsname\relax -%% v1.2: muskip for \cs{prime} \expandafter \mst@prime@muskip\csname mst@prime@skip@\mst@tmp\endcsname\relax -%% v1.2b: italic corrections except for italic/slanted (sic) letters, and of -%% course except in the subdued normal and bold math versions -%% v1.3: by default, letters are made mathematically active, even if italic -%% corrections are not used, to allow the action of \MTsetmathskips. \edef\mst@tmpa{\csname mst@ltshape@\mst@tmp\endcsname}% \edef\mst@tmpb{\csname mst@shape@\mst@tmp\endcsname}% - \MTicinmath + \MTmathoperatorsobeymathxx + \MTeverymathdefault \@for\mst@tmpc:=it,sl\do{\ifx\mst@tmpc\mst@tmpa\MTnoicinmath\fi}% \ifmst@frenchmath - \MTICinmath + \def\mst@ITcorr{\ifnum\fam=\m@ne\/\fi}% \@for\mst@tmpc:=it,sl\do{\ifx\mst@tmpc\mst@tmpb\MTnoICinmath\fi}% \fi -%% v1.15c: extending subdued to LGRgreek -%% v1.15f: subdueing math alphabets in a simpler way than in 1.15e -%% v1.2b: subdueing the activation of characters in math mode -%% v1.2d: special treatment of the asterisk -%% v1.3d: extended LGRgreek mechanism of activation/restoration of Greek to all -%% cases - \MTmathoperatorsobeymathxx - \MTeasynonlettersobeymathxx - \ifmst@asterisk\let\mst@doasterisk\mst@@doasterisk\fi \ifmst@subdued \def\mst@tmpa{normal}% \ifx\mst@tmp\mst@tmpa \mst@restorealphabets \MTstandardgreek \MTmathoperatorsdonotobeymathxx - \MTnonlettersdonotobeymathxx - \MTeasynonlettersdonotobeymathxx - \MTmathstandardletters - \ifmst@asterisk\let\mst@doasterisk\relax\fi + \MTnormalexists + \MTnormalforall + \MTeverymathoff \else \def\mst@tmpa{bold}% \ifx\mst@tmp\mst@tmpa \mst@restorealphabets \MTstandardgreek \MTmathoperatorsdonotobeymathxx - \MTnonlettersdonotobeymathxx - \MTeasynonlettersdonotobeymathxx - \MTmathstandardletters - \ifmst@asterisk\let\mst@doasterisk\relax\fi + \MTnormalexists + \MTnormalforall + \MTeverymathoff \else \mst@setalphabets \MTcustomgreek @@ -1056,9 +1070,9 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} \ifmst@asterisk\typeout{** asterisk: \string\ast\space and *} \AtBeginDocument{% \everymath\expandafter - {\the\everymath \mst@doasterisk \let\mst@doasterisk\relax }% + {\the\everymath \mst@doasterisk \MTnormalasterisk }% \everydisplay\expandafter - {\the\everydisplay\mst@doasterisk \let\mst@doasterisk\relax }} + {\the\everydisplay\mst@doasterisk \MTnormalasterisk }} \ifmst@symbolmisc \def\mst@bin@ast{% \mathbin{\mathchoice{\raisebox{-.1\height}% @@ -1089,7 +1103,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} {\the\scriptfont\fam\char42}}% {\raisebox{-\mst@lowerast}% {\the\scriptscriptfont\fam\char42}}}\fi}% - \let\mst@doasterisk\mst@@doasterisk + \MTactiveasterisk \DeclareRobustCommand*{\mst@ast}{\mst@bin@ast} \newcommand*\MTlowerast[1]{\def\mst@lowerast{#1}} \MTlowerast{.3\height} @@ -1951,7 +1965,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} \typeout{** mathastext has declared larger sizes for subscripts.^^J% ** To keep LaTeX defaults, use option `defaultmathsizes\string'.} \fi -\newcommand*\MTactivemathoff {% +\newcommand*\MTeverymathoff {% \MTnormalasterisk \MTnormalprime \MTnonlettersdonotobeymathxx @@ -1960,8 +1974,14 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue} }% \AtBeginDocument {% \@ifpackageloaded{hyperref} - {\def\Hurl{\begingroup\MTactivemathoff\Url}} - {\@ifpackageloaded{url}{\DeclareUrlCommand\url{\MTactivemathoff}}{}}% + {\def\Hurl{\begingroup\MTeverymathoff\Url}} + {\@ifpackageloaded{url}{\DeclareUrlCommand\url{\MTeverymathoff}}{}}% +}% +\newcommand*\MTeverymathdefault {% + \MTactiveasterisk + \MTprimedoesskip + \MTeasynonlettersobeymathxx + \MTicinmath }% \endinput %% -- cgit v1.2.3