# Why does \dot over \vec over {\bf E} gives a tilde?

When using AMSmath and trying to put a \dot over a \vec of a bold symbol it works, but subsequent instances have a tilde instead of a vector over the bold symbol, and strangely my partial wrt become bold. If I don't use AMSmath, this works. I have tried many variants with extra brackets or interchanged orders, but nothing seems to fix this bug. Here is a tex snippet that reproduces the problem on the second row, the third row when preceding {\vec E} with \bf produces only tildes instead of vectors, but the \dot make the D not be bold.

Any ideas what I am missing?

\documentclass [12pt] {article}
\usepackage{amsmath,amssymb}

%\let\vec\relax
%\DeclareMathAccent{\vec}{\mathord}{letters}{"7E}
\newcommand{\pdt}[1]{\frac{\partial^{#1}}{\partial t^{#1}}}
\begin{document}

\LARGE
$\vec E \cdot \dot{{\vec D}} = \vec E \cdot \pdt{} (\epsilon \vec E )$

$\vec {\bf E} \cdot \dot {\vec {\bf D}} = \vec {\bf E} \cdot \pdt{} (\epsilon \vec {\bf E} )$

${\bf {\vec E}} \cdot \dot{ {\bf {\vec D}}} = {\bf {\vec E}} \cdot \pdt{} (\epsilon {\bf {\vec E}} )$
\end{document}


The following should work:

\documentclass [12pt] {article}
\usepackage{amsmath,amssymb}

%\let\vec\relax
%\DeclareMathAccent{\vec}{\mathord}{letters}{"7E}
\newcommand{\pdt}[1]{\frac{\partial^{#1}}{\partial t^{#1}}}
\begin{document}

\LARGE
$\vec {E} \cdot \dot{{\vec {D}}} = \vec {E} \cdot \pdt{} (\epsilon \vec {E} )$

$\vec {\mathbf {E}} \cdot \dot {\vec {\mathbf {D}}} = \vec {\mathbf {E}} \cdot \pdt{} (\epsilon \vec {\mathbf {E}} )$

${\vec {\mathbf {E}}} \cdot \dot{{\vec {\mathbf {D}}}} = {\vec {\mathbf {E}}} \cdot \pdt{} (\epsilon {\vec {\mathbf {E}}} )$
\end{document}


PS: Since you are in math mode, it is better to use \mathbf instead of \bf.

As one can extrapolate from the comments and answers (I had to) the problem lies with the order of \vec and \mathbf. (Shouldn't use \bf in math mode.) Both examples are given below.

\documentclass[11pt]{article}
\usepackage{amsmath}

\begin{document}
This is the wrong order and gives a tilda:
$\mathbf{\vec{x}}$\par
This is the right order and gives an arrow:
$\vec{\mathbf{x}}$
\end{document}


• Shouldn't use \bf in text mode either – at least not when using LaTeX. Oct 23 '16 at 10:01