# Linux libertine, the {\l} character, ligatures, and T1 fontenc

If I understand correctly from the answers to this question, the default OT1 encoding will not get me enough "font space" for the proper \l character. On the other hand, I can't seem to get ligatures (like Th, or Qu) working if I enable this option. I need to show the \l character though, and wonder if there is a way to get both (using plain LaTeX or PDFLaTeX as a compiler, don't want XeLaTeX cause its total layour is worse IMHO, or at least different than plain LaTeX, which makes me suspicious anyways).

MNWE:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}

\title{This is Quantifiably finally ligatured text}
\begin{document}
\maketitle
I need the character \l too though.
\end{document}


With T1, not all ligatures show:

Without T1, the \l character doesn't show:

Commenting out the fontenc line, I get ligatures, but no proper \l (expected behaviour, cfr. this question). But I really want both. How can I do this? I'd accept solutions changing how I get at the \l character, as it only appears a small amount of times in nonessential text. Thanks!

• Exactly which error or problem do you get? If run the example, I seem to get l-bar plus text with ligatures. Running TeX Live 2014 on Linux. – daleif Feb 20 '15 at 9:37
• I have no ligatures (well, only the "fi" one, but not "Th" or "Qu") if the fontenc is set to T1. I'm running TeXLive 2014.34872, on Arch Linux. I also have the system Libertine font installed, if that would make a difference. – rubenvb Feb 20 '15 at 9:42
• No, I see the same as rubenvb, didn't look carefully enough. Rubenvb, maybe you should update your question with two images. – daleif Feb 20 '15 at 9:52
• @daleif: added images of the result. – rubenvb Feb 20 '15 at 10:01
• You should be aware that OT1 is missing space for a lot of things. E.g. write some umlauts or accented chars like ü, ä, é and then do some copy&paste from the pdf. Or type < in your document. – Ulrike Fischer Feb 20 '15 at 11:27

Load T1 before OT1, undeclare \l as an OT1 command and declare its default to be T1:

\documentclass{article}
\usepackage[T1,OT1]{fontenc}
\usepackage{libertine}

\UndeclareTextCommand{\l}{OT1}
\DeclareTextSymbolDefault{\l}{T1}

\title{This is Quantifiably finally ligatured text}
\begin{document}

\maketitle
I need the character \l{} too though.
\end{document}


Of course you lose some kerning pairs and hyphenation in words containing \l, but I don't think it's a big problem.

Here's what I get after copying the glyph from the PDF viewer window and pasting it in Unicode Checker

## Update

As of the version of libertine released on 2017/03/20, the \l and \L commands do the right thing also with the OT1 encoding.

\documentclass{article}
\usepackage{libertine}

\title{This is Quantifiably finally ligatured text}
\begin{document}
\maketitle
I need the characters \l{} and \L{} too though.
\end{document}


• Thanks! This fixes the problem! Is this libertine package-side fixable and could I submit a bug report? – rubenvb Feb 20 '15 at 13:23
• @rubenvb No, the OT1 encoding has no slot for the glyph. – egreg Feb 20 '15 at 13:24
• but shouldn't the T1 version have the same ligatures as the OT1 version, as it is supposed to be "superior"? – rubenvb Feb 20 '15 at 13:25
• @rubenvb In OT1 ł is realized as a composite character, not as a ligature – egreg Feb 20 '15 at 14:38
• @rubenvb: The OT1 encoding uses only 128 places in a font. As a font in pdftex can contain 256 glyphs there are 128 "free" places for fancy stuff like unusual ligatures. The T1 encoding is full. You would have to remove glyphs if you want to add the ligatures (and then better use a new name as encoding to avoid confusion). With xelatex or lualatex there is no problem as they can handle arbitrary large fonts. – Ulrike Fischer Feb 20 '15 at 16:59

Another method, by redeclaring \l to be in T1 font encoding:

\documentclass{article}
\usepackage[OT1]{fontenc}
\usepackage{libertine}

\let\oldl\l
\renewcommand{\l}{\begingroup\fontencoding{T1}\selectfont\oldl\endgroup}

\title{This is Quantifiably finally ligatured text}
\begin{document}

\maketitle
I need the character \l{} too though.
\end{document}


Output: