Latest news 2019-11-04: The giveaway of two signed copies of “Quack, quack, quack. Give my hat back!” has closed and the winning entrants have been selected. Thank you to everyone who took part.

9.4.11 Vectors

A variable representing a vector can be typeset using the command:

\vec{<variable>}

Example:

Vectors are often typeset in bold. This can be done by redefining the \vec command. You could use \mathbf, for example:

However, as you may have noticed, the Greek letter has not come out in bold. Here's an alternative (using \boldsymbol defined in the amsfonts package):

Located (or position) vectors, on the other hand, are usually typeset with a right arrow, but the default definition of \vec produces an arrow that is too small:

Instead, use \overrightarrow (Table 9.10):

You might prefer to define separate commands for a located vector and a vector variable.

Example:

In the preamble, define \lvec for a located vector and \bvec for a vector variable:

Later in the document:

Let $\bvec{u}=(x, y)$ represent $\lvec{OP}$, then
$\lVert \bvec{u} \rVert = \sqrt{x^2 + y^2}$

Exercise 23: Maths: Vectors and Arrays

Try to produce the following: