# Turn off auto-insertion of italic correction (undesired extra kerning)

The LaTeX2e font selection manual states

Commands defined by \DeclareTextFontCommand automatically take care of any necessary italic correction (on either side).

So running the following example

\documentclass{article}

\begin{document}

\showboxdepth=\maxdimen

f\textbf{H}f\showlists

f{\bfseries H}f\showlists

\end{document}


will produce the following relevant log

% for f\textbf{H}f
\OT1/cmr/m/n/10 f
\kern 0.77779
\OT1/cmr/bx/n/10 H
\kern 0.0
\OT1/cmr/m/n/10 f

% for f{\bfseries H}f
\OT1/cmr/m/n/10 f
\OT1/cmr/bx/n/10 H
\OT1/cmr/m/n/10 f


In certain applications, however, it is desired not to automatically insert the italic correction at all. How can I selectively/locally turn off the auto-insertion of italic correction from the \textXX{...} commands?

You can add \nocorr to suppress the italic correction at the beginning and/or at the end of a text command's argument:

\documentclass{article}

\begin{document}

\showboxdepth=\maxdimen
\tracingonline=1

f\textbf{\nocorr H\nocorr}f\showlists

f{\bfseries H}f\showlists

\end{document}


Prints for both hlists:

\hbox(0.0+0.0)x15.0
\OT1/cmr/m/n/10 f
\OT1/cmr/bx/n/10 H
\OT1/cmr/m/n/10 f
spacefactor 1000


From source2e.pdf (File w, ltfntcmd.dtx):

Or from usrguide.pdf, section 3.10 Font changing: text:

• \nocorr has such a complicated definition:-) Jun 3, 2020 at 20:37
• Ah yes, I forgot to check LaTeX2e for authors, where it says “… if you do not like the result, you can add an italic correction with \/ or remove it with \nocorr …” Seems like the information is quite scattered… Jun 3, 2020 at 20:42
• @DavidCarlisle Now I understand why it was defined that way, lol Jun 3, 2020 at 20:46
• @RuixiZhang Added the ursguide reference. The definition of \nocorr shows how you should not judge a macro by its definition ;-) Jun 3, 2020 at 20:54
• @PhelypeOleinik Wait a second… If I wrote \textXX{\nocorr\nocorr}, then \text@command{\nocorr\nocorr} expands to \check@nocorr@ \nocorr\nocorr\nocorr\@nil, then \reserved@a would be the same as \reserved@b, and \reserved@c would be \@empty. But in this case only \check@icl is set to be empty. Things get worse for \textXX{\nocorr} Jun 3, 2020 at 22:48