[Tex/LaTex] Vectors and indices

spacingsuperscriptsvector

I'm trying to write a vector, r, which is raised to the power two.
Currently this is what I'm using

$\vec{r}_{i}^{2}$

but the vector arrow and power of two are overlapping. Is there anyway I could change the spacing in the power, or should I do it another way?

Best Answer

i nearly always agree with david, but i think a little less space is called for:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[
\vec{r}_{i}^{2}
\quad
{\vec{r}_{i}}^{\,2}
\]

\end{document}

output of example code

Related Question