3

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.

enter image description here

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!!!

5
  • I confirm this on my just updated TeXLive 2018 distribution. Which TeX distribution are you using?
    – user121799
    Commented Apr 29, 2018 at 4:31
  • Hi Marmot, I'm using MikTex. Commented Apr 29, 2018 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
    Commented Apr 29, 2018 at 5:04
  • @marmot, I'm pretty curious about that as well. Commented Apr 29, 2018 at 5:16
  • 3
    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 Commented Apr 29, 2018 at 7:14

1 Answer 1

4

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}

INDEX^LOYALTY

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}

using \mathit

6
  • @OrangeEfficiency You’re welcome, but if you take another look, I recommend the one on the bottom.
    – Davislor
    Commented Apr 29, 2018 at 5:07
  • Or, consider \( \textit{INDEX}^{\textit{LOYALTY}} \), for improved kerning (esp. between O and Y and between Y and A).
    – Mico
    Commented Apr 29, 2018 at 5:16
  • 1
    @Mico The superscripts are too big that way. ^{\text{\textit{LOYALTY}}} works if you \usepackage{amsmath}.
    – Davislor
    Commented Apr 29, 2018 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
    Commented Apr 29, 2018 at 5:57
  • @Mico Do you mean, for not loading it? Here, I was trying to keep the examples minimal.
    – Davislor
    Commented Apr 29, 2018 at 6:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .