I'd like to write a word in bold followed by a comma and a non-bold word, like this:
\textbf{why}, blah
If I just write why,
TeX inserts a kern to shift the comma a little closer to the "y". But when I write {why},
(even without the \textbf
), TeX doesn't insert the kern; apparently kerning doesn't happen across a group boundary. If I write {why,}
then I get the kern, but I also get a bold comma.
What I'd like to know is:
- Is there a way to make TeX recognize that a pair of letters should be kerned even when there's a group boundary in between?
- Stylistically, should that comma be bold?
Best Answer
If you want to add a kerning based on the "outer" font, you can define
and
will add the kerning and the comma (also ignoring the italic correction). The usual meaning of
\nocorrlist
is,.
; with the first line we add\?
to the list without the need to know the current meaning.A different approach (the hint was in Wyzard's comment) is to define a new command:
that possibly applies the kerning only if the character following
\highlight{word}
is a space.