
###############################################################################
#                                                                             #
#  Lout @Eq package for equation formatting using TeX fonts (Version 1.1)     #
#                                                                             #
#  Versions 1.0 and 1.1 by Jeffrey H. Kingston, 10 April 1995                 #
#  Based on Version 2.0 of the ordinary @Eq package.                          #
#                                                                             #
#  This package reimplements the ordinary @Eq package using TeX fonts, in     #
#  an attempt to make nicer-looking equations.  The fonts themselves are      #
#  downloaded with each document by the @SysPrependGraphic command below,     #
#  which increases the output file size by 252 KB.                            #
#                                                                             #
###############################################################################

fontdef	cmsy Base   { cmsy10	cmsy	cmsy.CEV	NoRecode	- }
fontdef	cmsy Bold   { cmbsy10	cmbsy	cmbsy.CEV	NoRecode	- }
fontdef	cmmi Base   { cmmi10	cmmi	cmmi.CEV	NoRecode	- }
fontdef	cmmi Bold   { cmmib10	cmmib	cmmib.CEV	NoRecode	- }
fontdef	cmex Base   { cmex10	cmex	cmex.CEV	NoRecode	- }

@SysPrependGraphic { "teq.lpg" }

export	"`" "``" "```" bin rel punct non vctr big

	space exclam universal numbersign existential percent
	ampersand suchthat parenleft parenright asteriskmath
	plus comma minus period slash zero one two three four
	five six seven eight nine colon semicolon less equal
	greater question congruent Alpha Beta Chi Delta Epsilon
	Phi Gamma Eta Iota thetaone Kappa Lambda Mu Nu Omicron
	Pi Theta Rho Sigma Tau Upsilon sigmaone Omega Xi Psi Zeta
	bracketleft therefore bracketright perpendicular underscore
	radicalex alpha beta chi delta epsilon phi gamma eta iota
	phione kappa lambda mu nu omicron pi theta rho sigma tau
	upsilon omegaone omega xi psi zeta braceleft bar braceright
	similar Upsilonone minute lessequal fraction infinity florin
	club diamond heart spade arrowboth arrowleft arrowup
	arrowright arrowdown degree plusminus second greaterequal
	multiply proportional partialdiff bullet divide notequal
	equivalence approxequal ellipsis arrowvertex arrowhorizex
	carriagereturn aleph Ifraktur Rfraktur weierstrass
	circlemultiply circleplus emptyset intersection union
	propersuperset reflexsuperset notsubset propersubset
	reflexsubset element notelement angle gradient registerserif
	copyrightserif trademarkserif product radical dotmath
	logicalnot logicaland logicalor arrowdblboth arrowdblleft
	arrowdblup arrowdblright arrowdbldown lozenge angleleft
	registersans copyrightsans trademarksans summation parenlefttp
	parenleftex parenleftbt bracketlefttp bracketleftex
	bracketleftbt bracelefttp braceleftmid braceleftbt braceex
	angleright integral integraltp integralex integralbt
	parenrighttp parenrightex parenrightbt bracketrighttp
	bracketrightex bracketrightbt bracerighttp bracerightmid
	bracerightbt

	hbar Re Im partial infty prime nabla surd top bot dbar
	triangle backslash forall exists neg circle square

	"0" "1" "2" "3" "4" "5" "6" "7" "8" "9"

	sum prod coprod int oint bcap bcup bvee bwedge bodot botimes
	boplus buplus

	"+" "-" "+-" "-+" setminus cdot times "*" circ div cap cup uplus
	sqcap sqcup triangleleft triangleright wr bigcirc bigtriangleup
	bigtriangledown vee wedge oplus ominus otimes oslash odot dagger
	daggerdbl amalg

	"<" ">" "=" "<=" prec preceq "<<" subset subseteq sqsubseteq
	in vdash smile frown ">=" succ succeq ">>" supset supseteq
	sqsupseteq ni dashv mid parallel "==" "~" "-~" asymp "~~"
	"=~" bowtie propto models doteq perp notsub notin "!=" not
	"<->" "<--" "-->" up down "<=>" "<==" "==>" dblup dbldown
	":" "::" ":="

	lpar blpar rpar brpar lbrack blbrack rbrack brbrack lbrace blbrace
	rbrace brbrace lfloor blfloor rfloor brfloor lceil blceil
	rceil brceil langle blangle rangle brangle

	";" "," col
	
	"!" "?" "%" "(" ")" "[" "]"

	arccos arcsin arctan arg cos cosh cot coth csc deg det dim exp
	gcd hom inf ker lg lim liminf limsup ln log max min Pr sec sin
	sinh supr tan tanh mod ldots cdots vdots ddots del grad
	"..." ",...," "'" empty
	
	sup sub tsub supp on ton frac half third over from to widefrom wideto
	dot dotdot hat tilde vec dyad overbar underbar sqrt root above
	labove cabove rabove mabove nextcol
	matrix pmatrix bmatrix brmatrix fmatrix cmatrix amatrix

