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?

3 Answers 3


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

enter image description here

  • Thank you everyone. This was the solution that worked best for me. \prime gives a nice clear symbol as well, much nicer than '.
    – Peter4075
    Commented Oct 20, 2011 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.


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.

  • Could whoever downvoted my answer explain why?
    – Seamus
    Commented Oct 20, 2011 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. Commented Oct 21, 2011 at 0:20
  • 5
    @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
    Commented Nov 1, 2011 at 9:06
  • Right, I think you have a point here. Commented Nov 1, 2011 at 12:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .