TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


Any idea how I can fix this?

share|improve this question
up vote 21 down vote accepted

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

enter image description here

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

' 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




are valid.

share|improve this answer

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:


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

Your Answer


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.