The LaTeX command for vec is \vec{x} (vector arrow).
\vec{x}Writing a paper? The table generator and the BibTeX cleaner are one click away, no account.
| Command | Package | Use it when |
|---|---|---|
\vec{v} recommended | none | Arrow over one letter, common in physics. |
\mathbf{v} | none | Bold upright, common in engineering and linear algebra. |
\boldsymbol{\mu} | amsmath | Bold Greek or bold italic letters. |
\overrightarrow{AB} | none | Arrow over several letters: the vector from A to B. |
Write \vec{x} inside math mode, that is between $…$ for inline math or in a \[ … \] or equation block for display math. It is part of core LaTeX math, so no extra package is required.
$\vec{F} = m \vec{a}$Open this example in the live preview: it renders as you type, with no compiler and no signup.
\underline{x}\hat{x}\tilde{x}\bar{x}\overline{x}\overbrace{x}^{n}\underbrace{x}_{n}\dot{x}\ddot{x}\acute{x}\grave{x}\check{x}\breve{x}\mathring{x}Math accents in LaTeX: the full table or search all 350+ LaTeX symbols.
Use \vec{x} in math mode; it needs no extra package. For example, $\vec{F} = m \vec{a}$.
None: \vec{x} is built into LaTeX, so no extra package is required.
\vec draws a short arrow sized for one letter; over AB use \overrightarrow. And \mathbf leaves Greek letters thin.