Latex in axis labels

Hi

I am trying to include Latex formatting in a histogram axis label with

hist->GetYaxis()->SetTitle("- #mathcal{L}/#mathcal{L_{0}}");

but it doesn’t work.

I don’t understand why, since the following command does work

hist->GetXaxis()->SetTitle("#lambda_{Z}");

Help is much appreciated, thanks.

Kristian

Hi Kristian,
I’m not sure text styles are implemented in ROOT at all.
In ROOT manual I see notning neither about mathcal nor latex text styles.

Hmmmm
I think that only some basic LaTeX is implemented under ROOT, like the greek characters.
NT

[quote=“grkeren”]Hi

I am trying to include Latex formatting in a histogram axis label with

hist->GetYaxis()->SetTitle("- #mathcal{L}/#mathcal{L_{0}}");

but it doesn’t work.
I don’t understand why, since the following command does work

hist->GetXaxis()->SetTitle("#lambda_{Z}");

Help is much appreciated, thanks.
Kristian[/quote]

TLatex provides only a subset of LaTex. See the valid TLatex symbols.

Yes it does, but still no sign of mathcal that should write some fancy letters like these:

s0.wp.com/latex.php?latex=\mathcal+A\mathcal+B\mathcal+C\mathcal+D\mathcal+E\mathcal+F\mathcal+G\mathcal+H\mathcal+I\mathcal+J\mathcal+K\mathcal+L\mathcal+M\mathcal+N\mathcal+O\mathcal+P\mathcal+Q\mathcal+R\mathcal+S\mathcal+T\mathcal+U\mathcal+V\mathcal+W\mathcal+X\mathcal+Y\mathcal+Z&bg=ffffff&fg=000000&s=0

Yes mathcal is not implemented as I said the latex emulation is only partial.