# Space between emphasized word and parenthesis

When I have the following text

(\emph{WSJ})


the J will touch the parenthesis in an ugly way (my opinion). Is LaTeX supposed to keep some space there? How can I get some more space there in a a nice way?

-

I can't really see the J touching the parenthesis, but I do agree that the output is ugly. I find it ugly since the space between ( and W is much larger than the space between J and ); in fact, in my opinion this first space is much too large. The problem is that there is an italic correction after the J, so that there is at least a little space between J and ), but there is no sort of correction before the W. Look at the bounding box of the italic letter W to see the problem:

It is the white space in the left of the bounding box that makes WSJ look not centered in the parentheses. I'm afraid there is no clean solution for this, so you have to use manual spacing corrections, as Harald proposed. I find that (\!\emph{WSJ}) yields much better output:

(See also this question of mine that deals with the same problem in the definition of the italic fonts.)

-
(Commentary.) It's unfortunate (but understandable) that TeX has no left-side italic correction, and it's not clear whether it's appropriate to mirror the right-side italic correction to the left even if you can create a macro which does that. (Although usually it would probably work well.) The whole concept of kerning between different fonts is pretty murky and I don't think anyone's really done much about it—although perhaps Indesign's optical kerning tackles the problem. Your manual negative space is probably the best approach. – Will Robertson Oct 16 '10 at 10:21
@Will Robertson: I'm not sure, but I always thought it would indeed be appropriate to have some italic correction to the left, and it has bothered me for a long time that it seems that this can't be done. Can you think of an example where this left correction wouldn't be appropriate? – Hendrik Vogt Oct 16 '10 at 12:23
Oh, I only meant that using the right italic correction on the left might sometimes give poor results. I agree a right-side italic correction would be a useful tool. – Will Robertson Oct 16 '10 at 14:24
@Will Robertson: OK, now I understand what you mean. Using the right side correction on the left should indeed give very poor results for "f", but might be OK for "W". – Hendrik Vogt Oct 16 '10 at 15:18
Yep, that's what I was thinking. And I obviously meant to write "left-side italic correction would be useful", sorry for the typo. – Will Robertson Oct 16 '10 at 15:45

Yes, it does. Compare with ({\em WSJ}) which adds no italic correction. If the italic correction is not sufficient, you may wish to add a small bit of explicit \hspace yourself.

-

I also think that the italic correction after J is appropriate and that the missing negative kerning in front of W is responsible for the suboptimal output. If you use pdfTeX (PDF- or DVI-mode) you can cope with this problem (and similar ones) by means of the kerning feature of the microtype package:

\documentclass{article}

\usepackage[kerning]{microtype}

\SetExtraKerning[context=pemph]{encoding={OT1}, shape=it}{W={-150,}}


Now, you can define a command \pemph automatically taking care of the desirable kerning in front of W which results in a better centring of \emph{WSJ} inside the pair of parentheses:

\DeclareRobustCommand{\pemph}[1]{%
(\emph{\microtypecontext{kerning=pemph}#1})%
}

\begin{document}

\noindent
\pemph{WSJ}\\
(\emph{WSJ})

\end{document}


The resulting output is:

Note that the microtype package is designed to work with both pdfTeX and luaTeX. The kerning feature is currently only available for pdfTeX, though.

-
Nice idea to use microtype. But your solution doesn't automatically take care of the desirable kerning, does it? You'd need to manually find out a whole lot of \SetExtraKerning values, wouldn't you? – Hendrik Vogt Aug 24 '12 at 11:48
@HendrikVogt: Yes, you have to specify the desirable kerning for each character. – mhp Aug 25 '12 at 14:15
I wonder about 2 things: 1. Why do you have to specify a protrusion of {-150,} (with - sign) if the "usual" protrusion for W in cmr-it is {100,}, or {185,-55} in the most recent microtype version (without - sign)? 2. Can't one somehow use those "usual" protrusion values? (I'm not sure if they really fit.) – Hendrik Vogt Aug 25 '12 at 16:54
@HendrikVogt: According to the microtype documentation, protrusion and kerning are different concepts. W={-150,} as argument of \SetExtraKerning specifies additional negative kerning equal to 150/1000 of the character width at the left side of W. Obviously, no additional kerning is desirable at the right side of W in the current context. If you want to reuse the protrusion value of W, try W={-185,}. I’d say this is also OK. – mhp Aug 26 '12 at 9:26
Thanks for the info! – Hendrik Vogt Aug 26 '12 at 9:55