For some strange reason, this:
\hat{\dot{\bm{\phi}}}
prints the dot and the hat slightly off the left of the phi letter. Any ideas if this can be fixed? thanks. Using bm package for bold symbols.
For some strange reason, this:
\hat{\dot{\bm{\phi}}}
prints the dot and the hat slightly off the left of the phi letter. Any ideas if this can be fixed? thanks. Using bm package for bold symbols.
As to why this happens: TeX handles accents over single characters differently, using the \skewchar of the font. Thus you get nicely aligned math accents only over single characters, and \dot{\bm{\phi}} is already a composed symbol.
If you want double accents, you can use the amsmath or the accents package. However, both packages don't work together well with bm, so the simple \hat{\dot{\bm{\phi}}} won't work with \usepackage{accents}. It took me forever to find out what happens, but here's a fix:
\documentclass{minimal}
\usepackage{bm,accents}
\makeatletter
\newcommand\accbm[1]{\use@mathgroup{\M@OMS}{5}{\bm{#1}}}
\makeatother
\begin{document}
$\hat{\dot{\accbm{\phi}}}$
\end{document}
This gives you
. Thus, whenever you want to put accents over \bmed characters, you just have to use \accbm. I should add a few words of caution: 1. It works with \M@OMS, but I don't know if it's the Right Way. 2. In this example, it works with font family 5 in the \use@mathgroup, but I don't know if it'll always work with 5.
UPDATE: Philippe Goutet's great answer to my question How do I identify the encoding and family of a new math font? provides a solution that determines the font family automatically.

It's easier to get accent positioning right if the accents are bold as well as the base.
Also if \bm does get confused by its argument adding an extra set of {} stops it trying to disassemble the math construct and instead it sets the entire argumant as a sing;e expression (using \boldmath, essentially) this is a lot simpler (but slower).
Note the extra set of braces, and the better accent positioning in row 9.
\documentclass{article}
\usepackage{amsmath}
\usepackage{bm}
\begin{document}
1 $\mathcal{A} \bm{\mathcal{A}}$
2 $\hat{\mathcal{A}} \bm{\hat{\mathcal{A}}}$
3 $\mathcal{\hat{A}} \bm{\mathcal{\hat{A}}}$
4 $\hat{\hat{\mathcal{A}}} \bm{\hat{\hat{\mathcal{A}}}}$
5 $\mathcal{\hat{\hat{A}}} \bm{\mathcal{\hat{\hat{A}}}}$
6 $\phi \bm{\phi}$
7 $\hat{\phi} \bm{\hat{\phi}}$
8 $\hat{\hat{\phi}} \bm{\hat{\hat{\phi}}}$
9 $\hat{\hat{\phi}} \bm{{\hat{\hat{\phi}}}}$
\end{document}
$\mkern4mu\hat{\mkern-4mu\dot{\bm{\phi}}}$
$\skew{3}{\hat}{\skew{3}{\dot}{\bm{\phi}}}$
\mkern4mu should be inserted before the \hat (which I just did). @Herbert: I took the freedom to make this change. Hope you agree.
– Hendrik Vogt
Jan 19 '11 at 10:08
\bm{{\hat{\dot{\phi}}}}. – Philippe Goutet Feb 08 '11 at 21:57