% Macros and \mathcodes that apply when standard TeX fonts (of any size)
% are being used for math
% These definitions assume the math fonts
% (\textfont, \scriptfont, and \scriptscriptfont)
% of families 0, 1, 2 and 3 have been set respectively to STANDARD TeX fonts,
% respectively roman, math italic, symbol, and extension.
% MACROS FOR CONSTRUCTING NEW OPERATORS
\message{operator twiddling ...}
% abuts a mathrel to the previous one
\def\joinrel{\mathrel{\mkern-3mu}}
% Same as \not, but with steeper slash. Use with \mathpalette
\def\c@ncel#1#2{\overlap{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}}
% Puts #2 over equal sign. Use with \mathpalette.
\def\@vereq#1#2{\lower.5\p@ % bug! should vary with font size
\vbox{\baselinesep\z@glue\linesep-.5\p@
\ialign{$\m@th#1\hfil##\hfil$\crcr
#2\crcr
=\crcr}}}
% OTHER SYMBOLS AND OPERATORS
\message{operators ...}
% Named math characters
\mathchardef\aleph="0240
\mathchardef\imath="017B
\mathchardef\jmath="017C
\mathchardef\ell="0160
\mathchardef\wp="017D
\mathchardef\Re="023C
\mathchardef\Im="023D
\mathchardef\partial="0140
\mathchardef\infty="0231
\mathchardef\prime="0230
\mathchardef\varemptyset="023B % Knuth's empty set
\mathchardef\nabla="0272
\def\surd{{\mathchar"1270}}
\mathchardef\top="023E
\mathchardef\bot="023F
\mathchardef\triangle="0234
\mathchardef\forall="0238
\mathchardef\exists="0239
\mathchardef\coprod="1360
\mathchardef\bigvee="1357
\mathchardef\bigwedge="1356
\mathchardef\biguplus="1355
\mathchardef\bigcap="1354
\mathchardef\bigcup="1353
\mathchardef\intop="1352 \def\int{\intop\nolimits}
\mathchardef\prod="1351
\mathchardef\sum="1350
\mathchardef\bigotimes="134E
\mathchardef\bigoplus="134C
\mathchardef\bigodot="134A
\mathchardef\ointop="1348 \def\oint{\ointop\nolimits}
\mathchardef\bigsqcup="1346
\mathchardef\smallint="1273
\mathchardef\neg="023A \let\lnot=\neg
\mathchardef\triangleleft="212F \let\lpoint=\triangleleft
\mathchardef\triangleright="212E \let\rpoint=\triangleright
\mathchardef\bigtriangleup="2234
\mathchardef\bigtriangledown="2235
\mathchardef\wedge="225E \let\land=\wedge
\mathchardef\vee="225F \let\lor=\vee
\mathchardef\cap="225C \let\inte=\cap % infix intersection
\mathchardef\cup="225B \let\uni=\cup % infix union
\mathchardef\ddagger="227A
\mathchardef\dagger="2279
\mathchardef\sqcap="2275
\mathchardef\sqcup="2274
\mathchardef\uplus="225D
\mathchardef\amalg="2271
\mathchardef\diamond="2205
\mathchardef\bullet="220F
\mathchardef\wr="226F
\mathchardef\div="2204
\mathchardef\odot="220C
\mathchardef\oslash="220B
\mathchardef\otimes="220A
\mathchardef\ominus="2209
\mathchardef\oplus="2208 \let\xor=\oplus % boolean exclusive or
\mathchardef\mp="2207
\mathchardef\pm="2206
\mathchardef\circ="220E
\mathchardef\bigcirc="220D
\mathchardef\setminus="226E % for set difference A\setminus B
\mathchardef\cdot="2201
\mathchardef\ast="2203
\mathchardef\times="2202
\mathchardef\pentagram="213F % \star in Plain.TeX
\mathchardef\propto="322F
\mathchardef\sqsubseteq="3276
\mathchardef\sqsupseteq="3277
\mathchardef\parallel="326B
\mathchardef\mid="326A \let\st=\mid % \st = `such that' for \rset
\mathchardef\dashv="3261
\mathchardef\vdash="3260
\mathchardef\leq="3214 \let\le=\leq
\mathchardef\geq="3215 \let\ge=\geq
\mathchardef\succ="321F
\mathchardef\prec="321E
\mathchardef\approx="3219 \let\simil=\approx % double squiggle
\mathchardef\succeq="3217
\mathchardef\preceq="3216
\mathchardef\supset="321B
\mathchardef\subset="321A
\mathchardef\supseteq="3213
\mathchardef\subseteq="3212
\mathchardef\in="3232
\mathchardef\ni="3233 \let\owns=\ni
\mathchardef\gg="321D
\mathchardef\ll="321C
\mathchardef\not="3236
\mathchardef\sim="3218 \let\iso=\sim % single squiggle
\mathchardef\simeq="3227
\mathchardef\perp="323F
\mathchardef\equiv="3211
\mathchardef\asymp="3210
\mathchardef\smile="315E
\mathchardef\frown="315F
%
Varous arrows
% mostly horizontal or fixed-size; for vertical extensible ones look
% at the "delimiters" section.
\mathchardef\nearrow="3225
\mathchardef\searrow="3226
\mathchardef\nwarrow="322D
\mathchardef\swarrow="322E
\mathchardef\Leftrightarrow="322C
\mathchardef\Leftarrow="3228
\mathchardef\Rightarrow="3229
\let\up=\uparrow
\let\down=\downarrow
\mathchardef\leftrightarrow="3224
\mathchardef\leftarrow="3220 \let\gets=\leftarrow
\mathchardef\rightarrow="3221 \let\to=\rightarrow
\mathchardef\mapstochar="3237
\mathchardef\leftharpoonup="3128
\mathchardef\leftharpoondown="3129
\mathchardef\rightharpoonup="312A
\mathchardef\rightharpoondown="312B
\mathchardef\lhook="312C \def\hookrightarrow{\lhook\joinrel\rightarrow}
\mathchardef\rhook="312D \def\hookleftarrow{\leftarrow\joinrel\rhook}
\def\rightleftharpoons{\mathrel{\mathpalette\rlh@{}}}
\def\rlh@#1{\vcenter{\hbox{\overlap{
\raise2pt\hbox{$#1\rightharpoonup$}\crcr
$#1\leftharpoondown$}}}}
\def\relbar{\mathrel{\smash-}} % because - has the same height as +
\def\Relbar{\mathrel=}
\def\Longrightarrow{\Relbar\joinrel\Rightarrow}
\def\longrightarrow{\relbar\joinrel\rightarrow}
\def\longleftarrow{\leftarrow\joinrel\relbar}
\def\Longleftarrow{\Leftarrow\joinrel\Relbar}
\def\longmapsto{\mapstochar\longrightarrow}
\def\longleftrightarrow{\leftarrow\joinrel\rightarrow}
\def\Longleftrightarrow{\Leftarrow\joinrel\Rightarrow}
\def\iff{\;\Longleftrightarrow\;}
% Pieces used in constructing `brace leaders'
\mathchardef\braceld="37A \mathchardef\bracerd="37B
\mathchardef\bracelu="37C \mathchardef\braceru="37D
% Musical symbols
\mathchardef\flat="015B
\mathchardef\natural="015C
\mathchardef\sharp="015D
% Card suits
\mathchardef\clubsuit="027C
\mathchardef\diamondsuit="027D
\mathchardef\heartsuit="027E
\mathchardef\spadesuit="027F
% Roots
\def\sqrt{\radical"270370 }
\def\root#1\of{\setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#1}$}
\mathpalette\r@@t}
\def\r@@t#1#2{\setbox\z@\hbox{$\m@th#1\sqrt{#2}$}
\dimen@\ht\z@ \advance\dimen@-\dp\z@
\mskip5mu\raise.6\dimen@\copy\rootbox \mskip-10mu \box\z@}
%
Fancy primes:
{\catcode`\'=\active \gdef'{^\bgroup\prim@s}}
\def\prim@s{\prime\futurelet\next\pr@m@s}
\def\pr@m@s{\ifx'\next \let\next\pr@@@s \else\let\next\egroup\fi \next}
\def\pr@@@s#1{\prim@s}
%
Sets, sequences, absolute value:
\def\set#1{{\lbrace{#1}\rbrace}} % set defined by enumeration
\def\rset#1{{\lbrace \,{#1}\,\rbrace}} % set defined by \relv
\def\seq#1{{\langle{#1}\rangle}} % sequence
\def\abs#1{\left\leftv{#1}\right\rightv} % absolute value or set size
% Other constructed math symbols
\def\emptyset{\big\varphi} % bug! should vary with size
\let\ety=\emptyset
\def\hbar{{\mathchar'26\mskip-9muh}}
\def\models{\mathrel|\joinrel=}
\def\sp{\mathbin{\,}} % to denote continuous intervals (segs, arcs, etc)
\def\isp{\mathbin{.\,.}} % to denote integer intervals (as in Pascal)
\def\mapsto{\mapstochar\rightarrow}
\def\doteq{\buildrel\textstyle.\over=}
\def\*{\discretionary
{\thinspace\edef\next{\the\textfont2}\next\char2}{}{}}
\def\cong{\mathrel{\mathpalette\@vereq\sim}} % congruence sign
\def\neq{\not=} \let\ne=\neq
\def\nequiv{\not\equiv}
\def\notin{\mathrel{\mathpalette\c@ncel\in}}
\def\doubleint{\int\!\!\!\int} % double integral
\def\bowtie{\mathrel\triangleright\joinrel\mathrel\triangleleft}
\def\deg{^\circ} % degrees
\def\star{^\ast} % asterisk in superscript position.
\def\angle{{\vbox{\ialign
{$\m@th\scriptstyle##$\cr\not\mathrel{\mkern14mu}\cr
\noalign{\nointerlineskip}
\mkern2.5mu\leaders\hrule height.34pt\hfill\mkern2.5mu\cr}}}}
% BIGGGER SYMBOLS
\message{biggger symbols ...}
% Simply big ones (just enlarge the mathtext fonts)
\def\big#1{\hbox{$\biggermathfonts #1 $}}
% Really big ones (delimiters only; use the normal extension machinery):
\def\Big#1{
{\hbox{$\left#1\vbox to1.35ht\strutbox{}\right.\n@space$}}}
\def\bigg#1{
{\hbox{$\left#1\vbox to1.70ht\strutbox{}\right.\n@space$}}}
\def\Bigg#1{
{\hbox{$\left#1\vbox to2.25ht\strutbox{}\right.\n@space$}}}
\def\n@space{\nulldelimiterspace\z@ \m@th}
%
Biggger delimiters
\def\bigl#1{\mathopen{\big#1}}
\def\bigm#1{\mathrel{\big#1}}
\def\bigr#1{\mathclose{\big#1}}
\def\Bigl#1{\mathopen{\Big#1}}
\def\Bigm#1{\mathrel{\Big#1}}
\def\Bigr#1{\mathclose{\Big#1}}
\def\biggl#1{\mathopen{\bigg#1}}
\def\biggm#1{\mathrel{\bigg#1}}
\def\biggr#1{\mathclose{\bigg#1}}
\def\Biggl#1{\mathopen{\Bigg#1}}
\def\Biggm#1{\mathrel{\Bigg#1}}
\def\Biggr#1{\mathclose{\Bigg#1}}
% MATH ACCENTS
\message{accents ...}
%
Accents proper
\def\acute{\mathaccent"7013 }
\def\grave{\mathaccent"7012 }
\def\ddot{\mathaccent"707F }
\def\tilde{\mathaccent"707E }
\def\bar{\mathaccent"7016 }
\def\breve{\mathaccent"7015 }
\def\check{\mathaccent"7014 }
\def\hat{\mathaccent"705E }
\def\vec{\mathaccent"717E }
\def\dot{\mathaccent"705F }
\def\widetilde{\mathaccent"0365 }
\def\widehat{\mathaccent"0362 }
\def\skew#1#2#3{{#2{#3\mkern#1mu}\mkern-#1mu}{}}
%
Fancy overlines/underlines
\def\overbrace#1{\mathop{\vbox{\ialign{##\crcr
\noalign{\kern3\p@}
\downbracefill\crcr
\noalign{\kern3\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}
\def\underbrace#1{\mathop{\vtop{\ialign{##\crcr
$\hfil\displaystyle{#1}\hfil$\crcr
\noalign{\kern3\p@\nointerlineskip}
\upbracefill\crcr
\noalign{\kern3\p@}}}}\limits}
\def\overrightarrow#1{\vbox{\ialign{##\crcr
\rightarrowfill\crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
\def\overleftarrow#1{\vbox{\ialign{##\crcr
\leftarrowfill\crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
% Special characters
\def\dag{\mathhexbox279}
\def\ddag{\mathhexbox27A}
\def\sectionmark{\mathhexbox278} % was \S in plain.tex
\def\paragmark{\mathhexbox27B} % was \P in plain.tex