Simple question,
Why does the following cause a double superscript error?
$$ H^{' '} $$
Removing the spaces $$ H^{''} $$ produces the expected output.
Simple question,
Why does the following cause a double superscript error?
$$ H^{' '} $$
Removing the spaces $$ H^{''} $$ produces the expected output.
' 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}
Example for plain TeX:
$$ H^{\prime\prime} = H'' \neq H^{''} $$
\bye
Because ' acts as superscripted prime, i.e. you can write, e.g., $f'$ instead of $f^\prime$.
H'''is a macro that turns into^{\prime}which is why you get a double superscript in the first case, the second is equivalent toH^{{}^{\prime\prime}}– David Carlisle Jul 03 '14 at 22:46