Friday, October 18, 2002 Giuseppe Bilotta wrote:

GB> Hello,

GB> does ConTeXt provide extensible arrows with super and subscript?
GB> An extensible arrow is something like \leftarrow, \rightarrow,
GB> \Leftarrow, \Rightarrow, except that it accepts super/subscripts
GB> which gets typeset over or under the arrow body, which extends to
GB> accomdate the length of the super and subscripts (with a minimum
GB> guaranteed legth).

Sorry for following up to my own post, but I found a couple of
definitions in nath.sty (Nath is a wonderful LaTeX package) which
might be pertinent:

GB> %
GB> %  E x p a n d a b l e   h o r i z o n t a l  a r r o w s
GB> %
GB> 
GB> \def\longrightarrow@#1#2{\mathrel{\mathopen-\axis@@
GB>  \axis@{#1}{#2}
GB>  \axis@@\mathclose\rightarrow}}
GB> 
GB> \def\longleftarrow@#1#2{\mathrel{\mathopen\leftarrow\axis@@
GB>  \axis@{#1}{#2}
GB>  \axis@@\mathclose-}}
GB> 
GB> \def\longleftrightarrow@#1#2{\mathrel{\mathopen\leftarrow\axis@@
GB>  \axis@{#1}{#2}
GB>  \axis@@\mathclose\rightarrow}}
GB> 
GB> \pdef\to{\def\afterparse@{
GB>  \longrightarrow@{\ifsp@\sp@toks@\fi}{\ifsb@\sb@toks@\fi}\next}
GB>  \sb@false\sp@false
GB>  \def\next@comm{\afterassignment\parse@next\let\next=}
GB>  \next@comm}
GB> 
GB> \pdef\ot{\def\afterparse@{
GB>  \longleftarrow@{\ifsp@\sp@toks@\fi}{\ifsb@\sb@toks@\fi}\next}
GB>  \sb@false\sp@false
GB>  \def\next@comm{\afterassignment\parse@next\let\next=} 
GB>  \next@comm}
GB> 
GB> \pdef\otto{\def\afterparse@{
GB>  \longleftrightarrow@{\ifsp@\sp@toks@\fi}{\ifsb@\sb@toks@\fi}\next}
GB>  \sb@false\sp@false
GB>  \def\next@comm{\afterassignment\parse@next\let\next=} 
GB>  \next@comm}
GB> 
GB> \pdef\mapsto{\mathrel{\mapstochar}\mathclose{}\mathopen{}\to}
GB> 
GB> \def\sp@toks@{\edef\@tempa{\noexpand\inline{\the\sp@toks}}\@tempa}
GB> \def\sb@toks@{\edef\@tempa{\noexpand\inline{\the\sb@toks}}\@tempa}
GB> 
GB> \def\axis@#1#2{\setbox0\scriptstylehbox@{\protectinline@true #1}
GB>  \er@wd=\wd0
GB>  \setbox\@tempboxa\scriptstylehbox@{\protectinline@true #2}
GB>  \ifdim\wd\@tempboxa>\er@wd \er@wd=\wd\@tempboxa\fi
GB>  \@tempdima=\ht\@tempboxa
GB>  \advance\@tempdima\dp\@tempboxa
GB>  \advance\@tempdima-.42\mex
GB>  \vtop{\offinterlineskip
GB>  \hbox{\vbox{\hbox to\er@wd{\hss\box0\hss}%
GB>  \vskip -.26\mex
GB>  \hbox to\er@wd{\axis@@@\hfill}}}
GB>  \vskip -.26\mex
GB>  \hbox to\er@wd{\hss\box\@tempboxa\hss}}
GB>  }
GB> 
GB> \def\axis@@{\mkern-6mu
GB>  \axis@@@\mskip 3mu plus \arrow@expandability mu
GB>  \mkern-6mu}
GB> 
GB> \def\axis@@@{%
GB>  \cleaders\hbox{\o@math\mkern-3mu \icurrstyle@\mathord- \mkern-3mu\o@math}}
GB> 
GB> \def\arrow@expandability{1.2}
GB>  
GB> \def\longrightarrowfill{\axis@@@\hfill\mskip-6mu\rightarrow}
GB> \def\longleftarrowfill{\leftarrow\mskip-6mu\axis@@@\hfill}
GB> \def\longleftrightarrowfill{\leftarrow\mskip-6mu
GB>  \axis@@@\hfill\mskip-6mu\rightarrow}

It is my understanding that this shouldn't be too hard to port to
contest: \o@math is simply the "original" TeX $, the afterparse@,
\ifsp@, \ifsb@ do a lookahead to see if superscripts and
subscripts are used, and in case use them.

Would it be hard to port this to ConTeXt?

-- 
Giuseppe "Oblomov" Bilotta

_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://ref.ntg.nl/mailman/listinfo/ntg-context

Reply via email to