1

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}}

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

1 Answer 1

2

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}

Formula

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.