The LaTeX2e font selection manual states
Commands defined by
\DeclareTextFontCommandautomatically take care of any necessary italic correction (on either side).
So running the following example
\documentclass{article}
\begin{document}
\showboxbreadth=\maxdimen
\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?


\nocorrhas such a complicated definition:-) – David Carlisle Jun 03 '20 at 20:37\/or remove it with\nocorr…” Seems like the information is quite scattered… – Ruixi Zhang Jun 03 '20 at 20:42ursguidereference. The definition of\nocorrshows how you should not judge a macro by its definition ;-) – Phelype Oleinik Jun 03 '20 at 20:54\textXX{\nocorr\nocorr}, then\text@command{\nocorr\nocorr}expands to\check@nocorr@ \nocorr\nocorr\nocorr\@nil, then\reserved@awould be the same as\reserved@b, and\reserved@cwould be\@empty. But in this case only\check@iclis set to be empty. Things get worse for\textXX{\nocorr}… – Ruixi Zhang Jun 03 '20 at 22:48\nocorrthen only one italic correction is switched off, whereas with one\nocorr, both are. If so, arguably the second one looks correct, since the\nocorris both at the beginning and the end of the text. The first one is a bit odd, but that's what you get for not using the command properly ;-) (just kidding). I'll raise with the team to get more opinions... – Phelype Oleinik Jun 03 '20 at 23:27\tracingallforf\textbf{\nocorr}fshows that only the starting italic correction is suppressed, whilef\textbf{\nocorr\nocorr}fshows that both italic corrections are suppressed. For the macro\check@nocorr@, when user inputs two\nocorrin braces, the first\nocorrwas identified as#1, the second was identified as the one in the prespecified parameter text. Looks like a very well-hidden “bug”. – Ruixi Zhang Jun 04 '20 at 01:05\nocorrin the seems to do what's expected (I should probably have checked :-). I don't understand what's the bug you're referring to... You mean like\textbf{{\nocorr}\nocorr}? – Phelype Oleinik Jun 04 '20 at 01:18f\textbf{\nocorr}fwere to be interpreted as “the user had input\nocorrboth at the start and at the end of the argument”, then both italic corrections should be suppressed, but right now only the starting one is suppressed. On the other hand,f\textbf{\nocorr\nocorr}ftruly suppresses both italic corrections and the twof’s are much closer. – Ruixi Zhang Jun 04 '20 at 01:27f... Not sure about being a bug though, sincef\textbf{\nocorr}fis a really weird input – Phelype Oleinik Jun 04 '20 at 01:58f\textbf{\nocorr}fandf\textbf{\nocorr\nocorr}fare quite artificial (edge cases for sure). To support thef\textbf{\nocorr}finput, maybe the simplest change is in\text@command: Before reaching\check@nocorr@ #1\nocorr\@nil, do another check:\def \reserved@b {\nocorr} \ifx \reserved@a \reserved@b <set both ends empty> \else \check@nocorr@ #1\nocorr\@nil \fi. It’s up to the team whether this weird input should be support or not, of course :) – Ruixi Zhang Jun 04 '20 at 02:14