%From prakash@trichur.cs.mcgill.ca Mon Dec 2 21:30:02 1991 %Return-Path: %Received: from oliver.cs.mcgill.ca by triples.math.mcgill.ca (4.1/SMI-4.1) % id AA00870; Mon, 2 Dec 91 21:30:00 EST %Received: from trichur.CS.McGill.CA by oliver.cs.mcgill.ca (5.61+ (*mx)) with SMTP % id AA18638; Mon, 2 Dec 91 21:29:58 -0500 %Received: by trichur.cs.mcgill.ca (4.1/SMI-4.1.1) % id AA04156; Mon, 2 Dec 91 21:29:53 EST %Date: Mon, 2 Dec 91 21:29:53 EST %From: prakash@trichur.cs.mcgill.ca (Prakash) %Message-Id: <9112030229.AA04156@trichur.cs.mcgill.ca> %To: saraswat@parc.xerox.com, rags@triples.Math.McGill.CA %Subject: oops this is meaning.sty %Cc: %Reply-To: prakash@cs.mcgill.ca %Status: R % Double square brackets, as used for semantics, e.g. [[ f(2+5) ]] % Works in all sizes and also as sub- and subsubscript % Usage: \Mean{ } in math mode % % Ralf Treinen (yxoc@cs.uni-sb.de) 23.1.91 . Comments welcome. % \newbox\M@contents % the math stuff that goes inside the brackets \newbox\M@KH % two horizontal lines \newbox\M@KV % one vertical line \newdimen\M@height % height of the brackets \newdimen\M@depth % depth of the brackets \newdimen\M@total % height + depth of the brackets \newdimen\M@strength % the strength of the lines of the brackets \newdimen\M@width % distance between the 2 vertical lines of the brackets \def\Mean#1{\mathchoice% {\setbox\M@contents\hbox{$\displaystyle#1$}\M@draw} {\setbox\M@contents\hbox{$\textstyle#1$}\M@draw} {\setbox\M@contents\hbox{$\scriptstyle#1$}\M@draw} {\setbox\M@contents\hbox{$\scriptscriptstyle#1$}\M@draw}} \def\M@draw{ % calculate the sizes \M@height=\ht\M@contents \M@depth=\dp\M@contents \advance\M@height by 2pt \advance\M@depth by 2pt \M@total=\M@height \advance\M@total by\M@depth \ifdim\M@total<18pt\M@strength=0.4pt \else\ifdim\M@total<45pt\M@strength=0.55pt \else\M@strength=0.7pt\fi\fi \ifdim\M@total<18pt\M@width=1pt \else\ifdim\M@total<45pt\M@width=1.5pt \else\M@width=2.5pt\fi\fi % build the boxes \setbox\M@KV\hbox{% \hbox{\vrule height\M@height depth\M@depth width\M@strength}} \setbox\M@KH\hbox{\lower\M@depth\hbox{\vbox to \M@total{% \hrule width\M@width height0pt depth\M@strength% \vfil% \hrule width\M@width height\M@strength depth0pt}}} % ship out \,\mathopen{\copy\M@KV\copy\M@KH\copy\M@KV\copy\M@KH}\, \box\M@contents \,\mathclose{\copy\M@KH\copy\M@KV\box\M@KH\box\M@KV}\, } % end of meaning.sty