# LaTeX in PDF vs PNG

I am adding LaTeX expressions like “\{(2} \sigma, \text{min interval})” in my plot. The PNG turns out fine. The PDF, however, fails miserably.

Is there a way to make the PDF work as well?

_ROOT Version:6.19
_Platform: Ubuntu0eta1p4442.pdf (214.0 KB)

Compiler: Not Provided

When you use this kind of syntax using \ TMathText is invoked. TMathText has not been implemented for PDF. You can use PS instead. In case of PDF the TMathText formulae is turned into a TLatex formulae using “#” instead of \. That’s why you see #text because it is not a supported LaTeX command (in TLatex). Do you need this #text ? it does not seems to do anything special ?

Thanks for the reply. It makes sense - hope the developers will add PDF support for TMathText soon.

Regarding “\text”, I wanted that part of the formula to look like normal text. When I use “\” anywhere in the formula, the whole formula is assumed to be latex equation and I’ve found this to be the only way to escape it.

May be normal TLatex is good enough ? I do not see any thing in the formulae you use needing TMathText

Thanks for the suggestion. I prefer the math style and not text style for certain expressions. The point of the post was to ask why PDF was failing and I thank you for the answer. However, adding PDF support would be a great addition to root.

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