# TMathText bug (maybe)

**URL:** <https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543>\
**Category:** Newbie\
**Created:** [February 15, 2021, 9:19am UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543 "2021-02-15T09:19:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hvsouza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hvsouza/32/23711_2.png) [@hvsouza](https://root-forum.cern.ch/u/hvsouza)\
**Post date:** [February 15, 2021, 9:19am UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/1 "2021-02-15T09:19:44Z")

</div>

Hello everyone,

I have crossed by what seems to be a bug in the TMathText class, when plotting a graph with high values in the x axis the “\” symbols doesn’t seems to work anymore. Here is a quit test that you can check in the command lines:

```auto
//NOTWORKING
vector<double> a = {1.6014205e+09, 1.6015069e+09, 1.6015933e+09, 1.6016797e+09, 1.6017661e+09, 1.6018525e+09, 1.6019389e+09, 1.6020253e+09, 1.6021117e+09, 1.6021981e+09};
vector<double> b = {1,2,3,4,5,6,7,8,9,10}
TGraph g( a.size(), &a[0], &b[0]);
g.Draw("alp");
TLatex l;
l.DrawLatex(1.6015069e+09, 1, "Ciao");
l.DrawLatex(1.6015069e+09, 2, "\\mapsto");
//WORKING
new TCanvas;
vector<double> c = {10,9,8,7,6,5,4,3,2,1};
TGraph gg( c.size(), &b[0], &c[0]);
gg.Draw();
l.DrawLatex(1, 1, "Ciao");
l.DrawLatex(1, 2, "\\mapsto");

```

Does anyone know why the arrow doesn’t show in the first plot ?

Cheers,  
Henrique

* * *

_ROOT Version:_ 6.20/00  
_Platform:_ Linux Ubuntu 18.04  
_Compiler:_ g++ and gcc 7.5.0

* * *

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 15, 2021, 9:47am UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/2 "2021-02-15T09:47:32Z")

</div>

Yes this is weird.  
I see this effect too.  
This is a good candidate for a github issue.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [February 15, 2021, 11:04am UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/3 "2021-02-15T11:04:26Z")

</div>

Using `\#` seems to work for the symbols in the TLatex [documentation](https://root.cern/doc/master/classTLatex.html). This works, for instance:

```auto
   TLatex *tex = new TLatex(1.601507e+09,4,"\#subset");

```

But for mapsto, which is not listed, it doesn’t work.

---

<div class="post-metadata">

**Author:** ![hvsouza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hvsouza/32/23711_2.png) [@hvsouza](https://root-forum.cern.ch/u/hvsouza)\
**Post date:** [February 15, 2021, 11:18am UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/4 "2021-02-15T11:18:34Z")

</div>

Yes, everything from TLatex seems to be working properly, except TMathText commands ([here](https://root.cern/doc/master/classTMathText.html))

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 15, 2021, 11:47am UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/5 "2021-02-15T11:47:03Z")

</div>

There is a real issue with TMathText. None TMathText character work. Example:

```auto
l.DrawLatex(1.6015069e+09, 2, "\\alpha");

```

Can you create a GitHub issue with that ?

Edit: let me know if you want me to do it for you.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 15, 2021, 12:05pm UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/6 "2021-02-15T12:05:53Z")

</div>

a simpler reproducer is:

```auto
{
   TLatex l;
   auto c = new TCanvas();
   c->DrawFrame(1.6014205e+09,0.,1.6021981e+09,3.);
   l.DrawLatex(1.6015069e+09, 1, "#alpha #beta #gamma ");
   l.DrawLatex(1.6015069e+09, 2, "\\alpha \\beta \\gamma");
}

```

---

<div class="post-metadata">

**Author:** ![hvsouza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hvsouza/32/23711_2.png) [@hvsouza](https://root-forum.cern.ch/u/hvsouza)\
**Post date:** [February 15, 2021, 12:09pm UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/7 "2021-02-15T12:09:23Z")

</div>

Dear Couet,

I kindly ask you to open the issue, as I don’t know how to do it.

Cheers,  
Henrique

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 15, 2021, 12:10pm UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/8 "2021-02-15T12:10:43Z")

</div>

Done: [TMathText does not display with high value coordinates · Issue #7212 · root-project/root · GitHub](https://github.com/root-project/root/issues/7212)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 17, 2021, 1:53pm UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/9 "2021-02-17T13:53:56Z")

</div>

Once merged, [this PR](https://github.com/root-project/root/pull/7233) fixes it.

---

<div class="post-metadata">

**Author:** ![hvsouza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hvsouza/32/23711_2.png) [@hvsouza](https://root-forum.cern.ch/u/hvsouza)\
**Post date:** [February 17, 2021, 2:45pm UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/10 "2021-02-17T14:45:20Z")

</div>

Many thanks

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 18, 2021, 6:38am UTC](https://root-forum.cern.ch/t/tmathtext-bug-maybe/43543/11 "2021-02-18T06:38:17Z")

</div>

The PR is now merged. Thanks to have seen this problem.
