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