 LaTeX is a very flexible program for typesetting math, but sometimes figuring out how to get the effect you want can be tricky. Most of the stock math commands are written for typesetting math or computer science papers for academic journals, so you might need to dig deeper into LaTeX commands to get the vector notation styles that are common in physics textbooks and articles.

This post shows how to typeset a LaTeX vector with an arrow, a hat, or bold.

## LaTeX Vector With an Arrow

The arrow vector notation is the standard in LaTeX, just use the \vec command in math mode.

This:

$\dot{\vec{p}} = m\vec{v}$

Generates this: ## LaTeX Vectors With Hats

Using the \hat command in LaTeX generates a caret commonly used for unit vectors.

This:

$\hat{k’} = 0.5\hat{k} + 0.2\hat{\jmath}$

Generates this: Note that I used \jmath in the last statement. This gets rid of the dot over the j which screws up the placement of the caret. A similar command, \imath is also available for i.

## Bold LaTeX Vector

This command will make \vec typeset LaTeX vectors using bold instead of an arrow:

\renewcommand{\vec}{\mathbf{#1}}

Put that in the header of the LaTeX file, then $\vec{v} = 5\hat{k}$ generates: If you like bold unit vectors, these commands will also modify the \hat command:

\let\oldhat\hat
\renewcommand{\hat}{\oldhat{\mathbf{#1}}}

Now $\vec{v} = 5\hat{k}$ generates: My other post about bold LaTeX vectors has some great tips in the comments about using this with Greek letters.

Bold is my favorite style for vectors in LaTeX articles, but the decorated styles can look good in a well-printed book. Leave your favorite styles and tips in the comments!