10

Compile this MWE with LuaLaTeX and with XeLaTex

\documentclass{article}
\usepackage[defaultfeatures={Kerning=On,Ligatures={TeX,Common,Rare}}]{libertinus}
\begin{document}
\begin{tabular}{ccccccccccccc}
ff & fi & fj & fl & ft & ffi & ffj & ffl & fft & Th & ts & tt & Qu
\end{tabular}
\end{document}

The result for XeLaTeX (note the Qu-ligature): XeLaTeX result

The result for LuaLaTeX (note the missing Qu-ligature): LuaLaTeX result

Expected result: The Qu-ligature should be there. What am I doing wrong? Is this a bug and if yes, is there a workaround until it is fixed upstream?

1 Answer 1

11

The problem is that you explicitly enabled "Ligatures", but Qu not implemented as a ligature here, "Q" has a "contextual alternate" (Another version of the "Q" is inserted depending on the context). If you enable these Contextual Alternates, Qu works:

\documentclass{article}
\usepackage[defaultfeatures={Script=Latin,Kerning=On,Ligatures={TeX,Common,Rare},Contextuals = Alternate}]{libertinus}
\begin{document}
\begin{tabular}{ccccccccccccc}
ff & fi & fj & fl & ft & ffi & ffj & ffl & fft & Th & ts & tt & Qu
\end{tabular}
\end{document}

enter image description here

In addition to enableing thislonger form of "Q" if followed by a "u" or "v", enabling Contextuals = Alternate has one other effect: If a f (or ff ligature) is followed by a relativly high character but does not form a ligature with this character, the "f" is replaced by a shorter form.

For example this shows up for fi if ligatures are disabled: The following shows first fi with common ligatures enabled, then fi with neither common ligatures nor contextual alternates and then fi without ligatures but with the alternate.

enter image description here

2
  • May I ask if you would mind to extend your answer with repect to two points? a) According to my understanding the features are implemented in the font itsself, i.e. one can use otfinfo (under linux) on the font file and see what features the font offers. So why is the Qu-ligature enabled by a different font feature for LuaTex than for XeLaTeX. This does not make sens for me. b) What side-effects has the additional feature "contextual alternatives"? In other words, which other glyphs are replaced by alternatives?
    – nagmat84
    Feb 11, 2020 at 20:50
  • @nagmat84 You are right, the features only depend on the font. So calt (Contextual Alternates) is controlling Q both in XeLaTeX and in LuaLaTeX. The difference is which features are enabled: XeLaTeX enables calt by default, LuaLaTeX does not. Feb 11, 2020 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .