Asked in comments to expand on my comment about fonts.
TeX does not control the space between letters in math mode, the apparent space appears because usually math italic fonts have wider sidebearings and inter-letter kerning (and often the characters themselves are wider) than a text italic.
\documentclass{article}
\begin{document}
\showoutput
\textit{NP ffiv} $NP ffiv$ $\mathit{NP ffiv}$
\end{document}
Produces

and in the log:
...\hbox(6.94444+1.94444)x345.0, glue set 224.80687fil
....\hbox(0.0+0.0)x15.0
....\OT1/cmr/m/it/10 N
....\OT1/cmr/m/it/10 P
....\glue 3.57774 plus 1.53178 minus 1.02322
....\OT1/cmr/m/it/10 ^^N (ligature ffi)
....\OT1/cmr/m/it/10 v
....\kern 1.07637
....\glue 3.33333 plus 1.66666 minus 1.11111
....\mathon
....\OML/cmm/m/it/10 N
....\kern1.09026
....\OML/cmm/m/it/10 P
....\kern1.3889
....\OML/cmm/m/it/10 f
....\kern1.0764
....\OML/cmm/m/it/10 f
....\kern1.0764
....\OML/cmm/m/it/10 i
....\OML/cmm/m/it/10 v
....\kern0.35878
....\mathoff
....\glue 3.33333 plus 1.66666 minus 1.11111
....\mathon
....\hbox(6.94444+1.94444)x28.70953
.....\OT1/cmr/m/it/10 N
.....\OT1/cmr/m/it/10 P
.....\OT1/cmr/m/it/10 ^^N
.....\OT1/cmr/m/it/10 v
.....\kern1.07637
....\mathoff
....\penalty 10000
Looking at the log you see that the third example uses the same font, .\OT1/cmr/m/it/10
as the first (this is a choice of the default computer modern font setup, other font packages may differ in whether they make \mathit
use the same font as \textit
or a font chosen to match the main math font).
The fact that there is kern of 1.09026pt between N and P (and the fact that there is no ffi
ligature) in the middle example is not under the control of TeX (or visible from TeX macros except in luatex), it is a property of the font metrics. It is not just the kerning and sidebearings that differ, the letter shapes are different as well: most noticeable in v
in this example. Of course if the font package changes the text fonts to be other than computer modern, but leaves the math fonts untouched, the difference between \mathit
and \textit
would be more pronounced.
$A B$
to imply, for example, multiplication and get the extra spacing, but for$AB$
to denote a multi-letter variable and not get the extra spacing, without having to use$\mathit{AB}$
? I'd prefer to get the spacing only when there is a space between the symbols. – sudosensei Aug 21 '13 at 14:06\cs{letters}
, where\cs
should be a meaningful command name. Slightly less comfortable for typing, surely better to maintain information about your content. – egreg Aug 21 '13 at 15:32$NP$
and$\mathit{NP}$
It is a different font altogether and the fact that the spacing is larger is an effect of the of the math italic font being optimised for single letter variables whereas\mathit
uses the text italic font which is designed for words, but as far as TeX is concerned no extra space is added between the letters. – David Carlisle Aug 21 '13 at 21:29