Linux libertine、{\l} 字元、連字和 T1 fontenc

Linux libertine、{\l} 字元、連字和 T1 fontenc

如果我從答案中理解正確的話這個問題,預設的 OT1 編碼不會為我提供足夠的“字體空間”來容納正確的\l字元。另一方面,如果啟用此選項,我似乎無法使連字(如 Th 或 Qu)正常工作。不過,我需要顯示\l角色,並且想知道是否有辦法同時獲得兩者(使用普通LaTeX 或PDFLaTeX 作為編譯器,不想要XeLaTeX,因為它的總佈局更糟糕,恕我直言,或者至少與普通LaTeX 不同,這無論如何讓我懷疑)。

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}

對於 T1,並非所有連字​​都顯示: 在此輸入影像描述

如果沒有 T1,\l角色不會顯示: 在此輸入影像描述

註解掉該fontenc行,我得到連字,但沒有正確的\l(預期行為,cfr.這個問題)。但我真的兩個都想要。我怎樣才能做到這一點?我會接受改變我對\l角色的理解方式的解決方案,因為它只在非必要的文本中出現少量次。

答案1

在 OT1 之前載入 T1,取消宣告\l為 OT1 指令並聲明其預設為 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}

在此輸入影像描述

當然,在包含 的單字中,您會丟失一些字距調整對和連字符\l,但我認為這不是一個大問題。

這是從 PDF 檢視器視窗複製字形並將其貼上到 Unicode Checker 後得到的結果

在此輸入影像描述

更新

libertine截至2017/03/20 發布的版本,\l\L命令在 OT1 編碼下也能做正確的事情。

\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}

在此輸入影像描述

答案2

另一種方法,透過重新聲明\lT1字體編碼:

\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} 

輸出:

在此輸入影像描述

相關內容