# Double subscript error in align

What's the reason for the double superscript error?

\nabla = \frac{\partial}{\partial r} \hat{\textbf{\r}} + \frac{1}{r} \frac{\partial}{\partial \phi} \hat{\textbf{\phi}} + \frac{1}{r sin\phi} \frac{\partial}{\partial \theta} \hat{\textbf{\theta}}

• This code will not produce a “double superscript” error, for the simple reason that there's no superscript at all. Aug 16 '15 at 8:46
• How did you (re)define the macro \r? Is that where the double superscript error is originating?
– Mico
Aug 16 '15 at 11:12

This code snippet doesn't bring a double superscript error. align is not used, also no alignment marker &.

However,

• \r would bring an error, I guess you (re)defined it
• you should not use \textbf{\theta} in math context. Instead, use \boldsymbol of amsmath. It even works for bold Greek letters.
• You should use \sin for the sine operator, so it would be upright, not italics like variables s, i, and n. You can even define your own math operators.

A compilable minimal example with those fixes:

\documentclass{article}
\def\r{R}
\usepackage{amsmath}
\begin{document}
$\nabla = \frac{\partial}{\partial r} \hat{\textbf{\r}} + \frac{1}{r} \frac{\partial}{\partial \phi} \hat{\boldsymbol{\phi}} + \frac{1}{r \sin\phi} \frac{\partial}{\partial \theta} \hat{\boldsymbol{\theta}}$
\end{document}