From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/9581 Path: main.gmane.org!not-for-mail From: Giuseppe Bilotta Newsgroups: gmane.comp.tex.context Subject: Re: [NTG-context] A math question Date: Fri, 18 Oct 2002 23:59:46 +0200 Sender: ntg-context-admin@ref.vet.uu.nl Message-ID: <16520379373.20021018235946@iol.it> References: <14519861309.20021018235108@iol.it> Reply-To: Giuseppe Bilotta NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035399887 4161 80.91.224.250 (23 Oct 2002 19:04:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 19:04:47 +0000 (UTC) Cc: ntg-context@ntg.nl Original-Received: from hermes.hrz.uni-giessen.de (hermes.hrz.uni-giessen.de [134.176.2.15]) by osiris.hrz.uni-giessen.de (8.11.6+Sun/8.11.6) with ESMTP id g9IM2Ue15953 for ; Sat, 19 Oct 2002 00:02:30 +0200 (MEST) Original-Received: from ref.vet.uu.nl by hermes.hrz.uni-giessen.de with ESMTP for Guenter.Partosch@hrz.uni-giessen.de; Sat, 19 Oct 2002 00:02:19 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 6951710AF1; Sat, 19 Oct 2002 00:02:15 +0200 (MEST) Original-Received: from smtp3.libero.it (smtp3.libero.it [193.70.192.127]) by ref.ntg.nl (Postfix) with ESMTP id ECB7510AD7 for ; Sat, 19 Oct 2002 00:01:11 +0200 (MEST) Original-Received: from [151.29.131.173] (151.29.131.173) by smtp3.libero.it (6.5.028) id 3DA3111B004F6B4F; Sat, 19 Oct 2002 00:01:07 +0200 X-Mailer: The Bat! (v1.60q) Business X-Priority: 3 (Normal) Original-To: Giuseppe Bilotta In-Reply-To: <14519861309.20021018235108@iol.it> Errors-To: ntg-context-admin@ref.vet.uu.nl X-BeenThere: ntg-context@ref.ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:9581 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:9581 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 ntg-context@ref.ntg.nl http://ref.ntg.nl/mailman/listinfo/ntg-context