computer science, math, programming and other stuff
a blog by Christopher Swenson

Laying the \emph misunderstanding to rest

As a response to a previous post regarding LaTeX's \emph command: I was under the impression that you need to still use the \/ command afterward to do an italic correction: it turns out that you do not need to.

I verified this using the wonderul \showbox command in LaTeX: this spits out the contents of a box, including all characters and kerns.

Note: in order to use this command in LaTeX, you need to reset the \showboxdepth and \showboxbreadth counters, which are reset for some reason. This can be done like so:


Thanks to Oleg for this tip.

After I did this, I threw the following code in a LaTeX document (it has to be inside of a document, not the preamble, otherwise it won't load the fonts properly):

\setbox122=\hbox{{\it i}i}

Then, checking the log file gave me:

> \box122=
.\OT1/cmr/m/it/10 i
.\OT1/cmr/m/n/10 i

! OK.
l.7 \showbox122

> \box123=
.\OT1/cmr/m/it/10 i
.\kern 1.01895
.\OT1/cmr/m/n/10 i

! OK.
l.9 \showbox123

So, the \emph command automatically puts in the \/ as necessary. (I verified that it doesn't seem to insert this when it isn't needed.)