def @Eq                  
   body @Body
@Begin

   def @SkewGap  { 0.05f  }
   def @SupGap   { 0.40fk }
   def @ThinGap  { 0.15v  }
   def @MedGap   { 0.20v  }
   def @ThickGap { 0.25v  }
   def @ColGap   { 0.8f   }
   def @RowGap   { 0.5f   }
   def @FontRed  { 0.7f   }
   def @FontInc  { 1.3f   }

   def "`"       { &@ThinGap  }
   def "``"      { &@MedGap   }
   def "```"     { &@ThickGap }

   def @Base   	right x { Base @Font x }
   def @Smaller	right x { @FontRed @Font 0c @Space     0.2f @Break x }
   def @Sym	right x { {Symbol Base} @Font x }
   def @Cmsy	right x { {cmsy Base} @Font @Char x }
   def @Cmmi	right x { {cmmi Base} @Font @Char x }
   def @Cmex	right x { {cmex Base} @Font @Char x }

   def bin	right x { ``  x ``  }
   def rel	right x { ``` x ``` }
   def punct	right x {     x `   }
   def non	right x { 0c @Break x }
   def big	right x { @FontInc @Font 0c @Space @FontInc @Break x }
   def not	right x	{@HContract {@OneCol x /0co &0.5rt @Cmmi "slash"}}

   def @Top          # shrink the top of the bounding box of x by "drop"
      left drop      # needed because of inaccuracies in the AFM files
      right x
   {
      @OneRow { //0.0fo drop @VShift x }
   }

   def @Left         # shrink the left of the bounding box of x by "drop"
      left drop      # needed because of inaccuracies in the AFM files
      right x
   {
      @OneCol { &0.0fo drop @HShift x }
   }

   def @HLine
      named line { "0.05 ft setlinewidth" }
   {  
      { "0 0 moveto xsize 0 lineto" line "stroke" } @Graphic {}
   }

   def @VLine
   {
      "0 0 moveto 0 ysize lineto 0.05 ft setlinewidth stroke" @Graphic {}
   }

   def vctr
      right x
   {
   
     #@OneRow {  -180d @Rotate { /0.5wo 180d @Rotate { / @OneRow @OneCol x  } }
     #         ^/      @OneRow { /0.5wo      @OneRow { @OneRow @OneCol x ^/ } }
     #     }

     0.5w @VShift x
   }

   def @Strut right x
   {
     @OneCol { "1.0 1.0 1.0 setrgbcolor" @SetColour { &0io "9" &0io } | x }
   }

   ###################################################################
   #                                                                 #
   #   Full names                                                    #
   #                                                                 #
   #   These symbols and their names are taken directly from the     #
   #   Adobe Systems Inc. Symbol font (see PostScript Language       #
   #   Reference Manual, pp. 256-257).  The only differences are:    #
   #                                                                 #
   #      Adobe:  theta1        Eq:  thetaone                        #
   #              sigma1             sigmaone                        #
   #              phi1               phione                          #
   #              omega1             omegaone                        #
   #                                                                 #
   #   These were needed since Lout identifiers do not have digits.  #
   #                                                                 #
   ###################################################################

   def space           { @Base  " "				}
   def exclam          { @Base "!"				}
   def universal       { @Cmsy "universal"			}
   def numbersign      { @Cmmi "sharp" 				}
   def existential     { @Cmsy "existential"			}
   def percent         { @Base "%"				}
   def ampersand       { @Base "&"				}
   def suchthat        { 0.1f @Left @Cmsy "owner"		}
   def parenleft       { @Base "("				}
   def parenright      { @Base ")"				}
   def asteriskmath    { @Cmsy "asteriskmath"			}
   def plus            { @Base "+"				}
   def comma           { @Base ","				}
   def minus           { 0.09f @Left @Cmsy "minus" 		}
   def period          { @Base "."				}
   def slash           { @Cmmi "slash"				}
   def zero            { @Sym "\060"				}
   def one             { @Sym "\061"				}
   def two             { @Sym "\062"				}
   def three           { @Sym "\063"				}
   def four            { @Sym "\064"				}
   def five            { @Sym "\065"				}
   def six             { @Sym "\066"				}
   def seven           { @Sym "\067"				}
   def eight           { @Sym "\070"				}
   def nine            { @Sym "\071"				}
   def colon           { @Base ":"				}
   def semicolon       { @Base ";"				}
   def less            { @Cmmi "less"				}
   def equal           { @OneRow {minus ^//0.07f //0.07f minus}	}
   def greater         { @Cmmi "greater"			}
   def question        { @Base "?"				}
   def congruent       { @HContract @OneRow {0.05f @Left @Cmsy
			    "similar" ^//0.1f @HScale equal }	}
   def Alpha           { @Cmmi "A"				}
   def Beta            { @Cmmi "B"				}
   def Chi             { @Cmmi "X"				}
   def Delta           { @Cmmi "Delta"				}
   def Epsilon         { @Cmmi "E"				}
   def Phi             { @Cmmi "Phi"				}
   def Gamma           { @Cmmi "Gamma"				}
   def Eta             { @Cmmi "H"				}
   def Iota            { @Cmmi "I"				}
   def thetaone        { @Cmmi "theta1"				}
   def Kappa           { @Cmmi "K"				}

   def Lambda          { @Cmmi "Lambda"				}
   def Mu              { @Cmmi "M"				}
   def Nu              { @Cmmi "N"				}
   def Omicron         { @Cmmi "O"				}
   def Pi              { @Cmmi "Pi"				}
   def Theta           { @Cmmi "Theta"				}
   def Rho             { @Cmmi "P"				}
   def Sigma           { @Cmmi "Sigma"				}
   def Tau             { @Cmmi "T"				}
   def Upsilon         { @Cmmi "Upsilon"			}
   def sigmaone        { @Cmmi "sigma1"				}
   def Omega           { @Cmmi "Omega"				}
   def Xi              { @Cmmi "Xi"				}
   def Psi             { @Cmmi "Psi"				}
   def Zeta            { @Cmmi "Z"				}
   def bracketleft     { @Base "["				}
   def therefore       { @Sym "\134"				}
   def bracketright    { @Base "]"				}
   def perpendicular   { @Cmsy "perpendicular"			}
   def underscore      { @Base "_"				}
   def radicalex       { @Sym "\140"				}
   def alpha           { @Cmmi "alpha"				}
   def beta            { @Cmmi "beta"				}
   def chi             { @Cmmi "chi"				}
   def delta           { @Cmmi "delta"				}
   def epsilon         { @Cmmi "epsilon"			}
   def phi             { @Cmmi "phi"				}
   def gamma           { @Cmmi "gamma"				}
   def eta             { @Cmmi "eta"				}
   def iota            { @Cmmi "iota"				}
   def phione          { @Cmmi "phi1"				}
   def kappa           { @Cmmi "kappa"				}
   def lambda          { @Cmmi "lambda"				}
   def mu              { @Cmmi "mu"				}
   def nu              { @Cmmi "nu"				}

   def omicron         { @Cmmi "o"				}
   def pi              { @Cmmi "pi"				}
   def theta           { @Cmmi "theta"				}
   def rho             { @Cmmi "rho"				}
   def sigma           { @Cmmi "sigma"				}
   def tau             { @Cmmi "tau"				}
   def upsilon         { @Cmmi "upsilon"			}
   def omegaone        { @Cmmi "omega"				}
   def omega           { @Cmmi "omega"				}
   def xi              { @Cmmi "xi"				}
   def psi             { @Cmmi "psi"				}
   def zeta            { @Cmmi "zeta"				}
   def braceleft       { @Cmsy "braceleft"			}
   def bar             { @Cmsy "bar"				}
   def braceright      { @Cmsy "braceright"			}
   def similar         { 0.05f @Left @Cmsy "similar"		}
   def Upsilonone      { @Cmmi "Upsilon"			}
   def minute          { @Sym "\242"				}
   def lessequal       { @Cmsy "lessequal"			}
   def fraction        { @Sym "\244"				}
   def infinity        { @Cmsy "infinity"			}
   def florin          { @Cmmi "f"				}
   def club            { @Cmsy "club"				}
   def diamond         { @Cmsy "diamond"			}
   def heart           { @Cmsy "heart"				}
   def spade           { @Cmsy "spade"				}
   def arrowboth       { @Cmsy "arrowboth"			}
   def arrowleft       { @Cmsy "arrowleft"			}
   def arrowup         { @Cmsy "arrowup"			}
   def arrowright      { @Cmsy "arrowright"			}
   def arrowdown       { @Cmsy "arrowdown"			}
   def degree          { @Sym "\260"				}
   def plusminus       { @Cmsy "plusminus"			}
   def second          { @Sym "\262"				}
   def greaterequal    { @Cmsy "greaterequal"			}

   def multiply        { 0.09f @Left @Cmsy "multiply"		}
   def proportional    { @Cmsy "proportional"			}
   def partialdiff     { @Cmmi "partialdiff"			}
   def bullet          { @Cmsy "bullet"				}
   def divide          { @Cmsy "divide"				}
   def notequal        { not equal				}
   def equivalence     { @Cmsy "equivalence"			}
   def approxequal     { 0.05f @Left @Cmsy "approxequal"	}
   def ellipsis        { @Sym "\274"				}
   def arrowvertex     { vctr @Cmex "arrowvertex"		}
   def arrowhorizex    { @Sym "\276"				}
   def carriagereturn  { @Sym "\277"				}
   def aleph           { @Cmsy "aleph"				}
   def Ifraktur        { @Cmsy "Ifractur"			}
   def Rfraktur        { @Cmsy "Rfractur"			}
   def weierstrass     { @Cmmi "weierstrass"			}
   def circlemultiply  { @Cmsy "circlemultiply"			}
   def circleplus      { @Cmsy "circleplus"			}
   def emptyset        { @Cmsy "emptyset"			}
   def intersection    { @Cmsy "intersection"			}
   def union           { @Cmsy "union"				}
   def propersuperset  { 0.1f @Left @Cmsy "propersuperset"	}
   def reflexsuperset  { 0.1f @Left @Cmsy "reflexsuperset"	}
   def notsubset       { not @Cmsy "propersubset"		}
   def propersubset    { 0.1f @Left @Cmsy "propersubset"	}
   def reflexsubset    { 0.1f @Left @Cmsy "reflexsubset"	}
   def element         { 0.1f @Left @Cmsy "element"		}
   def notelement      { not element				}
   def angle           { less					}
   def gradient        { @Cmsy "nabla"				}
   def registerserif   { @Sym "\322"				}
   def copyrightserif  { @Sym "\323"				}
   def trademarkserif  { @Sym "\324"				}
   def product         { 0.6w @VShift 0.2f @Top @Cmex "producttext" }
   def radical         { vctr { 0.19f @Top @Cmsy "radical" }	}
   def dotmath         { @Cmsy "periodcentered"			}

   def logicalnot      { @Cmsy "logicalnot"			}
   def logicaland      { @Cmsy "logicaland"			}
   def logicalor       { @Cmsy "logicalor"			}
   def arrowdblboth    { @Cmsy "arrowdblboth"			}
   def arrowdblleft    { @Cmsy "arrowdblleft"			}
   def arrowdblup      { @Cmsy "arrowdblup"			}
   def arrowdblright   { @Cmsy "arrowdblright"			}
   def arrowdbldown    { @Cmsy "arrowdbldown"			}
   def lozenge         { @Sym "\340"				}
   def angleleft       { @Cmsy "angbracketleft"			}
   def registersans    { @Sym "\342"				}
   def copyrightsans   { @Sym "\343"				}
   def trademarksans   { @Sym "\344"				}
   def summation       { 0.6w @VShift 0.2f @Top @Cmex "summationtext"}
   def parenlefttp     { vctr @Cmex "parenlefttp"		}
   def parenleftex     { vctr @Cmex "parenleftex"		}
   def parenleftbt     { vctr @Cmex "parenleftbt"		}
   def bracketlefttp   { vctr @Cmex "bracketlefttp"		}
   def bracketleftex   { vctr @Cmex "bracketleftex"		}
   def bracketleftbt   { vctr @Cmex "bracketleftbt"		}
   def bracelefttp     { vctr @Cmex "bracelefttp"		}
   def braceleftmid    { vctr @Cmex "braceleftmid"		}
   def braceleftbt     { vctr @Cmex "braceleftbt"		}
   def braceex         { vctr @Cmex "braceex"			}
   def angleright      { @Cmsy "angbracketright"		}
   def integral        { @Cmsy "integral"			}
   def integraltp      { vctr @Cmex "bracelefttp"		}
   def integralex      { vctr @Cmex "braceex"			}
   def integralbt      { vctr @Cmex "bracerightbt"		}
   def parenrighttp    { vctr @Cmex "parenrighttp"		}
   def parenrightex    { vctr @Cmex "parenrightex"		}
   def parenrightbt    { vctr @Cmex "parenrightbt"		}
   def bracketrighttp  { vctr @Cmex "bracketrighttp"		}
   def bracketrightex  { vctr @Cmex "bracketrightex"		}
   def bracketrightbt  { vctr @Cmex "bracketrightbt"		}
   def bracerighttp    { vctr @Cmex "bracerighttp"		}
   def bracerightmid   { vctr @Cmex "bracerightmid"		}
   def bracerightbt    { vctr @Cmex "bracerightbt"		}


   ###################################################################
   #                                                                 #
   #   Short names                                                   #
   #                                                                 #
   #   These symbols, their names, and their spacing, are based on   #
   #   the list in Appendix F of Donald E. Knuth's The TeXBook.      #
   #                                                                 #
   #   Group 1 (lowercase Greek letters):  see full names above      #
   #   Group 2 (uppercase Greek letters):  see full names above      #
   #   Group 3 (calligraphic capitals):    not provided by Eq        #
   #                                                                 #
   ###################################################################

   ###################################################################
   #                                                                 #
   #   Group 4 (miscellaneous Ord symbols)                           #
   #                                                                 #
   #   Not all of Knuth's symbols are available.  The four suits     #
   #   (heartsuit, etc.), have definitions above.                    #
   #                                                                 #
   ###################################################################

   def hbar         { @OneCol { &0.1f @Base "-" ^/0.3fo h }	}
   def Re           { Rfraktur					}
   def Im           { Ifraktur					}
   def partial      { partialdiff				}
   def infty        { infinity					}
   def prime        { minute        				}
  #def emptyset     { defined above				}
   def nabla        { gradient					}
   def surd         { radical					}
   def top          { 180d @Rotate perpendicular		}
   def bot          { perpendicular				}
   def dbar         { @Cmsy "bardbl"				}
  #def angle        { defined above				}
   def backslash    { "\\"					}
   def forall       { universal					}
   def exists       { existential				}
   def neg          { logicalnot				}

   def circle       { @HContract @VContract
		      { "xsize ysize 2 div moveto"
			"xsize 2 div ysize 2 div xsize 2 div 0 360 arc"
			"0.04 ft setlinewidth stroke"
		      }
		      @Graphic { 0.7f @Wide 0.3f @High ^/ 0.3f @High }
		    }

   def square       { @HContract @VContract
		      { "0 0 moveto xsize 0 lineto xsize ysize lineto"
			"0 ysize lineto closepath"
			"0.04 ft setlinewidth stroke"
		      }
		      @Graphic { 0.6f @Wide 0.3f @High ^/ 0.3f @High }
		    }

   def triangle     { @HContract @VContract
		      { "0 0 moveto xsize 0 lineto"
		        "xsize 2 div ysize lineto closepath"
			"0.04 ft setlinewidth stroke"
		      }
		      @Graphic
		      { 0.3f @Wide 0.3f @High ^| ^/
		        0.3f @Wide 0.3f @High
		      }
		    }

   ###################################################################
   #                                                                 #
   #   Group 5 (digits)                                              #
   #                                                                 #
   ###################################################################

   def "0" { zero            }
   def "1" { one             }
   def "2" { two             }
   def "3" { three           }
   def "4" { four            }
   def "5" { five            }
   def "6" { six             }
   def "7" { seven           }
   def "8" { eight           }
   def "9" { nine            }


   ###################################################################
   #                                                                 #
   #   Group 6 ("Large" operators)                                   #
   #                                                                 #
   #   Knuth's large operators automatically change size depending   #
   #   on whether the equation is display or inline.  Eq does not    #
   #   do this; instead, the `big' operator must be used.            #
   #                                                                 #
   ###################################################################

   def sum	{ summation					}
   def prod	{ product					}
   def coprod   { 0.6w @VShift 0.1f @Top @Cmex "coproducttext"	}
   def int	{ 1.3f @Font vctr integral			}
   def oint	{ 1.3f @Font vctr 0.1f @Top @Cmex "contintegraltext"}
   def bcap	{ 1.3f @Font intersection			}
   def bcup	{ 1.3f @Font union				}
   def bvee	{ 1.3f @Font logicalor				}
   def bwedge	{ 1.3f @Font logicaland				}
   def bodot	{ vctr 0.1f @Top @Cmex "circledottext"		}
   def botimes	{ vctr 0.1f @Top @Cmex "circlemultiplytext"	}
   def boplus	{ vctr 0.1f @Top @Cmex "circleplustext"		}
   def buplus	{ vctr 0.1f @Top @Cmex "unionmultitext"		}

   ###################################################################
   #                                                                 #
   #   Group 7 (binary operations)                                   #
   #                                                                 #
   #   All of Knuth's symbols are available except \star, \diamond   #
   #   and \bullet; a few have been given more mnemonic names.       #
   #                                                                 #
   ###################################################################

   def "+"		{ bin plus				}
   def "-"		{ bin minus				}
   def "+-"		{ bin plusminus				}
   def "-+"		{ bin 180d @Rotate plusminus		}
   def setminus		{ bin backslash				}
   def cdot		{ bin dotmath				}
   def times		{ bin multiply				}
   def "*"		{ bin asteriskmath			}
  #def diamond		{ name used above			}
   def circ		{ bin circle				}
  #def bullet		{ name used above			}
   def div		{ bin divide				}
   def cap		{ bin intersection			}
   def cup		{ bin union				}
   def uplus		{ bin @Cmsy "unionmulti"		}
   def sqcap		{ bin @Cmsy "intersectionsq"		}
   def sqcup		{ bin @Cmsy "unionsq"			}
   def triangleleft	{ bin 90d @Rotate 0.8f @Font triangle	}
   def triangleright	{ bin "-90d" @Rotate 0.8f @Font triangle}
   def wr		{ bin @Cmsy "wreathproduct"		}
   def bigcirc		{ bin 1.2f @Font circle			}
   def bigtriangleup	{ bin 1.2f @Font triangle		}
   def bigtriangledown	{ bin 180d @Rotate 1.2f @Font triangle	}
   def vee		{ bin logicalor				}
   def wedge		{ bin logicaland			}
   def oplus		{ bin circleplus			}
   def ominus		{ bin @Cmsy "circleminus"		}
   def otimes		{ bin circlemultiply			}
   def oslash		{ bin @Cmsy "circledivide"		}
   def odot		{ bin @Cmsy "circledot"			}
   def dagger		{ bin @Cmsy "dagger"			}
   def daggerdbl	{ bin @Cmsy "daggerdbl"			}
   def amalg		{ bin vctr @Cmsy "coproduct"		}

   ###################################################################
   #                                                                 #
   #   Group 8 (relations)                                           #
   #                                                                 #
   #   All Knuth's operators are available, but many have been       #
   #   given different, more mnemonic names.  Also included is       #
   #   a not operator for negating the relations (at top of file).   #
   #                                                                 #
   ###################################################################

   def "<"		{ rel less				}
   def ">"		{ rel greater				}
   def "="		{ rel equal				}
   def "<="		{ rel lessequal				}
   def prec		{ rel 0.1f @Left @Cmsy "precedes"	}
   def preceq		{ rel 0.1f @Left @Cmsy "precedesequal"	}
   def "<<"		{ rel @Cmsy "lessmuch"			}
   def subset		{ rel propersubset			}
   def subseteq		{ rel reflexsubset			}
   def sqsubseteq	{ rel @Cmsy "subsetsqequal"		}
   def in		{ rel element				}
   def vdash		{ rel @Cmsy "turnstileleft"		}
   def smile		{ rel @Cmmi "slurbelow"			}
   def frown		{ rel @Cmmi "slurabove"			}

   def ">="		{ rel greaterequal			}
   def succ		{ rel 0.1f @Left @Cmsy "follows"	}
   def succeq		{ rel 0.1f @Left @Cmsy "followsequal"	}
   def ">>"		{ rel @Cmsy "greatermuch"		}
   def supset		{ rel propersuperset			}
   def supseteq		{ rel reflexsuperset			}
   def sqsupseteq	{ rel @Cmsy "supersetsqequal"		}
   def ni		{ rel 0.1f @Left @Cmsy "owner"		}
   def dashv		{ rel @Cmsy "turnstileright"		}
   def mid		{ rel @Cmsy "bar"			}
   def parallel		{ rel @Cmsy "bardbl"			}

   def "=="		{ rel equivalence			}
   def "~"		{ rel similar				}
   def "-~"		{ rel 0.05f @Left @Cmsy "similarequal"	}
   def asymp		{ rel @Cmsy "equivasymptotic"		}
   def "~~"		{ rel approxequal			}
   def "=~"		{ rel congruent				}
   def bowtie		{ rel{non triangleright non triangleleft}}
   def propto		{ rel proportional			}
   def models		{ rel{@Base vctr "|" &0.05fo vctr equal}}
   def doteq		{ rel @OneRow @HContract {&0.5rt dotmath^/0.15f equal}}
   def perp		{ rel perpendicular			}

   def notsub		{ rel notsubset				}
   def notin		{ rel notelement			}
   def "!="		{ rel notequal				}

   def "<->"		{ rel arrowboth				}
   def "<--"		{ rel arrowleft				}
   def "-->"		{ rel arrowright			}
   def up		{ rel arrowup				}
   def down		{ rel arrowdown				}
   def "<=>"		{ rel arrowdblboth			}
   def "<=="		{ rel arrowdblleft			}
   def "==>"		{ rel arrowdblright			}
   def dblup		{ rel arrowdblup			}
   def dbldown		{ rel arrowdbldown			}

   def ":"		{ rel colon				}
   def "::"		{ rel @OneCol {colon ` colon}		}
   def ":="		{ rel { colon{ //0.03fo ` equal} }	}



   ###################################################################
   #                                                                 #
   #   Groups 11 and 12 - openings and closings.                     #
   #                                                                 #
   ###################################################################

   def lpar	{ parenleft			}
   def rpar	{ parenright			}
   def lbrack	{ bracketleft			}
   def rbrack	{ bracketright			}
   def lbrace	{ braceleft			}
   def rbrace	{ braceright			}
   def lfloor	{ @Cmsy "floorleft"		}
   def rfloor	{ @Cmsy "floorright"		}
   def lceil	{ @Cmsy "ceilingleft"		}
   def rceil	{ @Cmsy "ceilingright"		}
   def langle	{ angleleft			}
   def rangle	{ angleright			}

   def blpar	{ vctr 0.1f @Top 0.2f @Left @Cmex "parenleftBigg"	}
   def brpar	{ vctr 0.1f @Top @Cmex "parenrightBigg"			}
   def blbrack	{ vctr 0.1f @Top 0.2f @Left @Cmex "bracketleftBigg"	}
   def brbrack	{ vctr 0.1f @Top @Cmex "bracketrightBigg"		}
   def blbrace	{ vctr 0.1f @Top 0.2f @Left @Cmex "braceleftBigg"	}
   def brbrace	{ vctr 0.1f @Top @Cmex "bracerightBigg"			}
   def blfloor	{ vctr 0.1f @Top 0.2f @Left @Cmex "floorleftBigg"	}
   def brfloor	{ vctr 0.1f @Top @Cmex "floorrightBigg"			}
   def blceil	{ vctr 0.1f @Top 0.2f @Left @Cmex "ceilingleftBigg"	}
   def brceil	{ vctr 0.1f @Top @Cmex "ceilingrightBigg"		}
   def blangle	{ vctr 0.1f @Top 0.2f @Left @Cmex "angbracketleftBigg"	}
   def brangle	{ vctr 0.1f @Top @Cmex "angbracketrightBigg"		}


   ###################################################################
   #                                                                 #
   #   Group 13 - punctuation.                                       #
   #                                                                 #
   ###################################################################

   def ";"     { punct semicolon     }
   def ","     { punct comma         }
   def col     { punct colon         }


   ###################################################################
   #                                                                 #
   #   Additional short symbols (Knuth p. 132)                       #
   #                                                                 #
   ###################################################################

   def "!" { exclam          }
   def "?" { question        }
   def "%" { percent         }
   def "(" { parenleft       }
   def ")" { parenright      }
   def "[" { bracketleft     }
   def "]" { bracketright    }


   ###################################################################
   #                                                                 #
   #   Common mathematical functions (from Knuth p. 162).            #
   #   mod is included, since @Rel mod is easily typed if needed.    #
   #                                                                 #
   ###################################################################

   def arccos	{ @Base "arccos"	}
   def arcsin	{ @Base "arcsin"	}
   def arctan	{ @Base "arctan"	}
   def arg	{ @Base "arg"		}
   def cos	{ @Base "cos"		}
   def cosh	{ @Base "cosh"		}
   def cot	{ @Base "cot"		}
   def coth	{ @Base "coth"		}
   def csc	{ @Base "csc"		}
   def deg	{ @Base "deg"		}
   def det	{ @Base "det"		}
   def dim	{ @Base "dim"		}
   def exp	{ @Base "exp"		}
   def gcd	{ @Base "gcd"		}
   def hom	{ @Base "hom"		}
   def inf	{ @Base "inf"		}
   def ker	{ @Base "ker"		}
   def lg	{ @Base "lg"		}
   def lim	{ @Base "lim"		}
   def liminf	{ @OneCol { @Base "lim" ` @Base "inf" }	}
   def limsup	{ @OneCol { @Base "lim" ` @Base "sup" }	}
   def ln	{ @Base "ln"		}
   def log	{ @Base "log"		}
   def max	{ @Base "max"		}
   def min	{ @Base "min"		}
   def Pr	{ @Base "Pr"		}
   def sec	{ @Base "sec"		}
   def sin	{ @Base "sin"		}
   def sinh	{ @Base "sinh"		}
   def supr	{ @Base "sup"		}
   def tan	{ @Base "tan"		}
   def tanh	{ @Base "tanh"		}
   def mod	{ @Base "mod"		}


   ###################################################################
   #                                                                 #
   #   Other symbols taken from TeX.                                 #
   #                                                                 #
   ###################################################################

   def ldots { .       &0.3f .       &0.3f .			}
   def cdots { dotmath &0.3f dotmath &0.3f dotmath		}
   def vdots { @OneRow { dotmath ^/0.3f dotmath /0.3f dotmath } }
   def ddots { @OneCol @OneRow
	       {        dotmath
	         ^/0.3f |0.3f dotmath
                  /0.3f |     |0.3f dotmath
	       }
	     }


   ###################################################################
   #                                                                 #
   #   Symbols taken from eqn (Kernighan and Cherry 1975).           #
   #                                                                 #
   ###################################################################

   def del	{ gradient		}
   def grad	{ gradient		}
   def "..."	{ ellipsis		}
   def ",...,"	{ , ellipsis ``` ,	}
   def "'"	{ minute		}
   def empty	{ emptyset		}



   ###################################################################
   #                                                                 #
   #   Symbols with parameters.                                      #
   #                                                                 #
   #   These symbols are essentially those of eqn, with some         #
   #   changes and additions.                                        #
   #                                                                 #
   ###################################################################

   def sup
      precedence 60
      associativity left
      left x
      named gap { @SupGap }
      right y
   {  @HContract @VContract
      {          | @Smaller y
	^/gap  x
      }
   }

   def sub
      precedence 60
      associativity left
      left x
      named gap { @SupGap }
      right y
   {  @HContract @VContract
      {
	      x
	 /gap    |  @Smaller y
      }
   }

   def tsub
      precedence 60
      associativity left
      left x
      named gap { @SupGap }
      right y
   {  @HContract @VContract
      {
	      x
	 /gap    |  &0io 0.3f @HShift @Smaller y
      }
   }

   def supp
      precedence 60
      associativity left
      left x
      named gap { @SupGap }
      right y
   {  @HContract @VContract
      { { ^/gap x /gap } |  y
      }
   }

   def on
      precedence 61
      associativity left
      left x
      named gap { @SupGap }
      right y
   {  @Smaller x ^/  / @Smaller y 
   }

   def ton
      precedence 61
      associativity left
      left x
      named gap { @SupGap }
      right y
   {  @Smaller x ^/  / &0io 0.3f @HShift @Smaller y 
   }

   def frac
      precedence 54
      associativity left
      left x
      named gap { 0ik }
      right y
   {  
      @HContract @VContract @Smaller
      { 1w @VShift { x /gap } | fraction &0io | 0w @VShift { |gap y }
      }
   }

   def half { 1 frac 2 }
   def third { 1 frac 3 }

   def over
      precedence 54
      associativity left
      left x
      named gap { 0.2f }
      right y
   {  
      @HContract @VContract
      {          |0.5rt @OneCol x
	^//gap   @HLine
	 //gap   |0.5rt @OneCol @Strut y
      }
   }

   def from
      precedence 58
      associativity left
      left x
      named gap { @ThinGap  }
      named skew { 0c }
      right y
   {  
      @HContract @VContract
      {          |0.5rt x
	 //gap   |0.5rt &skew @Smaller y
      }
   }

   def to
      precedence 58
      associativity left
      left x
      named gap { @ThinGap  }
      named skew { 0c }
      right y
   {
      @HContract @VContract
      {          |0.5rt &skew @Smaller y
	^//gap   |0.5rt x
      }
   }

   def widefrom
      precedence 58
      associativity left
      left x
      named gap { @ThinGap  }
      right y
   {
      @HContract @VContract
      {  x //gap @HScale y
      }
   }

   def wideto
      precedence 58
      associativity left
      left x
      named gap { @ThinGap  }
      right y
   {
      @HContract @VContract
      { @HScale y ^//gap x
      }
   }

   def dot
      precedence 62
      left x
      named gap { @ThinGap }
   {  x to gap { gap } skew { @SkewGap } .
   }

   def dotdot
      precedence 62
      left x
      named gap { @ThinGap }
   {  x to gap { gap } skew { @SkewGap } ..
   }

   def hat
      precedence 62
      left x
      named gap { @ThinGap }
   {  x to gap { gap } skew { @SkewGap } @Base "^"
   }

   def tilde
      precedence 62
      left x
      named gap { @ThinGap }
   {  x to gap { gap } skew { @SkewGap } @Base "~"
   }

   def vec
      precedence 62
      left x
      named gap { @ThinGap }
   {  x to gap { gap } skew { @SkewGap } arrowright
   }

   def dyad
      precedence 62
      left x
      named gap { @ThinGap }
   {  x to gap { gap } skew { @SkewGap } arrowboth
   }

   def overbar
      precedence 62
      left x
      named gap { @ThinGap }
   {  x wideto gap { gap } minus
   }

   def underbar
      precedence 62
      left x
      named gap { @ThinGap }
   {  x widefrom gap { gap } minus
   }

   def sqrt
      precedence 56
      named gap { @ThinGap }
      right x
   {
      @HContract @VContract
      { @VScale surd | @OneRow
	{ @HLine line { "0.03 ft setlinewidth 2 setlinecap" }
	  ^//gap  |gap  @Strut x //gap
	}
      }
   }

   def root
      precedence 56
      left x
      right y
   { "" sup x &0io sqrt y
   }

   def above
      precedence 52
      left x
      named gap { @RowGap }
      right y
   {  |0.5rt x //gap |0.5rt y
   }

   def labove
      precedence 52
      left x
      named gap { @RowGap }
      right y
   {  x //gap y
   }

   def cabove
      precedence 52
      left x
      named gap { @RowGap }
      right y
   {  |0.5rt x //gap |0.5rt y
   }

   def rabove
      precedence 52
      left x
      named gap { @RowGap }
      right y
   {  |1rt x //gap |1rt y
   }

   def mabove
      precedence 52
      left x
      named gap { @RowGap }
      right y
   {  x /gap y
   }

   def nextcol
      precedence 50
      left x
      named gap { @ColGap }
      right y
   { x |gap y
   }

   def matrix
      precedence 100
      named gap { @MedGap }
      named atleft {}
      named atright {}
      right x
   { vctr @HContract @VContract
     {  @VScale atleft
	||@ThinGap  { //gap x //gap } ||@ThinGap
	@VScale atright
     }
   }

   macro pmatrix  { matrix atleft { blpar   } atright { brpar   } }
   macro bmatrix  { matrix atleft { blbrack } atright { brbrack } }
   macro brmatrix { matrix atleft { blbrace } atright { brbrace } }
   macro fmatrix  { matrix atleft { blfloor } atright { brfloor } }
   macro cmatrix  { matrix atleft { blceil  } atright { brceil  } }
   macro amatrix  { matrix atleft { blangle } atright { brangle } }
 
   Slope @Font 1.2f @Break 0c @Space @Body

@End @Eq                  
