Sub and superscript before text

Hello, I would like to write with TLatex a nucleus with a “standard” notation such as

^{40}_{20}Ca

(in LaTeX). It works fine in standard LaTeX doument but not with TLaTeX



The left part of the picture has been done with the following code

^{40}_{20}Ca

while the right one with about the same

Ca^{40}_{20}

If there is no subscript then the text in superscript is well displayed.
Is there any way to place the superscript really as a superscript (like in the right picture)? Am I doing something wrong are is there a bug?
Thanks in advance.

{}^{40}_{20}Ca

Thanks a lot. It works :smiley:

Why doesn’t the standard TLatex ^{superscript} work in legend->AddEntry I wonder.

It works:

{
  hpx->Draw();
  TLegend *legend = new TLegend(0.25,0.7,0.35,0.85);
  legend->AddEntry(hpx,"e^{-}e^{-}","f");
  legend->AddEntry(hpx,"e^{+}e^{+}","f");
  legend->AddEntry(hpx,"e^{+}e^{-}","f");
  legend->Draw();
}


Thanks for the swift reply. I was referring to the legend in TGraph, which does not work. Histogram legends don’t have the problem.

Cheers

TLegend text does not depends on which object it applies. Can you provide a small macro showing what you mean ?

The minimal example I just made works fine - so it’s my problem, not a root problem.
Cheers.

(the problem was if you change the font “legend->SetTextFont(50);” - means the TLatex no longer works)