Is there something I can add to the preamble of my document such that multiple letters without spacing in a Math environment (such as $NP$
) do not have extra spacing between them and are not considered multiple distinct variables? Right now, I have to use $\mathit{NP}$
to prevent any extra spacing, but I feel that it is more natural to add a space between the letters if they are a different variable ($N P$
).
For example, if I want the multi-letter variable NP
, I want to be able to say $NP$
which would automatically be replaced by $\mathit{NP}$
. If I want N
and P
to have the proper inter-variable spacing, I want to do that only when they are separated by a space, like so: $N P$
.
Is there a way to achieve this? Would it break something that I'm unaware of?
Edit:
Here's a screenshot that shows what I mean:
So basically, is it possible for line 1 to automatically give me line 3 and for line 2 to give me line 2?
$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.\cs{letters}
, where\cs
should be a meaningful command name. Slightly less comfortable for typing, surely better to maintain information about your content.$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.