summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mathastext
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-08 00:02:45 +0000
committerKarl Berry <karl@freefriends.org>2016-01-08 00:02:45 +0000
commit42af20fa9b4836de5fd19cb86d1ac6cc125b8480 (patch)
treeb3bbdd76b7a6cef514f2f6fc0bb08484ee625f8b /Master/texmf-dist/tex/latex/mathastext
parentc6a9f41960195895fc4bd9efe7b17cd573dcaea8 (diff)
mathastext (7jan16)
git-svn-id: svn://tug.org/texlive/trunk@39305 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mathastext')
-rw-r--r--Master/texmf-dist/tex/latex/mathastext/mathastext.sty134
1 files changed, 77 insertions, 57 deletions
diff --git a/Master/texmf-dist/tex/latex/mathastext/mathastext.sty b/Master/texmf-dist/tex/latex/mathastext/mathastext.sty
index 71acee2f11d..5e1c1846206 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.3h 2015/10/31
+%% Version: 1.3i 2016/01/06
%% License: LPPL 1.3c (http://www.latex-project.org/lppl/lppl-1-3c.txt)
%% Copyright (C) 2011-2015 Jean-Francois Burnol <jfbu at free dot fr>
%% Examples of use of mathastext:
@@ -32,7 +32,7 @@
%%----------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage {mathastext}
- [2015/10/31 v1.3h Use the text font in math mode (jfB)]
+ [2016/01/06 v1.3i Use the text font in math mode (jfB)]
\let\mst@Umathcharnumdef\Umathcharnumdef
\let\mst@Umathcodenum \Umathcodenum
\let\mst@Umathcode \Umathcode
@@ -116,12 +116,7 @@
\DeclareOption{noasterisk}{\PackageWarningNoLine{mathastext}
{option `noasterisk\string' is deprecated.^^J\space\space\space
Check the documentation}}
- \DeclareOption{asterisk}{\mst@asterisktrue
- \AtBeginDocument{
- \everymath\expandafter{\the\everymath \mst@doasterisk
- \let\mst@doasterisk\relax}
- \everydisplay\expandafter{\the\everydisplay \mst@doasterisk
- \let\mst@doasterisk\relax}}}
+ \DeclareOption{asterisk}{\mst@asterisktrue}
\newif\ifmst@nospecials
\DeclareOption{nospecials}{\mst@nospecialstrue}
\newif\ifmst@basic % 1.3 to avoid unnecessary patch of amsmath \newmcodes@
@@ -224,11 +219,15 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\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}}
+\gdef\mst@@modifyprime{\mst@mathactivate'{}\mst@active@math@prime}}
\newcommand*\MTnormalprime{\let\mst@modifyprime\relax}
-\AtBeginDocument{
-\everymath\expandafter{\the\everymath \mst@modifyprime \MTnormalprime}
-\everydisplay\expandafter{\the\everydisplay \mst@modifyprime \MTnormalprime}
+\newcommand*\MTactiveprime{\let\mst@modifyprime\mst@@modifyprime}
+\MTactiveprime
+\AtBeginDocument{%
+ \everymath\expandafter
+ {\the\everymath \mst@modifyprime \MTnormalprime}%
+ \everydisplay\expandafter
+ {\the\everydisplay \mst@modifyprime \MTnormalprime}%
}
\newcommand*\MTexistsskip[1]{\edef\mst@exists@skip{#1}%
\mst@exists@muskip\mst@exists@skip\relax}
@@ -296,7 +295,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\newcommand*\MTmathstandardletters{\let\mst@thef\@gobble \let\mst@theF\@gobble}
\newcommand*\MTicinmath{%
\MTmathactiveletters
- \def\mst@itcorr{\ifnum\fam=\m@ne\/\else\ifnum\fam=\symmtletterfont\/\fi\fi}%
+ \def\mst@itcorr{\ifnum\fam=\m@ne\/\fi}%
\let\mst@ITcorr\mst@itcorr}
\newcommand*\MTICinmath{%
\MTmathactiveLetters
@@ -306,25 +305,25 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\newcommand*\MTicalsoinmathxx{%
\ifx\mst@itcorr\@empty\else\def\mst@itcorr{\/}\fi
\ifx\mst@ITcorr\@empty\else\def\mst@ITcorr{\/}\fi}
-\AtBeginDocument{
+\AtBeginDocument{%
\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}
+ \mst@theF\mst@do@AZ \let\mst@theF\@gobble}%
\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}
+ \mst@theF\mst@do@AZ \let\mst@theF\@gobble}%
}
\newcommand*\MTsetmathskips[3]{%
- \@namedef{mst@before#1}{\mskip#2\relax}%
- \@namedef{mst@after#1}{\mskip#3\relax}%
+ \@namedef{mst@before#1}{\ifnum\fam=\m@ne\mskip#2\relax\fi }%
+ \@namedef{mst@after#1}{\ifnum\fam=\m@ne\mskip#3\relax\fi }%
}
\newcommand*\MTunsetmathskips[1]{%
- \@namedef{mst@before#1}{\relax}%
- \@namedef{mst@after#1}{\relax}%
+ \@namedef{mst@before#1}{}%
+ \@namedef{mst@after#1}{}%
}
\def\mst@magic@v #1#2#3#4#5{#1#3#4}
\def\mst@magic@vi #1#2#3#4#5#6{#1#2#4#5}
@@ -368,15 +367,17 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\lccode`##1=`##1
\lowercase{\endgroup
\ifnum\catcode`##1=\active
- \mst@do@activecase ##1{##2}##3
+ \mst@do@activecase ##1{##2}##3%
% careful as ##2 is empty in the asterisk and
% prime case!
\else
\mathcode`##1="8000
% version 1.3 adds the possibility of extra skips around letters,
% (only if non catcode active at the time of use).
- \ifcat##1a\def~{{\csname mst@before##1\endcsname ##2##3%
- \csname mst@after##1\endcsname}}%
+ \ifcat##1a\edef~{% extra braces for a^b for example
+ {\expandafter\noexpand\csname mst@before##1\endcsname
+ ##2\noexpand##3%
+ \expandafter\noexpand\csname mst@after##1\endcsname}}%
\else\def~{##2##3}\fi
\fi}}}
\x
@@ -389,11 +390,11 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\def\mst@addtodo@easynonletters#1#2{% #1 is a one char control sequence
\mst@do@easynonletters\expandafter{\the\mst@do@easynonletters\mathcode`#1=#2}%
}
-\def\mst@addtodo@az#1#2#3{%
- \mst@do@az\expandafter{\the\mst@do@az\mst@mathactivate#1#2#3}
+\def\mst@addtodo@az#1#2{%
+ \mst@do@az\expandafter{\the\mst@do@az\mst@mathactivate#1#2\mst@itcorr}
}
-\def\mst@addtodo@AZ#1#2#3{%
- \mst@do@AZ\expandafter{\the\mst@do@AZ\mst@mathactivate#1#2#3}%
+\def\mst@addtodo@AZ#1#2{%
+ \mst@do@AZ\expandafter{\the\mst@do@AZ\mst@mathactivate#1#2\mst@ITcorr}%
}
\ifmst@basic\else
\AtBeginDocument {%
@@ -528,9 +529,9 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\def\psy@scale{1}
\DeclareSymbolFont{mtpsymbol}{U}{psy}{m}{n}
\DeclareSymbolFontAlphabet{\MathPSymbol}{mtpsymbol}
-\AtBeginDocument{
- \DeclareFontFamily{U}{psy}{}
- \DeclareFontShape{U}{psy}{m}{n}{<->s*[\psy@scale] psyr}{}
+\AtBeginDocument{%
+ \DeclareFontFamily{U}{psy}{}%
+ \DeclareFontShape{U}{psy}{m}{n}{<->s*[\psy@scale] psyr}{}%
}
\fi
\newcommand*\MTSymbolScale[1]{\edef\psy@scale{#1}}
@@ -1002,8 +1003,7 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\DeclareMathSymbol {#1}{\mathalpha}{mtletterfont}{`#1}%
\expandafter
\DeclareMathSymbol \csname mst@#1\endcsname{\mathalpha}{mtletterfont}{`#1}%
- \expandafter\mst@addtodo@az
- \expandafter #1\csname mst@#1\endcsname\mst@itcorr
+ \expandafter\mst@addtodo@az\expandafter #1\csname mst@#1\endcsname
}%
\@for\mst@tmp:=a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\do
{\expandafter\mst@DeclareMathLetter\mst@tmp}%
@@ -1014,8 +1014,8 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\DeclareMathSymbol {#1}{\mathalpha}{\mst@font@tbu}{`#1}%
\expandafter
\DeclareMathSymbol \csname mst@#1\endcsname{\mathalpha}{\mst@font@tbu}{`#1}%
- \expandafter\mst@addtodo@AZ
- \expandafter #1\csname mst@#1\endcsname\mst@ITcorr}%
+ \expandafter\mst@addtodo@AZ\expandafter #1\csname mst@#1\endcsname
+}%
\@for\mst@tmp:=A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z\do
{\expandafter\mst@DeclareMathLetter\mst@tmp}%
\let\mst@DeclareMathLetter\relax
@@ -1051,7 +1051,14 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\expandafter\mst@addtodo@nonletters\string?\mathclose\mst@varfam@question
\fi
\def\mst@@doasterisk{\let\ast\mst@ast\mst@mathactivate*{}\mst@ast}%
+\newcommand*\MTnormalasterisk {\let\mst@doasterisk\relax}
+\newcommand*\MTactiveasterisk {\let\mst@doasterisk\mst@@doasterisk}
\ifmst@asterisk\typeout{** asterisk: \string\ast\space and *}
+ \AtBeginDocument{%
+ \everymath\expandafter
+ {\the\everymath \mst@doasterisk \let\mst@doasterisk\relax }%
+ \everydisplay\expandafter
+ {\the\everydisplay\mst@doasterisk \let\mst@doasterisk\relax }}
\ifmst@symbolmisc
\def\mst@bin@ast{%
\mathbin{\mathchoice{\raisebox{-.1\height}%
@@ -1086,7 +1093,8 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\DeclareRobustCommand*{\mst@ast}{\mst@bin@ast}
\newcommand*\MTlowerast[1]{\def\mst@lowerast{#1}}
\MTlowerast{.3\height}
- \mst@do@easynonletters\expandafter{\the\mst@do@easynonletters
+ \mst@do@easynonletters\expandafter\expandafter\expandafter
+ {\expandafter\the\expandafter\mst@do@easynonletters
\expandafter\def\csname mst@ast \endcsname{\mst@varfam@ast}}
\fi
\ifmst@nopunct\else\typeout{** punctuation\string: \string, \string. \string: \string; and \string\colon}
@@ -1136,14 +1144,14 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\def\do@the@endashstuff{\edef\mst@tmp@enc{\encodingdefault}
\ifx\mst@tmp@enc\mst@eui % xetex+fontspec
\AtBeginDocument{%
- \mst@Umathcode`\-="2 \symmtoperatorfont "2013\relax
- \mst@Umathchardef\mst@varfam@minus="7 \symmtoperatorfont "2013\relax
+ \mst@Umathcode`\-=2 \symmtoperatorfont "2013\relax
+ \mst@Umathchardef\mst@varfam@minus=7 \symmtoperatorfont "2013\relax
}
\else
\ifx\mst@tmp@enc\mst@euii % luatex+fontspec
\AtBeginDocument{%
- \mst@Umathcode`\-="2 \symmtoperatorfont "2013\relax
- \mst@Umathchardef\mst@varfam@minus="7 \symmtoperatorfont "2013\relax
+ \mst@Umathcode`\-=2 \symmtoperatorfont "2013\relax
+ \mst@Umathchardef\mst@varfam@minus=7 \symmtoperatorfont "2013\relax
}
\else
\ifx\mst@tmp@enc\mst@ti % T1
@@ -1167,14 +1175,14 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\def\do@the@emdashstuff{\edef\mst@tmp@enc{\encodingdefault}
\ifx\mst@tmp@enc\mst@eui % xetex+fontspec
\AtBeginDocument{%
- \mst@Umathcode`\-="2 \symmtoperatorfont "2014\relax
- \mst@Umathchardef\mst@varfam@minus="7 \symmtoperatorfont "2014\relax
+ \mst@Umathcode`\-=2 \symmtoperatorfont "2014\relax
+ \mst@Umathchardef\mst@varfam@minus=7 \symmtoperatorfont "2014\relax
}
\else
\ifx\mst@tmp@enc\mst@euii % luatex+fontspec
\AtBeginDocument{%
- \mst@Umathcode`\-="2 \symmtoperatorfont "2014\relax
- \mst@Umathchardef\mst@varfam@minus="7 \symmtoperatorfont "2014\relax
+ \mst@Umathcode`\-=2 \symmtoperatorfont "2014\relax
+ \mst@Umathchardef\mst@varfam@minus=7 \symmtoperatorfont "2014\relax
}
\else
\ifx\mst@tmp@enc\mst@ti % T1
@@ -1344,37 +1352,37 @@ defaultbf,defaultit,defaultsf,defaulttt}\mst@nonormalboldtrue}
\typeout{** \string\#\space\string\mathdollar\space
\string\%\space\string\&\space}
\ifmst@XeOrLua
- \mst@Umathcode`\#="0 \symmtoperatorfont "0023 \relax
- \mst@Umathchardef\mathdollar="0 \symmtoperatorfont "0024 \relax
- \mst@Umathcode`\%="0 \symmtoperatorfont "0025 \relax
- \mst@Umathcode`\&="0 \symmtoperatorfont "0026 \relax
+ \mst@Umathcode`\#=0 \symmtoperatorfont "23 \relax
+ \mst@Umathchardef\mathdollar=0 \symmtoperatorfont "24 \relax
+ \mst@Umathcode`\%=0 \symmtoperatorfont "25 \relax
+ \mst@Umathcode`\&=0 \symmtoperatorfont "26 \relax
\mst@do@easynonletters\expandafter{%
\the\mst@do@easynonletters
- \mst@Umathcode`\#="7 \symmtoperatorfont "0023 \relax
- \mst@Umathchardef\mathdollar="7 \symmtoperatorfont "0024 \relax
- \mst@Umathcode`\%="7 \symmtoperatorfont "0025 \relax
- \mst@Umathcode`\&="7 \symmtoperatorfont "0026 \relax
+ \mst@Umathcode`\#=7 \symmtoperatorfont "23 \relax
+ \mst@Umathchardef\mathdollar=7 \symmtoperatorfont "24 \relax
+ \mst@Umathcode`\%=7 \symmtoperatorfont "25 \relax
+ \mst@Umathcode`\&=7 \symmtoperatorfont "26 \relax
}
\else
\count255=\symmtoperatorfont
\multiply\count255 by 256
\advance\count255 by 35
\mathcode`\#\count255
- \advance\count255 by 1
+ \advance\count255 by \@ne
\mathchardef\mathdollar\count255
- \advance\count255 by 1
+ \advance\count255 by \@ne
\mathcode`\%\count255
- \advance\count255 by 1
+ \advance\count255 by \@ne
\mathcode`\&\count255
\count255=\symmtoperatorfont
\multiply\count255 by 256
\advance\count255 by 28707 % = "7023
\mathchardef\mst@varfam@mathhash\count255
- \advance\count255 by 1
+ \advance\count255 by \@ne
\mathchardef\mst@varfam@mathdollar\count255
- \advance\count255 by 1
+ \advance\count255 by \@ne
\mathchardef\mst@varfam@mathpercent\count255
- \advance\count255 by 1
+ \advance\count255 by \@ne
\mathchardef\mst@varfam@mathampersand\count255
\mst@do@easynonletters\expandafter{\the\mst@do@easynonletters
\mathcode`\#=\mst@varfam@mathhash
@@ -1943,6 +1951,18 @@ 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 {%
+ \MTnormalasterisk
+ \MTnormalprime
+ \MTnonlettersdonotobeymathxx
+ \MTeasynonlettersdonotobeymathxx
+ \MTmathstandardletters
+}%
+\AtBeginDocument {%
+ \@ifpackageloaded{hyperref}
+ {\def\Hurl{\begingroup\MTactivemathoff\Url}}
+ {\@ifpackageloaded{url}{\DeclareUrlCommand\url{\MTactivemathoff}}{}}%
+}%
\endinput
%%
%% End of file `mathastext.sty'.