Debian Codegraph @

texmf-dist/tex/latex/mdwtools/mdwmath.sty

raw
1 %%
2 %% This is file `mdwmath.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% mdwmath.dtx (with options: `package')
8 %%
9 %% IMPORTANT NOTICE
10 %%
11 %% mdwmath package -- various nicer mathematical things
12 %% Copyright (c) 1996 Mark Wooding
13 %%
14 %% This program is free software; you can redistribute it and/or modify
15 %% it under the terms of the GNU General Public License as published by
16 %% the Free Software Foundation; either version 2 of the License, or
17 %% (at your option) any later version.
18 %%
19 %% This program is distributed in the hope that it will be useful,
20 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
21 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 %% GNU General Public License for more details.
23 %%
24 %% You should have received a copy of the GNU General Public License
25 %% along with this program; if not, write to the Free Software
26 %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 %%
28 \NeedsTeXFormat{LaTeX2e}
29 \ProvidesPackage{mdwmath}
30 [1996/04/11 1.1 Nice mathematical things]
31 %% \CharacterTable
32 %% {Upper-case \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
33 %% Lower-case \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
34 %% Digits \0\1\2\3\4\5\6\7\8\9
35 %% Exclamation \! Double quote \" Hash (number) \#
36 %% Dollar \$ Percent \% Ampersand \&
37 %% Acute accent \' Left paren \( Right paren \)
38 %% Asterisk \* Plus \+ Comma \,
39 %% Minus \- Point \. Solidus \/
40 %% Colon \: Semicolon \; Less than \<
41 %% Equals \= Greater than \> Question mark \?
42 %% Commercial at \@ Left bracket \[ Backslash \\
43 %% Right bracket \] Circumflex \^ Underscore \_
44 %% Grave accent \` Left brace \{ Vertical bar \|
45 %% Right brace \} Tilde \~}
46 %%
47 \newcount\sq@sqrt
48 \begingroup
49 \catcode`\|0 \catcode`\\12
50 |def|sq@readrad#1"#2\#3|relax{|global|sq@sqrt"#2|relax}
51 |expandafter|sq@readrad|meaning|sqrtsign|relax
52 |endgroup
53 \def\sq@delim{\delimiter\sq@sqrt\relax}
54 \def\sqrtdel{\mathpalette\sqrtdel@i}
55 \def\sqrtdel@i#1#2{%
56 \setbox\z@\hbox{$\m@th#1#2$}% %%% Bzzzt -- uncramps the mathstyle
57 \ifx#1\displaystyle%
58 \@tempdima1ex%
59 \else%
60 \@tempdima.6\p@%
61 \fi%
62 \@tempdimb.6\p@%
63 \advance\@tempdimb.25\@tempdima%
64 \[email protected]\p@%
65 \advance\dimen@\@tempdimb%
66 \advance\dimen@\ht\z@%
67 \advance\dimen@\dp\z@%
68 \setbox\tw@\hbox{%
69 $\left\sq@delim\vcenter to\dimen@{}\right.\n@space$%
70 }%
71 \@tempdima\ht\tw@%
72 \advance\@tempdima\dp\tw@%
73 \advance\@tempdima-\ht\z@%
74 \advance\@tempdima-\dp\z@%
75 \ifdim\@tempdima>\@tempdimb%
76 \advance\@tempdima\@tempdimb%
77 \@tempdimb.5\@tempdima%
78 \fi%
79 \@tempdima\ht\z@%
80 \advance\@tempdima\@tempdimb%
81 \advance\@tempdima-\ht\tw@%
82 {\raise\@tempdima\box\tw@\vbox{\kern\@tempdimb\box\z@}}%
83 }
84 \DeclareRobustCommand\sqrt{\@ifstar{\sqrt@i\sqrtdel}{\sqrt@i\sqrtsign}}
85 \def\sqrt@i#1{\@ifnextchar[{\sqrt@ii{#1}}{\sqrt@iv{#1}}}
86 \def\sqrt@ii#1[#2]{%
87 \setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#2}$}%
88 \ifdim\wd\rootbox<6\p@%
89 \setbox\rootbox\hb@xt@6\p@{\hfil\unhbox\rootbox}%
90 \fi%
91 \mathpalette{\sqrt@iii{#1}}%
92 }
93 \def\sqrt@iii#1#2#3{%
94 \setbox\z@\hbox{$\m@th#2#1{#3}$}%
95 \dimen@\ht\z@%
96 \advance\dimen@-\dp\z@%
97 \[email protected]\dimen@%
98 \advance\dimen@\dp\rootbox%
99 \mkern-3mu%
100 \raise\dimen@\copy\rootbox%
101 \mkern-10mu%
102 \box\z@%
103 }
104 \def\sqrt@iv#1#2{#1{#2}}
105 \def\root{\@ifstar{\root@i\sqrtdel}{\root@i\sqrtsign}}
106 \def\root@i#1#2\of{\sqrt@ii{#1}[#2]}
107 \DeclareMathSymbol{&}{\mathbin}{operators}{`\&}
108 \DeclareMathSymbol{\bitand}{\mathbin}{operators}{`\&}
109 \def\bitor{\mathbin\mid}
110 \def\dblor{\mathbin{\mid\mid}}
111 \def\dbland{\mathbin{\mathrel\bitand\mathrel\bitand}}
112 \def\bbigg{\@bbigg\mathord}
113 \def\bbiggl{\@bbigg\mathopen}
114 \def\bbiggr{\@bbigg\mathclose}
115 \def\bbiggm{\@bbigg\mathrel}
116 \def\@bbigg#1{\@ifnextchar[{\@bigg@i{#1}}{\@bigg@i{#1}[\z@]}}
117 \def\@bigg@i#1[#2]#3#4{#1{\bbigg@{#2}{#3}{#4}}}
118 \def\bbigg@#1#2#3{%
119 \hbox{$%
120 \dimen@\ht\strutbox\advance\dimen@\dp\strutbox%
121 \advance\dimen@#1%
122 \dimen@#2\dimen@%
123 \left#3\vcenter to\dimen@{}\right.\n@space%
124 $}%
125 }
126 \def\big{\bbigg@\z@\@ne}
127 \def\Big{\bbigg@\z@{1.5}}
128 \def\bigg{\bbigg@\z@\tw@}
129 \def\Bigg{\bbigg@\z@{2.5}}
130 \endinput
131 %%
132 %% End of file `mdwmath.sty'.