Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm a relative beginner with Lyx. When I type in this code I'm hoping for T' to be followed by superscripts and subscripts. Instead I get a "double superscript" error when I try to view the pdf

\[
T'_{\alpha_{1}\alpha_{2}\ldots\alpha_{n}}^{\mu_{1}\mu_{2}\ldots\mu_{m}}
\]

Any idea how I can fix this?

share|improve this question
add comment

3 Answers

up vote 13 down vote accepted

You can insert \prime symbol as part of the superscript ^{...}, rather than having "two superscripts":

enter image description here

\documentclass{article}
\begin{document}
\[
  T_{\alpha_{1}\alpha_{2}\ldots\alpha_{n}}^{\prime\mu_{1}\mu_{2}\ldots\mu_{m}}
\]
\end{document} 
share|improve this answer
    
Thank you everyone. This was the solution that worked best for me. \prime gives a nice clear symbol as well, much nicer than '. –  Peter4075 Oct 20 '11 at 18:53
add comment

' in math mode expands to ^\prime, so your code is equivalent to T^{\prime}_{...}^{...}, which explains the error you get. You can either swap sub- and superscripts to be T'^{...}_{...} (' is defined in a way that merges it with an adjacent superscript), or use \prime inside the superscript as suggested in Werner's answer, so both

T'^{\mu_{1}\mu_{2}\ldots\mu_{m}}_{\alpha_{1}\alpha_{2}\ldots\alpha_{n}}

and

T_{\alpha_{1}\alpha_{2}\ldots\alpha_{n}}^{\prime\mu_{1}\mu_{2}\ldots\mu_{m}}

are valid.

share|improve this answer
add comment

In mathmode, ' acts like ^\prime. So you have two superscripts, which isn't allowed. One way around this is to group the T' like so:

\[
{T'}_{\alpha_{1}\alpha_{2}\ldots\alpha_{n}}^{\mu_{1}\mu_{2}\ldots\mu_{m}}
\]

But this doesn't look good. I'd suggest maybe replacing T' with some other variable name…

As Khaled has pointed out, this solution breaks the horizontal positioning of subscripts:

broken placement of subscripts

The top one is my grouping solution, the bottom is doing it The Right Way. Given the special service the prime superscript performs (marking out T' as an entity distinct from T, I'm not sure that this solution isn't in fact better.

Either way, I stick to my suggestion that you should consider using a different variable name.

share|improve this answer
    
Could whoever downvoted my answer explain why? –  Seamus Oct 20 '11 at 17:08
    
Because grouping {T'} breaks horizontal placement of subscripts as it puts it in a box of its own with all its side effects, so it is generally a bad idea. –  Khaled Hosny Oct 21 '11 at 0:20
2  
@KhaledHosny Thanks. I'm not sure that this is a bad thing in this case. It neatly differentiates the prime from the other sub/superscripts. After all, the prime ins't just another superscript, it's serving a slightly different function… –  Seamus Nov 1 '11 at 9:06
    
Right, I think you have a point here. –  Khaled Hosny Nov 1 '11 at 12:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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