\vec
but this command works for only single letter vectors but what about multiple character vectors?Math & Science ⇒ Extended Vector Arrow
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Extended Vector Arrow
How do you put an arrow above a vector as in vector AB or vector ABC? I have used
NEW: TikZ book now 40% off at Amazon.com for a short time.

Extended Vector Arrow
hi (:
Use this.
or the package esvect
greez tommy
Use this.
Code: Select all
\documentclass[12pt]{article}
\begin{document}
$$\overrightarrow{ABC}$$
$$\overrightarrow{ABCDEFG}$$
\end{document}
greez tommy

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Extended Vector Arrow
Never ever usetommytex wrote:[…] Use this.[…]Code: Select all
\documentclass[12pt]{article} \begin{document} $$\overrightarrow{ABC}$$ $$\overrightarrow{ABCDEFG}$$ \end{document}
$$ … $$
for unnumbered equations (look here for the reason).Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Extended Vector Arrow
sorrry thorsten
i hoope i can give a better answer next time
tommy

i hoope i can give a better answer next time

tommy
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Extended Vector Arrow
the problem with
\overrightarrow
is that the arrow touches the top borders of the letters. Are there packages to customize vector arrows ?
Last edited by cgnieder on Tue Apr 09, 2013 9:44 pm, edited 1 time in total.
Extended Vector Arrow
This depends on the font you're using:ghostanime2001 wrote:the problem with\overrightarrow
is that the arrow touches the top borders of the letters.
Code: Select all
\documentclass[margin=.75cm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\begin{document}
$\overrightarrow{AB}$
\end{document}
Code: Select all
\documentclass[margin=.75cm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage{amsmath}
\usepackage[libertine]{newtxmath}
\begin{document}
$\overrightarrow{AB}$
\end{document}
Code: Select all
\documentclass[margin=.75cm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{MnSymbol}
\begin{document}
$\overrightarrow{AB}$
\end{document}
site moderator & package author
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Re: Extended Vector Arrow
can the arrow be moved just a little bit upward ?
Extended Vector Arrow
actually i looked it up and found some nice usage of "esvect" where it works indeed.... using a command called \vv
unfortunately, the page is in german but i think you can get its meaning anyway
see http://www.latex-pfeile.de/ you will have to scroll down a bit
unfortunately, the page is in german but i think you can get its meaning anyway
see http://www.latex-pfeile.de/ you will have to scroll down a bit
- Attachments
-
- a_esvect_vec_vvv.jpg (2.51 KiB) Viewed 89420 times
-
- f_esvect_vec_vvv.jpg (2.52 KiB) Viewed 89420 times
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Re: Extended Vector Arrow
that's what I wanted to use but if only it can be moved up a little, what is the full command for \vv ? like I know it has to be made up from other commands, so maybe there's a parameter for height and if that could be changed the height of the arrow could also be changed.
Extended Vector Arrow
ghostanime2001 wrote:what is the full command for\vv
?
That actually doesn't tell you much, except that it has a starred variant:
Code: Select all
\def\vv{\@ifstar{\vvstar}{\vecteur}}
\vvstar
calls itself \vecteur
which in turn calls ... The code of esvect.sty
is only 32 lines long, you could look it up yourself.The macro that actually places the arrow over the letters is the following:ghostanime2001 wrote:maybe there's a parameter for height and if that could be changed the height of the arrow could also be changed.
Code: Select all
\def\overvect@#1#2#3{\vbox{\ialign{##\crcr%
\noalign{\kern-.7pt\nointerlineskip}#1#2\crcr%
\noalign{\kern-.3pt\nointerlineskip}$\m@th\hfil#2#3\hfil$\crcr}}}
-.3pt
. Changing this value shifts the arrow vertically, so you can play until you find something you like:Code: Select all
\documentclass[margin=5pt]{standalone}
\usepackage{esvect}
\begin{document}
% original:
$\vv{AB}$
% changed definition:
\makeatletter
\def\overvect@#1#2#3{\vbox{\ialign{##\crcr%
\noalign{\kern-.7pt\nointerlineskip}#1#2\crcr%
\noalign{\kern3pt\nointerlineskip}$\m@th\hfil#2#3\hfil$\crcr}}}
\makeatother
$\vv{AB}$
\end{document}
site moderator & package author