# Math letter's italic correction

Are there a way to display PS and TN and CD and so forth (product of two variables) more beautifully? The normal CM font puts a wide space between the left letter and right letter.

If use the package txfonts the $S_1$ turned not so good-looking.

-

I've nothing to do with txfonts (more exactly, txmi family). Maybe you can use another Times like font package. mathptmx works fine (but it has fewer symbols than txfonts), and if you use XeTeX, you can also use XITS Math for math fonts. Commercial fonts like MathTimePro(2) are also good-looking.

I suggest XITS Math with XeLaTeX:

\documentclass{article}
\usepackage{unicode-math}
\setmainfont{XITS}
\setmathfont{XITS Math}
\begin{document}
See $S_1$, $S_2$, $S_3$.
\end{document}


-

Leo Liu has answered about subscripts: unfortunately, the tx fonts have some design flaws.

Regarding the space between letters in math mode, that's a design decision by Knuth. The simple juxtaposition of two letters means usually the product of two variables (or parameters). If you need "multiletter identifiers", then use

$\mathit{AB}\mathit{CD}$.

-
$\textit{AB}\textit{CD}$. in comparison has no space between the B and the C (apparently italic correction for \textit is deactivated in math mode). But forcing italic correction with $\texthit{AB\/}\textit{CD}$. gives the same output as $\mathit{AB}\mathit{CD}$. Is it because \mathit applies italic correction with a multiletter argument? –  Maggyero May 26 at 17:48
@Maggyero In math mode TeX applies automatically the italic correction in well determined situations. The addition is done only at the end of the subformula, so with $\mathit{A}\mathit{B}\mathit{C}\mathit{D}$ there's an added kern only after D (with a single character in the argument of \mathit TeX doesn't build a subformula, which it does with multiple characters). –  egreg May 26 at 17:52
I got it, thanks for that clear explanation! –  Maggyero May 26 at 18:15
And there is the same difference with \mathrm and \textrm: $\mathrm{AV}\mathrm{AD}$. and $\textrm{AV}\textrm{AD}$. have a different output, but the difference is way subtler that I would expect (you have to zoom in to notice that the distance between A and V in the \textrm formula in less large than that in the \mathrm formula, while I would expect the distance in the \textrm formula to be the same as in AVAD. in text mode). –  Maggyero May 27 at 22:40
The V has a non zero italic correction. So in \mathrm{AV}\mathrm{AD} there is a kern after V, which is not added for \textrm{AV}\textrm{AD} in math mode. –  egreg May 27 at 22:42

As egreg explained, the space between the letters is a design decision. In most cases I'd stick with TeX's default spacing, but it's possible to remove the italic correction. The result is shown in the second line of the following image.

As you can see, the result is not always desirable: for the combination PW, the letters are much too close to each other. But for WA and Tf, the output looks better with the italic correction removed. Here's my implementation of \ric (remove italic correction):

\documentclass{article}
\newcommand*\ric[1]{\vphantom{#1}\smash{#1_{}\kern-\scriptspace}}
\begin{document}
$PS\ TN\ CD\ WA\ Tf\ PW$

$\ric{P}S\ \ric{T}N\ \ric{C}D\ \ric{W}A\ \ric{T}f\ \ric{P}W$
\end{document}


A short explanation of the code: the italic correction is not used when the character is followed by a subscript, but no superscript. However, a \scriptspace is automatically added to the width of the subscript. I used an empty subscript and a negative kern to compensate the \scriptspace. The rest of the code takes care of the unwanted additional depth caused by the empty subscript.

-
can anyone tell me what's wrong with the newtx fonts -- more complete and consistent than mathptmx, based on txfonts but with corrected metrics, and work with tex itself, unlike xits and the other unicode maths fonts. (living up to my moniker...) –  wasteofspace Sep 11 '12 at 9:16
I can't tell you anything about the newtx fonts, sorry. –  Hendrik Vogt Sep 11 '12 at 10:14