I use the standard AMS theorem style, which means that my theorems are set in italic. In combination with math variables, this sometimes gives horrible spacing: The input
If $U$ or $V$ \dots yields
I see two spacing problems here: The space between "If" and "U" is too small, and the space between "U" and "or" is too large. Thus, the output would look a lot better if the "U" would be moved a bit to the right. One non-solution is to remove the dollar signs:
If U or V \dots yields
Here the spacing is a lot better, but now the problem is that a different font (namely italic) is used for "U" and "V", which is similar but not quite the same. Another non-solution is to use italic correction
\/ after "If": This only corrects the first space (and it is not nice if one has to remember typing
\/ all the time).
My present "solution" is to apply manual corrections where I find it appropriate, which of course is a real nuisance. Does anyone have a better solution? Do XeTeX or LuaTeX offer something?
(I think I do understand what causes the problem. The idea is to show the bounding boxes of the relevant characters in both examples:
What you see is that the spacing of the bounding boxes is good in both cases. But the italic letters tend to stick out of their boxes to the right, and with "U" (in the right picture) and "o" you see that they have some white space in the left of the box. The math "U" (in the left picture), however, does not have this white space in the left, and it doesn't stick out to the right. As a result, the math "U" sits too far to the left.)
Khaled is quite right, the space between the math "U" and "or" is so large since the math "U" includes an italic correction. This is explicitly described in the infamous Appendix G of the TeXbook, rule 17. So the math "U" doesn't stick out of its box since the box includes the italic correction, and this is quite alright if the math in embedded in roman text. I just have no idea how to get rid of the italic correction if the math is already in some italic text!