# Unwanted spaces between characters in math mode

When typesetting $INDEX^{LOYALTY}$ in math mode, I realize that it creates a space in between Character Y and A. I just wonder if there is any way to remove this unwanted gap.

My code is as follows:

\documentclass[12pt]{article}
\usepackage[a4paper,left = 2.5 cm, right=2.5 cm, top = 2.5 cm, bottom = 2.5 cm]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{float}
\usepackage{bm}
\begin{document}
$INDEX^{LOYALTY}$
\end{document}


Thank you very much!!!

• I confirm this on my just updated TeXLive 2018 distribution. Which TeX distribution are you using?
– user121799
Apr 29 '18 at 4:31
• Hi Marmot, I'm using MikTex. Apr 29 '18 at 4:57
• Hmmh, I thought the question was really on the fact that the space after the Y in math mode is so large.
– user121799
Apr 29 '18 at 5:04
• @marmot, I'm pretty curious about that as well. Apr 29 '18 at 5:16
• all the spaces are large because the font is designed to make sure adjacent letters do not look like a word bur rather a product of single letter variables Apr 29 '18 at 7:14

## 1 Answer

If you want to interpret the letters in INDEX and LOYALTY as words, not individual symbols, you can use \mathrm{} (Roman font in math mode.)

\documentclass[varwidth, preview]{standalone}

\usepackage[T1]{fontenc}

\begin{document}
$$\mathrm{INDEX}^\mathrm{LOYALTY}$$
\end{document}


This also works with unicode-math, which will set the words in your text font and has a separate \symup{} command for upright letters that are individual symbols, not words.

One way to get text-mode italic letters is with \mathit{} from unicode-math or amsfonts. This is what I recommend. You can also wrap arbitrary text-mode formatting inside \text{} from amsmath.

\documentclass[varwidth, preview]{standalone}

\usepackage{unicode-math}

\begin{document}
$$\mathit{INDEX}^{\mathit{LOYALTY}}$$
\end{document}


• @OrangeEfficiency You’re welcome, but if you take another look, I recommend the one on the bottom. Apr 29 '18 at 5:07
• Or, consider $$\textit{INDEX}^{\textit{LOYALTY}}$$, for improved kerning (esp. between O and Y and between Y and A).
– Mico
Apr 29 '18 at 5:16
• @Mico The superscripts are too big that way. ^{\text{\textit{LOYALTY}}} works if you \usepackage{amsmath}. Apr 29 '18 at 5:35
• @Davislor - You're right. In my own code, I was indeed loading the amsmath package. (Aside: Unless one's document contains no math material at all, including any subscript or superscript material, I can't think of a good reason for loading the amsmath package...)
– Mico
Apr 29 '18 at 5:57
• @Mico Do you mean, for not loading it? Here, I was trying to keep the examples minimal. Apr 29 '18 at 6:13