2
%% This is file `mathstyle.sty',
3
%% generated with the docstrip utility.
5
%% The original source files were:
7
%% mathstyle.dtx (with options: `package')
9
%% This is a generated file.
11
%% Copyright (C) 1997-2003 by Michael J. Downes
12
%% Copyright (C) 2007 by Morten Hoegholm <mh.ctan@gmail.com>
14
%% This work may be distributed and/or modified under the
15
%% conditions of the LaTeX Project Public License, either
16
%% version 1.3 of this license or (at your option) any later
17
%% version. The latest version of this license is in
18
%% http://www.latex-project.org/lppl.txt
19
%% and version 1.3 or later is part of all distributions of
20
%% LaTeX version 2005/12/01 or later.
22
%% This work has the LPPL maintenance status "maintained".
24
%% This Current Maintainer of this work is Morten Hoegholm.
26
%% This work consists of the main source file mathstyle.dtx
27
%% and the derived files
28
%% mathstyle.sty, mathstyle.pdf, mathstyle.ins, mathstyle.drv.
30
\ProvidesPackage{mathstyle}[2007/12/19 v0.84]
31
\providecommand\@saveprimitive[2]{%
33
\edef\@tempa{\string#1}\edef\@tempb{\meaning#1}%
34
\ifx\@tempa\@tempb \global\let#2#1%
36
\edef\@tempb{\meaning#2}%
38
\else \@saveprimitive@a#1#2%
43
\providecommand\@saveprimitive@a[2]{%
45
\def\@tempb##1#1##2{\edef\@tempb{##2}\@car{}}%
46
\@tempb\nullfont{select font nullfont}%
47
\topmark{\string\topmark:}%
48
\firstmark{\string\firstmark:}%
49
\botmark{\string\botmark:}%
50
\splitfirstmark{\string\splitfirstmark:}%
51
\splitbotmark{\string\splitbotmark:}%
53
\edef\@tempa{\expandafter\strip@prefix\meaning\@tempb}%
54
\edef\@tempb{\meaning#1}%
55
\ifx\@tempa\@tempb \global\let#2#1%
57
\PackageError{mathstyle}%
58
{Unable to properly define \string#2; primitive
59
\noexpand#1no longer primitive}\@eha
64
\chardef\mathstyle=\z@
65
\@saveprimitive\displaystyle\@@displaystyle
66
\@saveprimitive\textstyle\@@textstyle
67
\@saveprimitive\scriptstyle\@@scriptstyle
68
\@saveprimitive\scriptscriptstyle\@@scriptscriptstyle
69
\@saveprimitive\mathchoice\@@mathchoice
70
\@saveprimitive\over\@@over
71
\@saveprimitive\atop\@@atop
72
\@saveprimitive\above\@@above
73
\@saveprimitive\overwithdelims\@@overwithdelims
74
\@saveprimitive\atopwithdelims\@@atopwithdelims
75
\@saveprimitive\abovewithdelims\@@abovewithdelims
76
\DeclareRobustCommand{\displaystyle}{%
77
\@@displaystyle \chardef\mathstyle\z@}
78
\DeclareRobustCommand{\textstyle}{%
79
\@@textstyle \chardef\mathstyle\@ne}
80
\DeclareRobustCommand{\scriptstyle}{%
81
\@@scriptstyle \chardef\mathstyle\tw@}
82
\DeclareRobustCommand{\scriptscriptstyle}{%
83
\@@scriptscriptstyle \chardef\mathstyle\thr@@}
84
\begingroup \catcode`\^=7\relax \catcode`\_=8\relax % just in case
86
\let\@@superscript=^ \let\@@subscript=_
89
\ifnum\mathstyle<\tw@ \chardef\mathstyle\tw@
90
\else \chardef\mathstyle\thr@@
93
\let\mathsup=\@@superscript
94
\let\mathsub=\@@subscript
95
\def\sb#1{\mathsub{\protect\subsupstyle#1}}%
96
\def\sp#1{\mathsup{\protect\subsupstyle#1}}%
98
\relax\ifcase\mathstyle
99
\expandafter\@firstoffour
101
\expandafter\@secondoffour
103
\expandafter\@thirdoffour
105
\expandafter\@fourthoffour
108
\providecommand\@firstoffour[4]{#1}
109
\providecommand\@secondoffour[4]{#2}
110
\providecommand\@thirdoffour[4]{#3}
111
\providecommand\@fourthoffour[4]{#4}
112
\DeclareRobustCommand\genfrac[6]{%
114
{\begingroup #5\endgroup
115
\csname @@\ifx\maxdimen#4\maxdimen over\else above\fi
116
\if @#2@\else withdelims\fi\endcsname #2#3#4\relax
120
\renewcommand{\frac}{\genfrac{}{}{}{}}
121
\providecommand{\dfrac}{}
122
\providecommand{\tfrac}{}
123
\renewcommand{\dfrac}{\genfrac\displaystyle{}{}{}}
124
\renewcommand{\tfrac}{\genfrac\textstyle{}{}{}}
125
\providecommand{\binom}{}
126
\providecommand{\tbinom}{}
127
\providecommand{\dbinom}{}
128
\renewcommand{\binom}{\genfrac{}(){0pt}}
129
\renewcommand{\dbinom}{\genfrac\displaystyle(){0pt}}
130
\renewcommand{\tbinom}{\genfrac\textstyle(){0pt}}
131
\def\fracstyle{\ifcase\mathstyle
132
\chardef\mathstyle=\@ne
134
\chardef\mathstyle=\tw@
136
\chardef\mathstyle=\thr@@
139
\def\currentmathstyle{%
149
\DeclareOption{mathactivechars}{\catcode`\^=7\relax \catcode`\_=8\relax }
150
\DeclareOption{activechars}{\catcode`\^=13\relax \catcode`\_=13\relax }
151
\ProcessOptions\relax
152
\ifnum\catcode`\^=13\relax
155
\mathcode`\^="8000\relax \mathcode`\_="8000\relax
156
\begingroup \catcode`\^=\active \catcode`\_=\active
157
\global\let^=\sp \global\let_=\sb
162
%% End of file `mathstyle.sty'.