# MandysNotes

Monday, 15 September 2014 00:00

## Vectors in Latex

By  Gideon
Rate this item
(4 votes)

The basic vector command in Latex is

$$\vec{v} :=$$      \vec{v}

You can also use the command \overrightarrow

$$\overrightarrow{v} :=$$ \overrightarrow{v}

This is useful for long expressions such as:

$$\overrightarrow{\alpha (V \cdot \hat{B}) B} :=$$ \overrightarrow{\alpha (V \cdot \hat{B}) B}

The \overleftarrow command is useful for making vectors with arrows that point to the left:

$$\overleftarrow{A} :=$$   \overleftarrow{A}

The \overleftrightarrow command creates vectors with arrows that point in both directions.

This is useful for writing, for example, the probability current in Dirac theory:

$$\overleftrightarrow{\partial}:=$$  \overleftrightarrow{\partial}

To make the Dirac vectors, bras and kets, used in quantum theory, you need to define commands in the pramble of your Latex document.

\newcommand{\ket}[1]{\ensuremath{\left|#1\right\rangle}} % Dirac Kets

\newcommand{\bra}[1]{\ensuremath{\left\langle #1 \right|}} % Dirac Bras

\newcommand{\braket}[2]{\ensuremath{\left\langle #1 | #2 \right\rangle}} % Dirac Braket

For example, the code below:

\text{Dirac bra vector: } \bra{A}

\text{Dirac ket vector: } \ket{A}

\text{Dirac Bracket: } \braket{A}{A}

will display as:

Read 2813 times Last modified on Monday, 15 September 2014 15:53
Login to post comments