# Right Arrow alignment in text

**URL:** <https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007>\
**Category:** ROOT\
**Tags:** graphics\
**Created:** [September 30, 2026, 3:04pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007 "2026-09-30T15:04:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lost\_soul\_519](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/lost_soul_519/32/30431_2.png) [@lost\_soul\_519](https://root-forum.cern.ch/u/lost_soul_519)\
**Post date:** [September 30, 2026, 3:04pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007/1 "2026-09-30T15:04:13Z")

</div>

Hello,  
Had a quick question on a particular nuiances with how the text is rendered. Specifically with the right arrow. I’ve attached the script below. The alignment of the right arrow is clearly not centered with the text neither the capital “X” nor the “e” in this case? Just want to check if there is a quick fix to this?

Thank you.

```auto
import ROOT
ROOT.gROOT.SetBatch(True)

c = ROOT.TCanvas("c", "c", 800, 600)
c.SetGrid()
c.DrawFrame(0,0,0.3,0.3)

latex = ROOT.TLatex()
# latex.SetBorderSize(0)
latex.SetNDC()
latex.SetTextAlign(12)
latex.SetTextFont(42)
latex.SetTextSize(0.028)
latex.DrawLatex(0.3, 0.2, "X#rightarrow e^{+}e^{-}")
latex.Draw()

processLabelText = ROOT.TPaveText(0.3, 0.1, 0.4, 0.2, "NDC")
processLabelText.SetBorderSize(0)
processLabelText.SetFillStyle(0)
processLabelText.SetTextAlign(12)
processLabelText.SetTextFont(42)
processLabelText.SetTextSize(0.028)
processLabelText.SetTextColor(ROOT.kBlack)
processLabelText.AddText("X#rightarrow e^{+}e^{-}")
processLabelText.Draw()

c.Draw()
c.SaveAs("RightArrowTest.pdf")

```

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/2/3/232bacd513952a5faa79603c81d07691a11daf49.png)

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [September 30, 2026, 3:18pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007/2 "2026-09-30T15:18:11Z")

</div>

Maybe @linev can help…

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [September 30, 2026, 3:30pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007/3 "2026-09-30T15:30:05Z")

</div>

Hi,

There is nothing special done in `TLatex` concerning `#rightarrow` symbol -  
it is how symbol defined in the font. The only you can do - adjust text position with the command:

```auto
processLabelText.AddText("X#lower[-0.2]{#rightarrow} e^{+}e^{-}")

```

One uses `#lower[-0.2]{text}` command for this.  
See more info in the documentation:

> **[ROOT: TLatex Class Reference](https://root.cern.ch/doc/master/classTLatex.html#L11)**
>
> The two commands #kern and #lower enable a better control over character placement. The command #kern\[(Float\_t)dx\]{text} moves the output string horizontally by the fraction dx of its length. Similarly, #lower\[(Float\_t)dy\]{text} shifts the text up or...

Regards,  
Sergey

---

<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:** [September 30, 2026, 4:23pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007/4 "2026-09-30T16:23:37Z")

</div>

Using ROOT 6.40.02 on Linux (Mint), the arrows look well-aligned (just very slightly below the horizontal line in the “e”, if we look that closely) with the original code, no addded adjustments:

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/0/0/00cc87c4d1229fb4a8b3d6e627d2b370711de078.png)

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [September 30, 2026, 4:31pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007/5 "2026-09-30T16:31:13Z")

</div>

@dastudillo

It also may depend from PDF viewer.

---

<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:** [September 30, 2026, 4:35pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007/6 "2026-09-30T16:35:02Z")

</div>

Indeed; my arrows look a bit different, for instance. But if I save as PNG or JPG the alignment still looks the same for me, so at least it’s consistent within the same system 🙂 ; here’s from the png:

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/f/f/ff900f3e293f2bbc09343f8f92ae492d1b8b98a6.png)

Edit: by the way, the “+” exponents also have extra space in the original, so the arrow issue might also be related to their system or viewer.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [October 14, 2026, 4:35pm UTC](https://root-forum.cern.ch/t/right-arrow-alignment-in-text/65007/7 "2026-10-14T16:35:13Z")

</div>

Closed on October 14, 2026, 4:35pm UTC

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