[dev-context] My way on matharrows

Hans Hagen pragma at wxs.nl
Wed Jul 19 11:39:17 CEST 2006


Aditya Mahajan wrote:
> Hi,
>
>  I am attaching myway on using matharrow. Are there any suggestions 
> before I release it to public?
>
> I found some surprises while making this my way.
>
> 1. Somewhere along the line of development, \xrightarrow{text} changed 
> to placing text at the bottom of the arrow (rather than the top as in 
> amstex). This is not a bug, just something that works differently. 
> Should this be changed? These arrow definitions are pretty new, so I 
> do not think that a change at this stage will effect too many users. 
> It may not be possible to change later for compatibility reasons.
>
> 2. Something goes wrong with palatino (used by mag-01). Have a look at 
> the \xmapsto and \xrightleftharpoons and \xleftrightharpoons in the 
> pdf. \xmapsto can be corrected by changing its defintion to
>
> \definematharrow [xmapsto]            [3599] [\mapstofill]
>
> Basically, providing a bit more cusion on the left, so that the middle 
> \relbar not overlap the \mapstochar.
>
> Should this definition go to math-ext.tex or to something specific to 
> palatino. I have not tested with other fonts, but what is the general 
> strategy when definitions differ for different fonts?
>
> I could not correct leftrightharpoons. Why does this not work?
>
> \definematharrow [xleftrightharpoons] [3395,3359] 
> [\leftharpoonupfill,\rightharpoondownfill]
>
> \starttext
> \math{\xleftrightharpoons}
> \stoptext
>

ok, a dirty trick: when no third arg, then one redefines the dimensions

\starttext

\def\dodefinematharrow[#1][#2][#3][#4]%  
  {\iffourthargument
      \executeifdefined{dodefine#2arrow}
\gobblethreearguments{#1}{#3}{#4}%
   \else\ifthirdargument
      \dodefinebotharrow{#1}{#2}{#3}%
   \else\ifsecondargument
      \redefinebotharrow{#1}{#2}{#3}%
   \fi\fi\fi}

\def\redefinebotharrow#1#2#3%
  {\doifdefined{#1}
     {\pushmacro\dotripleempty
      \def\dotripleempty##1[##2][##3]%
{\setvalue{#1}{\dotripleempty\xmtharrow[#2][##3]}}%
      \getvalue{#1}%
      \popmacro\dotripleempty}}


\def\dodefinebotharrow#1#2#3%
  {\setvalue{#1}{\dotripleempty\xmtharrow[#2][#3]}}


\startformula \xrightarrow{stuff on top}             \stopformula

\definematharrow[xrightarrow][9999]

\startformula \xrightarrow{stuff on top}             \stopformula

\definematharrow[xrightarrow][0000]

\startformula \xrightarrow{stuff on top}             \stopformula

\stoptext


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------




More information about the dev-context mailing list