7

When using a hyphen directly next to a capital T the spacing (kerning) looks weird:
Input: Abc-Tuv
Output: kerning for hyphen next to capital T

It seems as there is too much space between the hyphen and the T. I can reproduce this behavior in PdfLaTeX and XeLaTeX (even Word) using the default font.

Is this typographically correct? If it is not what would be correct? How can I achieve a consistent correct kerning throughout the document without specifying \kern manually on each occurrence?

Thanks for your answers.

Edit: Given that this question was marked as duplicate I realize that my formulation of the question was somewhat misleading. Maybe it would have been better to emphasize the typographical aspect of the question: Usually the automatic kerning works quite well (meaning that I never had to bother about it before). Why does the spacing look "wrong" in this special case? Am I mistaken and this is actually (typographically) correct? If it is not which value should I supply to \kern? Guessing a value and change it until it "feels" good? Is there a better way, so that the best value is chosen automatically?

I hope this clears things up, sorry for not being precise in the first place.

4

With XeTeX, you could use \XeTeXinterchartoks:

\XeTeXinterchartokenstate=1
\newXeTeXintercharclass\exhyph
\newXeTeXintercharclass\negbear
\XeTeXcharclass`-\exhyph
\XeTeXcharclass`T\negbear
\XeTeXinterchartoks\exhyph\negbear={\kern-.2em}
Abc-Tuv Abc-Tuv
\bye

enter image description here

Whether it's "typographically correct", well, "to be able to bend the rules, you first have to know the rules", but then again, "the only rule is that there are no rules".

4

I agree with Werner that is a very subjective problem. Reducing the kerning, the hyphen is shadowed by the T character, so with small fonts is less clear that "Abc-Tuv" is a compound word and not a WikiWord with a small spot in the middle.

Said that, another not adjustable solution, could be obtained typing $\!$ after the hyphen:

\documentclass{article}
\begin{document}
Abc-$\!$Tuv
\end{document}

The results is roughly the same that \kern-.1em but it is easy to type (4 keystrokes vs 10) and less distracting.

Edit: egreg's comment show how use \! in text, reducing typing to 2 characters (plus the hyphen. To promote lazyness of writing, this is an alternative with zero typing, using the own egreg's weapons: \newunicodechar. Here you can simply type ¬ instead of the hyphen:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}
\newunicodechar{¬}{-\ensuremath\!}
\begin{document}
Abc¬Tuv 
\end{document}

I chose ¬ because is similar to a hyphen, I never need that symbol and it is showed in my keyboard, but fell free to change ¬ by another unused character. Of course, you can change also the definition form -\ensuremath\! to -kern.1em or what you want.

  • 2
    \DeclareRobustCommand{\!}{\relax\ifmmode\mskip-\thinmuskip\else\negthinspace\fi} and \! will become usable also in text mode. However the backspacing is -.16667em which might be too much. – egreg Feb 12 '14 at 9:38
  • @egreg Much better definition of "roughly the same" :) About reducing keystrokes, please see the edited answer. – Fran Feb 12 '14 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.