7

I have noticed that default kerning of hyphenated words (like "Finite-Valued") looks like this:

e-V

e-V

As you can see, the hyphen is too close to the e and too far away from the V. Is there a way to fix this, so the hyphen has proper kerning?

7
  • Welcome to TeX SX! If it's a normal hyphenated word, the V is to be found at the beginning of the following line. What do you want to obtain, exactly?
    – Bernard
    Jan 5, 2021 at 15:32
  • 1
    @Bernard I want to write "Finite-Valued". Jan 5, 2021 at 15:35
  • 1
    The simplest would be to write both words lower-case. Do you have any serious reason to use title-case?
    – Bernard
    Jan 5, 2021 at 15:40
  • 2
    or Finite-\!Valued Jan 5, 2021 at 15:41
  • similar to tex.stackexchange.com/questions/159857/…
    – Rmano
    Jan 5, 2021 at 15:46

2 Answers 2

7

The \kern primitive is your friend.

enter image description here

\documentclass{article}
\begin{document}
Finite-Valued

Finite\kern0.5pt-\kern-2ptV\kern-1.5ptalued % 1 postive kern, 2 negative kerns
\end{document}
9
  • 2
    I knew that there was some way to manually move the characters around, but I'd still prefer the kerning to just work, the way it does for every other character pair... Jan 5, 2021 at 18:46
  • 1
    @JanPokorný - What you've encountered is that the -V glyph pair is so unusual as not to have been considered to be a realistic possibility, by whoever created the font's kerning table. That said, I doubt that any font truly has a truly complete kerning table, i.e., one that considers all possible character pairs.
    – Mico
    Jan 5, 2021 at 18:48
  • 1
    Interesting, I was under the impression that there was some automated process that decided the kerning based on the shape of the characters, not just hand-made kerning pairs... Jan 5, 2021 at 19:34
  • 1
    @JanPokorný As far as I’m aware, that is indeed the default.
    – bradrn
    Jan 6, 2021 at 7:28
  • 3
    @JanPokorný as far as I know, TeX doesn't actually know what the glyphs look like at all. It just sees each letter as a box with a bunch of parameters like width, height and kerning values. The actual shapes of the letters are only known by the rendering engine, which is a separate process from typesetting.
    – N. Virgo
    Jan 6, 2021 at 9:06
6

If you are using LuaTeX then you can declare more kerning pairs of used fonts. Example shows how to do it in OpTeX:

\fontfam[lm]

\directlua
  {fonts.handlers.otf.addfeature 
    {
    name = "khv",
    type = "kern",
    data = {
    ["-"] = { ["V"] = -150},
    }
  }
}

Finite-Valued.

\setff{khv}\rm Finite-Valued.

\bye

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.