Merge branch 'master' into rtoy-verify-html-index
[maxima.git] / interfaces / emacs / imaxima / breqn097a / mathstyle.sty
blob5dc1db7caff637123eef88c8bb1a9c43bd62f898
1 %%
2 %% This is file `mathstyle.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% mathstyle.dtx (with options: `package')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 1997-2003 by Michael J. Downes
12 %% Copyright (C) 2007 by Morten Hoegholm <mh.ctan@gmail.com>
13 %%
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.
21 %%
22 %% This work has the LPPL maintenance status "maintained".
23 %%
24 %% This Current Maintainer of this work is Morten Hoegholm.
25 %%
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.
29 %%
30 \ProvidesPackage{mathstyle}[2007/12/19 v0.84]
31 \providecommand\@saveprimitive[2]{%
32 \begingroup
33 \edef\@tempa{\string#1}\edef\@tempb{\meaning#1}%
34 \ifx\@tempa\@tempb \global\let#2#1%
35 \else
36 \edef\@tempb{\meaning#2}%
37 \ifx\@tempa\@tempb
38 \else \@saveprimitive@a#1#2%
39 \fi
40 \fi
41 \endgroup
43 \providecommand\@saveprimitive@a[2]{%
44 \begingroup
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:}%
52 #1{\string#1}%
53 \edef\@tempa{\expandafter\strip@prefix\meaning\@tempb}%
54 \edef\@tempb{\meaning#1}%
55 \ifx\@tempa\@tempb \global\let#2#1%
56 \else
57 \PackageError{mathstyle}%
58 {Unable to properly define \string#2; primitive
59 \noexpand#1no longer primitive}\@eha
60 \fi
61 \fi
62 \endgroup
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
85 \lowercase{\endgroup
86 \let\@@superscript=^ \let\@@subscript=_
88 \def\subsupstyle{%
89 \ifnum\mathstyle<\tw@ \chardef\mathstyle\tw@
90 \else \chardef\mathstyle\thr@@
91 \fi
93 \let\mathsup=\@@superscript
94 \let\mathsub=\@@subscript
95 \def\sb#1{\mathsub{\protect\subsupstyle#1}}%
96 \def\sp#1{\mathsup{\protect\subsupstyle#1}}%
97 \def\mathchoice{%
98 \relax\ifcase\mathstyle
99 \expandafter\@firstoffour
101 \expandafter\@secondoffour
103 \expandafter\@thirdoffour
104 \else
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]{%
113 {\fracstyle #1%
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
117 #6}%
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@
135 \else
136 \chardef\mathstyle=\thr@@
139 \def\currentmathstyle{%
140 \ifcase\mathstyle
141 \@@displaystyle
143 \@@textstyle
145 \@@scriptstyle
147 \@@scriptscripstyle
148 \fi}
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
153 \let^=\sp \let_=\sb
154 \else
155 \mathcode`\^="8000\relax \mathcode`\_="8000\relax
156 \begingroup \catcode`\^=\active \catcode`\_=\active
157 \global\let^=\sp \global\let_=\sb
158 \endgroup
160 \endinput
162 %% End of file `mathstyle.sty'.