[Tex/LaTex] \dot{\vec{\hat{x}}}} fails to compile with svjour3

sv-classesvector

The title says it all. I would like to typeset the time-derivative of a vector whose symbol shall be \hat{x}. The documentclass svjour3 is used in Springer journals. The following MWE reproduces the behaviour in the article class:

\documentclass{article}
\if@mathematic
   \def\vec#1{\ensuremath{\mathchoice
                     {\mbox{\boldmath$\displaystyle\mathbf{#1}$}}
                     {\mbox{\boldmath$\textstyle\mathbf{#1}$}}
                     {\mbox{\boldmath$\scriptstyle\mathbf{#1}$}}
                     {\mbox{\boldmath$\scriptscriptstyle\mathbf{#1}$}}}}
\else
   \def\vec#1{\ensuremath{\mathchoice
                     {\mbox{\boldmath$\displaystyle#1$}}
                     {\mbox{\boldmath$\textstyle#1$}}
                     {\mbox{\boldmath$\scriptstyle#1$}}
                     {\mbox{\boldmath$\scriptscriptstyle#1$}}}}
\fi

\usepackage{amsmath}

\begin{document}
\begin{equation}
    \dot{\vec{\hat{x}}}  % Failure
    \vec{\dot{\hat{x}}}  % OK
    \dot{\hat{\vec{x}}}  % OK
\end{equation}
\end{document}

Pdflatex output contains

! Undefined control sequence.
\macc@adjust ->\dimen@ \macc@kerna 
                                   \advance \dimen@ \macc@kernb \kern -\dimen@ 

How can I typeset such a vector in the svjour3 class?

Best Answer

The svjour3 class uses a wrong way for redefining \vec.

Just load the class and do

\let\vec\mathbf

Full example

\documentclass{svjour3}
\usepackage{amsmath}

\let\vec\mathbf % fix svjour3 wrong definition

\begin{document}

\begin{equation}
    \vec{\dot{\hat{x}}}
    \dot{\vec{\hat{x}}}
    \dot{\hat{\vec{x}}}
\end{equation}

\end{document}

enter image description here

If you prefer bold italic vectors, add \usepackage{bm} and do

\let\vec\bm

instead.