[Tex/LaTex] Discretionary hyphen destroys kerning and ligature

hyphenationkerningligaturesline-breakingtex-core

Consider the following example (plain TeX format):

VA fi\par
V\-A f\-i
\bye

I tried TeX, pdfTeX, XeTeX, and LuaTeX, but the second line looks the same as the first line only when using LuaTeX. My questions are:

  1. Is this an intended behaviour?

  2. Is it difficult or impossible to make other TeX engines act like LuaTeX (discretionary hyphen does not destroy kerning and ligature)?

  3. How can I work around this problem?

Best Answer

\discretionary{f-}{i}{fi} seems to work. You can define a macro to ease the use:

\def\dfi{\discretionary{f-}{i}{fi}}
\def\VA{\discretionary{V-}{A}{VA}}
VA fi\par
AD\VA NCE Nar\dfi na
\bye

Not ideal but if you don't have many problems, you could work with that.

In any case, hyphenation is not something user should worry much in theory, do you have the correct language set in your document? That comes with many rules to tell TeX how to break up words. And you also have \hyphenation{wordwithf-ibreak wordwithV-Abreak} to add rules for particular words; it does work well (ligature when not broken, and broken correctly, plus you set it up once for the whole document).

Rant/Question: I don't understand why \- is a primitive. What was the need? Couldn't it be just defined in terms of \discretionary? It's one of those doubts I have about TeX :)

Related Question