Dot notation for derivative of a vector
I’ve only ever seen it written with the dot above the arrow; never below it. As @PeterGrill pointed out, this might be a good case to use boldface instead of arrows.
That said, I personally feel that arrow-vectors are under-used in TeX because the default implementation (\vec
) looks awful. With some tweaks, it can be made to look better.
About TeX's \vec macro
One reason \vec
looks bad is because the arrows are always the same width. Notice, for example, how \vec{w}
and \vec{m}
look:
The ‘m’ looks like it’s wearing a t-shirt three sizes too small, and the ‘w’ looks like it's having trouble balancing a plate on its head.
Let’s look at a more real-life example. Notice how the arrow sits too far to the right of the ‘r’ and ‘v’ below. Worse yet, the arrowheads are crooked, and the dots atop them are too high and are mis-aligned:
Alternative 1 — esvect's \vv macro
To improve upon this, the LaTeX2e package esvect
provides 8 new variants of vector styles. Shown below is style b
, which in my opinion looks the best of the bunch. You can write \vv{PQ}
and the arrows are automatically drawn as wide as needed. However, note that the arrows are far too wide for vector variables, and also note that the horizontal bar of the arrow is composed of multiple overlapping line segments, resulting in visible anti-aliasing rendering artifacts when viewed on the screen:
I don’t recommend using \vv
unless you really like the super-wide arrows. You might also want to check out the other 7 variants.
Alternative 2 — new macro \xvec
To address the shortcomings of \vec
and \vv
, here is a new command called \xvec
(for lack of a better name) which measures its argument automatically and provides appropriate alignment for dots:
There are three forms:
\xvec{}
makes an unadorned vector variable.\xvec[.]{}
makes a single-dotted vector variable.\xvec[:]{}
makes a double-dotted vector variable.
The sample file (included at the bottom of this reply) includes definitions to override TeX's default \vec
(if you prefer) and also provides shortcuts \dvec
and \ddvec
for single- and double-dotted vectors, respectively.
Here are the 26 letters ‘a’ to ‘z’:
I’m not terribly happy with the ‘i’ and the ‘j’, but these are almost always typeset in boldface anyway—especially when used with a hat to denote unit vectors.
Source code with examples used in this answer
\documentclass{article}
\usepackage[T1]{fontenc} % For correct {}s in \texttt
\usepackage{amsmath} % For better \dot placement
\usepackage[b]{esvect} % For \vv
\usepackage{tikz} % For arrow and dots in \xvec
% --- Macro \xvec
\makeatletter
\newlength\xvec@height%
\newlength\xvec@depth%
\newlength\xvec@width%
\newcommand{\xvec}[2][]{%
\ifmmode%
\settoheight{\xvec@height}{$#2$}%
\settodepth{\xvec@depth}{$#2$}%
\settowidth{\xvec@width}{$#2$}%
\else%
\settoheight{\xvec@height}{#2}%
\settodepth{\xvec@depth}{#2}%
\settowidth{\xvec@width}{#2}%
\fi%
\def\xvec@arg{#1}%
\def\xvec@dd{:}%
\def\xvec@d{.}%
\raisebox{.2ex}{\raisebox{\xvec@height}{\rlap{%
\kern.05em% (Because left edge of drawing is at .05em)
\begin{tikzpicture}[scale=1]
\pgfsetroundcap
\draw (.05em,0)--(\[email protected],0);
\draw (\[email protected],0)--(\[email protected], .075em);
\draw (\[email protected],0)--(\[email protected],-.075em);
\ifx\xvec@arg\xvec@d%
\fill(\xvec@width*.45,.5ex) circle (.5pt);%
\else\ifx\xvec@arg\xvec@dd%
\fill(\xvec@width*.30,.5ex) circle (.5pt);%
\fill(\xvec@width*.65,.5ex) circle (.5pt);%
\fi\fi%
\end{tikzpicture}%
}}}%
#2%
}
\makeatother
% --- Override \vec with an invocation of \xvec.
\let\stdvec\vec
\renewcommand{\vec}[1]{\xvec[]{#1}}
% --- Define \dvec and \ddvec for dotted and double-dotted vectors.
\newcommand{\dvec}[1]{\xvec[.]{#1}}
\newcommand{\ddvec}[1]{\xvec[:]{#1}}
\begin{document}
% --- w and m look terrible with TeX's standard \vec macro
$\stdvec{w}~\stdvec{m}$\par
\vskip2em
% --- Table comparing \vec, \vv, and \xvec
\begin{tabular}{rcc}
\texttt{\scriptsize\char92 vec} &
$\stdvec{r} = \frac{1}{2}\dot{\stdvec{v}}t^2 + \stdvec{v}t$ &
$\stdvec{v}~\dot{\stdvec{v}}~\ddot{\stdvec{v}}$ \\[.75em]
\texttt{\scriptsize\char92 vv} &
$\vv{r} = \frac{1}{2}\dot{\vv{v}}t^2 + \vv{v}t$ &
$\vv{v}~\dot{\vv{v}}~\ddot{\vv{v}}$ \\[.75em]
\texttt{\scriptsize\char92 xvec} &
$\vec{r} = \frac{1}{2}\dvec{v}t^2 + \vec{v}t$ &
$\xvec{v}~\xvec[.]{v}~\xvec[:]{v}$ \\[.75em]
\end{tabular}\vskip1em
% --- Table showing \xvec, \xvec[.], and \xvec[:]
\begin{tabular}{ccc}
\texttt{\tiny\char92 xvec\{v\}} &
\texttt{\tiny\char92 xvec[.]\{v\}} &
\texttt{\tiny\char92 xvec[:]\{v\}} \\[.75ex]
$\xvec{v}$ &
$\xvec[.]{v}$ &
$\xvec[:]{v}$ \\[-.5ex]
\texttt{\tiny\char92 vec\{v\}} &
\texttt{\tiny\char92 dvec\{v\}} &
\texttt{\tiny\char92 ddvec\{v\}} \\[.75ex]
\end{tabular}\vskip2em
% --- Lowercase letters a to z
$\vec{a}~\vec{b}~\vec{c}~\vec{d}~\vec{e}~\vec{f}~\vec{g}%
~\vec{h}~\vec{\imath}~\vec{\jmath}~\vec{k}~\vec{l}~\vec{m}%
~\vec{n}~\vec{o}~\vec{p}~\vec{q}~\vec{r}~\vec{s}~\vec{t}~\vec{u}%
~\vec{v}~\vec{w}~\vec{x}~\vec{y}~\vec{z}$\par
\end{document}
Caveats
- I have only proofed this on the screen; you may need to tweak things for print.
- This implementation of
\xvec
is intended for\textstyle
and\displaystyle
sizes only; it will not work properly for\scriptstyle
and\scriptscriptstyle
.
Proper vector/tensor notation in advanced dynamics handbooks and journals is still in a state of total chaos. Everyone is using his or her own undocumented notation.
The one that I have found that works the best for me is by Hassenpflug (1993) and Hassenpflug (1995). It is unfortunately very difficult to implement it in Latex (or in Word). An exercise to the reader: Typeset the following simple time derivative of a vector with respect to base s ;-)
The mattens package was developed to implement the Hassenpflug notation
\usepackage{mattens}
\begin{align*}
\aS{x} &= \aSb{E}_s \cdot \bS{x}^s \\
\aS[\dot]{x} &= \aSb{E}_s \cdot
\left[
\bS[\dot]{x}^s + \bS{\omega}^s\times \bS{x}^s
\right]
\end{align*}
When you are giving class and writing on the blackboard you cannot use bold letters (so much for the bold vector notation). The noformat
option for mattens
gives
EDIT: The arrows can look a lot better with other fonts, e.g. Luicida