Quoting Aditya Mahajan <[EMAIL PROTECTED]>:

> On Sat, 30 Jun 2007, Mojca Miklavec wrote:

>> Consider
>> \def\myvec#1{\overrightharpoonup{#1}}
>> $(\myvec{\imath},\myvec{\jmath},\myvec{k})$ or $\myvec{\nabla}$,
>> $\myvec{\sigma}$, $\myvec{r}$, ...
>> The base size on top of i, j, k, ... is just too long and the harpoon
>> is also slightly too big.
>
> A realy realy ugly solution (if you do not want extensible arrows).

Here is a slightly better solution; I have tested it only for harpoons, 
and there are no configuration options for other "accents". But it 
works for both short and long objects.

\def\definemathfancyarrow
  {\dotripleargument\dodefinemathfancyarrow}

\def\dodefinemathfancyarrow[#1][#2][#3]% arrow short long
  {\setvalue{#1}{\dohandlemathfancyarrow[#2][#3]}}

\def\dohandlemathfancyarrow[#1][#2]%
  {\mathpalette{\dodohandlemathfancyarrow{#1}{#2}}}

%TODO: The clip operation should be configurable, whether you want to clip
%right or clip left.

\unexpanded\def\dodohandlemathfancyarrow#1#2#3#4% short long style text
  [EMAIL PROTECTED]
   [EMAIL PROTECTED]
   \vbox{\ialign{##\crcr
   \ifdim\wd0<\wd2
     [EMAIL PROTECTED]
   \else
     #2#3%
   \fi\crcr
   \noalign{\kern-\onepoint\nointerlineskip}%
   [EMAIL PROTECTED]

\definemathfancyarrow  [fancyoverrightharpoonup]
                       [\rightharpoonup]
                       [\rightharpoonupfill]


\let\myvec\fancyoverrightharpoonup

\starttext
$\myvec{\imath} \myvec{\jmath} \myvec{ABCD}$
\stoptext

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to