# TLatex/TMathText with math input and TCanvas PDF export

**URL:** <https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576>\
**Category:** ROOT\
**Created:** [July 21, 2015, 9:05am UTC](https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576 "2015-07-21T09:05:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HeXor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/c5a1d2/32.png) [@HeXor](https://root-forum.cern.ch/u/HeXor)\
**Post date:** [July 21, 2015, 9:05am UTC](https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576/1 "2015-07-21T09:05:28Z")

</div>

I have a plotting skript, including a TLatex text input for the center of mass energy and lumi, i.e. including a \sqrt and a \int command.

`tl = TLatex()
tl.SetTextSize(0.1)
tl.SetNDC()  
tl.DrawLatex(0.2, 0.6, "\sqrt{s} = 8 TeV")
tl.DrawLatex(0.2, 0.4, "\int L dt = 20.3 \; fb^{-1}")`

The output in \*.png and \*.eps look fine, but the \*.pdf output just shows a single line for the \sqrt output and nothing for the \int output (see attached screenshot)

I found some related posts but none really solving the issue!?

I am using  
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86\_64/root/5.34.25-x86\_64-slc6-gcc48-opt/bin/root

But I confirmed the same behaviour with  
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86\_64/root/6.02.12-x86\_64-slc6-gcc48-opt/bin/root  
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86\_64/root/6.04.02-x86\_64-slc6-gcc48-opt/bin/root

minimal working example MWE.py attached

 ![](https://root-forum.cern.ch/uploads/default/original/2X/0/0d1a3742b4cdb88ba64a0f2efe065e6c9a408d01.png)  
  
[MWE.py](https://root-forum.cern.ch/uploads/default/original/2X/9/9c43c76d9412b01aefb82d22ba31d335fafe80d4.py) (527 Bytes)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 21, 2015, 9:10am UTC](https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576/2 "2015-07-21T09:10:57Z")

</div>

[TLatex](https://root.cern.ch/root/html534/TLatex.html) != [TMathText](https://root.cern.ch/root/html534/TMathText.html)

---

<div class="post-metadata">

**Author:** ![HeXor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/c5a1d2/32.png) [@HeXor](https://root-forum.cern.ch/u/HeXor)\
**Post date:** [July 21, 2015, 9:17am UTC](https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576/3 "2015-07-21T09:17:28Z")

</div>

I see the same behaviour when using TMathText

`tm = TMathText()
tm.SetTextSize(0.1)
tm.SetNDC()  
tm.DrawMathText(0.2, 0.4, "\sqrt{s} = 8 TeV")
tm.DrawMathText(0.2, 0.2, "\int L dt = 20.3 \; fb^{-1}")`

Minimal working example MWE2.py attached  
[MWE2.py](https://root-forum.cern.ch/uploads/default/original/2X/c/c7a8e40faeb3f9a05204cc4bdfedd1b4d914d428.py) (698 Bytes)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 21, 2015, 9:50am UTC](https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576/4 "2015-07-21T09:50:38Z")

</div>

[sft.its.cern.ch/jira/browse/ROOT-5445](https://sft.its.cern.ch/jira/browse/ROOT-5445)

> [@TMathText in PDF/SVG export](https://root-forum.cern.ch/t/tmathtext-in-pdf-svg-export/19505/1):
>
> Hi everyone, Exporting TMathText objects (also implicitly in labels using “…”-syntax) does not work when saving as PDF or SVG. Searching the forums, I found [url=https://root-forum.cern.ch/t/no-latex-text-in-exported-pdf/16285/1 topic, where it is said that this is known and not [i]implemented yet[/i]. This was two years ago. Are there any plans on including that feature? It would be really nice, because TMathText is way more powerful than TLatex and looks much better. But I guess not being …

---

<div class="post-metadata">

**Author:** ![HeXor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/c5a1d2/32.png) [@HeXor](https://root-forum.cern.ch/u/HeXor)\
**Post date:** [July 21, 2015, 11:09am UTC](https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576/5 "2015-07-21T11:09:05Z")

</div>

Thanks for the reference to JIRA.

This isse indeed seems to be quite old (August 2013), so I guess I can not expect any updates in near future?

---

<div class="post-metadata">

**Author:** ![jolange](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jolange](https://root-forum.cern.ch/u/jolange)\
**Post date:** [July 26, 2015, 1:38pm UTC](https://root-forum.cern.ch/t/tlatex-tmathtext-with-math-input-and-tcanvas-pdf-export/19576/6 "2015-07-26T13:38:57Z")

</div>

Did you see the second link here? (deals with exactly that question)

[quote=“Wile E. Coyote”]  
[https://root-forum.cern.ch/t/tmathtext-in-pdf-svg-export/19505/1[/quote]](https://root-forum.cern.ch/t/tmathtext-in-pdf-svg-export/19505/1%5B/quote%5D)

Seems to me, you’d better not expect this to be fixed in the near future 😉
