Use of Latex fonts ("mathcal") for axis labels in root

Thanks! @couet Here a minimal standalone reproducer:

void test()
{
    auto c = new TCanvas();
    TPaveText *pt = new TPaveText(0,0,1,1,"brNDC");
    TText *pt_LaTex = pt->AddText(0.2,0.93,"#font[62]{#scale[1.5]{CMS }} #font[42]{ 36.3 fb^{-1} (13 TeV)}");
    pt_LaTex->SetTextAlign(11);
    pt->Draw();
    c->SaveAs("/tmp/test.tex");
}

Ah yes, of course, when you use the latex ouput you should use LaTeX directives. scale is not, it is an ROOT extension of TLatex.

So in the end there is no real solution except heavy editing of the tex file…

You can do it in advance. Do not use scale/font method when writing your C++ script. Use instead native latex commands such as \large, \textit, etc. in your C++ script / ttext labels. Later you will not have problems when you save as .tex!

You said:

In that example you are not using and TMathText feature, you can change the font as you wish and save the result as a normal PDF file.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.