[Tex/LaTex] Dot notation for derivative of a vector


If I want to use the dot notation for the time derivative of a vector is better (more common) to put the dot over the vector, or the other way around

  1. \dot{\vec{v}}

    dot over vec

  2. \vec{\dot{v}}

    vec over dot

The first says the rate of change of the vector components, and the second says a vector made from the component rates.

Best Answer

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:

  1. \xvec{} makes an unadorned vector variable.
  2. \xvec[.]{} makes a single-dotted vector variable.
  3. \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


\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
    \kern.05em%  (Because left edge of drawing is at .05em)
    \draw (.05em,0)--(\xvec@width-.05em,0);
    \draw (\xvec@width-.05em,0)--(\xvec@width-.15em, .075em);
    \draw (\xvec@width-.05em,0)--(\xvec@width-.15em,-.075em);
      \fill(\xvec@width*.45,.5ex) circle (.5pt);%
      \fill(\xvec@width*.30,.5ex) circle (.5pt);%
      \fill(\xvec@width*.65,.5ex) circle (.5pt);%

% --- Override \vec with an invocation of \xvec.
% --- Define \dvec and \ddvec for dotted and double-dotted vectors.


% --- w and m look terrible with TeX's standard \vec macro

% --- Table comparing \vec, \vv, and \xvec
  \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]

% --- Table showing \xvec, \xvec[.], and \xvec[:]
  \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]

% --- Lowercase letters a to z



  1. I have only proofed this on the screen; you may need to tweak things for print.
  2. This implementation of \xvec is intended for \textstyle and \displaystyle sizes only; it will not work properly for \scriptstyle and \scriptscriptstyle.

Related Question