Vector arrow (v⃗) in LaTeX
\vec{v} draws a small right-pointing arrow over a symbol to mark it as a vector. For an arrow spanning several symbols, such as a directed segment, use \overrightarrow{...}; bold (\mathbf{v}) is a common alternative.
LaTeX command
\vec{v}Not the symbol you meant? Draw it to find the command →
\vec{v} is the standard math-mode accent for a vector: it places a short arrow over a single letter. It needs no package and renders in KaTeX. Many texts instead denote vectors with upright bold, \mathbf{v}, or bold italic, \boldsymbol{v}; all three are widely accepted, so pick one convention and keep it consistent.
Like other accents, \vec is sized for one character. To draw an arrow over two or more symbols, such as the directed segment from A to B, use \overrightarrow{AB}, which stretches to fit. There is also \overleftarrow for the opposite direction and \overleftrightarrow for a line through two points.
In physics and quick notes \vec is convenient, while \mathbf reads more cleanly in print and avoids clutter over subscripts. Unit vectors are often written with a hat, \hat{n}, rather than an arrow. Whichever you choose, the accent is decorative and does not affect how the symbol behaves in an equation.
Other forms
\overrightarrow{AB}arrow over several symbols\mathbf{v}bold vector notationExamples
$\vec{v} = (x, y, z)$a vector
$\overrightarrow{AB}$the directed segment from A to B
$\vec{a} \cdot \vec{b} = |\vec{a}|\,|\vec{b}|\cos\theta$a dot product
$\mathbf{F} = m\mathbf{a}$bold vector notation
$\vec{r}(t) = \vec{r}_0 + t\vec{v}$a parametric line
Tips and common mistakes
\vec{v}sizes to one symbol; for a directed segment or multi-letter label use\overrightarrow{AB}so the arrow spans the whole thing.- Choose one vector convention (
\vec,\mathbf, or\boldsymbol) and use it throughout a document. \mathbfgives upright bold and suits Latin letters; for a bold Greek vector use\boldsymbol{\omega}, since\mathbfwill not bold lowercase Greek.- A unit vector is usually a hat,
\hat{n}, rather than an arrow. - Keep subscripts outside the accent:
\vec{v}_1marks v then subscripts it, which is normally what you want.
Working from handwritten notes?
LatexNotes turns a photo or PDF of handwritten mathematics into clean, compilable LaTeX - graphs and all. Free to try, no sign-up.
Convert your maths to LaTeX →FAQ
How do I write a vector with an arrow on top in LaTeX?
Use for a single symbol. The arrow renders over the letter with no extra package.
How do I draw an arrow over two letters like AB?
Use \overrightarrow, for example . \vec only fits one character and would leave the arrow too short.
Should I use \vec or \mathbf for vectors?
Both are standard. \vec adds an arrow and is common in physics and handwriting; \mathbf makes the letter bold and is cleaner in print. Pick one and stay consistent.