Article View: comp.text.tex
Article #979How to maintain relative spacing in stacked math symbols?
From: Mark McCaughrean
Date: Fri, 07 Aug 1992 03:15
Date: Fri, 07 Aug 1992 03:15
34 lines
2188 bytes
2188 bytes
By slightly modifying the definition of \cong in Plain TeX, I built
symbols for "greater than or similar to" and "less than or similar
to" like so:
\def\oversim#1#2{\lower0.5ex\vbox{\baselineskip=0pt\lineskip=0.2ex
\ialign{$\mathsurround=0pt #1\hfil##\hfil$\crcr#2\crcr\sim\crcr}}}
\def\simgt{\mathrel{\mathpalette\oversim>}}
\def\simlt{\mathrel{\mathpalette\oversim<}}
These _almost_ work right. I noted that \cong used \lower and \lineskip
with dimensions measured in points to make the stack. It seems as though
you'd be better off using (say) ex's as the unit: then when \mathpalette
builds the symbols at the three sizes (\textfont, \scriptfont, and
\scriptscriptfont), the relative space between the two stacked parts
and its position relative to the baseline, should remain the same.
Didn't work. The stacked parts do change size perfectly correctly
as you use the macros in subscripts etc., but they don't adjust
their relative spacing and the overall stack doesn't maintain position
relative to the local baseline. Why? And more's the point perhaps,
why did Knuth define \cong using points? If you try out this:
$a\cong b_{a\cong b_{a\cong b}$
you should notice the \sim and = get closer together and move down
relative to the local baseline, as you get into the subscripts.
Ideas? Thanks. (P.S. Thanks to all who helped with my \halign and
\multispan glue problem - suggestions worked out fine).
------------------------------------------------------------------------
Mark McCaughrean | University of Arizona | Phone: US + (602) 621 8347
Steward Observatory | Tucson, AZ 85721, USA | E-mail: mjm@as.arizona.edu
------------------------------------------------------------------------
Technical Details
Message-ID:
<1992Aug7.031504.14147@organpipe.uug.arizona.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!ncar!noao!amethyst!organpipe.uug.arizona.edu!hercules.as.arizona.edu!mjmShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!ncar!noao!amethyst!organpipe.uug.arizona.edu!hercules.as.arizona.edu!mjm From: mjm@hercules.as.arizona.edu (Mark McCaughrean) Newsgroups: comp.text.tex Subject: How to maintain relative spacing in stacked math symbols? Message-ID: <1992Aug7.031504.14147@organpipe.uug.arizona.edu> Date: 7 Aug 92 03:15:04 GMT Sender: news@organpipe.uug.arizona.edu Organization: University of Arizona, Tucson, AZ Lines: 34