Sometimes it is desirable to remove the automatic italic correction appended after a math object (e.g., any ordinary math letter, the integral sign, etc.) while in math mode. Applications include:
- Hendrik Vogt’s answer to Math letter's italic correction.
- jfbu’s answer to Bad spacing of math letters within italic text.
- Someone uses Computer Modern for math, but sets text in a different font. Consider this sentence:
Let $f$ and $g$ be elements of a Hilbert space, and let $\langle f,g\rangle$ denote their inner-product.This sentence contains two commas (one in text, the other in math). It would be weird to see two different commas. A solution is\DeclareMathSymbol{,}{\mathpunct}{operators}{`,}which tells LaTeX to use text font for commas in math. But then$\langle f,g\rangle$would look horrible because of the italic correction after thef. Removing such italic correction cures this problem.
The method to remove italic correction is simple: TeX does not add italic correction to a math atom if this atom has a subscript and has no superscript. So appending _{} almost does the trick. One needs to remove an additional \scriptspace because of the added subscript field.
My question is: Should \kern-\scriptspace stay outside or go inside of the subscript field? The majority answers on this site seem to be _{}\kern-\scriptspace (i.e., stay outside; this includes egreg’s use of \aftergroup). But what about _{\kern-\scriptspace}? What are the benefits and/or drawbacks?
\documentclass{article}
\begin{document}
\newcommand*\sampletext{%
Here is some sample text with no significance.
It tries to typeset a math $f\noic$ before a line break
and another before period: $f\noic$.
How about $f'\noic$?%
}
\newcommand*\noic{}
\noindent\verb|\newcommand*\noic{}|
\sampletext
\medskip
\renewcommand*\noic{_{}\kern-\scriptspace}
\noindent1.~\verb|\renewcommand*\noic{_{}\kern-\scriptspace}|
aka stay outside
\sampletext
\medskip
\renewcommand*\noic{_{\kern-\scriptspace}}
\noindent2.~\verb|\renewcommand*\noic{_{\kern-\scriptspace}}|
aka go inside
\sampletext
\end{document}

