3

I have the following:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

I want this:

\begin{align*}
\Omega_1 &= {\sigma_{1}}^{2} \left( X' B_1' A_1' A_1 B_1 X \right)^{-1} \\
\Omega_2 &= {\sigma_{1}}^{2} \left( X^*' B_2' A_2' A_2 B_2 X^* \right)^{-1}
\end{align*}

\end{document}

When I try to compile it, I get:

! Double superscript.
<recently read> ^

I cannot understand why. Any help?

3
  • 4
    X^*', in math mode ' is equivalent to ^{\prime} plus extra. So X^*' is similar to X^{*}^{\prime}, use X^{*\prime}. Note that the converse works, X'^*
    – daleif
    Commented 21 hours ago
  • @JohnKormylo - You wrote, "Note that {\sigma_{1}}^{2} is equivalent to \sigma_1^2". Not quite, I'm afraid: In the former case, the superscript 2 is not placed above the subscript 1 but, rather, to the right.
    – Mico
    Commented 21 hours ago
  • @Dario - What are you trying to achieve by writing {\sigma_{1}}^{2}, which places the superscript 2 needlessly to the right of \sigma_{1}? Why not write \sigma_{1}^{2}?
    – Mico
    Commented 21 hours ago

1 Answer 1

7

You didn't show the error message as formatted by TeX which is

! Double superscript.
<recently read> ^
                 
l.11 \end{align*}
                 
? 

Math errors in align slightly harder to find than in normal math as for technical reasons the whole environment is read first, so all errors are reported at \end{align}

It often helps to debug by removing the alignment (even if the visual form is then incorrect)

\documentclass{article}
\usepackage{amsmath}

\begin{document}

I want this:

\[
\begin{matrix}
\Omega_1 &= {\sigma_{1}}^{2} \left( X' B_1' A_1' A_1 B_1 X \right)^{-1} \\
\Omega_2 &= {\sigma_{1}}^{2} \left( X^*' B_2' A_2' A_2 B_2 X^* \right)^{-1}
\end{matrix}
\]

\end{document}

produces the error message

! Double superscript.
<recently read> ^
                 
l.11 \Omega_2 &= {\sigma_{1}}^{2} \left( X^*'
                                              B_2' A_2' A_2 B_2 X^* \right)^...

? 

which clearly highlights the exact place the error occurs, X^*' is the same as X^*^{\prime} hence a double superscript.

You could use {X^*}' or X^{*\prime} depending on how you want it to look.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
{X^*}' + X^{*\prime}
\]

\end{document}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.