6

Context: My document uses the libertine package and I process it with pdfTeX.

T1 encoding is better than OT1. A LY1 encoding exists but is less common.

Problem: For reasons explained above, I use the T1 font encoding for my document. However, this font encoding does not provide neither the Th nor the Qu ligature. I thus looked at similar questions (Linux Libertine ligatures / T1; Should I use the font encoding LY1 with the package libertine?; and Linux libertine, the {\l} character, ligatures, and T1 fontenc) and noted that the font provides different ligatures according to the encoding chosen. Here is the difference (MWE below):

  • OT1 encoding: all ligatures.
    enter image description here
  • T1 encoding: common ligatures only.
    enter image description here
  • LY1 encoding: extended ligatures, but not with capital letters.
    enter image description here

I would like to include at least Th and Qu ligatures in my document, but also want to benefit from T1 features (automatic hyphenation, accented characters being recognized as one single glyph), and be sure the text remains copy & past-able as well as search-able through the pdf.

Question: How to enable the Th and Qu ligatures in my document, without loosing T1 encoding benefits?

Bonus: The same question with the less common fb, fh, fj, fk, and ft ligature.

Note: Processing the document with LuaTeX or XeTeX is not an option for me (I have no time to shift from pdfTeX to another processing systems + I want to use microtype's tracking and spacing features), but answers involving them are still welcome.


\documentclass{scrbook}
    \usepackage[OT1]{fontenc}
    \usepackage[utf8]{inputenc}

    \usepackage{libertine}

\begin{document}
    Ligatures with \texttt{OT1} encoding:  ff  fi   fl  ffi fb fh fj fk ft Qu Th
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
%   Ligatures with \texttt{T1} encoding:  ff  fi   fl  ffi 
%   
%   No ligature : fb fh fj fk ft Qu Th
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
%   Ligatures with \texttt{LY1} encoding:  ff  fi   fl  ffi fb fh fj fk ft
%   
%   No ligature: Qu Th
\end{document}
  • 3
    T1 has no free slots, see also my comment here tex.stackexchange.com/questions/229168/… – Ulrike Fischer Jun 5 '17 at 20:42
  • @UlrikeFischer Very explanatory, thank you. I should learn further about font encoding. It's surprising though, that glyphs got deleted when switching from OT1 to T1 (i.e. adding 128 more slots)! – ebosi Jun 5 '17 at 20:48
  • 1
    @ebo The 128 additional slots are needed for accented letters supporting most Western Europe languages. – egreg Jun 5 '17 at 21:12
  • @egreg This makes sense! I trying to dig into fonttable for looking at the various glyphs made available by the T1 encoding. – ebosi Jun 5 '17 at 21:13
  • 1
    There are 5 positions in T1 which can be used for such ligatures. In libertine there are ff, fi, fl, ffi and ffl on this position. Biolinum uses them for ff, ft, tt, QU and a "double exclam". You can check such things with the fonttable package and e.g. \xfonttable{T1}{LinuxBiolinumT-TLF}{m}{n} – Ulrike Fischer Jun 6 '17 at 7:05
4

This might not be the solution you are looking for but just using LuaLaTeX (or XeLaTeX) and OpenType fonts you don't have this problem.

\documentclass{scrbook}
\usepackage{libertine}
\begin{document}
Ligatures with \texttt{TU} encoding:
ff fi fl ffi fb fh fj fk ft Qu Th
\end{document}

enter image description here

  • Not the answer I hoped, yet the most useful... – ebosi Sep 7 '17 at 16:53
4

Based on karl's answer at Linux libertine, the {\l} character, ligatures, and T1 fontenc. Of course, in this case, the desired ligatures need to be explicitly invoked via macro.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\newcommand{\Th}{\begingroup\fontencoding{OT1}\selectfont Th\endgroup}
\newcommand{\Qu}{\begingroup\fontencoding{OT1}\selectfont Qu\endgroup}
\begin{document}
I have Th and Qu but I need the ligatures \Th{} and \Qu{} too though.
\end{document}

enter image description here

  • Thank you! Changing every instances of The into \Th{}e does not seem to be, however, a longterm viable solution for my thesis! – ebosi Jun 5 '17 at 21:01
  • @ebo With a capable text editor, it may not be so bad. – Steven B. Segletes Jun 5 '17 at 21:01
  • You are right, but I'm using butterflies instead (-; The source would look horrible though, and I'd prefer to separate content from layout markup in the sources. – ebosi Jun 5 '17 at 21:06
  • 4
    @ebo You will lose kerning, too. Any font switch breaks kerning. – cfr Jun 6 '17 at 3:51

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.