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.
/.../ Wow! Aditya, thanks a lot! I didn't do any extensive testing, but the functionality should really end up in the core (including the added bonus if possible ;).
As an added bonus:
\definemathoverarrow [overtwoheadrightarrow] [\twoheadrightarrowfill] \definemathoverarrow [overtwoheadleftarrow] [\twoheadleftarrowfill] \definemathoverarrow [overrightharpoondown] [1pt] [\rightharpoondownfill] \definemathoverarrow [overrightharpoonup] [\rightharpoonupfill] \definemathoverarrow [overleftharpoondown] [1pt] [\leftharpoondownfill] \definemathoverarrow [overleftharpoonup] [\leftharpoonupfill]
$\overtwoheadrightarrow {XYZ}$ $\overtwoheadleftarrow {XYZ}$ $\overrightharpoondown {XYZ}$ $\overrightharpoonup {XYZ}$ $\overleftharpoondown {XYZ}$ $\overleftharpoonup {XYZ}$
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.
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 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. ---- But to sum up: I really like your patch, and I vote for its inclusion. (The most annoying problem is stil open though.) Thanks a lot, Mojca