Here's something strange:
\documentclass[letterpaper]{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{gensymb}
\DeclareMathOperator{\Vi}{\vec{i}}
\begin{document}
$\Vi$
$\vec{i}$
\end{document}
When I compile this, only the second one produces the desired result. The other gives me a tilde over the i! What gives?
Best Answer
The
\DeclareMathOperator
function is for defining a quite narrow kind of objects; for instance\log
,\exp
,\sin
or\max
use (an equivalent form of) it. So it's for defining function symbols that should consist of letters in the same shape as normal text, as opposed to math italic.Basically
\DeclareMathOperator{\foo}{blurb}
does something like(I just omit irrelevant technical complications). The
\mathop
bit is what produces the peculiar spacing around operator names; for instance there is a space in$\log x$
, but not in $\log(xy)$. Of course,
\mathrm` is what selects upright letters.The input
produces
but as soon as we uncomment the loading of
amsmath
we getThe tilde instead of an arrow is a “feature”1 in
amsmath
, then.What you need is
or, maybe better,
where the “i” loses its dot.
1 It's not the only “feature” of
amsmath
related to math accents. The word “feature” is used in its common meaning of “bug”.