I write unit vectors frequently. Right now, the best thing going for me is to define:
\newcommand{\uvec}[1]{\boldsymbol{\hat{\textbf{#1}}}}
and then do
\uvec{i}
, \uvec{j}
, and \uvec{k}
. I like the results (they're clear enough), but I would prefer no dots for the i
and j
unit vectors. What's a nice, unified way to get that?
I tried \hat{\textbf{\i}}
, and that works ok, as does \hat{\textbf{k}}
. The problem is that \hat{\textbf{\j}}
doesn't work for me. For some reason, I don't get a j
, but some rectangular blob of ink.
\jmath
and \imath
don't work for me, because I don't want italics but bold-face.
So, to sum up:
-
Want bold, not italic
-
Want a hat over the unit vector
-
Want no dot for the
i
orj
unit vectors.
How best to get all this? Thanks very much for your time!
Here's a minimum working example:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\uvec}[1]{\boldsymbol{\hat{\textbf{#1}}}}
\begin{document}
$\uvec{i}, \uvec{j}, \uvec{k}$
\end{document}
Please feel free to suggest the inclusion of other packages.
Best Answer
You have to use
\i
and\j
, which means you need to switch to text mode. However, there is a problem that text fonts in math mode inherit the attributes of the context, so, for example,$\textbf{\i}$
would give a bold italic dotless i in a theorem statement.You can type both
\uveci
and\uvec{i}
for uniformity, the same for a ājā.You can't use the
times
package for this; first of all because it's obsolete, but even its substitute, that ismathptmx
, doesn't provide a dotless j. You can usenewtxtext
andnewtxmath
:With newTX you also have the possibility of getting upright lowercase Greek letters. Here's how to do it; I also added the possibility of typing
\uvec{\alpha}
. Please, be aware of the fact that the argument of\uvec
must be a single Latin character (not\i
or\j
, which are unnecessary and illegal for the macro) or a single Greek symbol.Note
The Times font is by no means necessary and the code works as well with the standard fonts.