5

Simple question,

Why does the following cause a double superscript error?

$$ H^{' '} $$

Removing the spaces $$ H^{''} $$ produces the expected output.

  • 3
    The markup should be H'' ' is a macro that turns into ^{\prime} which is why you get a double superscript in the first case, the second is equivalent to H^{{}^{\prime\prime}} – David Carlisle Jul 3 '14 at 22:46
  • Welcome to TeX.SX! Please read the following Q&A: tex.stackexchange.com/q/503 – LaRiFaRi Jul 3 '14 at 22:46
6

' is made active in math mode both in plain TeX and LaTeX. It puts \prime at the superscript position: ^{\prime}. However, consecutive ' are quite common and would raise a double superscript error. Therefore the macro behind ' checks the next token, whether it is again a '. If yes, the following ' is added to the superscript. The number of consecutive ' is not limited, but any other token as your space token stops it.

Since ' is putting \prime at the superscript position already. Putting ' into a superscript would move the \prime too high:

\documentclass{article}
\begin{document}
\[
  H^{\prime\prime} = H'' \neq H^{''}
\]
\end{document}

Result

Example for plain TeX:

$$ H^{\prime\prime} = H'' \neq H^{''} $$
\bye
| improve this answer | |
0

Because ' acts as superscripted prime, i.e. you can write, e.g., $f'$ instead of $f^\prime$.

| improve this answer | |

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.