I would like to place a D0 Preliminary quote on one of my graphs. I looked around and found the following...
TLatex *text = new TLatex();
text->DrawTextNDC(0.12, 0.14, "D0 Preliminary");
Unfortunately this seems to not honor LaTeX commands cause what I really need it to be is the following…
TLatex *text = new TLatex();
text->DrawTextNDC(0.12, 0.14, "D#slash{0} Preliminary");
Can anybody explane to me why the second code chunk does not work and how I might be able to get that zero with a slash on it in my plot? Thanks for any info.
I think that the root version that I am using at D0 is 4.04 and the local install on my laptop is 5.12.
TLatex inherits from TText. So you can use all the TText methods on a TLatex. DrawTextNDC is one of them. But if you use it a TLatex will be consider as a TText and the TLatex directives will not be interpreted. Use DrawLatex instead.
To make this clear for other users (like me) who are searching for an answer:
If you want to draw a latex label but in NDC coordinates you have to do:
TLatex tt1 = TLatex();
tt1.SetNDC();
tt1.DrawLatex(0.17, 0.21, "#sqrt{s} = 7 TeV");
because there is no DrawLatexNDC(), but doing SetNDC() lets you do it.
It works in 5.34, but I cannot find how to change the title size. Top of the integral sign is outside the canvas. When I lower it, it enters into the histogram. Please help me about this issue.
Thank you very much for your solution. It works, but do you have any option for the font size of the title. It is still too big. I saw some papers that do it.