Instead of changing to \overrightarrow{}
, which uses a usual extensible arrow and puts it above the argument, I would like to get an extensible \vec{}
symbol. My intention is to obtain a new command \vect{}
, for instance, which is exactly the same as \overrightarrow{}
but the head is the \vec
symbol (and the extensible part is done with the aproppiate ā\relbar
sā, which I don't know).
In my case I'm using kpfonts
package.
\documentclass{scrartcl}
\usepackage{kpfonts}
\newcommand*{\vv}[1]{\vec{\mkern0mu#1}}
\begin{document}
\[
\vec u,\ \vv u,\ \vv{OA},\ \vv{BC},\ \overrightarrow{AB}
\]
\end{document}
I defined the \vv{}
command because the usual \vec
gives you a misaligned arrow.
EDIT:
As @GonzaloMedina pointed, there exists the esvect
package. But, in my opinion, it doesn't provide any arrow with a head matching the style of kpfonts
.
Best Answer
Here I introduce
\xshlongvec
that takes an optional and mandatory argument. The mandatory is the text over which to lay the\vec
. The optional is a number which represents the rightward kern (in points) applied to the vec arrow, since as the OP points out, the kerning of\vec
is not the best.In this MWE, I use the
kpfonts
mentioned by the OP. I first give the unaltered\vec
followed by two instances of\xshlongvec
. The one flaw that I note is that the left end of the arrow is not slanted like\vec
, but is square as the result of being created by a\rule
.Thanks to Phillipe for pointing out a deficiency in the original answer, since repaired.
This EDITED solution below works across math styles, by using the
scalerel
package.