Discussion:
Q: Left pointing \vec ?
Add Reply
markus
2005-01-02 19:40:05 UTC
Reply
Permalink
Hello LaTeX'ers,
<-- -->
E and E
of course this can be done with
\newcommand{\leftvect}[1]{\stackrel{\leftarrow}{#1}}
\newcommand{\rightvect}[1]{\stackrel{\rightarrow}{#1}}
but I find the arrow used by \vec much nicer. Is there a way to have
a simular
arrow as \vec uses pointing left ?
Thanks a lot for all help,
Well, better late (11 years ;-) than never:

I found that so far the following works quite well for me:

\usepackage{graphicx}
\newcommand{\lvec}[1]{\,\,\reflectbox{$\vec{\reflectbox{$\!\!#1$}}$}}

However, the spacing is rather manual and may not fit in all cases/for
all font sizes. Note that changes done with \reflectbox and \rotatebox
are not shown in some dvi-Viewers. Create ps/pdf first.

Regards,

Markus

PS: Some keywords for those who -- like me -- searched one or more
hours to find a solution online:
This code provides a way to draw \vec in LaTeX from right to left, like
\leftarrow but as an accent. I did not find a way to solve this with
some \DeclareMathAccent command, since the character is missing.
\overleftarrow is not convenient for inverting \vec, since it is too
large. Flipping \vec may also work with the help of the
accents-package.
markus
2005-01-02 20:46:39 UTC
Reply
Permalink
Update to my previous post: The above spacing fails at some places,
since the indenting with "\," will not work everywhere. Inserting an
empty \rule helps:

\newcommand{\lvec}[1]{\rule{0mm}{0mm}\,\,\reflectbox{$\vec{\reflectbox{$\!\!#1$}}$}}
Markus
Julian V. Noble
2005-01-02 21:56:07 UTC
Reply
Permalink
Post by markus
Hello LaTeX'ers,
<-- -->
E and E
of course this can be done with
\newcommand{\leftvect}[1]{\stackrel{\leftarrow}{#1}}
\newcommand{\rightvect}[1]{\stackrel{\rightarrow}{#1}}
but I find the arrow used by \vec much nicer. Is there a way to have
a simular
arrow as \vec uses pointing left ?
Thanks a lot for all help,
[ deleted ]

This is how mathType does it:


{\mathord{\buildrel{\lower3pt\hbox{$\scriptscriptstyle\leftarrow$}}\over E} }
--
Julian V. Noble
Professor Emeritus of Physics
***@lessspamformother.virginia.edu
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"For there was never yet philosopher that could endure the
toothache patiently."

-- Wm. Shakespeare, Much Ado about Nothing. Act v. Sc. 1.
markus
2005-01-04 09:11:35 UTC
Reply
Permalink
...
{\mathord{\buildrel{\lower3pt\hbox{$\scriptscriptstyle\leftarrow$}}\over
E} }
Thanks. Actually I was looking for something like \lower as well!

However, I think that the placement of the arrow with \vec is somewhat
nicer. \vec can also scale down to scriptscriptsize, while the above
code cannot produce smaller arrows. My final version of \lvec which
supports all math styles (font sizes) is:

\newcommand{\lvec}[1]{\rule{0mm}{0mm}\,\,\mathchoice%
{\reflectbox{$\displaystyle\vec{\reflectbox{$\displaystyle\!\!#1$}}$}}
{\reflectbox{$\vec{\reflectbox{$\!\!#1$}}$}}
{\reflectbox{$\scriptstyle\vec{\reflectbox{$\scriptstyle\!\!#1$}}$}}
{\reflectbox{$\scriptscriptstyle\vec{\reflectbox{$\scriptscriptstyle\!\!#1$}}$}}
}

Of course the downside of this solution is that it requires functions
from the graphicx package which do not display correctly in dvi (at
least with my viewers kdvi and xdvi). But results in ps and pdf are
rather nice.

Markus
m***@backbase.com
2018-11-20 14:47:53 UTC
Reply
Permalink
Hello Markus,

Well, better late (13 years ;-) than never, but thanks a lot for your answer!

-- Marcel
Post by markus
Hello LaTeX'ers,
<-- -->
E and E
of course this can be done with
\newcommand{\leftvect}[1]{\stackrel{\leftarrow}{#1}}
\newcommand{\rightvect}[1]{\stackrel{\rightarrow}{#1}}
but I find the arrow used by \vec much nicer. Is there a way to have
a simular
arrow as \vec uses pointing left ?
Thanks a lot for all help,
\usepackage{graphicx}
\newcommand{\lvec}[1]{\,\,\reflectbox{$\vec{\reflectbox{$\!\!#1$}}$}}
However, the spacing is rather manual and may not fit in all cases/for
all font sizes. Note that changes done with \reflectbox and \rotatebox
are not shown in some dvi-Viewers. Create ps/pdf first.
Regards,
Markus
PS: Some keywords for those who -- like me -- searched one or more
This code provides a way to draw \vec in LaTeX from right to left, like
\leftarrow but as an accent. I did not find a way to solve this with
some \DeclareMathAccent command, since the character is missing.
\overleftarrow is not convenient for inverting \vec, since it is too
large. Flipping \vec may also work with the help of the
accents-package.
Loading...