# Issue with displaying unit vectors

I am using the following command to display unit vectors for my report:

\newcommand{\ihat}{\boldsymbol{\hat{\textbf{\i}}}}
\newcommand{\jhat}{\boldsymbol{\hat{\textbf{\j}}}}


This is my result:

What am I doing wrong? Any help is greatly appreciated!

• Could you give a full example, how to obtain such unexpected result, please? – Przemysław Scherwentke Sep 7 '15 at 11:46
• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Symbol 1 Sep 7 '15 at 11:50

In proper method, which you can also see in the log. Try this (memoir class not related, just happens to be the basic class in my editor):

\documentclass[a4paper]{memoir}
\usepackage{amsmath,amssymb,bm,mathtools}

\newcommand{\ihat}{\boldsymbol{\hat{\imath}}}
\newcommand{\jhat}{\boldsymbol{\hat{\jmath}}}

\begin{document}

$\ihat \quad \jhat$

\end{document}


EDIT: If you want them upright, then with the packages I used, you code should work. If not, then as usual on this site, please provide a full minimal example that we can compile and test. Sniplets like this usually does not help much

• Why double \bm? Note that bm.sty redefines \boldsymbol to do \bm. – egreg Sep 7 '15 at 12:08
• @egreg, typo. I never use \boldsymbol. \bm removed – daleif Sep 7 '15 at 12:12

I'm not sure how you're obtaining that strange output, but here's how you can get a (bold) hat over a bold letter.

\documentclass{article}
\usepackage{amsmath,bm}

\begin{document}

\begin{equation*}
\bm{\hat{\imath}}+\bm{\hat{\jmath}}+\bm{\hat{k}}
\end{equation*}

\end{document}


Should the hat not be boldface, switch the positions of \hat and \bm:

\begin{equation*}
\hat{\bm{\imath}}+\hat{\bm{\jmath}}+\hat{\bm{k}}
\end{equation*}