About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Latest news 2019-12-05: new blog post "RSS Feeds and Other Notifications."


9.4.11 Vectors

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

\vec{<variable>}

Example:

\[ \vec{x} \]

Image: x with a small right arrow above it.

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

Image: upright bold x centred dot xi equals z

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

\renewcommand{\vec}[1]{\boldsymbol{#1}}
\[
  \vec{x}\cdot\vec{\xi} = z
\]

As before but x and xi in italic bold

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:

\[ \vec{OP} \]

Image: the letters O P with a small right arrow
above them.

Instead, use \overrightarrow (Table 9.10):

\[ \overrightarrow{OP} \]

Image: as above but with a longer arrow that spans
both letters.

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}
\]

Image: the vector u appeas in italic bold and the
letters O P are as above.

Exercise 23: Maths: Vectors and Arrays

Try to produce the following:

As before, you can download or view the solution.


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs