[Tex/LaTex] Why does \dot over \vec over {\bf E} gives a tilde

amsmathboldvector

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}

Best Answer

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}

enter image description here

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