On Sat, 30 Jun 2007, Mojca Miklavec wrote: > On 6/29/07, Aditya Mahajan wrote: >> Actually just adding overleftrightarrow is easy, but better will be an >> interface to easily define such commands. So .... >> >> > If not, what can I do so that I can use it? >> >> ConTeXt uses overleftarrow and overrightarrow as defined in plain >> tex. This does not work in subscripts. >> >> $\overleftarrow{A}$ $\overleftarrow{ABC}$ >> $a_{\overleftarrow{A}}$ $b_{\overleftarrow{ABC}}$ >> >> Here is a solution. First we patch math-ext so that arrowfills take a >> style. >> >> There are also underarrows, which will not be too hard to do. I will >> patch math-ext with both overarrows and underarrows. I think that >> there needs to be some "italic correction" for the arrow. It is >> centered on the math box, but the math box is tilted to the right. Any >> way to determine the "correct" horizontal skip that should be added. I am attaching an updated math-ext.tex that defines over and under arrows. To use it, copy it to your current directory and add \input math-ext somewhere in your environment file. Hans, this file also contains some minor typo corrections in the earlier documentation. I have also changed the text width for comments to 70, as 80 characters do not look nice on contextgarden. >> Mojca, I remember that you had some trouble with overharpoons. Does >> this take care of that? > > \vec is not good for two reasons: > > a) often stretchable arrows are needed (vectors both over single > letters and things like {AB} are mixed, and \vec looks really weird in > cases where letters are longer, or when we have combinations of them) > > b) vectors should be harpoons (not arrows) according to our conventions. > > > My old \overrightharpoonup definitions had two other problems: > > c) scalability/interfering with style change: you solved exactly that > one in a really nice way - thanks a lot (I did patch it, but it looked > like really ugly code) > > d) glyphs themselves and their size (probably only the Polish guys can > help here) - and that's the real problem at the moment Long ago, for some other problem, Taco had suggested that it will be nice to have just the arrow heads. Then we could stack them the way we want. IIRC, this is what the cow font does. If nothing else works, you can try the cow font for writing math. I think that it matches nicely with iwona-heavy :) > 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). \def\definemathshortarrow {\dotripleargument\dodefinemathshortarrow} \def\dodefinemathshortarrow[#1][#2][#3]% {\ifthirdargument \setvalue{#1}{\dohandlemathshortarrow[#2][#3]}% \else \setvalue{#1}{\dohandlemathshortarrow[\zeropoint][#2]}% \fi} \def\dohandlemathshortarrow[#1][#2]% {\mathpalette{\dodohandlemathshortarrow{#1}{#2}}} \def\dodohandlemathshortarrow#1#2#3#4% {\setbox0\hbox{$\m@th#3#4$}% \vbox{\ialign{##\crcr \mirror{\clip[width=\wd0]{\mirror{$\m@th#2#3$}}}\crcr \noalign{\kern#1\nointerlineskip}% $\m@th\hfil#3#4\hfil$\crcr}}} \definemathshortarrow [shortoverrightharpoonup] [\rightharpoonup] \let\myvec\shortoverrightharpoonup I do not like mirror->clip->mirror but I could not find how to clip from the left rather than the right. I guess now is the time to update the myway on math arrows :) Aditya