0

I have the following problem in my thesis. Throughout the phrase "conf" appears in subscript in many equations, which is short for configuration. Thus the letters should be evenly spaced, instead the "con" is contracted and the "f" stands out. I searched a bit and found that kerning is apparently difficult to change in latex. Is there some easy fix to protect the phrase "conf" from this kerning? The rest of the document is fine as is.

Here is the MWE:

\documentclass[]{memoir}

\usepackage{lineno,graphicx,siunitx,textcomp,booktabs,miller,babel,amssymb,amsmath,adjustbox,microtype,pdfpages,gensymb,titlesec,setspace,sidecap,multicol,multirow,float,fancyvrb,newverbs,xcolor,appendix,pdfpages,fancyhdr}

\begin{document}
$S_{conf}=1$

$con$

$conf$
\end{document}

And the result: result

1 Answer 1

5

The problem is that $conf$ is treated by LaTeX as a product of four variables: c, o, n and f, and never should be used to typeset words. In your case you can use \mathit{} or \mathrm{} (if you want the upright font) to typeset text inside math. (Previously, I suggested \text{} from amsmath, but since it preserves the outer font style (for example, \text{foobar} stays italic inside theorem formulations) it's better to use certain font shape directly:

\documentclass[]{memoir}
\usepackage{amsmath}
\begin{document}
$S_{\mathit{conf}}=1$

$S_{\mathrm{conf}}=1$
\end{document}

I'd personally prefer upright style for such indices.

The result: enter image description here

5
  • \text{\textit is the same as \textit and just \text has the disadvantage that it uses the text font outside the math so will be italic in theorems etc. I'd use \mathrm{conf} Oct 18, 2021 at 10:11
  • You're right. I forgot about text in theorems. I'll change the answer. Oct 18, 2021 at 10:18
  • Thank you, that solves the problem. Can you explain why the spacing between the letters is (apparently) different if they are all treated as variables?
    – And
    Oct 18, 2021 at 10:57
  • 1
    The spacing isn't really different. Notice that the tail of f starts just to the right of n, its just that the tail of f is low down and an italic f slants quite a lot. On the other hand when you have \mathit{conf} this is adjusted for so the tail of f starts below n
    – Willoughby
    Oct 18, 2021 at 11:02
  • 1
    @And it is not spacing added by TeX it is that the font is designed that way with wide side bearings and no inter-letter kerning so that adjacent letters do not look like a word but as adjacent but separate variables as typically used for multiplication. \mathit says to use the text italic font in math mode, this is not the default math italic font. Oct 18, 2021 at 11:08

You must log in to answer this question.

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